package Savage.Scenarios.AmphibiousRaidCampPendleton;

import org.web3d.x3d.jsail.Core.*;
import org.web3d.x3d.jsail.fields.*;
import org.web3d.x3d.jsail.Grouping.*;
import org.web3d.x3d.jsail.Navigation.*;
import org.web3d.x3d.jsail.Networking.*;
import org.web3d.x3d.jsail.Time.*;

// Javadoc metadata annotations follow, see below for X3DJSAIL Java source code.
/**
 * <p> Autogenerated AUV mission from the actual data collected during exercise KB01. </p>
 <p> Related links: Catalog page <a href="../../../../Scenarios/AmphibiousRaidCampPendleton/Remus01PositionInterpolatorIndex.html" target="_blank">Remus01PositionInterpolator</a>,  source <a href="../../../../Scenarios/AmphibiousRaidCampPendleton/Remus01PositionInterpolator.java">Remus01PositionInterpolator.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="../../../../Scenarios/AmphibiousRaidCampPendleton/Remus01PositionInterpolator.x3d">Remus01PositionInterpolator.x3d</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> description </i> </td>
			<td> Autogenerated AUV mission from the actual data collected during exercise KB01. </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> creator </i> </td>
			<td> Don Brutzman </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> generator </i> </td>
			<td> AuvDataServer (ADS) </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> created </i> </td>
			<td> 10 June 2001 </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> modified </i> </td>
			<td> 27 July 2024 </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/Scenarios/AmphibiousRaidCampPendleton/Remus01PositionInterpolator.x3d" target="_blank">https://www.web3d.org/x3d/content/examples/Savage/Scenarios/AmphibiousRaidCampPendleton/Remus01PositionInterpolator.x3d</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> generator </i> </td>
			<td> X3D-Edit 3.2, <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="../../../../Scenarios/AmphibiousRaidCampPendleton/../../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 Don Brutzman
 */

