package Savage.Robots.UnmannedUnderwaterVehicles;

import org.web3d.x3d.jsail.Core.*;
import org.web3d.x3d.jsail.DIS.*;
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.Interpolation.*;
import org.web3d.x3d.jsail.Navigation.*;
import org.web3d.x3d.jsail.Scripting.*;
import org.web3d.x3d.jsail.Shape.*;
import org.web3d.x3d.jsail.Texturing.*;
import org.web3d.x3d.jsail.Time.*;

// Javadoc metadata annotations follow, see below for X3DJSAIL Java source code.
/**
 * <p> Remote Environmental Monitoring UnitS (REMUS) is a low-cost autonomous underwater vehicle (AUV) for coastal monitoring and multiple vehicle survey operations. REMUS is developed and operated by the Woods Hole Oceanographic Institute (WHOI) Oceanographic Systems Laboratory. Red fin is topside. p.s. Jeff Weekley's first model!. </p>
 <p> Related links: Catalog page <a href="../../../../Robots/UnmannedUnderwaterVehicles/RemusEspduIndex.html" target="_blank">RemusEspdu</a>,  source <a href="../../../../Robots/UnmannedUnderwaterVehicles/RemusEspdu.java">RemusEspdu.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="../../../../Robots/UnmannedUnderwaterVehicles/RemusEspdu.x3d">RemusEspdu.x3d</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> description </i> </td>
			<td> Remote Environmental Monitoring UnitS (REMUS) is a low-cost autonomous underwater vehicle (AUV) for coastal monitoring and multiple vehicle survey operations. REMUS is developed and operated by the Woods Hole Oceanographic Institute (WHOI) Oceanographic Systems Laboratory. Red fin is topside. p.s. Jeff Weekley's first model! </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> creator </i> </td>
			<td> Jeffrey Weekley, DIS and terrain content added by Duane Davis </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> created </i> </td>
			<td> 16 March 2001 </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> modified </i> </td>
			<td> 20 October 2019 </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> <a href="http://adcp.whoi.edu" target="_blank">http://adcp.whoi.edu</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> <a href="http://www.whoi.edu/home/marine/remus_main.html" target="_blank">http://www.whoi.edu/home/marine/remus_main.html</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> <a href="../../../../Robots/UnmannedUnderwaterVehicles/remus_main_May2001.pdf">remus_main_May2001.pdf</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/Robots/UnmannedUnderwaterVehicles/Remus.x3d" target="_blank">https://www.web3d.org/x3d/content/examples/Savage/Robots/UnmannedUnderwaterVehicles/Remus.x3d</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> photo </i> </td>
			<td> marine_remus_top.jpg </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> <a href="../../../../Robots/UnmannedUnderwaterVehicles/SAHRV-SemiAutonomousHydrographicReconnaissainceVehicle.pdf">SAHRV-SemiAutonomousHydrographicReconnaissainceVehicle.pdf</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> <a href="http://www.onr.navy.mil/sci_tech/ocean/info/yerpts/oeye00/oe5vona1.pdf" target="_blank">http://www.onr.navy.mil/sci_tech/ocean/info/yerpts/oeye00/oe5vona1.pdf</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> <a href="../../../../Robots/UnmannedUnderwaterVehicles/oe5vona1-NavalSpecialWarfareSupportWithREMUS.pdf">oe5vona1-NavalSpecialWarfareSupportWithREMUS.pdf</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/Robots/UnmannedUnderwaterVehicles/RemusEspdu.x3d" target="_blank">https://www.web3d.org/x3d/content/examples/Savage/Robots/UnmannedUnderwaterVehicles/RemusEspdu.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="../../../../Robots/UnmannedUnderwaterVehicles/../../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 Jeffrey Weekley, DIS and terrain content added by Duane Davis
 */

