package Savage.AircraftFixedWing.F18BlueAngelUnitedStates;

import org.web3d.x3d.jsail.Core.*;
import org.web3d.x3d.jsail.EnvironmentalEffects.*;
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.PointingDeviceSensor.*;
import org.web3d.x3d.jsail.Scripting.*;

// Javadoc metadata annotations follow, see below for X3DJSAIL Java source code.
/**
 * <p> The BlueAngelF18 example model integrated with ExternPrototypes - clicking any axle starts animation, such as, raising or lowering landing gears simultaneously. Clicking cockpit canopy makes it open or close. </p>
 <p> Related links: Catalog page <a href="../../../../AircraftFixedWing/F18BlueAngelUnitedStates/BlueAngelF18ExampleIndex.html" target="_blank">BlueAngelF18Example</a>,  source <a href="../../../../AircraftFixedWing/F18BlueAngelUnitedStates/BlueAngelF18Example.java">BlueAngelF18Example.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="../../../../AircraftFixedWing/F18BlueAngelUnitedStates/BlueAngelF18Example.x3d">BlueAngelF18Example.x3d</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> description </i> </td>
			<td> The BlueAngelF18 example model integrated with ExternPrototypes - clicking any axle starts animation, such as, raising or lowering landing gears simultaneously. Clicking cockpit canopy makes it open or close. </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> creator </i> </td>
			<td> Etsuko Lippi </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> created </i> </td>
			<td> 18 October 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> Image </i> </td>
			<td> <a href="../../../../AircraftFixedWing/F18BlueAngelUnitedStates/blueangels.jpg">blueangels.jpg</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> Image </i> </td>
			<td> <a href="https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/blueangels.jpg" target="_blank">https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/blueangels.jpg</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> <a href="http://www.navy.com/blueangels" target="_blank">http://www.navy.com/blueangels</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> <a href="http://www.BlueAngels.navy.mil" target="_blank">http://www.BlueAngels.navy.mil</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> <a href="https://www.fas.org/man/dod-101/sys/ac/f-18.htm" target="_blank">https://www.fas.org/man/dod-101/sys/ac/f-18.htm</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> <a href="http://www.BlueAngels.org" target="_blank">http://www.BlueAngels.org</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> <a href="http://www.chinfo.navy.mil/navpalib/aircraft/b-angels/blues.html" target="_blank">http://www.chinfo.navy.mil/navpalib/aircraft/b-angels/blues.html</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> <a href="http://www.danshistory.com/fa18.html" target="_blank">http://www.danshistory.com/fa18.html</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> <a href="http://www.csd.uwo.ca/~pettypi/elevon/baugher_us/f018.html" target="_blank">http://www.csd.uwo.ca/~pettypi/elevon/baugher_us/f018.html</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> <a href="https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/Blue_Angels.jpg" target="_blank">https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/Blue_Angels.jpg</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> <a href="https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/Blue_Angels_bottom.jpg" target="_blank">https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/Blue_Angels_bottom.jpg</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> identifier </i> </td>
			<td> <a href="https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/BlueAngelF18Example.x3d" target="_blank">https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/BlueAngelF18Example.x3d</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> subject </i> </td>
			<td> Aircraft, F18, Blue Angel example </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> license </i> </td>
			<td> <a href="../../../../AircraftFixedWing/F18BlueAngelUnitedStates/../../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 Etsuko Lippi
 */