public class Remus01PositionInterpolator
{
	/** Default constructor to create this object. */
	public Remus01PositionInterpolator ()
	{
	  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_0)
  .setHead(new head()
    .addMeta(new meta().setName(meta.NAME_TITLE      ).setContent("Remus01PositionInterpolator.x3d"))
    .addMeta(new meta().setName(meta.NAME_DESCRIPTION).setContent("Autogenerated AUV mission from the actual data collected during exercise KB01."))
    .addMeta(new meta().setName(meta.NAME_CREATOR    ).setContent("Don Brutzman"))
    .addMeta(new meta().setName(meta.NAME_GENERATOR  ).setContent("AuvDataServer (ADS)"))
    .addMeta(new meta().setName(meta.NAME_CREATED    ).setContent("10 June 2001"))
    .addMeta(new meta().setName(meta.NAME_MODIFIED   ).setContent("27 July 2024"))
    .addMeta(new meta().setName(meta.NAME_IDENTIFIER ).setContent("https://www.web3d.org/x3d/content/examples/Savage/Scenarios/AmphibiousRaidCampPendleton/Remus01PositionInterpolator.x3d"))
    .addMeta(new meta().setName(meta.NAME_GENERATOR  ).setContent("X3D-Edit 3.2, https://www.web3d.org/x3d/tools/X3D-Edit"))
    .addMeta(new meta().setName(meta.NAME_LICENSE    ).setContent("../../license.html")))
  .setScene(new Scene()
    .addChild(new WorldInfo().setInfo(new String[] {"AUV exercise KB01"}).setTitle("Remus01PositionInterpolator.x3d"))
    .addChild(new ExternProtoDeclare("WaypointInterpolator").setName("WaypointInterpolator").setAppinfo("Reads waypoints and legSpeeds/legDurations/defaultSpeed to provide a customizable position/orientation interpolator.").setUrl(new String[] {"../../../Savage/Tools/Animation/WaypointInterpolatorPrototype.x3d#WaypointInterpolator","https://www.web3d.org/x3d/content/examples/Savage/Tools/Animation/WaypointInterpolatorPrototype.x3d#WaypointInterpolator","../../../Savage/Tools/Animation/WaypointInterpolatorPrototype.wrl#WaypointInterpolator","https://www.web3d.org/x3d/content/examples/Savage/Tools/Animation/WaypointInterpolatorPrototype.wrl#WaypointInterpolator"})
      .addComments(" Priority of use: legSpeeds (m/sec), legDurations (seconds), defaultSpeed (m/sec) ")
      .addField(new field().setName("description").setType(field.TYPE_SFSTRING).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setAppinfo("Short description of what is animated by this WaypointInterpolator."))
      .addField(new field().setName("waypoints").setType(field.TYPE_MFVEC3F).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setAppinfo("Waypoints being traversed with interpolation of intermediate positions and orientations."))
      .addField(new field().setName("add_waypoint").setType(field.TYPE_SFVEC3F).setAccessType(field.ACCESSTYPE_INPUTONLY).setAppinfo("Add another single waypoint to array of waypoints recalculate interpolator values."))
      .addField(new field().setName("set_waypoints").setType(field.TYPE_MFVEC3F).setAccessType(field.ACCESSTYPE_INPUTONLY).setAppinfo("Replace all waypoints recalculate interpolator values."))
      .addField(new field().setName("pitchUpDownForVerticalWaypoints").setType(field.TYPE_SFBOOL).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setAppinfo("Whether to pitch child geometry (such as a vehicle) up or down to match vertical slope"))
      .addField(new field().setName("legSpeeds").setType(field.TYPE_MFFLOAT).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setAppinfo("Units m/sec. If used array lengths for legSpeeds and legDurations must be one less than number of waypoints."))
      .addField(new field().setName("legDurations").setType(field.TYPE_MFTIME).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setAppinfo("Units in seconds. If used array lengths for legSpeeds and legDurations must be one less than number of waypoints."))
      .addField(new field().setName("defaultSpeed").setType(field.TYPE_SFFLOAT).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setAppinfo("Units m/sec."))
      .addField(new field().setName("turningRate").setType(field.TYPE_SFFLOAT).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setAppinfo("turningRate (degrees/second) also determines standoff distance prior to waypoint where turn commences. If 0 turns are instantaneous."))
      .addField(new field().setName("totalDuration").setType(field.TYPE_SFTIME).setAccessType(field.ACCESSTYPE_OUTPUTONLY).setAppinfo("Output calculation summing all leg durations, useful for setting TimeSensor cycleInterval. Units in seconds."))
      .addComments(" interpolation fields ")
      .addField(new field().setName("set_fraction").setType(field.TYPE_SFFLOAT).setAccessType(field.ACCESSTYPE_INPUTONLY).setAppinfo("exposed PositionInterpolator and OrientationInterpolator setting"))
      .addField(new field().setName("position_changed").setType(field.TYPE_SFVEC3F).setAccessType(field.ACCESSTYPE_OUTPUTONLY).setAppinfo("exposed PositionInterpolator setting"))
      .addField(new field().setName("orientation_changed").setType(field.TYPE_SFROTATION).setAccessType(field.ACCESSTYPE_OUTPUTONLY).setAppinfo("exposed OrientationInterpolator setting"))
      .addComments(" display-related fields ")
      .addField(new field().setName("lineColor").setType(field.TYPE_SFCOLOR).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setAppinfo("default color for non-active line segments"))
      .addField(new field().setName("highlightSegmentColor").setType(field.TYPE_SFCOLOR).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setAppinfo("active segment highlight color"))
      .addField(new field().setName("transparency").setType(field.TYPE_SFFLOAT).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setAppinfo("1.0 is completely transparent, 0.0 is completely opaque."))
      .addField(new field().setName("labelDisplayMode").setType(field.TYPE_SFSTRING).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setAppinfo("allowed values: none; waypoints (produce labels at each waypoint); or interpolation (produce single moving label at interpolator time course speed location)"))
      .addField(new field().setName("heightLabel").setType(field.TYPE_SFSTRING).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setAppinfo("allowed values: altitude depth (negate Y value) none"))
      .addField(new field().setName("labelOffset").setType(field.TYPE_SFVEC3F).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setAppinfo("heightLabel relative location"))
      .addField(new field().setName("labelFontSize").setType(field.TYPE_SFFLOAT).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setAppinfo("heightLabel text size"))
      .addField(new field().setName("labelColor").setType(field.TYPE_SFCOLOR).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setAppinfo("heightLabel text color"))
      .addField(new field().setName("traceEnabled").setType(field.TYPE_SFBOOL).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setAppinfo("enable console output to trace script computations and prototype progress"))
      .addField(new field().setName("outputInitializationComputations").setType(field.TYPE_SFBOOL).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setAppinfo("Output the number of waypoints totalDistance and totalDuration to console upon initialization"))
      .addField(new field().setName("verticalDropLineColor").setType(field.TYPE_SFCOLOR).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setAppinfo("default color for vertical drop-line segments"))
      .addField(new field().setName("verticalDropLineTransparency").setType(field.TYPE_SFFLOAT).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setAppinfo("1.0 is completely transparent, 0.0 is completely opaque.")))
    .addComments(" ====================================== ")
    .addChild(new ExternProtoDeclare("HiddenViewpoint").setName("HiddenViewpoint").setUrl(new String[] {"../../../Savage/Tools/Animation/HiddenViewpointPrototype.wrl#HiddenViewpoint","https://www.web3d.org/x3d/content/examples/Savage/Environment/Tools/Animation/HiddenViewpointPrototype.wrl#HiddenViewpoint","../../../Savage/Tools/Animation/HiddenViewpointPrototype.x3d#HiddenViewpoint","https://www.web3d.org/x3d/content/examples/Savage/Environment/Tools/Animation/HiddenViewpointPrototype.x3d#HiddenViewpoint"})
      .addField(new field().setName("position").setType(field.TYPE_SFVEC3F).setAccessType(field.ACCESSTYPE_INPUTOUTPUT))
      .addField(new field().setName("rotation").setType(field.TYPE_SFROTATION).setAccessType(field.ACCESSTYPE_INPUTOUTPUT))
      .addField(new field().setName("sensorRadius").setType(field.TYPE_SFFLOAT).setAccessType(field.ACCESSTYPE_INITIALIZEONLY))
      .addField(new field().setName("activate").setType(field.TYPE_SFBOOL).setAccessType(field.ACCESSTYPE_INPUTONLY))
      .addField(new field().setName("label").setType(field.TYPE_MFSTRING).setAccessType(field.ACCESSTYPE_INPUTOUTPUT))
      .addField(new field().setName("labelOffset").setType(field.TYPE_SFVEC3F).setAccessType(field.ACCESSTYPE_INPUTOUTPUT))
      .addField(new field().setName("labelFontSize").setType(field.TYPE_SFFLOAT).setAccessType(field.ACCESSTYPE_INITIALIZEONLY))
      .addField(new field().setName("labelColor").setType(field.TYPE_SFCOLOR).setAccessType(field.ACCESSTYPE_INPUTOUTPUT)))
    .addComments(" ====================================== ")
    .addComments(" Example instance follows prototype declaration ")
    .addChild(new Viewpoint().setDescription("Remus01PositionInterpolator").setOrientation(1.0,0.0,0.0,-0.3).setPosition(0.0,0.0,0.0))
    .addChild(new Viewpoint().setDescription("Above, looking down").setOrientation(1.0,0.0,0.0,-1.57).setPosition(0.0,5000.0,0.0))
    .addComments(" Reduce aliasing by increasing relative precision ")
    .addChild(new NavigationInfo().setVisibilityLimit(20000))
    .addChild(new Inline("CoordinateAxes").setUrl(new String[] {"../../Tools/Authoring/CoordinateAxes.x3d","../../X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.x3d","https://www.web3d.org/x3d/content/examples/Savage/Tools/Authoring/CoordinateAxes.x3d","https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.x3d","../../Tools/Authoring/CoordinateAxes.wrl","../../X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.wrl","https://www.web3d.org/x3d/content/examples/Savage/Tools/Authoring/CoordinateAxes.wrl","https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.wrl"}))
    .addChild(new TimeSensor("Clock").setCycleInterval(4.0).setLoop(true))
    .addChild(new ProtoInstance("WaypointInterpolator", "TrackPosition").setContainerField("children")
      .addComments(" XZ coordinates are converted from Lat/Long based on the origin ")
      .addComments(" The origin is the first data point ")
      .addFieldValue(new fieldValue().setName("description").setValue("TrackPosition"))
      .addFieldValue(new fieldValue().setName("waypoints").setValue(new MFVec3f(getfieldValue_waypoints_4_53_value())))
      .addFieldValue(new fieldValue().setName("pitchUpDownForVerticalWaypoints").setValue(false))
      .addComments(" Priority of use: legSpeeds (m/sec), legDurations (seconds), defaultSpeed (m/sec) ")
      .addComments(" If used, array lengths for legSpeeds and legDurations must be one less than number of waypoints. ")
      .addFieldValue(new fieldValue().setName("legDurations").setValue(new double[] {60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,6060.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0,60.0}))
      .addComments(" turningRate (degrees/second) will also determine standoff distance prior to waypoint where turn commences. if 0, turns are instantaneous. ")
      .addFieldValue(new fieldValue().setName("turningRate").setValue(90))
      .addFieldValue(new fieldValue().setName("lineColor").setValue(new SFColor(1.0,0.0,0.0)))
      .addFieldValue(new fieldValue().setName("highlightSegmentColor").setValue(new SFColor(1.0,1.0,0.0)))
      .addFieldValue(new fieldValue().setName("transparency").setValue(0))
      .addFieldValue(new fieldValue().setName("labelOffset").setValue(new SFVec3f(0.0,-0.8,0.0)))
      .addFieldValue(new fieldValue().setName("labelFontSize").setValue(0.5))
      .addFieldValue(new fieldValue().setName("labelColor").setValue(new SFColor(0.3,0.9,0.3)))
      .addFieldValue(new fieldValue().setName("traceEnabled").setValue(true)))
    .addChild(new Transform("TrackingTransform")
      .addComments(" Always align initial geometry with X axis ")
      .addChild(new Group()
        .addComments(" Point vehicle along X-axis ")
        .addChild(new Transform()
          .addChild(new Inline().setUrl(new String[] {"../../Robots/UnmannedUnderwaterVehicles/RemusSideScan.x3d","https://www.web3d.org/x3d/content/examples/Savage/Robots/UnmannedUnderwaterVehicles/RemusSideScan.x3d","../../Robots/UnmannedUnderwaterVehicles/RemusSideScan.wrl","https://www.web3d.org/x3d/content/examples/Savage/Robots/UnmannedUnderwaterVehicles/RemusSideScan.wrl"})))
        .addChild(new Viewpoint().setDescription("Ride on").setOrientation(0.0,1.0,0.0,-1.57).setPosition(-4.0,1.0,0.0))
        .addChild(new Viewpoint().setDescription("Ride alongside").setPosition(0.0,0.0,5.0))
        .addChild(new Viewpoint().setDescription("Ride in front").setOrientation(0.0,1.0,0.0,1.57).setPosition(4.0,1.0,0.0))))
    .addChild(new ROUTE().setFromNode("Clock").setFromField("fraction_changed").setToNode("TrackPosition").setToField("set_fraction"))
    .addChild(new ROUTE().setFromNode("TrackPosition").setFromField("totalDuration").setToNode("Clock").setToField("cycleInterval"))
    .addChild(new ROUTE().setFromNode("TrackPosition").setFromField("position_changed").setToNode("TrackingTransform").setToField("translation"))
    .addChild(new ROUTE().setFromNode("TrackPosition").setFromField("orientation_changed").setToNode("TrackingTransform").setToField("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

		/** Define subarrays using type double[] */
		private double[] getfieldValue_waypoints_4_53_value_1()
		{
			double[] value = {0.0,-0.121920004,0.0,-3.8177228,-3.07848,10.638249,-57.26584,-10.42416,251.0717,14.8467,-10.5156,363.8412,57.26584,-10.027921,421.28983,183.67488,-8.9916,599.30963,268.51315,-9.540239,714.2068,342.74667,-8.74776,814.91925,413.16245,-8.29056,914.21313,485.69916,-7.5590396,1013.507,594.7164,-6.5532,1170.9587,698.64325,-5.3949604,1309.261,711.7932,-5.27304,1327.7013,824.6281,-3.26136,1483.0253,880.1972,-1.00584,1556.7865,804.2669,-2.5908,1480.8976,706.2787,-5.12064,1344.7231,609.56305,-6.49224,1211.3855,500.54587,-7.83336,1058.1893,415.2834,-8.44296,941.87354,372.44006,-7.98576,883.0064,274.45184,-8.80872,749.66895,220.57953,-9.17448,672.3616,98.41241,-9.7536,500.7249,40.722374,-9.875521,426.25452,-105.623665,-10.454639,294.33548,-94.59468,-10.27176,314.19424,-3.8177228,-9.41832,443.27634,66.59805,-9.57072,539.02405,177.7362,-9.144,690.8018,290.9953,-8.47344,848.9628,374.561,-8.10768,965.2785,444.97678,-7.3152,1061.0262,515.3926,-7.1018395,1156.0647,624.4097,-5.3949604,1307.8425,694.8255,-4.75488,1407.1365,735.5479,-3.99288,1462.4573,828.4458,-1.34112,1591.5393,702.461,-4.38912,1441.18,672.7676,-4.66344,1403.5902,563.3262,-6.49224,1248.9753,492.91043,-6.94944,1151.1001,368.62234,-7.7114396,979.4634,311.3565,-8.59536,903.5745,242.63748,-8.62584,808.536,189.18936,-8.80872,731.22864,107.32043,-9.4488,619.8776,22.057953,-9.47928,503.56192,-74.2335,-9.72312,370.2244,-150.16376,-10.08888,342.56393,-96.29145,-9.78408,414.90662,27.996634,-8.93064,587.25244,94.59468,-9.50976,681.58167,161.19273,-8.50392,770.23694,240.94072,-8.59536,880.1695,318.56775,-8.16864,985.1373,448.37033,-7.13232,1168.1217,461.52026,-6.76656,1183.7251,556.1149,-5.3035197,1313.5165,672.7676,-4.51104,1476.6421,726.6399,-2.68224,1549.6941,767.36224,-0.70103997,1620.6183,683.7966,-2.9260802,1517.0688,565.44714,-5.4559197,1353.9432,470.85248,-6.79704,1224.1519,418.6769,-7.1018395,1151.1001,315.17422,-7.52856,1007.12384,220.57953,-8.44296,880.1695,168.82819,-8.59536,807.11755,105.623665,-8.93064,717.0438,53.87231,-9.05256,644.7011,-86.959236,-9.235439,453.91495,-111.13815,-9.875521,421.28983,-174.34267,-9.47928,409.2327,-83.565704,-9.11352,534.76855,-31.390163,-8.96112,607.11127,7.211254,-8.96112,663.1414,140.83154,-8.86968,842.57965,192.5829,-8.74776,915.63153,261.3019,-8.74776,1016.344,368.62234,-7.74192,1160.3201,388.98352,-7.22376,1192.9452,474.246,-5.6388,1306.424,522.6038,-5.5473604,1372.3835,654.10315,-3.7795198,1555.368,702.461,-0.97536004,1620.6183,711.7932,-1.03632,1651.825,613.3808,-4.02336,1521.3243,530.23926,-5.1816,1405.0087,467.03473,-6.03504,1323.4458,402.13345,-6.82752,1173.0865,361.41107,-7.68096,1056.7708,327.89996,-7.83336,958.8953,281.6631,-7.83336,824.13934,268.51315,-8.41248,785.8403,194.70386,-8.71728,568.8122,187.0684,-8.80872,549.66266,146.34604,-9.387839,431.92844,107.32043,-8.93064,316.32196,59.3868,-9.47928,202.84323};
			return value;
		}
		private double[] getfieldValue_waypoints_4_53_value_2()
		{
			double[] value = {24.178911,-10.302239,83.69053,0.0,-0.18288001,-1.4145588,-61.083565,-9.235439,-4.9641376,-61.083565,-9.4488,82.27206,-174.34267,-9.02208,244.6885,-251.9697,-9.35736,375.18906,-287.17758,-9.20496,528.3854,-231.6085,-9.02208,605.69275,-129.80257,-8.29056,746.832,-42.843334,-7.9552803,865.9846,13.149934,-7.8028803,946.8382,142.52832,-6.94944,1124.858,215.06505,-6.88848,1226.9889,298.20657,-6.21792,1343.3047,381.77228,-5.0901604,1458.2019,407.64795,-4.7244,1495.0824,556.1149,-1.43256,1701.4719,568.8407,-0.82296,1719.9121,468.7315,-3.5052,1558.9142,370.7433,-5.21208,1426.9952,342.74667,-5.66928,1387.9868,189.18936,-6.79704,1174.505,133.6203,-6.858,1095.07,92.473724,-7.28472,1038.3304,9.3322115,-7.7114396,922.01483,-142.52832,-8.44296,707.82367,-157.37502,-8.6868,687.9649,-240.94072,-9.20496,574.48615,-318.99194,-8.9916,461.7166,-205.73283,-8.80872,607.11127,-122.16713,-8.65632,723.42694,-63.20452,-7.7724,804.2806,64.90128,-7.1628,980.88184,162.8895,-7.2542396,1117.0564,246.45522,-6.2484,1236.209,330.0209,-5.57784,1353.9432,357.59335,-5.27304,1391.5331,511.57483,-3.7795198,1605.015,581.9906,-1.18872,1696.5072,604.0486,-0.94487995,1665.3005,506.06036,-3.41376,1526.2891,409.7689,-5.334,1394.3701,326.2032,-6.4008,1275.2174,281.6631,-6.52272,1216.3502,129.80257,-7.2542396,1004.2868,72.11254,-7.2542396,926.2702,31.390163,-7.74192,867.40314,-122.16713,-8.56488,655.3397,-201.91512,-8.86968,542.57025,-276.14862,-9.35736,427.673,-248.15198,-9.72312,463.1351,-137.01382,-8.6868,619.8776,-50.054585,-8.138161,737.6118,22.057953,-7.7114396,836.9057,135.31706,-7.4980803,992.93896,161.19273,-7.3152,1033.3658,259.60513,-6.91896,1170.9587,370.7433,-6.43128,1324.8643,456.00577,-5.21208,1441.18,509.4539,-3.9014401,1518.4874,621.01624,-0.9144,1670.2653,557.8117,-2.7432,1563.1697,489.09268,-4.17576,1470.2589,403.83023,-5.2425604,1353.9432,324.50644,-6.4008,1237.6276,239.24396,-6.58368,1122.0211,140.83154,-7.4066396,985.1373,46.236862,-7.8028803,855.346,-31.390163,-8.47344,743.995,-96.29145,-8.80872,653.92126,-185.37164,-9.2964,531.22235,-259.60513,-9.144,429.0915,-183.67488,-9.05256,464.5536,-133.6203,-9.144,537.6055,-68.71901,-8.26008,627.67926,61.083565,-8.77824,807.11755,140.83154,-7.6504803,915.63153,165.01045,-7.8638396,951.0937,292.69208,-6.88848,1131.2412,342.74667,-6.21792,1200.747,405.95117,-6.52272,1289.4022,507.7571,-4.78536,1431.2506,585.80835,-3.87096,1534.0907,648.5887,-1.55448,1623.4553,656.2241,-0.79248,1619.1998,581.9906,-3.3528,1513.5227,491.21365,-4.9987197,1387.9868,370.7433,-6.096,1220.6057,305.842,-6.73608,1131.2412,240.94072,-6.67512,1039.749,148.467,-8.50392,912.7947,98.41241,-7.8638396,841.16113,-3.8177228,-8.59536,697.18506,-72.11254,-9.11352,604.2743,-105.623665,-8.96112,556.04584,-168.82819,-9.41832,468.0998,-212.94409,-9.72312,378.02606,-181.55392,-9.235439,289.3708,-157.37502,-9.57072,253.90868,-74.2335,-9.78408,116.315674};
			return value;
		}
		private double[] getfieldValue_waypoints_4_53_value_3()
		{
			double[] value = {-14.8467,-9.72312,21.986317,-7.6354456,-9.72312,7.801188};
			return value;
		}

		/** Large attribute array: fieldValue value field, scene-graph level=4, element #53, 606 total numbers made up of 202 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 MFVec3f getfieldValue_waypoints_4_53_value()
		{
			MFVec3f fieldValue_waypoints_4_53_value = new MFVec3f()/*2.finalize*/
				.append(new MFVec3f(getfieldValue_waypoints_4_53_value_1()))
				.append(new MFVec3f(getfieldValue_waypoints_4_53_value_2()))
				.append(new MFVec3f(getfieldValue_waypoints_4_53_value_3()));
			return fieldValue_waypoints_4_53_value;
		}

	/** 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 Remus01PositionInterpolator 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 Remus01PositionInterpolator().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.Scenarios.AmphibiousRaidCampPendleton.Remus01PositionInterpolator\" 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.Scenarios.AmphibiousRaidCampPendleton.Remus01PositionInterpolator self-validation test confirmation: ");
                if (!validationResults.equals("success"))
                    System.out.println();
                System.out.println(validationResults.trim());

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