package Savage.Locations.StraitsOfMalaccaLarge;

import org.web3d.x3d.jsail.Core.*;
import org.web3d.x3d.jsail.fields.*;
import org.web3d.x3d.jsail.Geospatial.*;
import org.web3d.x3d.jsail.Grouping.*;
import org.web3d.x3d.jsail.Interpolation.*;
import org.web3d.x3d.jsail.Navigation.*;
import org.web3d.x3d.jsail.Networking.*;
import org.web3d.x3d.jsail.Rendering.*;
import org.web3d.x3d.jsail.Shape.*;
import org.web3d.x3d.jsail.Time.*;

// Javadoc metadata annotations follow, see below for X3DJSAIL Java source code.
/**
 * <p> Waypoints of Straits of Malacca. </p>
 <p> Related links: Catalog page <a href="../../../../Locations/StraitsOfMalaccaLarge/StraitsOfMalaccaWayPointsIndex.html" target="_blank">StraitsOfMalaccaWayPoints</a>,  source <a href="../../../../Locations/StraitsOfMalaccaLarge/StraitsOfMalaccaWayPoints.java">StraitsOfMalaccaWayPoints.java</a>, <a href="https://www.web3d.org/x3d/content/examples/X3dResources.html" target="_blank">X3D Resources</a>, <a href="https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html" target="_blank">X3D Scene Authoring Hints</a>, and <a href="https://www.web3d.org/x3d/content/X3dTooltips.html" target="_blank">X3D Tooltips</a>. </p>
	<table style="color:black; border:0px solid; border-spacing:10px 0px;">
        <caption>Scene Meta Information</caption>
		<tr style="background-color:silver; border-color:silver;">
			<td style="text-align:center; padding:10px 0px;"><i>meta tags</i></td>
			<td style="text-align:left;   padding:10px 0px;">&nbsp; Document Metadata </td>
		</tr>

		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> title </i> </td>
			<td> <a href="../../../../Locations/StraitsOfMalaccaLarge/StraitsOfMalaccaWayPoints.x3d">StraitsOfMalaccaWayPoints.x3d</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> description </i> </td>
			<td> Waypoints of Straits of Malacca </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> creator </i> </td>
			<td> Byounghyun Yoo </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> created </i> </td>
			<td> 24 July 2008 </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> modified </i> </td>
			<td> 18 December 2023 </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> generator </i> </td>
			<td> ArcGIS </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> identifier </i> </td>
			<td> <a href="https://www.web3d.org/x3d/content/examples/Savage/Locations/StraitsOfMalaccaLarge/StraitsOfMalaccaWayPoints.x3d" target="_blank">https://www.web3d.org/x3d/content/examples/Savage/Locations/StraitsOfMalaccaLarge/StraitsOfMalaccaWayPoints.x3d</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> generator </i> </td>
			<td> X3D-Edit, <a href="https://www.web3d.org/x3d/tools/X3D-Edit" target="_blank">https://www.web3d.org/x3d/tools/X3D-Edit</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> license </i> </td>
			<td> <a href="../../../../Locations/StraitsOfMalaccaLarge/../../license.html">../../license.html</a> </td>
		</tr>
		<tr style="background-color:silver; border-color:silver;">
			<td style="text-align:center;" colspan="2">  &nbsp; </td>
		</tr>
	</table>

	<p>
		This program uses the
		<a href="https://www.web3d.org/specifications/java/X3DJSAIL.html" target="_blank">X3D Java Scene Access Interface Library (X3DJSAIL)</a>.
		It has been produced using the 
		<a href="https://www.web3d.org/x3d/stylesheets/X3dToJava.xslt" target="_blank">X3dToJava.xslt</a>
		stylesheet
	       (<a href="https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/X3dToJava.xslt" target="_blank">version control</a>)
                which is used to create Java source code from an original <code>.x3d</code> model.
	</p>

	* @author Byounghyun Yoo
 */

public class StraitsOfMalaccaWayPoints
{
	/** Default constructor to create this object. */
	public StraitsOfMalaccaWayPoints ()
	{
	  initialize();
	}