public class BlueAngelF18Example
{
	/** Default constructor to create this object. */
	public BlueAngelF18Example ()
	{
	  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("BlueAngelF18Example.x3d"))
    .addMeta(new meta().setName(meta.NAME_DESCRIPTION).setContent("The BlueAngelF18 example model integrated with ExternPrototypes - clicking any axle starts animation, such as, raising or lowering landing gears simultaneously. Clicking cockpit canopy makes it open or close."))
    .addMeta(new meta().setName(meta.NAME_CREATOR    ).setContent("Etsuko Lippi"))
    .addMeta(new meta().setName(meta.NAME_CREATED    ).setContent("18 October 2001"))
    .addMeta(new meta().setName(meta.NAME_MODIFIED   ).setContent("28 January 2024"))
    .addMeta(new meta().setName(meta.NAME_IMAGE      ).setContent("blueangels.jpg"))
    .addMeta(new meta().setName(meta.NAME_IMAGE      ).setContent("https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/blueangels.jpg"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("http://www.navy.com/blueangels"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("http://www.BlueAngels.navy.mil"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("https://www.fas.org/man/dod-101/sys/ac/f-18.htm"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("http://www.BlueAngels.org"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("http://www.chinfo.navy.mil/navpalib/aircraft/b-angels/blues.html"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("http://www.danshistory.com/fa18.html"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("http://www.csd.uwo.ca/~pettypi/elevon/baugher_us/f018.html"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/Blue_Angels.jpg"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/Blue_Angels_bottom.jpg"))
    .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_IDENTIFIER ).setContent("https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/BlueAngelF18Example.x3d"))
    .addMeta(new meta().setName(meta.NAME_SUBJECT    ).setContent("Aircraft, F18, Blue Angel example"))
    .addMeta(new meta().setName(meta.NAME_LICENSE    ).setContent("../../license.html")))
  .setScene(new Scene()
    .addChild(new ExternProtoDeclare("ViewPositionOrientation").setName("ViewPositionOrientation").setAppinfo("ViewPositionOrientation provides provides console output of local position and orientation as user navigates").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).setAppinfo("Whether or not ViewPositionOrientation sends output to console."))
      .addField(new field().setName("traceEnabled").setType(field.TYPE_SFBOOL).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setAppinfo("Output internal trace messages for debugging this node - developer use only can be ignored."))
      .addField(new field().setName("set_traceEnabled").setType(field.TYPE_SFBOOL).setAccessType(field.ACCESSTYPE_INPUTONLY).setAppinfo("Ability to turn output tracing on/off at runtime."))
      .addField(new field().setName("position_changed").setType(field.TYPE_SFVEC3F).setAccessType(field.ACCESSTYPE_OUTPUTONLY).setAppinfo("Output local position."))
      .addField(new field().setName("orientation_changed").setType(field.TYPE_SFROTATION).setAccessType(field.ACCESSTYPE_OUTPUTONLY).setAppinfo("Output local orientation."))
      .addField(new field().setName("outputViewpointString").setType(field.TYPE_MFSTRING).setAccessType(field.ACCESSTYPE_OUTPUTONLY).setAppinfo("MFString value of new Viewpoint")))
    .addChild(new ExternProtoDeclare("WheelsRearRight").setName("WheelsRearRight").setUrl(new String[] {"WheelsRearRightPrototype.x3d#WheelsRearRight","../../AircraftFixedWing/F18BlueAngelUnitedStates/WheelsRearRightPrototype.x3d#WheelsRearRight","https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/WheelsRearRightPrototype.x3d#WheelsRearRight","../../AircraftFixedWing/F18BlueAngelUnitedStates/WheelsRearRightPrototype.wrl#WheelsRearRight","WheelsRearRightPrototype.wrl#WheelsRearRight","https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/WheelsRearRightPrototype.wrl#WheelsRearRight"})
      .addField(new field().setName("gearup").setType(field.TYPE_SFBOOL).setAccessType(field.ACCESSTYPE_INPUTONLY).setAppinfo("boolean eventIn: true = wheels up false = wheels down."))
      .addField(new field().setName("gearupOut").setType(field.TYPE_SFBOOL).setAccessType(field.ACCESSTYPE_OUTPUTONLY))
      .addField(new field().setName("animationStartTime").setType(field.TYPE_SFTIME).setAccessType(field.ACCESSTYPE_INPUTONLY))
      .addField(new field().setName("traceEnabled").setType(field.TYPE_SFBOOL).setAccessType(field.ACCESSTYPE_INITIALIZEONLY)))
    .addChild(new ExternProtoDeclare("WheelsRearLeft").setName("WheelsRearLeft").setUrl(new String[] {"WheelsRearLeftPrototype.x3d#WheelsRearLeft","../../AircraftFixedWing/F18BlueAngelUnitedStates/WheelsRearLeftPrototype.x3d#WheelsRearLeft","https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/WheelsRearLeftPrototype.x3d#WheelsRearLeft","../../AircraftFixedWing/F18BlueAngelUnitedStates/WheelsRearLeftPrototype.wrl#WheelsRearLeft","WheelsRearLeftPrototype.wrl#WheelsRearLeft","https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/WheelsRearLeftPrototype.wrl#WheelsRearLeft"})
      .addField(new field().setName("gearup").setType(field.TYPE_SFBOOL).setAccessType(field.ACCESSTYPE_INPUTONLY).setAppinfo("boolean eventIn: true = wheels up false = wheels down."))
      .addField(new field().setName("gearupOut").setType(field.TYPE_SFBOOL).setAccessType(field.ACCESSTYPE_OUTPUTONLY))
      .addField(new field().setName("animationStartTime").setType(field.TYPE_SFTIME).setAccessType(field.ACCESSTYPE_INPUTONLY))
      .addField(new field().setName("traceEnabled").setType(field.TYPE_SFBOOL).setAccessType(field.ACCESSTYPE_INITIALIZEONLY)))
    .addChild(new ExternProtoDeclare("WheelsFront").setName("WheelsFront").setUrl(new String[] {"WheelsFrontPrototype.x3d#WheelsFront","../../AircraftFixedWing/F18BlueAngelUnitedStates/WheelsFrontPrototype.x3d#WheelsFront","https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/WheelsFrontPrototype.x3d#WheelsFront","../../AircraftFixedWing/F18BlueAngelUnitedStates/WheelsFrontPrototype.wrl#WheelsFront","WheelsFrontPrototype.wrl#WheelsFront","https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/WheelsFrontPrototype.wrl#WheelsFront"})
      .addField(new field().setName("gearup").setType(field.TYPE_SFBOOL).setAccessType(field.ACCESSTYPE_INPUTONLY).setAppinfo("boolean eventIn: true = wheels up false = wheels down."))
      .addField(new field().setName("gearupOut").setType(field.TYPE_SFBOOL).setAccessType(field.ACCESSTYPE_OUTPUTONLY))
      .addField(new field().setName("animationStartTime").setType(field.TYPE_SFTIME).setAccessType(field.ACCESSTYPE_INPUTONLY))
      .addField(new field().setName("traceEnabled").setType(field.TYPE_SFBOOL).setAccessType(field.ACCESSTYPE_INITIALIZEONLY)))
    .addChild(new ExternProtoDeclare("Canopy").setName("Canopy").setUrl(new String[] {"CanopyPrototype.x3d#Canopy","../../AircraftFixedWing/F18BlueAngelUnitedStates/CanopyPrototype.x3d#Canopy","https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/CanopyPrototype.x3d#Canopy","../../AircraftFixedWing/F18BlueAngelUnitedStates/CanopyPrototype.wrl#Canopy","CanopyPrototype.wrl#Canopy","https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/CanopyPrototype.wrl#Canopy"})
      .addField(new field().setName("canopyOpen").setType(field.TYPE_SFBOOL).setAccessType(field.ACCESSTYPE_INPUTONLY).setAppinfo("boolean eventIn: true = canopy open false = canopy close."))
      .addField(new field().setName("canopyOut").setType(field.TYPE_SFBOOL).setAccessType(field.ACCESSTYPE_OUTPUTONLY))
      .addField(new field().setName("animationStartTime").setType(field.TYPE_SFTIME).setAccessType(field.ACCESSTYPE_INPUTONLY))
      .addField(new field().setName("traceEnabled").setType(field.TYPE_SFBOOL).setAccessType(field.ACCESSTYPE_INITIALIZEONLY)))
    .addChild(new NavigationInfo().setSpeed(2))
    .addChild(new Background().setGroundAngle(new double[] {1.309,1.5702}).setGroundColor(new MFColor(new double[] {0.5,0.3,0.3,0.5,0.3,0.3,0.5,0.4,0.4})).setSkyAngle(new double[] {1.309,1.572}).setSkyColor(new MFColor(new double[] {0.0,0.2,0.7,0.0,0.5,1.0,1.0,1.0,1.0})))
    .addChild(new ProtoInstance("ViewPositionOrientation", "ConsoleOutputViewPositionOrientation").setContainerField("children")
      .addFieldValue(new fieldValue().setName("enabled").setValue(true)))
    .addChild(new Viewpoint().setDescription("Blue Angel Default View").setPosition(1.9,-.8,7.6))
    .addChild(new Viewpoint().setDescription("Blue Angel View From Above").setOrientation(-.952,-.264,-.152,1.4741).setPosition(.3,12.4,-4.8))
    .addChild(new Viewpoint().setDescription("Blue Angel View From Bottom").setOrientation(.513,-.797,.319,1.3342).setPosition(-7.1,-8.8,-2.0))
    .addChild(new Viewpoint().setDescription("Blue Angel Front View").setOrientation(0.048,.998,0.049,4.6832).setPosition(-7.2,.2,-5.0))
    .addChild(new Viewpoint().setDescription("Blue Angel Back View").setOrientation(-.152,.981,.116,1.3177).setPosition(13.4,2.1,-2.1))
    .addChild(new Viewpoint().setDescription("Blue Angel Side View").setOrientation(-.733,.678,0.065,.3177).setPosition(3.7,1.6,4.3))
    .addChild(new Viewpoint().setDescription("Cockpit Inside Pilot View").setOrientation(0.0,1.0,0.0,1.5636).setPosition(-.8,.6,-5.0))
    .addChild(new LOD().setRange(new double[] {200.0,600.0,1000.0})
      .addChild(new Group("Viewpoints")
        .addComments(" High Resolution ")
        .addChild(new Group("High")
          .addChild(new Group("LODHigh")
            .addChild(new Transform().setRotation(0.0,1.0,0.0,1.57).setTranslation(3.595,0.1,-0.8)
              .addChild(new ProtoInstance("Canopy", "CP").setContainerField("children")
                .addFieldValue(new fieldValue().setName("traceEnabled").setValue(true)))
              .addChild(new TouchSensor("CanopyTouchSensor").setDescription("canopy open/close")))
            .addChild(new Transform().setRotation(0.0,1.0,-0.0,3.14).setTranslation(5.7,-0.2,-5.0)
              .addChild(new Inline().setUrl(new String[] {"HorizontalTailplanes.x3d","https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/HorizontalTailplanes.x3d","HorizontalTailplanes.wrl","https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/HorizontalTailplanes.wrl"})))
            .addChild(new Transform().setRotation(-0.69,0.70,0.19,2.78).setScale(1.5,1.5,1.5).setTranslation(5.3,-0.46,-4.3)
              .addChild(new Inline("TwinVerticalTails").setUrl(new String[] {"TwinVerticalTails.x3d","https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/TwinVerticalTails.x3d","TwinVerticalTails.wrl","https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/TwinVerticalTails.wrl"}))
              .addComments(" X = -170, Y = 0, Z = 91 "))
            .addChild(new Transform().setRotation(-0.69,0.70,-0.19,3.51).setScale(1.5,1.5,1.5).setTranslation(5.3,-0.46,-5.7)
              .addChild(new Inline().setUSE("TwinVerticalTails"))
              .addComments(" X = -210, Y = 0, Z = 91 "))
            .addChild(new Transform()
              .addChild(new Inline().setUrl(new String[] {"AircraftFuselage.x3d","https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/AircraftFuselage.x3d","AircraftFuselage.wrl","https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/AircraftFuselage.wrl"})))
            .addChild(new Transform().setRotation(0.0,0.0,-1.0,0.07).setTranslation(-3.0,0.39,-5.0)
              .addChild(new Inline().setUrl(new String[] {"LEX.x3d","https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/LEX.x3d","LEX.wrl","https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/LEX.wrl"})))
            .addChild(new Transform().setRotation(0.0,0.0,1.0,3.14).setScale(0.7,0.7,0.5).setTranslation(-1.0,-0.1,-2.5)
              .addChild(new Inline().setUrl(new String[] {"Fuselage.x3d","https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/Fuselage.x3d","Fuselage.wrl","https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/Fuselage.wrl"}))))
          .addChild(new Group("LODHigh2")
            .addChild(new Transform().setScale(0.25,0.25,0.25).setTranslation(-1.0,0.1,-5.0)
              .addChild(new Inline().setUrl(new String[] {"F18CockpitSeat.x3d","https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/F18CockpitSeat.x3d","F18CockpitSeat.wrl","https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/F18CockpitSeat.wrl"})))
            .addChild(new Transform().setScale(0.35,0.35,0.35).setTranslation(-0.5,-1.25,-5.26)
              .addChild(new ProtoInstance("WheelsFront", "WP").setContainerField("children")
                .addFieldValue(new fieldValue().setName("traceEnabled").setValue(true))))
            .addChild(new TouchSensor("GearUpDownTouchSensor").setDescription("landing gear up/down"))
            .addChild(new Transform().setScale(0.35,0.35,0.35).setTranslation(3.5,-1.2,-6.5)
              .addChild(new ProtoInstance("WheelsRearLeft", "WPLeft").setContainerField("children")
                .addFieldValue(new fieldValue().setName("traceEnabled").setValue(true))))
            .addChild(new Transform().setRotation(0.0,1.0,0.0,3.14).setScale(0.35,0.35,0.35).setTranslation(3.5,-1.215,-3.5)
              .addChild(new ProtoInstance("WheelsRearRight", "WPRight").setContainerField("children")
                .addFieldValue(new fieldValue().setName("traceEnabled").setValue(true))))
            .addChild(new Transform().setRotation(0.0,0.0,-1.0,0.09).setScale(0.85,0.85,0.85).setTranslation(0.8,0.15,-1.15)
              .addChild(new Inline().setUrl(new String[] {"BlueAngelEngines.x3d","https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/BlueAngelEngines.x3d","BlueAngelEngines.wrl","https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/BlueAngelEngines.wrl"})))
            .addChild(new Group("Animation")
              .addChild(new Transform("GearUPDown")
                .addChild(new Script("ExampleSelectionScript").setSourceCode("""
ecmascript:


function tracePrint (outputString)
{
	var traceEnabled = false;
	if (traceEnabled) Browser.println ('[trace] ' + outputString);
}

function enabled(value, timeStamp) {

	tracePrint('enabled = ' + value);
	if (value == true)
	{
		if (landed == -1)
		{			
                        status = false;
                        landed = 0;			
		}
                
		if (landed == 0)
		{
			if (status)
			{
				status = false;                                
			}
			else
			{
				status = true;                                				
			}
		}

                else
                {
         		landed = 0;
     			return;
                }
	}
	//print ('status = ' + status);
}
""")
                  .addField(new field().setName("landed").setType(field.TYPE_SFINT32).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setValue(-1))
                  .addField(new field().setName("enabled").setType(field.TYPE_SFBOOL).setAccessType(field.ACCESSTYPE_INPUTONLY))
                  .addField(new field().setName("status").setType(field.TYPE_SFBOOL).setAccessType(field.ACCESSTYPE_OUTPUTONLY))))
              .addChild(new Transform("Canopy")
                .addChild(new Script("CanopyExampleSelectionScript").setSourceCode("""
ecmascript:


function tracePrint (outputString)
{
	var traceEnabled = false;
	if (traceEnabled) Browser.println ('[trace] ' + outputString);
}

function enabled(value, timeStamp) {

	tracePrint('enabled = ' + value);
	if (value == true)
	{
		if (landed == -1)
		{			
                        status = false;
                        landed = 0;			
		}
                
		if (landed == 0)
		{
			if (status)
			{
				status = false;                                
			}
			else
			{
				status = true;                               				
			}
		}

                else
                {
         		landed = 0;
     			return;
                }
	}
	//print ('status = ' + status);
}
""")
                  .addField(new field().setName("landed").setType(field.TYPE_SFINT32).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setValue(-1))
                  .addField(new field().setName("enabled").setType(field.TYPE_SFBOOL).setAccessType(field.ACCESSTYPE_INPUTONLY))
                  .addField(new field().setName("status").setType(field.TYPE_SFBOOL).setAccessType(field.ACCESSTYPE_OUTPUTONLY))))
              .addComments(" GearUpDown Animation ")
              .addChild(new ROUTE().setFromNode("GearUpDownTouchSensor").setFromField("touchTime").setToNode("WP").setToField("animationStartTime"))
              .addChild(new ROUTE().setFromNode("GearUpDownTouchSensor").setFromField("touchTime").setToNode("WPRight").setToField("animationStartTime"))
              .addChild(new ROUTE().setFromNode("GearUpDownTouchSensor").setFromField("touchTime").setToNode("WPLeft").setToField("animationStartTime"))
              .addChild(new ROUTE().setFromNode("GearUpDownTouchSensor").setFromField("isActive").setToNode("ExampleSelectionScript").setToField("enabled"))
              .addChild(new ROUTE().setFromNode("ExampleSelectionScript").setFromField("status").setToNode("WP").setToField("gearup"))
              .addChild(new ROUTE().setFromNode("ExampleSelectionScript").setFromField("status").setToNode("WPRight").setToField("gearup"))
              .addChild(new ROUTE().setFromNode("ExampleSelectionScript").setFromField("status").setToNode("WPLeft").setToField("gearup"))
              .addComments(" Canopy Animation ")
              .addChild(new ROUTE().setFromNode("CanopyTouchSensor").setFromField("touchTime").setToNode("CP").setToField("animationStartTime"))
              .addChild(new ROUTE().setFromNode("CanopyTouchSensor").setFromField("isActive").setToNode("CanopyExampleSelectionScript").setToField("enabled"))
              .addChild(new ROUTE().setFromNode("CanopyExampleSelectionScript").setFromField("status").setToNode("CP").setToField("canopyOpen"))))
          .addChild(new Group("LODLow")
            .addChild(new Transform().setRotation(0.0,1.0,0.0,3.14).setScale(1.1,1.1,1.1).setTranslation(1.4,0.0,-5.0)
              .addChild(new Inline().setUrl(new String[] {"WingMain.x3d","https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/WingMain.x3d","WingMain.wrl","https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/WingMain.wrl"}))))))
      .addComments(" Medium Resolution ")
      .addChild(new Group("Medium")
        .addChild(new Group().setUSE("LODHigh"))
        .addChild(new Group("LODMedium")
          .addChild(new Transform().setScale(0.35,0.35,0.35).setTranslation(-0.5,-1.25,-5.26)
            .addChild(new Inline().setUrl(new String[] {"WheelsFrontMediumLOD.x3d","https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/WheelsFrontMediumLOD.x3d","WheelsFrontMediumLOD.wrl","https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/WheelsFrontMediumLOD.wrl"})))
          .addChild(new Transform().setScale(0.35,0.35,0.35).setTranslation(3.5,-1.2,-6.5)
            .addChild(new Inline().setUrl(new String[] {"WheelsRearLeftMediumLOD.x3d","https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/WheelsRearLeftMediumLOD.x3d","WheelsRearLeftMediumLOD.wrl","https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/WheelsRearLeftMediumLOD.wrl"})))
          .addChild(new Transform().setRotation(0.0,1.0,0.0,3.14).setScale(0.35,0.35,0.35).setTranslation(3.5,-1.2,-3.5)
            .addChild(new Inline().setUrl(new String[] {"WheelsRearRightMediumLOD.x3d","https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/WheelsRearRightMediumLOD.x3d","WheelsRearRightMediumLOD.wrl","https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/WheelsRearRightMediumLOD.wrl"})))
          .addChild(new Transform().setRotation(0.0,0.0,-1.0,0.09).setScale(0.85,0.85,0.85).setTranslation(0.8,0.15,-1.15)
            .addChild(new Inline().setUrl(new String[] {"BlueAngelEnginesMediumLOD.x3d","https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/BlueAngelEnginesMediumLOD.x3d","BlueAngelEnginesMediumLOD.wrl","https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/BlueAngelEnginesMediumLOD.wrl"}))))
        .addChild(new Group().setUSE("LODLow")))
      .addComments(" Low Resolution ")
      .addChild(new Group("Low")
        .addChild(new Group().setUSE("LODHigh"))
        .addChild(new Group().setUSE("LODMedium"))
        .addChild(new Transform().setRotation(0.0,1.0,0.0,3.14).setScale(1.1,1.1,1.1).setTranslation(1.4,0.0,-5.0)
          .addChild(new Inline().setUrl(new String[] {"WingMainLowLOD.x3d","https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/WingMainLowLOD.x3d","WingMainLowLOD.wrl","https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/F18BlueAngelUnitedStates/WingMainLowLOD.wrl"}))))
      .addChild(new WorldInfo().setInfo(new String[] {"null node"}))));
            }
            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

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

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