package Savage.Scenarios.CollisionUssGreenevilleMvEhimeMaru;

import org.web3d.x3d.jsail.Core.*;
import org.web3d.x3d.jsail.EnvironmentalEffects.*;
import org.web3d.x3d.jsail.fields.*;
import org.web3d.x3d.jsail.Geometry3D.*;
import org.web3d.x3d.jsail.Grouping.*;
import org.web3d.x3d.jsail.Navigation.*;
import org.web3d.x3d.jsail.Networking.*;
import org.web3d.x3d.jsail.Rendering.*;
import org.web3d.x3d.jsail.Scripting.*;
import org.web3d.x3d.jsail.Shape.*;
import org.web3d.x3d.jsail.Time.*;

// Javadoc metadata annotations follow, see below for X3DJSAIL Java source code.
/**
 * <p> Animate ship tracks showing collision by USS GREENVILLE with MV EHIME MARU. We hope that studying lessons learned this incident might help prevent future accidents. </p>
 <p> Related links: Catalog page <a href="../../../../Scenarios/CollisionUssGreenevilleMvEhimeMaru/CollisionCoursesIndex.html" target="_blank">CollisionCourses</a>,  source <a href="../../../../Scenarios/CollisionUssGreenevilleMvEhimeMaru/CollisionCourses.java">CollisionCourses.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/CollisionUssGreenevilleMvEhimeMaru/CollisionCourses.x3d">CollisionCourses.x3d</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> description </i> </td>
			<td> Animate ship tracks showing collision by USS GREENVILLE with MV EHIME MARU. We hope that studying lessons learned this incident might help prevent future accidents. </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> creator </i> </td>
			<td> Don Brutzman and UW3303 students </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> created </i> </td>
			<td> 16 May 2001 </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> modified </i> </td>
			<td> 28 January 2024 </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> <a href="../../../../Scenarios/CollisionUssGreenevilleMvEhimeMaru/CollisionUssGreenevilleMvEhimeMaru.html">CollisionUssGreenevilleMvEhimeMaru.html</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> CollisionUssGreenevilleMvEhimeMaru.ppt </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> UW 3303 reconstruction worklist.doc </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> CalculateTrackLegWaypoints.m </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> CalculateTrackLegWaypoints.out </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> ExcelPlottingData.txt </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> TrackOrders.xls </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> TrackCalculations.m </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> <a href="../../../../Scenarios/CollisionUssGreenevilleMvEhimeMaru/Greeneville_Track_Reconstruction.pdf">Greeneville_Track_Reconstruction.pdf</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> drawing </i> </td>
			<td> <a href="../../../../Scenarios/CollisionUssGreenevilleMvEhimeMaru/popup.greeneville.size.gif">popup.greeneville.size.gif</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> drawing </i> </td>
			<td> <a href="../../../../Scenarios/CollisionUssGreenevilleMvEhimeMaru/10308_nat_subHAWAIIch.gif">10308_nat_subHAWAIIch.gif</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> drawing </i> </td>
			<td> <a href="http://www.nytimes.com/images/2001/03/08/national/010308_nat_subHAWAIIch.gif" target="_blank">http://www.nytimes.com/images/2001/03/08/national/010308_nat_subHAWAIIch.gif</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> Image </i> </td>
			<td> <a href="../../../../Scenarios/CollisionUssGreenevilleMvEhimeMaru/PR_030101-2.gif">PR_030101-2.gif</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> Image </i> </td>
			<td> <a href="../../../../Scenarios/CollisionUssGreenevilleMvEhimeMaru/PR_030101-3.gif">PR_030101-3.gif</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> Image </i> </td>
			<td> <a href="../../../../Scenarios/CollisionUssGreenevilleMvEhimeMaru/PR_030101-4.gif">PR_030101-4.gif</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> <a href="http://www.ntsb.gov/Pressrel/2001/010302.htm" target="_blank">http://www.ntsb.gov/Pressrel/2001/010302.htm</a> </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/CollisionUssGreenevilleMvEhimeMaru/CollisionCourses.x3d" target="_blank">https://www.web3d.org/x3d/content/examples/Savage/Scenarios/CollisionUssGreenevilleMvEhimeMaru/CollisionCourses.x3d</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> subject </i> </td>
			<td> 3D simulation Collision Ehime Maru USS GREENEVILLE </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> reference </i> </td>
			<td> TrackCalculations.m </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> TrackOrders.xls </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> <a href="http://www.cpf.navy.mil/cpfnews/coidownloadmain.html" target="_blank">http://www.cpf.navy.mil/cpfnews/coidownloadmain.html</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> <a href="../../../../Scenarios/CollisionUssGreenevilleMvEhimeMaru/Greeneville_Track_Reconstruction.pdf">Greeneville_Track_Reconstruction.pdf</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> <a href="http://www.cpf.navy.mil/pages/legal/foia/Greeneville_Track_Reconstruction.pdf" target="_blank">http://www.cpf.navy.mil/pages/legal/foia/Greeneville_Track_Reconstruction.pdf</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> popup.greeneville.size.gif </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> <a href="http://www.cnn.com/interactive/world/0102/sub.size.comparison/popup.greeneville.size.gif" target="_blank">http://www.cnn.com/interactive/world/0102/sub.size.comparison/popup.greeneville.size.gif</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> license </i> </td>
			<td> <a href="../../../../Scenarios/CollisionUssGreenevilleMvEhimeMaru/../../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 and UW3303 students
 */