	/** Create and initialize the X3D model for this object. */
	public final void initialize()
	{
            try { // catch-all
  x3dModel = new X3D().setProfile(X3D.PROFILE_IMMERSIVE).setVersion(X3D.VERSION_3_3)
  .setHead(new head()
    .addComponent(new component().setName("Geospatial").setLevel(2))
    .addMeta(new meta().setName(meta.NAME_TITLE      ).setContent("StraitsOfMalaccaWayPoints.x3d"))
    .addMeta(new meta().setName(meta.NAME_DESCRIPTION).setContent("Waypoints of Straits of Malacca"))
    .addMeta(new meta().setName(meta.NAME_CREATOR    ).setContent("Byounghyun Yoo"))
    .addMeta(new meta().setName(meta.NAME_CREATED    ).setContent("24 July 2008"))
    .addMeta(new meta().setName(meta.NAME_MODIFIED   ).setContent("18 December 2023"))
    .addMeta(new meta().setName(meta.NAME_GENERATOR  ).setContent("ArcGIS"))
    .addMeta(new meta().setName(meta.NAME_IDENTIFIER ).setContent("https://www.web3d.org/x3d/content/examples/Savage/Locations/StraitsOfMalaccaLarge/StraitsOfMalaccaWayPoints.x3d"))
    .addMeta(new meta().setName(meta.NAME_GENERATOR  ).setContent("X3D-Edit, https://www.web3d.org/x3d/tools/X3D-Edit"))
    .addMeta(new meta().setName(meta.NAME_LICENSE    ).setContent("../../license.html")))
  .setScene(new Scene()
    .addComments(" GeoViewpoint description='Default Viewpoint StraitsOfMalaccaLarge' geoSystem='\"GD\" \"WE\"' orientation='-1 0 0 1.57' position='0.3471685463819618 100.89750038406439 1792095.085119945' ")
    .addChild(new WorldInfo().setTitle("StraitsOfMalaccaWayPoints.x3d"))
    .addChild(new GeoViewpoint().setDescription("Viewpoint StraitsOfMalaccaLarge").setOrientation(-1.0,0.0,0.0,1.57).setPosition(0.3471685463819618,100.89750038406439,2010000.0)
      .setGeoOrigin(new GeoOrigin("ORIGIN").setGeoCoords(0.3471685463819618,100.89750038406439,0.0).setGeoSystem(new String[] {"GD"})))
    .addChild(new GeoLocation("ContainerShipRed").setGeoCoords(0.8869992941,92.8767804884,0.0)
      .setGeoOrigin(new GeoOrigin().setUSE("ORIGIN"))
      .addChild(new Transform("ContainerShipRedAxis").setScale(300.0,300.0,300.0)
        .addChild(new Inline().setUrl(new String[] {"../../ShipsCivilian/CargoShips/ContainerShipRed.x3d","https://www.web3d.org/x3d/content/examples/Savage/ShipsCivilian/CargoShips/ContainerShipRed.x3d"}))))
    .addChild(new GeoLocation("ContainerShipBlue").setGeoCoords(8.2849709007,96.2388926211,0.0)
      .setGeoOrigin(new GeoOrigin().setUSE("ORIGIN"))
      .addChild(new Transform("ContainerShipBlueAxis").setScale(300.0,300.0,300.0)
        .addChild(new Inline().setUrl(new String[] {"../../ShipsCivilian/CargoShips/ContainerShipBlue.x3d","https://www.web3d.org/x3d/content/examples/Savage/ShipsCivilian/CargoShips/ContainerShipBlue.x3d"}))))
    .addChild(new GeoTransform().setGeoCenter(0.3471685463819618,100.89750038406439,0.0).setTranslation(0.0,2000.0,0.0)
      .addChild(new Shape()
        .setAppearance(new Appearance()
          .setMaterial(new Material().setEmissiveColor(1.0,0.0,0.0)))
        .setGeometry(new IndexedLineSet().setCoordIndex(new int[] {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32})
          .setCoord(new GeoCoordinate().setPoint(getGeoCoordinate_6_25_point())
            .setGeoOrigin(new GeoOrigin().setUSE("ORIGIN")))))
      .addChild(new Shape()
        .setAppearance(new Appearance()
          .setMaterial(new Material().setEmissiveColor(0.0,0.0,1.0)))
        .setGeometry(new IndexedLineSet().setCoordIndex(new int[] {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26})
          .setCoord(new GeoCoordinate().setPoint(new MFVec3d(new double[] {8.2849709007,96.2388926211,0.0,6.8936793008,97.5308062496,0.0,5.8336476056,98.6239639353,0.0,4.7736159104,99.5514916685,0.0,3.8460881772,100.1477594971,0.0,3.1338793820,100.6777753447,0.0,2.6782036379,101.0410093971,0.0,2.3846602797,101.3558240131,0.0,2.3251007577,101.6834013839,0.0,2.1634391981,101.9726904906,0.0,1.9124383555,102.3045221129,0.0,1.6699460161,102.5895569680,0.0,1.4827589471,102.8575748168,0.0,1.4104366705,103.1043214078,0.0,1.3303264703,103.2439502237,0.0,1.2839135926,103.3367759791,0.0,1.1989544266,103.4697213406,0.0,1.1564748437,103.6003067253,0.0,1.1514127881,103.6772698796,0.0,1.1670242115,103.7462888039,0.0,1.1900305196,103.7947663818,0.0,1.2103666303,103.8178129770,0.0,1.2306950791,103.8328383522,0.0,1.2445419934,103.8425606538,0.0,1.2521629893,103.8507486209,0.0,1.2559692475,103.8568971917,0.0,1.2588971383,103.8618746062,0.0}))
            .setGeoOrigin(new GeoOrigin().setUSE("ORIGIN"))))))
    .addChild(new GeoPositionInterpolator("GeoPositionINTERP1").setKey(new double[] {0.0,0.03125,0.0625,0.09375,0.125,0.15625,0.1875,0.21875,0.25,0.28125,0.3125,0.34375,0.375,0.40625,0.4375,0.46875,0.5,0.53125,0.5625,0.59375,0.625,0.65625,0.6875,0.71875,0.75,0.78125,0.8125,0.84375,0.875,0.90625,0.9375,0.96875,1.0}).setKeyValue(getGeoPositionINTERP1_3_36_keyValue()))
    .addChild(new GeoPositionInterpolator("GeoPositionINTERP2").setKey(new double[] {0.0,0.038461538,0.076923077,0.115384615,0.153846154,0.192307692,0.230769231,0.269230769,0.307692308,0.346153846,0.384615385,0.423076923,0.461538462,0.5,0.538461538,0.576923077,0.615384615,0.653846154,0.692307692,0.730769231,0.769230769,0.807692308,0.846153846,0.884615385,0.923076923,0.961538462,1.0}).setKeyValue(new MFVec3d(new double[] {8.2849709007,96.2388926211,0.0,6.8936793008,97.5308062496,0.0,5.8336476056,98.6239639353,0.0,4.7736159104,99.5514916685,0.0,3.8460881772,100.1477594971,0.0,3.1338793820,100.6777753447,0.0,2.6782036379,101.0410093971,0.0,2.3846602797,101.3558240131,0.0,2.3251007577,101.6834013839,0.0,2.1634391981,101.9726904906,0.0,1.9124383555,102.3045221129,0.0,1.6699460161,102.5895569680,0.0,1.4827589471,102.8575748168,0.0,1.4104366705,103.1043214078,0.0,1.3303264703,103.2439502237,0.0,1.2839135926,103.3367759791,0.0,1.1989544266,103.4697213406,0.0,1.1564748437,103.6003067253,0.0,1.1514127881,103.6772698796,0.0,1.1670242115,103.7462888039,0.0,1.1900305196,103.7947663818,0.0,1.2103666303,103.8178129770,0.0,1.2306950791,103.8328383522,0.0,1.2445419934,103.8425606538,0.0,1.2521629893,103.8507486209,0.0,1.2559692475,103.8568971917,0.0,1.2588971383,103.8618746062,0.0})))
    .addChild(new OrientationInterpolator("OrientationINTERP1").setKey(new double[] {0.0,0.03125,0.0625,0.09375,0.125,0.15625,0.1875,0.21875,0.25,0.28125,0.3125,0.34375,0.375,0.40625,0.4375,0.46875,0.5,0.53125,0.5625,0.59375,0.625,0.65625,0.6875,0.71875,0.75,0.78125,0.8125,0.84375,0.875,0.90625,0.9375,0.96875,1.0}).setKeyValue(new MFRotation(new double[] {0.0,1.0,0.0,-1.0491,0.0,1.0,0.0,-0.7989,0.0,1.0,0.0,-0.7136,0.0,1.0,0.0,-0.5951,0.0,1.0,0.0,-0.4041,0.0,1.0,0.0,-0.2462,0.0,1.0,0.0,-0.0073,0.0,1.0,0.0,0.3324,0.0,1.0,0.0,0.4200,0.0,1.0,0.0,0.5766,0.0,1.0,0.0,0.9537,0.0,1.0,0.0,1.0669,0.0,1.0,0.0,1.0851,0.0,1.0,0.0,1.5283,0.0,1.0,0.0,1.6848,0.0,1.0,0.0,1.8235,0.0,1.0,0.0,2.0492,0.0,1.0,0.0,2.1455,0.0,1.0,0.0,2.2328,0.0,1.0,0.0,2.4924,0.0,1.0,0.0,2.8808,0.0,1.0,0.0,-3.1350,0.0,1.0,0.0,-2.8120,0.0,1.0,0.0,-2.8100,0.0,1.0,0.0,-3.0951,0.0,1.0,0.0,2.7853,0.0,1.0,0.0,2.4055,0.0,1.0,0.0,2.1909,0.0,1.0,0.0,2.7950,0.0,1.0,0.0,-2.9275,0.0,1.0,0.0,-2.5307,0.0,1.0,0.0,-2.2564,0.0,1.0,0.0,3.1358})))
    .addChild(new OrientationInterpolator("OrientationINTERP2").setKey(new double[] {0.0,0.038461538,0.076923077,0.115384615,0.153846154,0.192307692,0.230769231,0.269230769,0.307692308,0.346153846,0.384615385,0.423076923,0.461538462,0.5,0.538461538,0.576923077,0.615384615,0.653846154,0.692307692,0.730769231,0.769230769,0.807692308,0.846153846,0.884615385,0.923076923,0.961538462,1.0}).setKeyValue(new MFRotation(new double[] {0.0,1.0,0.0,-0.8253,0.0,1.0,0.0,-0.7720,0.0,1.0,0.0,-0.8533,0.0,1.0,0.0,-1.0003,0.0,1.0,0.0,-0.9316,0.0,1.0,0.0,-0.8983,0.0,1.0,0.0,-0.7508,0.0,1.0,0.0,-0.1799,0.0,1.0,0.0,-0.5098,0.0,1.0,0.0,-0.6478,0.0,1.0,0.0,-0.7051,0.0,1.0,0.0,-0.6098,0.0,1.0,0.0,-0.2851,0.0,1.0,0.0,-0.5210,0.0,1.0,0.0,-0.4637,0.0,1.0,0.0,-0.5687,0.0,1.0,0.0,-0.3145,0.0,1.0,0.0,-0.0657,0.0,1.0,0.0,0.2225,0.0,1.0,0.0,0.4432,0.0,1.0,0.0,0.7231,0.0,1.0,0.0,0.9344,0.0,1.0,0.0,0.9588,0.0,1.0,0.0,0.7497,0.0,1.0,0.0,0.5544,0.0,1.0,0.0,0.5318,0.0,1.0,0.0,0.5318})))
    .addChild(new TimeSensor("TIMER1").setCycleInterval(100).setLoop(true))
    .addChild(new ROUTE().setFromNode("TIMER1").setFromField("fraction_changed").setToNode("GeoPositionINTERP1").setToField("set_fraction"))
    .addChild(new ROUTE().setFromNode("TIMER1").setFromField("fraction_changed").setToNode("OrientationINTERP1").setToField("set_fraction"))
    .addChild(new ROUTE().setFromNode("GeoPositionINTERP1").setFromField("geovalue_changed").setToNode("ContainerShipRed").setToField("set_geoCoords"))
    .addChild(new ROUTE().setFromNode("OrientationINTERP1").setFromField("value_changed").setToNode("ContainerShipRedAxis").setToField("set_rotation"))
    .addChild(new TimeSensor("TIMER2").setCycleInterval(40).setLoop(true))
    .addChild(new ROUTE().setFromNode("TIMER2").setFromField("fraction_changed").setToNode("GeoPositionINTERP2").setToField("set_fraction"))
    .addChild(new ROUTE().setFromNode("TIMER2").setFromField("fraction_changed").setToNode("OrientationINTERP2").setToField("set_fraction"))
    .addChild(new ROUTE().setFromNode("GeoPositionINTERP2").setFromField("geovalue_changed").setToNode("ContainerShipBlue").setToField("set_geoCoords"))
    .addChild(new ROUTE().setFromNode("OrientationINTERP2").setFromField("value_changed").setToNode("ContainerShipBlueAxis").setToField("set_rotation")));
            }
            catch (Exception ex)
            {       
                System.err.println ("*** Further hints on X3DJSAIL errors and exceptions at");
                System.err.println ("*** https://www.web3d.org/specifications/java/X3DJSAIL.html");
                throw (ex);
            }
	}
	// end of initialize() method