public class RemusEspdu
{
	/** Default constructor to create this object. */
	public RemusEspdu ()
	{
	  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()
    .addComponent(new component().setName("DIS").setLevel(1))
    .addMeta(new meta().setName(meta.NAME_TITLE      ).setContent("RemusEspdu.x3d"))
    .addMeta(new meta().setName(meta.NAME_DESCRIPTION).setContent("Remote Environmental Monitoring UnitS (REMUS) is a low-cost autonomous underwater vehicle (AUV) for coastal monitoring and multiple vehicle survey operations. REMUS is developed and operated by the Woods Hole Oceanographic Institute (WHOI) Oceanographic Systems Laboratory. Red fin is topside. p.s. Jeff Weekley's first model!"))
    .addMeta(new meta().setName(meta.NAME_CREATOR    ).setContent("Jeffrey Weekley, DIS and terrain content added by Duane Davis"))
    .addMeta(new meta().setName(meta.NAME_CREATED    ).setContent("16 March 2001"))
    .addMeta(new meta().setName(meta.NAME_MODIFIED   ).setContent("20 October 2019"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("http://adcp.whoi.edu"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("http://www.whoi.edu/home/marine/remus_main.html"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("remus_main_May2001.pdf"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("https://www.web3d.org/x3d/content/examples/Savage/Robots/UnmannedUnderwaterVehicles/Remus.x3d"))
    .addMeta(new meta().setName(meta.NAME_PHOTO      ).setContent("marine_remus_top.jpg"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("SAHRV-SemiAutonomousHydrographicReconnaissainceVehicle.pdf"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("http://www.onr.navy.mil/sci_tech/ocean/info/yerpts/oeye00/oe5vona1.pdf"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("oe5vona1-NavalSpecialWarfareSupportWithREMUS.pdf"))
    .addMeta(new meta().setName(meta.NAME_IDENTIFIER ).setContent("https://www.web3d.org/x3d/content/examples/Savage/Robots/UnmannedUnderwaterVehicles/RemusEspdu.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()
    .addComments(" Produce wireframe or transparent beam cones. ")
    .addChild(new ExternProtoDeclare("BeamCone").setName("BeamCone").setAppinfo("Produce wireframe or transparent beam cones. Typical uses include propeller/thruster water flow or line-of-sight sonar/radar/light beams. Negative range values invert base and apex at same relative location. Default: beam with apex at (0 0 0) and base of radius 1 in x-z plane at (1 0 0).").setUrl(new String[] {"../../CommunicationsAndSensors/Beam/BeamConePrototype.x3d#BeamCone","https://www.web3d.org/x3d/content/examples/Savage/CommunicationsAndSensors/Beam/BeamConePrototype.x3d#BeamCone","../../CommunicationsAndSensors/Beam/BeamConePrototype.wrl#BeamCone","https://www.web3d.org/x3d/content/examples/Savage/CommunicationsAndSensors/Beam/BeamConePrototype.wrl#BeamCone"})
      .addField(new field().setName("contact").setType(field.TYPE_SFBOOL).setAccessType(field.ACCESSTYPE_INPUTONLY).setAppinfo("(communications) is transmitted signal in contact with receiver or (sensor) is a target return detected?"))
      .addField(new field().setName("range").setType(field.TYPE_SFFLOAT).setAccessType(field.ACCESSTYPE_INPUTONLY).setAppinfo("distance in meters along x axis"))
      .addField(new field().setName("defaultRange").setType(field.TYPE_SFFLOAT).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setAppinfo("distance in meters used until eventIn range sent"))
      .addField(new field().setName("wireframe").setType(field.TYPE_SFBOOL).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setAppinfo("whether wireframe beam is drawn"))
      .addField(new field().setName("solid").setType(field.TYPE_SFBOOL).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setAppinfo("whether solid beam is drawn"))
      .addField(new field().setName("beamHeightDegrees").setType(field.TYPE_SFFLOAT).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setAppinfo("degrees across vertical y axis"))
      .addField(new field().setName("beamWidthDegrees").setType(field.TYPE_SFFLOAT).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setAppinfo("degrees across horizontal z axis"))
      .addField(new field().setName("contactColor").setType(field.TYPE_SFCOLOR).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setAppinfo("rendering color when contact=true"))
      .addField(new field().setName("noContactColor").setType(field.TYPE_SFCOLOR).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setAppinfo("rendering color when contact=false"))
      .addField(new field().setName("transparency").setType(field.TYPE_SFFLOAT).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setAppinfo("1 = fully transparent wireframe only"))
      .addField(new field().setName("name").setType(field.TYPE_SFSTRING).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setAppinfo("BeamCone name aids in node identification and tracing"))
      .addField(new field().setName("traceEnabled").setType(field.TYPE_SFBOOL).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setAppinfo("flag to turn on Script tracing")))
    .addChild(new WorldInfo().setInfo(new String[] {"Only unclassified open resources were used to create this model."}).setTitle("Remus AUV"))
    .addChild(new Background().setSkyColor(new MFColor(new double[] {0.2,0.8,0.8})))
    .addComments(" This file builds the REMUS Autonomous Underwater Vehicle (AUV). The dimensions were originally provided in English units and is converted to metric using a scale that 39.3 inches equal one meter. ")
    .addChild(new EspduTransform("AUVTRANSFORM").setAddress("224.2.181.145").setMarking("Remus AUV").setNetworkMode("networkReader").setPort(62040)
      .addChild(new Group()
        .addChild(new Transform().setRotation(0.0,1.0,0.0,-1.57).setTranslation(-3.0,1.0,0.0)
          .addChild(new Viewpoint().setDescription("Remus over-the-shoulder 3m").setOrientation(1.0,0.0,0.0,-0.25).setPosition(0.0,0.0,0.0)))
        .addChild(new Transform().setRotation(0.0,0.0,1.0,1.57079).setScale(0.2145,0.2145,0.2145).setTranslation(1.0,0.0,0.0)
          .addChild(new Transform("torpedoband1").setTranslation(0.0,2.475,0.0)
            .addChild(new Shape()
              .setGeometry(new Cylinder().setBottom(false).setHeight(0.45).setRadius(.267).setTop(false))
              .setAppearance(new Appearance()
                .setMaterial(new Material().setDiffuseColor(0.0,0.5,0.5)))))
          .addChild(new Transform("torpedoband2").setTranslation(0.0,2.735,0.0)
            .addChild(new Shape()
              .setGeometry(new Cylinder().setBottom(false).setHeight(.07).setRadius(.267).setTop(false))
              .setAppearance(new Appearance()
                .setMaterial(new Material().setDiffuseColor(0.0,0.5,0.5)))))
          .addChild(new Transform("torpedobody2").setTranslation(0.0,3.37,0.0)
            .addChild(new Shape()
              .setGeometry(new Cylinder().setBottom(false).setHeight(1.2).setRadius(0.267).setTop(false))
              .setAppearance(new Appearance()
                .setMaterial(new Material().setDiffuseColor(1.0,1.0,0.0)))))
          .addChild(new Transform("torpedoband3").setTranslation(0.0,4.005,0.0)
            .addChild(new Shape()
              .setGeometry(new Cylinder().setBottom(false).setHeight(.07).setRadius(.267).setTop(false))
              .setAppearance(new Appearance()
                .setMaterial(new Material().setDiffuseColor(1.0,1.0,0.0)))))
          .addChild(new Transform("torpedobody3").setTranslation(0.0,4.638,0.0)
            .addChild(new Shape()
              .setGeometry(new Cylinder().setBottom(false).setHeight(1.2).setRadius(0.267).setTop(false))
              .setAppearance(new Appearance()
                .setMaterial(new Material().setDiffuseColor(1.0,1.0,0.0)))))
          .addChild(new Transform("torpedoband4").setTranslation(0.0,3.8075,0.0)
            .addChild(new Transform().setTranslation(0.0,1.465,0.0)
              .addChild(new Shape()
                .setGeometry(new Cylinder().setBottom(false).setHeight(.07).setRadius(.267).setTop(false))
                .setAppearance(new Appearance()
                  .setMaterial(new Material().setDiffuseColor(1.0,1.0,0.0))))))
          .addChild(new Transform("torpedobody4").setTranslation(0.0,3.8075,0.0)
            .addChild(new Transform().setTranslation(0.0,2.1,0.0)
              .addChild(new Shape()
                .setGeometry(new Cylinder().setBottom(false).setHeight(1.2).setRadius(.267).setTop(false))
                .setAppearance(new Appearance()
                  .setMaterial(new Material().setDiffuseColor(1.0,1.0,0.0))))))
          .addChild(new Transform("torpedonose").setRotation(1.0,0.0,0.0,3.1416).setTranslation(0.0,2.2525,0.0)
            .addChild(new Shape()
              .setAppearance(new Appearance()
                .setMaterial(new Material().setShininess(0.5)))
              .setGeometry(new Extrusion().setCreaseAngle(1.785).setCrossSection(new MFVec2f(new double[] {0.267,0.000,0.231,-0.134,0.134,-0.231,0.0,-0.267,-0.134,-0.231,-0.231,-0.134,-0.267,0.000,-0.231,0.134,-0.134,0.231,0.0,0.267,0.134,0.231,0.231,0.134,0.267,0.0})).setScale(new MFVec2f(new double[] {1.00,1.00,0.95,0.95,0.88,0.88,0.76,0.76,0.48,0.48})).setSpine(new MFVec3f(new double[] {0.00,0.00,0.00,0.00,0.10,0.00,0.00,0.20,0.00,0.00,0.30,0.00,0.00,0.40,0.00})))))
          .addChild(new Group("controlfins")
            .addChild(new Transform().setTranslation(0.0,-0.25,0.0)
              .addChild(new Transform("ControlFin1")
                .addChild(new Transform().setTranslation(0.19,7.81,0.0)
                  .addChild(new Transform("Deflector1")
                    .addChild(new Shape()
                      .setGeometry(new Box().setSize(0.4,.2,0.02))
                      .setAppearance(new Appearance()
                        .setMaterial(new Material().setDiffuseColor(1.0,0.0,0.0).setShininess(0.5)))))))
              .addChild(new Transform("ControlFin2").setRotation(0.0,1.0,0.0,3.17)
                .addChild(new Transform().setTranslation(0.19,7.81,0.0)
                  .addChild(new Transform("Deflector2")
                    .addChild(new Shape()
                      .setGeometry(new Box().setSize(0.4,.2,0.02))
                      .setAppearance(new Appearance()
                        .setMaterial(new Material().setDiffuseColor(0.1,0.1,0.1).setShininess(0.5)))))))
              .addChild(new Transform("ControlFin3").setRotation(0.0,1.0,0.0,1.57)
                .addChild(new Transform().setTranslation(0.19,7.81,0.0)
                  .addChild(new Transform("Deflector3")
                    .addChild(new Shape()
                      .setGeometry(new Box().setSize(0.4,.2,0.02))
                      .setAppearance(new Appearance()
                        .setMaterial(new Material().setDiffuseColor(0.1,0.1,0.1).setShininess(0.5)))))))
              .addChild(new Transform("ControlFin4").setRotation(0.0,1.0,0.0,4.74)
                .addChild(new Transform().setTranslation(0.19,7.81,0.0)
                  .addChild(new Transform("Deflector4")
                    .addChild(new Shape()
                      .setGeometry(new Box().setSize(0.4,.2,0.02))
                      .setAppearance(new Appearance()
                        .setMaterial(new Material().setDiffuseColor(0.1,0.1,0.1).setShininess(0.5)))))))))
          .addChild(new Group("TailSection")
            .addChild(new Transform("torpedotail").setRotation(1.0,0.0,0.0,3.1416).setTranslation(0.0,7.9375,0.0)
              .addChild(new Shape()
                .setAppearance(new Appearance()
                  .setMaterial(new Material().setShininess(1.0)))
                .setGeometry(new Extrusion().setCreaseAngle(2.0).setCrossSection(new MFVec2f(new double[] {0.267,0.000,0.231,-0.134,0.134,-0.231,0.0,-0.267,-0.134,-0.231,-0.231,-0.134,-0.267,0.000,-0.231,0.134,-0.134,0.231,0.0,0.267,0.134,0.231,0.231,0.134,0.267,0.0})).setEndCap(false).setScale(new MFVec2f(new double[] {0.342,0.342,0.500,0.500,0.643,0.643,0.766,0.766,0.866,0.866,0.940,0.940,0.985,0.985,1.0,1.0})).setSpine(new MFVec3f(new double[] {0.0,0.0,0.000,0.0,0.114,0.000,0.0,0.266,0.000,0.0,0.453,0.000,0.0,0.670,0.000,0.0,0.910,0.000,0.0,1.166,0.000,0.0,1.431,0.0}))))
              .addChild(new LOD().setRange(new double[] {20.0})
                .addChild(new Group("torpedostator")
                  .addChild(new Transform("propeller").setTranslation(0.0,-0.15,0.0)
                    .addChild(new Group("statorblade1")
                      .addChild(new Transform("torpedostatorblade1")
                        .addChild(new Transform().setRotation(-1.0,0.0,0.0,1.0472).setTranslation(0.075,0.0,0.0)
                          .addChild(new Shape()
                            .setGeometry(new Box().setSize(0.125,0.09,0.015))
                            .setAppearance(new Appearance()
                              .setMaterial(new Material().setDiffuseColor(0.1,0.1,0.1).setShininess(0.75))))))
                      .addChild(new Transform("torpedostatorblade2").setRotation(0.0,1.0,0.0,1.0472)
                        .addChild(new Transform().setRotation(1.0,0.0,0.0,1.0472).setTranslation(-0.075,0.0,0.0)
                          .addChild(new Shape()
                            .setGeometry(new Box().setSize(0.125,0.09,0.015))
                            .setAppearance(new Appearance()
                              .setMaterial(new Material().setDiffuseColor(0.1,0.1,0.1).setShininess(0.5))))))
                      .addChild(new Transform("torpedostatorblade3").setRotation(0.0,1.0,0.0,-1.0472)
                        .addChild(new Transform().setRotation(1.0,0.0,0.0,1.0472).setTranslation(-0.075,0.0,0.0)
                          .addChild(new Shape()
                            .setGeometry(new Box().setSize(0.125,0.09,0.015))
                            .setAppearance(new Appearance()
                              .setMaterial(new Material().setDiffuseColor(0.1,0.1,0.1)))))))
                    .addChild(new Transform("statorcrankshaft").setRotation(1.0,0.0,0.0,3.1416).setTranslation(0.0,0.05,0.0)
                      .addChild(new Shape()
                        .setGeometry(new Cone().setBottomRadius(0.09).setHeight(0.2))
                        .setAppearance(new Appearance()
                          .setMaterial(new Material().setDiffuseColor(0.1,0.1,0.1))))))
                  .addComments(" Spins the propellor and stator once every 4 seconds ")
                  .addChild(new TimeSensor("Clock").setCycleInterval(0.5).setLoop(true))
                  .addChild(new OrientationInterpolator("PropSpin").setKey(new double[] {0.0,0.5,1.0}).setKeyValue(new MFRotation(new double[] {0.0,1.0,0.0,0.00,0.0,1.0,0.0,3.14,0.0,1.0,0.0,6.28})))
                  .addChild(new ROUTE().setFromNode("Clock").setFromField("fraction_changed").setToNode("PropSpin").setToField("set_fraction"))
                  .addChild(new ROUTE().setFromNode("PropSpin").setFromField("value_changed").setToNode("propeller").setToField("rotation")))
                .addChild(new WorldInfo().setInfo(new String[] {"null node"})))))
          .addChild(new Transform("SideScanningSonarArray1").setTranslation(0.0,4.5,0.27)
            .addChild(new Shape()
              .setGeometry(new Box().setSize(0.04,2.0,0.025))
              .setAppearance(new Appearance()
                .setMaterial(new Material().setDiffuseColor(0.1,0.1,0.1).setShininess(0.5)))))
          .addChild(new Transform("SideScanningSonarArray2").setTranslation(0.0,0.0,-.54)
            .addChild(new Transform().setUSE("SideScanningSonarArray1")))
          .addChild(new Transform("TopHook").setTranslation(0.27,4.25,0.0)
            .addChild(new Shape()
              .setGeometry(new Box().setSize(0.04,0.1,0.04))
              .setAppearance(new Appearance()
                .setMaterial(new Material().setDiffuseColor(0.1,0.1,0.1).setShininess(.75)))))
          .addChild(new Transform("SCREW_BEAMCONE").setRotation(0.0,0.0,1.0,1.571).setTranslation(0.0,8.2,0.0)
            .addChild(new ProtoInstance("BeamCone", "ScrewBeamCone").setContainerField("children")
              .addComments(" range values -1..0..1 m <==> -700..0..700 RPM ")
              .addFieldValue(new fieldValue().setName("defaultRange").setValue(1))
              .addFieldValue(new fieldValue().setName("beamHeightDegrees").setValue(8))
              .addFieldValue(new fieldValue().setName("beamWidthDegrees").setValue(8))
              .addFieldValue(new fieldValue().setName("solid").setValue(false))
              .addFieldValue(new fieldValue().setName("wireframe").setValue(true))
              .addComments(" Greenish blue for sea water flow ")
              .addFieldValue(new fieldValue().setName("noContactColor").setValue(new SFColor(0.0,.8,.4)))
              .addFieldValue(new fieldValue().setName("transparency").setValue(0)))))
        .addChild(new Group("GPSTransiever")
          .addChild(new Transform().setRotation(0.0,1.0,0.0,1.57).setScale(0.0125,0.0125,0.0125).setTranslation(-0.3,0.06,0.0)
            .addChild(new Transform("Top")
              .addChild(new Shape()
                .setGeometry(new Extrusion().setCreaseAngle(3.14).setCrossSection(new MFVec2f(new double[] {0.0,1.1,0.65,0.4,0.7,0.2,0.7,-0.2,0.0,-1.6,-0.7,-0.2,-0.7,0.2,-0.65,0.4,0.0,1.1})).setScale(new MFVec2f(new double[] {0.9,0.9,1.0,1.0,1.0,1.0,0.9,0.9})).setSpine(new MFVec3f(new double[] {0.0,5.0,0.0,0.0,5.1,0.0,0.0,5.9,0.0,0.0,6.0,0.0})))
                .setAppearance(new Appearance()
                  .setMaterial(new Material().setDiffuseColor(0.8,0.63,0.7).setTransparency(0.2)))))
            .addChild(new Transform("Fin")
              .addChild(new Shape()
                .setGeometry(new Extrusion().setCreaseAngle(3.14).setCrossSection(new MFVec2f(new double[] {0.0,2.2,0.2,1.8,0.0,-2.2,-0.2,1.8,0.0,2.2})).setScale(new MFVec2f(new double[] {1.0,1.0,0.4,0.4})).setSpine(new MFVec3f(new double[] {0.0,0.0,0.0,0.0,5.9,0.0})))
                .setAppearance(new Appearance("Orange")
                  .setMaterial(new Material().setDiffuseColor(0.8,0.43,0.3)))))
            .addChild(new Transform("Base")
              .addChild(new Shape()
                .setGeometry(new Extrusion().setCreaseAngle(2).setCrossSection(new MFVec2f(new double[] {0.0,2.3,0.2,2.2,0.4,2.0,0.5,1.6,0.5,-1.6,0.3,-2.0,0.0,-2.3,-0.3,-2.0,-0.5,-1.6,-0.5,1.6,-0.4,2.0,-0.2,2.2,0.0,2.3})).setScale(new MFVec2f(new double[] {1.0,1.0,1.0,1.0,0.9,0.9})).setSpine(new MFVec3f(new double[] {0.0,-0.5,0.0,0.0,0.1,0.0,0.0,0.11,0.0})))
                .setAppearance(new Appearance().setUSE("Orange"))))
            .addChild(new Transform().setTranslation(0.0,5.825,0.0)
              .addChild(new Shape()
                .setGeometry(new Box().setSize(0.8,0.3,1.0))
                .setAppearance(new Appearance()
                  .setMaterial(new Material().setDiffuseColor(0.15,0.15,0.25)))))))
        .addChild(new Group()
          .addChild(new Viewpoint().setDescription("Remus from above 15m").setOrientation(-0.58,-0.58,-0.58,2.09).setPosition(0.0,15.0,0.0))
          .addChild(new Viewpoint().setDescription("Remus starboard side 10m"))
          .addChild(new Viewpoint().setDescription("Remus starboard side 3m").setPosition(0.0,0.0,3.0))
          .addChild(new Viewpoint().setDescription("Remus astern 10m").setOrientation(0.0,1.0,0.0,-1.57).setPosition(-10.0,0.0,0.0))
          .addChild(new Viewpoint().setDescription("Remus astern 2m").setOrientation(0.0,1.0,0.0,-1.57).setPosition(-2.0,0.0,0.0))
          .addChild(new Viewpoint().setDescription("Remus port side 10m").setOrientation(0.0,1.0,0.0,3.14).setPosition(0.0,0.0,-10.0))
          .addChild(new Viewpoint().setDescription("Remus port side 3m").setOrientation(0.0,1.0,0.0,3.14).setPosition(0.0,0.0,-3.0)))
        .addChild(new Group()
          .addChild(new Script("ArticulationParameterControl").setSourceCode("""
ecmascript:

function initialize()
{
   rpm     = 0;
   rudder  = new SFRotation (0, 1, 0, 0);
   planes  = new SFRotation (1, 0, 0, 0);
}

function set_articulationParameters( value, timestamp )
{
   rpm          = value[1] * 3.0;
   topRudder    = new SFRotation (1, 0, 0,  value[4]);
   bottomRudder = new SFRotation (1, 0, 0, -value[4]);
   stbdPlane    = new SFRotation (1, 0, 0,  value[6]);
   portPlane    = new SFRotation (1, 0, 0, -value[6]);
}
""")
            .addField(new field().setName("set_articulationParameters").setType(field.TYPE_MFFLOAT).setAccessType(field.ACCESSTYPE_INPUTONLY))
            .addField(new field().setName("rpm").setType(field.TYPE_SFFLOAT).setAccessType(field.ACCESSTYPE_OUTPUTONLY))
            .addField(new field().setName("topRudder").setType(field.TYPE_SFROTATION).setAccessType(field.ACCESSTYPE_OUTPUTONLY))
            .addField(new field().setName("bottomRudder").setType(field.TYPE_SFROTATION).setAccessType(field.ACCESSTYPE_OUTPUTONLY))
            .addField(new field().setName("stbdPlane").setType(field.TYPE_SFROTATION).setAccessType(field.ACCESSTYPE_OUTPUTONLY))
            .addField(new field().setName("portPlane").setType(field.TYPE_SFROTATION).setAccessType(field.ACCESSTYPE_OUTPUTONLY)))
          .addChild(new ROUTE().setFromNode("AUVTRANSFORM").setFromField("articulationParameterArray").setToNode("ArticulationParameterControl").setToField("set_articulationParameters"))
          .addChild(new ROUTE().setFromNode("ArticulationParameterControl").setFromField("rpm").setToNode("ScrewBeamCone").setToField("range"))
          .addChild(new ROUTE().setFromNode("ArticulationParameterControl").setFromField("topRudder").setToNode("Deflector1").setToField("set_rotation"))
          .addChild(new ROUTE().setFromNode("ArticulationParameterControl").setFromField("bottomRudder").setToNode("Deflector2").setToField("set_rotation"))
          .addChild(new ROUTE().setFromNode("ArticulationParameterControl").setFromField("portPlane").setToNode("Deflector3").setToField("set_rotation"))
          .addChild(new ROUTE().setFromNode("ArticulationParameterControl").setFromField("stbdPlane").setToNode("Deflector4").setToField("set_rotation")))))
    .addChild(new Transform("TERRAINTRANSFORM").setTranslation(-750.0,0.0,-750.0)
      .addChild(new Shape()
        .setAppearance(new Appearance()
          .setMaterial(new Material().setDiffuseColor(0.5,0.5,0.0).setEmissiveColor(0.1,0.1,0.0))
          .setTexture(new ImageTexture().setUrl(new String[] {"../../../Savage/AuvWorkbench/OperatingAreas/dirt4.gif","https://www.web3d.org/x3d/content/examples/Savage/AuvWorkbench/OperatingAreas/dirt4.gif"})))
        .setGeometry(new ElevationGrid().setCreaseAngle(3.14).setXDimension(11).setXSpacing(150).setZDimension(11).setZSpacing(150).setHeight(new double[] {-75.0,-100.0,-75.0,-75.0,-100.0,-125.0,-150.0,-125.0,-100.0,-75.0,-50.0,-75.0,-100.0,-75.0,-75.0,-100.0,-125.0,-150.0,-125.0,-100.0,-75.0,-50.0,-50.0,-75.0,-50.0,-50.0,-75.0,-100.0,-125.0,-100.0,-75.0,-50.0,-25.0,-75.0,-100.0,-75.0,-75.0,-100.0,-125.0,-150.0,-125.0,-100.0,-75.0,-50.0,-100.0,-125.0,-100.0,-100.0,-125.0,-150.0,-175.0,-150.0,-125.0,-100.0,-75.0,-75.0,-100.0,-75.0,-75.0,-100.0,-125.0,-150.0,-125.0,-100.0,-75.0,-50.0,-75.0,-100.0,-75.0,-75.0,-100.0,-125.0,-150.0,-125.0,-100.0,-75.0,-50.0,-50.0,-75.0,-50.0,-50.0,-75.0,-100.0,-125.0,-100.0,-75.0,-50.0,-25.0,-75.0,-100.0,-75.0,-75.0,-100.0,-125.0,-150.0,-125.0,-100.0,-75.0,-50.0,-100.0,-125.0,-100.0,-100.0,-125.0,-150.0,-175.0,-150.0,-125.0,-100.0,-75.0,-75.0,-100.0,-75.0,-75.0,-100.0,-125.0,-150.0,-125.0,-100.0,-75.0,-50.0})
          .setTexCoord(new TextureCoordinate().setPoint(new MFVec2f(/*0.invocation*/)))))));
            }
            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 RemusEspdu 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 RemusEspdu().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.Robots.UnmannedUnderwaterVehicles.RemusEspdu\" 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.Robots.UnmannedUnderwaterVehicles.RemusEspdu self-validation test confirmation: ");
                if (!validationResults.equals("success"))
                    System.out.println();
                System.out.println(validationResults.trim());

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