public class CollisionCourses
{
	/** Default constructor to create this object. */
	public CollisionCourses ()
	{
	  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()
    .addComments(" =============================== ")
    .addComments(" Track reconstruction spreadsheet and programs ")
    .addComments(" ================================ ")
    .addComments(" MV Ehime Maru and USS GREENEVILLE references ")
    .addMeta(new meta().setName(meta.NAME_TITLE      ).setContent("CollisionCourses.x3d"))
    .addMeta(new meta().setName(meta.NAME_DESCRIPTION).setContent("Animate ship tracks showing collision by USS GREENVILLE with MV EHIME MARU. We hope that studying lessons learned this incident might help prevent future accidents."))
    .addMeta(new meta().setName(meta.NAME_CREATOR    ).setContent("Don Brutzman and UW3303 students"))
    .addMeta(new meta().setName(meta.NAME_CREATED    ).setContent("16 May 2001"))
    .addMeta(new meta().setName(meta.NAME_MODIFIED   ).setContent("28 January 2024"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("CollisionUssGreenevilleMvEhimeMaru.html"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("CollisionUssGreenevilleMvEhimeMaru.ppt"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("UW 3303 reconstruction worklist.doc"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("CalculateTrackLegWaypoints.m"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("CalculateTrackLegWaypoints.out"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("ExcelPlottingData.txt"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("TrackOrders.xls"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("TrackCalculations.m"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("Greeneville_Track_Reconstruction.pdf"))
    .addMeta(new meta().setName(meta.NAME_DRAWING    ).setContent("popup.greeneville.size.gif"))
    .addMeta(new meta().setName(meta.NAME_DRAWING    ).setContent("10308_nat_subHAWAIIch.gif"))
    .addMeta(new meta().setName(meta.NAME_DRAWING    ).setContent("http://www.nytimes.com/images/2001/03/08/national/010308_nat_subHAWAIIch.gif"))
    .addMeta(new meta().setName(meta.NAME_IMAGE      ).setContent("PR_030101-2.gif"))
    .addMeta(new meta().setName(meta.NAME_IMAGE      ).setContent("PR_030101-3.gif"))
    .addMeta(new meta().setName(meta.NAME_IMAGE      ).setContent("PR_030101-4.gif"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("http://www.ntsb.gov/Pressrel/2001/010302.htm"))
    .addMeta(new meta().setName(meta.NAME_IDENTIFIER ).setContent("https://www.web3d.org/x3d/content/examples/Savage/Scenarios/CollisionUssGreenevilleMvEhimeMaru/CollisionCourses.x3d"))
    .addMeta(new meta().setName(meta.NAME_SUBJECT    ).setContent("3D simulation Collision Ehime Maru USS GREENEVILLE"))
    .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_REFERENCE  ).setContent("TrackCalculations.m"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("TrackOrders.xls"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("http://www.cpf.navy.mil/cpfnews/coidownloadmain.html"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("Greeneville_Track_Reconstruction.pdf"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("http://www.cpf.navy.mil/pages/legal/foia/Greeneville_Track_Reconstruction.pdf"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("popup.greeneville.size.gif"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("http://www.cnn.com/interactive/world/0102/sub.size.comparison/popup.greeneville.size.gif"))
    .addMeta(new meta().setName(meta.NAME_LICENSE    ).setContent("../../license.html")))
  .setScene(new Scene()
    .addComments(" Coordinate system: origin is collision point 21°05'N 157°50'W (21.0917N, -157.8183W) y=vertical (depth negative) meters | | | x=latitude=north meters | / | / | / |/ *- - - > z=longitude meters ")
    .addComments(" Prototype and external prototype declarations must precede scene definition. ")
    .addChild(new WorldInfo().setTitle("CollisionCourses.x3d"))
    .addChild(new ExternProtoDeclare("HiddenViewpoint").setName("HiddenViewpoint").setAppinfo("Hidden viewpoint becomes active (binds) upon pointer selection to reveal an interesting view with an optionally label").setUrl(new String[] {"../../../Savage/Tools/Animation/HiddenViewpointPrototype.x3d#HiddenViewpoint","https://www.web3d.org/x3d/content/examples/Savage/Tools/Animation/HiddenViewpointPrototype.x3d#HiddenViewpoint","../../../Savage/Tools/Animation/HiddenViewpointPrototype.wrl#HiddenViewpoint","https://www.web3d.org/x3d/content/examples/Savage/Tools/Animation/HiddenViewpointPrototype.wrl#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("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))
      .addField(new field().setName("activate").setType(field.TYPE_SFBOOL).setAccessType(field.ACCESSTYPE_INPUTONLY)))
    .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.")))
    .addChild(new ExternProtoDeclare("ViewPositionOrientation").setName("ViewPositionOrientation").setUrl(new String[] {"../../Tools/Authoring/ViewPositionOrientationPrototype.x3d#ViewPositionOrientation","https://www.web3d.org/x3d/content/examples/Savage/Tools/Authoring/ViewPositionOrientationPrototype.x3d#ViewPositionOrientation","../../Tools/Authoring/ViewPositionOrientationPrototype.wrl#ViewPositionOrientation","https://www.web3d.org/x3d/content/examples/Savage/Tools/Authoring/ViewPositionOrientationPrototype.wrl#ViewPositionOrientation"})
      .addField(new field().setName("enabled").setType(field.TYPE_SFBOOL).setAccessType(field.ACCESSTYPE_INPUTOUTPUT))
      .addField(new field().setName("traceEnabled").setType(field.TYPE_SFBOOL).setAccessType(field.ACCESSTYPE_INITIALIZEONLY))
      .addField(new field().setName("set_traceEnabled").setType(field.TYPE_SFBOOL).setAccessType(field.ACCESSTYPE_INPUTONLY))
      .addField(new field().setName("position_changed").setType(field.TYPE_SFVEC3F).setAccessType(field.ACCESSTYPE_OUTPUTONLY))
      .addField(new field().setName("orientation_changed").setType(field.TYPE_SFROTATION).setAccessType(field.ACCESSTYPE_OUTPUTONLY))
      .addField(new field().setName("outputViewpointString").setType(field.TYPE_MFSTRING).setAccessType(field.ACCESSTYPE_OUTPUTONLY)))
    .addChild(new ExternProtoDeclare("SeaStateExtrusion").setName("SeaStateExtrusion").setUrl(new String[] {"../../Environment/SeaState/SeaStateExtrusionPrototype.x3d#SeaStateExtrusion","https://www.web3d.org/x3d/content/examples/Savage/Environment/SeaState/SeaStateExtrusionPrototype.x3d#SeaStateExtrusion","../../Environment/SeaState/SeaStateExtrusionPrototype.wrl#SeaStateExtrusion","https://www.web3d.org/x3d/content/examples/Savage/Environment/SeaState/SeaStateExtrusionPrototype.wrl#SeaStateExtrusion"})
      .addField(new field().setName("shipPitch").setType(field.TYPE_SFROTATION).setAccessType(field.ACCESSTYPE_OUTPUTONLY))
      .addField(new field().setName("shipRoll").setType(field.TYPE_SFROTATION).setAccessType(field.ACCESSTYPE_OUTPUTONLY)))
    .addChild(new ExternProtoDeclare("DvdController").setName("DvdController").setAppinfo("Digital Virtual Display (DVD) Controller Prototype definition to control a scenario's animation timing").setUrl(new String[] {"../../Tools/HeadsUpDisplays/DvdControllerPrototype.x3d#DvdController","https://www.web3d.org/x3d/content/examples/Savage/Tools/HeadsUpDisplays/DvdControllerPrototype.x3d#DvdController","../../Tools/HeadsUpDisplays/DvdControllerPrototype.wrl#DvdController","https://www.web3d.org/x3d/content/examples/Savage/Tools/HeadsUpDisplays/DvdControllerPrototype.wrl#DvdController"})
      .addField(new field().setName("description").setType(field.TYPE_SFSTRING).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setAppinfo("Short description of what is animated by this DvdController."))
      .addField(new field().setName("playEnabled").setType(field.TYPE_SFBOOL).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setAppinfo("Whether or not play mode is enabled including during startup."))
      .addField(new field().setName("displayMode").setType(field.TYPE_SFSTRING).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setAppinfo("Initializes how control buttons and slider are displayed. The control buttons include DIS control (i.e. Master Ghost Local) and Playback control (i.e. Reset to Start Fast Rewind Rewind Pause Play Fast Forward Reset to End). Possible values are (case sensitive): ALL DIS_ONLY PLAYBACK_ONLY SLIDER_ONLY DIS_PLAYBACK DIS_SLIDER PLAYBACK_SLIDER and NONE."))
      .addField(new field().setName("setDisplayMode").setType(field.TYPE_SFSTRING).setAccessType(field.ACCESSTYPE_INPUTONLY).setAppinfo("Sets how control buttons and slider are displayed. The control buttons include DIS control (i.e. Master Ghost Local) and Playback control (i.e. Reset to Start Fast Rewind Rewind Pause Play Fast Forward Reset to End). Possible values are (case sensitive): ALL DIS_ONLY PLAYBACK_ONLY SLIDER_ONLY DIS_PLAYBACK DIS_SLIDER PLAYBACK_SLIDER and NONE."))
      .addField(new field().setName("buttonColor").setType(field.TYPE_SFCOLOR).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setAppinfo("Default button color."))
      .addField(new field().setName("selectedButtonColor").setType(field.TYPE_SFCOLOR).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setAppinfo("Button color when selected by user."))
      .addField(new field().setName("labelColor").setType(field.TYPE_SFCOLOR).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setAppinfo("Default label color."))
      .addField(new field().setName("selectedLabelColor").setType(field.TYPE_SFCOLOR).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setAppinfo("Label color when selected by user."))
      .addField(new field().setName("locationOffset").setType(field.TYPE_SFVEC3F).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setAppinfo("Modified screen location and distance (for size)."))
      .addField(new field().setName("clockEnabled").setType(field.TYPE_SFBOOL).setAccessType(field.ACCESSTYPE_INITIALIZEONLY))
      .addField(new field().setName("cycleInterval").setType(field.TYPE_SFTIME).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setAppinfo("Time for complete loop cycle in seconds."))
      .addField(new field().setName("set_cycleInterval").setType(field.TYPE_SFTIME).setAccessType(field.ACCESSTYPE_INPUTONLY))
      .addField(new field().setName("cycleInterval_changed").setType(field.TYPE_SFTIME).setAccessType(field.ACCESSTYPE_OUTPUTONLY))
      .addField(new field().setName("speedFactor").setType(field.TYPE_SFFLOAT).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setAppinfo("Factor used to determine the speed increase/decrease for Fast Rewind and Fast Forward action."))
      .addField(new field().setName("isActive").setType(field.TYPE_SFBOOL).setAccessType(field.ACCESSTYPE_OUTPUTONLY))
      .addField(new field().setName("startTime_changed").setType(field.TYPE_SFTIME).setAccessType(field.ACCESSTYPE_OUTPUTONLY))
      .addField(new field().setName("stopTime_changed").setType(field.TYPE_SFTIME).setAccessType(field.ACCESSTYPE_OUTPUTONLY))
      .addField(new field().setName("time_changed").setType(field.TYPE_SFTIME).setAccessType(field.ACCESSTYPE_OUTPUTONLY))
      .addField(new field().setName("fraction_changed").setType(field.TYPE_SFFLOAT).setAccessType(field.ACCESSTYPE_OUTPUTONLY))
      .addField(new field().setName("secondsElapsed").setType(field.TYPE_SFTIME).setAccessType(field.ACCESSTYPE_OUTPUTONLY))
      .addField(new field().setName("isMaster").setType(field.TYPE_SFBOOL).setAccessType(field.ACCESSTYPE_OUTPUTONLY).setAppinfo("isMaster isRemote and isLocal are booleans represent a 3-way toggle. Only one of them can have a true value at any time."))
      .addField(new field().setName("isRemote").setType(field.TYPE_SFBOOL).setAccessType(field.ACCESSTYPE_OUTPUTONLY).setAppinfo("isMaster isRemote and isLocal are booleans represent a 3-way toggle. Only one of them can have a true value at any time."))
      .addField(new field().setName("isLocal").setType(field.TYPE_SFBOOL).setAccessType(field.ACCESSTYPE_OUTPUTONLY).setAppinfo("isMaster isRemote and isLocal are booleans represent a 3-way toggle. Only one of them can have a true value at any time."))
      .addField(new field().setName("isPaused").setType(field.TYPE_SFBOOL).setAccessType(field.ACCESSTYPE_OUTPUTONLY).setAppinfo("isPaused and isRunning always have opposite values. When isPaused is true isRunning will be false and vice versa."))
      .addField(new field().setName("isRunning").setType(field.TYPE_SFBOOL).setAccessType(field.ACCESSTYPE_OUTPUTONLY).setAppinfo("isPaused and isRunning always have opposite values. When isPaused is true isRunning will be false and vice versa."))
      .addField(new field().setName("traceEnabled").setType(field.TYPE_SFBOOL).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setAppinfo("Enable/disable console output for troubleshooting."))
      .addField(new field().setName("testTimeVal").setType(field.TYPE_SFTIME).setAccessType(field.ACCESSTYPE_INITIALIZEONLY)))
    .addComments(" =================================== ")
    .addComments(" Begin actual scene here. Top-level viewpoint, navigation and control nodes. ")
    .addChild(new NavigationInfo().setSpeed(1000).setVisibilityLimit(100000))
    .addChild(new Background().setGroundAngle(new double[] {1.309,1.570796}).setGroundColor(new MFColor(new double[] {0.0,0.0,.6,0.0,0.0,.4,0.0,0.0,.6})).setSkyAngle(new double[] {1.309,1.571}).setSkyColor(new MFColor(new double[] {0.0,0.2,0.7,0.0,0.5,1.0,0.6,0.6,0.6})))
    .addChild(new Viewpoint().setDescription("Operating area").setOrientation(0.032,.985,.167,3.578).setPosition(-20000.0,20000.0,-50000.0))
    .addComments(" ViewPositionOrientation is a prototype lets us find good viewpoints for inclusion in the scene ")
    .addChild(new ProtoInstance("ViewPositionOrientation", "ConsoleOutputViewPositionOrientation").setContainerField("children")
      .addFieldValue(new fieldValue().setName("enabled").setValue(false)))
    .addComments(" =================================== ")
    .addComments(" Sea state ")
    .addChild(new Transform("GreenevilleSeaStateTransform")
      .addChild(new Transform().setTranslation(0.0,0.0,-1000.0)
        .addChild(new Group("ViewPoints")
          .addChild(new Transform("AerialView").setRotation(0.0,1.0,0.0,1.8).setTranslation(15.0,50.0,-5.0)
            .addChild(new Transform().setRotation(0.0,1.0,0.0,0.75)
              .addChild(new Viewpoint().setDescription("Sea State aerial view").setOrientation(1.0,0.0,0.0,-0.35)))))
        .addChild(new ProtoInstance("SeaStateExtrusion").setContainerField("children")))
      .addComments(" semi-transparent flat plate at surface ")
      .addChild(new Switch().setWhichChoice(-1)
        .addChild(new Shape("oceanSurface")
          .addComments(" IndexedFaceSet subdivided to enable view-frustrum culling for performance improvement ")
          .addComments(" area 10Km in X by 10Km in Z ")
          .setGeometry(new IndexedFaceSet().setSolid(false).setCoordIndex(new int[] {0,1,2,3,0,-1,0,3,4,5,0,-1,0,5,6,7,0,-1,0,7,8,1,0,-1})
            .setCoord(new Coordinate().setPoint(new MFVec3f(new double[] {0.0,0.0,0.0,0.0,0.0,25000.0,25000.0,0.0,25000.0,25000.0,0.0,0.0,25000.0,0.0,-25000.0,0.0,0.0,-25000.0,-25000.0,0.0,-25000.0,-25000.0,0.0,0.0,-25000.0,0.0,25000.0}))))
          .setAppearance(new Appearance()
            .setMaterial(new Material().setDiffuseColor(0.0,.2,.5).setTransparency(0.05))))))
    .addComments(" =================================== ")
    .addComments(" USS GREENEVILLE ")
    .addChild(new Group()
      .addChild(new Transform("GreenevilleTransform")
        .addChild(new Inline().setUrl(new String[] {"../../Submarines/SsnLosAngelesUnitedStates/688.x3d","https://www.web3d.org/x3d/content/examples/Savage/Submarines/SsnLosAngelesUnitedStates/688.x3d","../../Submarines/SsnLosAngelesUnitedStates/688.wrl","https://www.web3d.org/x3d/content/examples/Savage/Submarines/SsnLosAngelesUnitedStates/688.wrl"}))
        .addChild(new Viewpoint().setDescription("USS Greeneville").setOrientation(0.0,1.0,0.0,-1.57).setPosition(-150.0,6.0,0.0)))
      .addChild(new ProtoInstance("WaypointInterpolator", "GreenevilleInterpolator").setContainerField("children")
        .addComments(" initial waypoint time 1330, final waypoint time 1343.25 ")
        .addFieldValue(new fieldValue().setName("description").setValue("GreenevilleInterpolator"))
        .addFieldValue(new fieldValue().setName("waypoints").setValue(new MFVec3f(getfieldValue_waypoints_5_130_value())))
        .addComments(" 1 knot = 0.514444444 meters/second, 11 knots = 5.66 meters/second ")
        .addFieldValue(new fieldValue().setName("legDurations").setValue(new double[] {93.0,87.0,100.0,61.0,196.0,114.0,145.0,19.0,146.0,4.0,41.0,120.0,135.0,28.0,76.0,161.0,65.0,556.0,94.0,221.0,241.0,93.0,86.0,362.0,7.0,112.0,85.0,16.0,81.0,13.0,40.0,50.0,55.0,51.0,3.0,27.0,45.0,6.0,9.0,4.0,53.0,48.0,51.0,9.0,57.0,13.0,5.0,15.0,30.0,52.0,24.0,26.0,5.0,11.0,4.0,13.0,31.0,83.0,6.0,22.0,50.0}))
        .addFieldValue(new fieldValue().setName("turningRate").setValue(5))
        .addFieldValue(new fieldValue().setName("pitchUpDownForVerticalWaypoints").setValue(true))
        .addFieldValue(new fieldValue().setName("labelDisplayMode").setValue("interpolation"))
        .addFieldValue(new fieldValue().setName("heightLabel").setValue("depth"))
        .addFieldValue(new fieldValue().setName("lineColor").setValue(new SFColor(0.0,0.8,0.8)))
        .addFieldValue(new fieldValue().setName("highlightSegmentColor").setValue(new SFColor(0.8,0.6,0.2)))
        .addFieldValue(new fieldValue().setName("labelColor").setValue(new SFColor(0.0,0.8,0.8)))
        .addFieldValue(new fieldValue().setName("labelOffset").setValue(new SFVec3f(0.0,20.0,0.0)))
        .addFieldValue(new fieldValue().setName("labelFontSize").setValue(6))
        .addFieldValue(new fieldValue().setName("traceEnabled").setValue(false)))
      .addChild(new ROUTE().setFromNode("GreenevilleInterpolator").setFromField("position_changed").setToNode("GreenevilleTransform").setToField("set_translation"))
      .addChild(new ROUTE().setFromNode("GreenevilleInterpolator").setFromField("orientation_changed").setToNode("GreenevilleTransform").setToField("set_rotation"))
      .addComments(" Move sea state extrusion to stay located over submarine ")
      .addChild(new Script("SurfaceMovementFilter").setSourceCode("""
ecmascript:

function input3dPosition (position, timestamp)
{
	output2dPosition = new SFVec3f (position.x, 0, position.z);
}
""")
        .addField(new field().setName("input3dPosition").setType(field.TYPE_SFVEC3F).setAccessType(field.ACCESSTYPE_INPUTONLY))
        .addField(new field().setName("output2dPosition").setType(field.TYPE_SFVEC3F).setAccessType(field.ACCESSTYPE_OUTPUTONLY)))
      .addChild(new ROUTE().setFromNode("GreenevilleInterpolator").setFromField("position_changed").setToNode("SurfaceMovementFilter").setToField("input3dPosition"))
      .addChild(new ROUTE().setFromNode("SurfaceMovementFilter").setFromField("output2dPosition").setToNode("GreenevilleSeaStateTransform").setToField("set_translation")))
    .addComments(" =================================== ")
    .addComments(" MV EHIME MARU ")
    .addChild(new Group()
      .addChild(new Transform("EhimeMaruTransform")
        .addChild(new Inline().setUrl(new String[] {"../../ShipsCivilian/Trawlers/EhimeMaru.x3d","https://www.web3d.org/x3d/content/examples/Savage/ShipsCivilian/Trawlers/EhimeMaru.x3d","../../ShipsCivilian/Trawlers/EhimeMaru.wrl","https://www.web3d.org/x3d/content/examples/Savage/ShipsCivilian/Trawlers/EhimeMaru.wrl"})))
      .addChild(new ProtoInstance("WaypointInterpolator", "EhimeMaruInterpolator").setContainerField("children")
        .addComments(" initial waypoint time 1330, final waypoint time 1343.25 ")
        .addFieldValue(new fieldValue().setName("description").setValue("EhimeMaruInterpolator"))
        .addFieldValue(new fieldValue().setName("waypoints").setValue(new MFVec3f(getfieldValue_waypoints_5_154_value())))
        .addComments(" 1 knot = 0.514444444 meters/second, 11 knots = 5.66 meters/second ")
        .addFieldValue(new fieldValue().setName("legDurations").setValue(new double[] {93.0,87.0,100.0,61.0,196.0,114.0,145.0,19.0,146.0,4.0,41.0,120.0,135.0,28.0,76.0,161.0,65.0,556.0,94.0,221.0,241.0,93.0,86.0,362.0,7.0,112.0,85.0,16.0,81.0,13.0,40.0,50.0,55.0,51.0,3.0,27.0,45.0,6.0,9.0,4.0,53.0,48.0,51.0,9.0,57.0,13.0,5.0,15.0,30.0,52.0,24.0,26.0,5.0,11.0,4.0,13.0,31.0,83.0,6.0,22.0,50.0}))
        .addFieldValue(new fieldValue().setName("heightLabel").setValue("none"))
        .addFieldValue(new fieldValue().setName("lineColor").setValue(new SFColor(0.4,0.4,0.1)))
        .addFieldValue(new fieldValue().setName("highlightSegmentColor").setValue(new SFColor(0.8,0.8,0.2)))
        .addFieldValue(new fieldValue().setName("labelColor").setValue(new SFColor(0.8,0.8,0.0)))
        .addFieldValue(new fieldValue().setName("labelOffset").setValue(new SFVec3f(0.0,20.0,0.0)))
        .addFieldValue(new fieldValue().setName("labelFontSize").setValue(6))
        .addFieldValue(new fieldValue().setName("traceEnabled").setValue(false)))
      .addChild(new ROUTE().setFromNode("EhimeMaruInterpolator").setFromField("position_changed").setToNode("EhimeMaruTransform").setToField("set_translation"))
      .addChild(new ROUTE().setFromNode("EhimeMaruInterpolator").setFromField("orientation_changed").setToNode("EhimeMaruTransform").setToField("set_rotation")))
    .addComments(" =================================== ")
    .addComments(" Grid and coordinate axes ")
    .addChild(new Group()
      .addChild(new Viewpoint().setDescription("Collision point").setOrientation(-.233,.962,.143,1.1352).setPosition(4000.0,1000.0,1500.0))
      .addChild(new Transform().setScale(2500.0,2500.0,2500.0)
        .addChild(new Inline().setUrl(new String[] {"../../../Savage/Tools/Authoring/GridXZ_20x20Fixed.x3d","https://www.web3d.org/x3d/content/examples/Savage/Tools/Authoring/GridXZ_20x20Fixed.x3d","../../../Savage/Tools/Authoring/GridXZ_20x20Fixed.wrl","https://www.web3d.org/x3d/content/examples/Savage/Tools/Authoring/GridXZ_20x20Fixed.wrl"})))
      .addChild(new Transform().setScale(10.0,10.0,10.0)
        .addChild(new Inline("CoordinateAxes").setUrl(new String[] {"../../X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.x3d","https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.x3d","https://www.web3d.org/x3d/content/examples/Savage/Tools/Authoring/CoordinateAxes.x3d","../../X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.wrl","https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.wrl","https://www.web3d.org/x3d/content/examples/Savage/Tools/Authoring/CoordinateAxes.wrl"}))))
    .addComments(" =================================== ")
    .addComments(" Can use either MasterClock or DvdControllerClock ")
    .addChild(new TimeSensor("MasterClock").setLoop(true))
    .addChild(new ProtoInstance("DvdController", "DvdControllerClock").setContainerField("children")
      .addFieldValue(new fieldValue().setName("displayMode").setValue("PLAYBACK_SLIDER"))
      .addFieldValue(new fieldValue().setName("playEnabled").setValue(true))
      .addFieldValue(new fieldValue().setName("buttonColor").setValue(new SFColor(0.655,0.655,0.655)))
      .addFieldValue(new fieldValue().setName("selectedButtonColor").setValue(new SFColor(0.675,0.675,0.675)))
      .addFieldValue(new fieldValue().setName("selectedLabelColor").setValue(new SFColor(0.9,0.0,0.0)))
      .addFieldValue(new fieldValue().setName("locationOffset").setValue(new SFVec3f(-12.0,-4.0,0.0)))
      .addFieldValue(new fieldValue().setName("cycleInterval").setValue(40))
      .addFieldValue(new fieldValue().setName("speedFactor").setValue(10.0))
      .addFieldValue(new fieldValue().setName("traceEnabled").setValue(false)))
    .addChild(new ROUTE().setFromNode("EhimeMaruInterpolator").setFromField("totalDuration").setToNode("DvdControllerClock").setToField("set_cycleInterval"))
    .addChild(new ROUTE().setFromNode("DvdControllerClock").setFromField("fraction_changed").setToNode("GreenevilleInterpolator").setToField("set_fraction"))
    .addChild(new ROUTE().setFromNode("DvdControllerClock").setFromField("fraction_changed").setToNode("EhimeMaruInterpolator").setToField("set_fraction")));
            }
            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: fieldValue value field, scene-graph level=5, element #130, 186 total numbers made up of 62 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_5_130_value()
		{
			MFVec3f fieldValue_waypoints_5_130_value = new MFVec3f(new double[] {-18256.7,-198.1,-2429.6,-17778.3,-198.1,-2429.6,-17330.7,-198.1,-2429.6,-16816.3,-121.9,-2429.6,-16502.5,-121.9,-2429.6,-15494.2,-198.1,-2429.6,-14907.7,-198.1,-2429.6,-14161.8,-198.1,-2429.6,-14064.0,-198.1,-2429.6,-14439.6,-198.1,-3080.1,-14449.9,-198.1,-3097.9,-14555.3,-198.1,-3280.6,-14864.0,-198.1,-3815.2,-14169.5,-198.1,-3815.2,-14025.4,-121.9,-3815.2,-13634.5,-121.9,-3815.2,-12806.2,-198.1,-3815.2,-12471.8,-198.1,-3815.2,-9611.5,-198.1,-3815.2,-9128.0,-198.1,-3815.2,-8059.6,-198.1,-3426.3,-6894.6,-198.1,-3002.3,-6445.0,-198.1,-2838.7,-6029.3,-198.1,-2687.3,-4279.3,-198.1,-2050.4,-4245.5,-121.9,-2038.1,-2805.0,-121.9,-2038.1,-1711.9,-121.9,-2038.1,-1869.5,-121.9,-1905.8,-2667.5,-121.9,-1236.2,-2510.4,-121.9,-1293.4,-2027.0,-121.9,-1469.3,-1422.7,-121.9,-1689.3,-1776.4,-121.9,-1076.7,-2104.3,-121.9,-508.7,-2123.6,-121.9,-475.2,-1875.6,-121.9,-565.5,-1462.3,-121.9,-715.9,-1407.2,-45.7,-736.0,-1352.0,-45.7,-756.1,-1326.8,-45.7,-765.3,-993.8,-45.7,-886.5,-692.1,-45.7,-996.3,-371.6,-45.7,-1112.9,-389.0,-45.7,-1082.9,-498.9,-45.7,-892.4,-524.0,-45.7,-849.0,-533.6,-45.7,-832.3,-562.6,-45.7,-782.1,-620.5,-45.7,-681.9,-720.8,-18.3,-508.1,-767.1,-18.3,-427.9,-817.2,-17.7,-341.1,-826.9,-17.4,-324.4,-848.1,-17.4,-287.6,-855.8,-19.5,-274.2,-877.9,-24.1,-237.6,-946.4,-54.6,-118.8,-432.9,-121.9,-305.7,-400.5,-122.5,-280.4,-278.1,-122.5,-194.7,0.0,-6.1,0.0});
			return fieldValue_waypoints_5_130_value;
		}
		/** Large attribute array: fieldValue value field, scene-graph level=5, element #154, 186 total numbers made up of 62 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_5_154_value()
		{
			MFVec3f fieldValue_waypoints_5_154_value = new MFVec3f(new double[] {20060.7,-3.0,-5001.7,19875.0,-3.0,-4955.4,19701.3,-3.0,-4912.1,19501.6,-3.0,-4862.3,19379.8,-3.0,-4831.9,18988.5,-3.0,-4734.4,18760.9,-3.0,-4677.6,18471.4,-3.0,-4605.4,18433.4,-3.0,-4596.0,18141.9,-3.0,-4523.3,18133.9,-3.0,-4521.3,18052.1,-3.0,-4500.9,17812.5,-3.0,-4441.2,17542.9,-3.0,-4373.9,17389.2,-3.0,-4335.6,16971.9,-3.0,-4231.6,16087.9,-3.0,-4011.2,15731.0,-3.0,-3922.2,12678.1,-3.0,-3161.0,12162.0,-3.0,-3032.3,10948.6,-3.0,-2729.8,9625.3,-3.0,-2399.9,9114.6,-3.0,-2272.5,8642.4,-3.0,-2154.8,6654.8,-3.0,-1659.2,6616.4,-3.0,-1649.6,6001.4,-3.0,-1496.3,5534.7,-3.0,-1379.9,5446.8,-3.0,-1358.0,5002.1,-3.0,-1247.2,4930.7,-3.0,-1229.4,4711.1,-3.0,-1174.6,4436.5,-3.0,-1106.1,4134.5,-3.0,-1030.9,3854.5,-3.0,-961.0,3838.0,-3.0,-956.9,3689.8,-3.0,-920.0,3442.7,-3.0,-858.4,3409.8,-3.0,-850.1,3360.3,-3.0,-837.8,3338.4,-3.0,-832.4,3047.4,-3.0,-759.8,2783.8,-3.0,-694.1,2503.8,-3.0,-624.3,2454.4,-3.0,-611.9,2141.4,-3.0,-533.9,2070.0,-3.0,-516.1,2042.6,-3.0,-509.3,1960.2,-3.0,-488.7,1795.5,-3.0,-447.7,1510.0,-3.0,-376.5,1378.2,-3.0,-343.6,1235.4,-3.0,-308.0,1208.0,-3.0,-301.2,1147.6,-3.0,-286.1,1125.6,-3.0,-280.6,1054.2,-3.0,-262.8,884.0,-3.0,-220.4,428.3,-3.0,-106.8,395.3,-3.0,-98.6,274.5,-3.0,-68.4,0.0,-3.0,0.0});
			return fieldValue_waypoints_5_154_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 CollisionCourses 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 CollisionCourses().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.CollisionUssGreenevilleMvEhimeMaru.CollisionCourses\" 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.CollisionUssGreenevilleMvEhimeMaru.CollisionCourses self-validation test confirmation: ");
                if (!validationResults.equals("success"))
                    System.out.println();
                System.out.println(validationResults.trim());

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