		/** Large attribute array: GeoCoordinate point field, scene-graph level=6, element #25, 99 total numbers made up of 33 3-tuple values.
		 * Reassemble split array as single method to improve readability and runnability.
		 * Provide large array values via separate methods, hoping to avoid 'code too large' Java compilation errors. 
		 * Individual Java methods (including aggregated initializations) are limited to 64KB.
		 * @see https://stackoverflow.com/questions/2407912/code-too-large-compilation-error-in-java
		 * @see https://stackoverflow.com/questions/11437905/java-too-many-constants-jvm-error
		 */
		private MFVec3d getGeoCoordinate_6_25_point()
		{
			MFVec3d GeoCoordinate_6_25_point = new MFVec3d(new double[] {0.8878209480,92.8767804884,0.0,-0.7856056734,93.8385199259,0.0,-2.2859191959,95.3003638709,0.0,-3.8631718735,97.1276688022,0.0,-5.2480766635,99.1857911986,0.0,-6.1521117348,101.3208527499,0.0,-6.5861540186,103.0714821502,0.0,-6.5933597415,104.2604264274,0.0,-6.2835136571,105.1611417890,0.0,-6.0817534161,105.6151023312,0.0,-5.9232275125,105.8600969095,0.0,-5.3467696811,106.2708231144,0.0,-4.4604657653,106.7608122711,0.0,-3.7110705845,107.1571270302,0.0,-2.6950636567,107.2003613675,0.0,-2.0033142590,107.1210984157,0.0,-0.9152501023,106.8400752229,0.0,-0.3315865480,106.5374348614,0.0,0.4250143557,106.0474457047,0.0,0.9150035124,105.6655423914,0.0,1.2320553196,105.2476104637,0.0,1.3473468859,104.8152670902,0.0,1.3455911768,104.5518924318,0.0,1.2968455216,104.4093634703,0.0,1.2623360594,104.3091216991,0.0,1.2574061362,104.2031283510,0.0,1.2836990598,104.1324661189,0.0,1.3231384452,104.0889184642,0.0,1.3518963303,104.0683771177,0.0,1.3625778305,104.0387975787,0.0,1.3584695612,104.0198995398,0.0,1.3469664072,104.0034664626,0.0,1.3379282147,103.9960715779,0.0});
			return GeoCoordinate_6_25_point;
		}
		/** Large attribute array: GeoPositionInterpolator DEF='GeoPositionINTERP1' keyValue field, scene-graph level=3, element #36, 99 total numbers made up of 33 3-tuple values.
		 * Reassemble split array as single method to improve readability and runnability.
		 * Provide large array values via separate methods, hoping to avoid 'code too large' Java compilation errors. 
		 * Individual Java methods (including aggregated initializations) are limited to 64KB.
		 * @see https://stackoverflow.com/questions/2407912/code-too-large-compilation-error-in-java
		 * @see https://stackoverflow.com/questions/11437905/java-too-many-constants-jvm-error
		 */
		private MFVec3d getGeoPositionINTERP1_3_36_keyValue()
		{
			MFVec3d GeoPositionINTERP1_3_36_keyValue = new MFVec3d(new double[] {0.8878209480,92.8767804884,0.0,-0.7856056734,93.8385199259,0.0,-2.2859191959,95.3003638709,0.0,-3.8631718735,97.1276688022,0.0,-5.2480766635,99.1857911986,0.0,-6.1521117348,101.3208527499,0.0,-6.5861540186,103.0714821502,0.0,-6.5933597415,104.2604264274,0.0,-6.2835136571,105.1611417890,0.0,-6.0817534161,105.6151023312,0.0,-5.9232275125,105.8600969095,0.0,-5.3467696811,106.2708231144,0.0,-4.4604657653,106.7608122711,0.0,-3.7110705845,107.1571270302,0.0,-2.6950636567,107.2003613675,0.0,-2.0033142590,107.1210984157,0.0,-0.9152501023,106.8400752229,0.0,-0.3315865480,106.5374348614,0.0,0.4250143557,106.0474457047,0.0,0.9150035124,105.6655423914,0.0,1.2320553196,105.2476104637,0.0,1.3473468859,104.8152670902,0.0,1.3455911768,104.5518924318,0.0,1.2968455216,104.4093634703,0.0,1.2623360594,104.3091216991,0.0,1.2574061362,104.2031283510,0.0,1.2836990598,104.1324661189,0.0,1.3231384452,104.0889184642,0.0,1.3518963303,104.0683771177,0.0,1.3625778305,104.0387975787,0.0,1.3584695612,104.0198995398,0.0,1.3469664072,104.0034664626,0.0,1.3379282147,103.9960715779,0.0});
			return GeoPositionINTERP1_3_36_keyValue;
		}

	/** The initialized model object, created within initialize() method. */
	private X3D x3dModel;

	/** 
	 * Provide a 
	 * <a href="https://dzone.com/articles/java-copy-shallow-vs-deep-in-which-you-will-swim" target="_blank">shallow copy</a>
	 * of the X3D model.
	 * @see <a href="https://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Core/X3D.html">X3D</a>
	 * @return StraitsOfMalaccaWayPoints model
	 */
	public X3D getX3dModel()
	{	  
		return x3dModel;
	}
	   
    /** 
     * Default main() method provided for test purposes, uses CommandLine to set global ConfigurationProperties for this object.
     * @param args array of input parameters, provided as arguments
     * @see <a href="https://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Core/X3D.html#handleArguments-java.lang.String:A-">X3D.handleArguments(args)</a>
     * @see <a href="https://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Core/X3D.html#validationReport--">X3D.validationReport()</a>
     * @see <a href="https://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/CommandLine.html">CommandLine</a>
     * @see <a href="https://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/CommandLine.html#USAGE">CommandLine.USAGE</a>
     * @see <a href="https://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/ConfigurationProperties.html">ConfigurationProperties</a>
     */
    public static void main(String args[])
    {
        System.out.println("Build this X3D model, showing validation diagnostics...");
        X3D thisExampleX3dModel = new StraitsOfMalaccaWayPoints().getX3dModel();
//      System.out.println("X3D model construction complete.");
	
        // next handle command line arguments
        boolean hasArguments = (args != null) && (args.length > 0);
        boolean validate = true; // default
        boolean argumentsLoadNewModel = false;
        String  fileName = new String();

        if (args != null)
        {
                for (String arg : args)
                {
                        if (arg.toLowerCase().startsWith("-v") || arg.toLowerCase().contains("validate"))
                        {
                                validate = true; // making sure
                        }
                        if (arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_X3D) ||
                                arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_CLASSICVRML) ||
                                arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_X3DB) ||
                                arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_VRML97) ||
                                arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_EXI) ||
                                arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_GZIP) ||
                                arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_ZIP) ||
                                arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_HTML) ||
                                arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_XHTML))
                        {
                                argumentsLoadNewModel = true;
                                fileName = arg;
                        }
                }
        }
        if      (argumentsLoadNewModel)
                System.out.println("WARNING: \"Savage.Locations.StraitsOfMalaccaLarge.StraitsOfMalaccaWayPoints\" model invocation is attempting to load file \"" + fileName + "\" instead of simply validating itself... file loading ignored.");
        else if (hasArguments) // if no arguments provided, this method produces usage warning
                thisExampleX3dModel.handleArguments(args);
	
        if (validate)
        {
            //  System.out.println("--- TODO fix duplicated outputs ---"); // omit when duplicated outputs problem is solved/refactored
		String validationResults = thisExampleX3dModel.validationReport();
            //  System.out.println("-----------------------------------"); // omit when duplicated outputs problem is solved/refactored
                System.out.print("Savage.Locations.StraitsOfMalaccaLarge.StraitsOfMalaccaWayPoints self-validation test confirmation: ");
                if (!validationResults.equals("success"))
                    System.out.println();
                System.out.println(validationResults.trim());

                // experimental: test X3DJSAIL output files
                // Locations/StraitsOfMalaccaLarge/StraitsOfMalaccaWayPoints_JavaExport.* file validation is checked when building X3D Example Archives
                String filenameX3D  = "Locations/StraitsOfMalaccaLarge/StraitsOfMalaccaWayPoints_JavaExport.x3d"; 
                String filenameX3DV = "Locations/StraitsOfMalaccaLarge/StraitsOfMalaccaWayPoints_JavaExport.x3dv"; 
                String filenameJSON = "Locations/StraitsOfMalaccaLarge/StraitsOfMalaccaWayPoints_JavaExport.json";
                thisExampleX3dModel.toFileX3D        (filenameX3D);
                thisExampleX3dModel.toFileClassicVRML(filenameX3DV);
// TODO         thisExampleX3dModel.toFileJSON       (filenameJSON);
        }
    }
}
