package Savage.Tools.Symbology;

import org.web3d.x3d.jsail.Core.*;
import org.web3d.x3d.jsail.fields.*;
import org.web3d.x3d.jsail.Geometry2D.*;
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.Shape.*;
import org.web3d.x3d.jsail.Text.*;

// Javadoc metadata annotations follow, see below for X3DJSAIL Java source code.
/**
 * <p> Standard Naval Tactical Display Symbology (NTDS) icons. </p>
 <p> Related links: Catalog page <a href="../../../../Tools/Symbology/NTDSPrototypesIndex.html" target="_blank">NTDSPrototypes</a>,  source <a href="../../../../Tools/Symbology/NTDSPrototypes.java">NTDSPrototypes.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="../../../../Tools/Symbology/NTDSPrototypes.x3d">NTDSPrototypes.x3d</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> description </i> </td>
			<td> Standard Naval Tactical Display Symbology (NTDS) icons </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> creator </i> </td>
			<td> LT Patrick Sullivan </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> created </i> </td>
			<td> 11 February 2006 </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> modified </i> </td>
			<td> 28 November 2019 </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> <a href="../../../../Tools/Symbology/NTDSExternProtoExamples.x3d">NTDSExternProtoExamples.x3d</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/Tools/Symbology/NTDSPrototypes.x3d" target="_blank">https://www.web3d.org/x3d/content/examples/Savage/Tools/Symbology/NTDSPrototypes.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="../../../../Tools/Symbology/../../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 LT Patrick Sullivan
 */

public class NTDSPrototypes
{
	/** Default constructor to create this object. */
	public NTDSPrototypes ()
	{
	  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_1)
  .setHead(new head()
    .addComponent(new component().setName("Geometry2D").setLevel(2))
    .addMeta(new meta().setName(meta.NAME_TITLE      ).setContent("NTDSPrototypes.x3d"))
    .addMeta(new meta().setName(meta.NAME_DESCRIPTION).setContent("Standard Naval Tactical Display Symbology (NTDS) icons"))
    .addMeta(new meta().setName(meta.NAME_CREATOR    ).setContent("LT Patrick Sullivan"))
    .addMeta(new meta().setName(meta.NAME_CREATED    ).setContent("11 February 2006"))
    .addMeta(new meta().setName(meta.NAME_MODIFIED   ).setContent("28 November 2019"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("NTDSExternProtoExamples.x3d"))
    .addMeta(new meta().setName(meta.NAME_IDENTIFIER ).setContent("https://www.web3d.org/x3d/content/examples/Savage/Tools/Symbology/NTDSPrototypes.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(" These first two Protos are common to all symbology ")
    .addChild(new WorldInfo().setTitle("NTDSPrototypes.x3d"))
    .addChild(new ProtoDeclare("SymbolVector").setName("SymbolVector").setAppinfo("NTDS Symbology for vector")
      .setProtoInterface(new ProtoInterface()
        .addField(new field().setName("labelColor").setType(field.TYPE_SFCOLOR).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new SFColor(0.8,0.8,0.8)).setAppinfo("Color for labels"))
        .addField(new field().setName("color").setType(field.TYPE_MFCOLOR).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new MFColor(new MFColor(new double[] {0.8,0.8,0.8}))).setAppinfo("Single color value for symbol")))
      .setProtoBody(new ProtoBody()
        .addChild(new Transform()
          .addChild(new Shape()
            .setAppearance(new Appearance()
              .setMaterial(new Material()
                .setIS(new IS()
                  .addConnect(new connect().setNodeField("diffuseColor").setProtoField("labelColor"))
                  .addConnect(new connect().setNodeField("emissiveColor").setProtoField("labelColor")))))
            .addComments(" Cylinder bottom='false' height='.01' radius='.1' side='false'/ ")
            .setGeometry(new IndexedTriangleSet().setCcw(true).setColorPerVertex(true).setIndex(new int[] {2,1,0}).setNormalPerVertex(true).setSolid(true)
              .setCoord(new Coordinate().setPoint(new MFVec3f(new double[] {2.0,0.0,-0.05,2.3,0.0,0.0,2.0,0.0,0.05})))))
          .addChild(new Shape()
            .setGeometry(new IndexedLineSet().setColorPerVertex(false).setColorIndex(new int[] {0,0}).setCoordIndex(new int[] {0,1})
              .setCoord(new Coordinate().setPoint(new MFVec3f(new double[] {0.0,0.0,0.0,2.0,0.0,0.0})))
              .setColor(new Color()
                .setIS(new IS()
                  .addConnect(new connect().setNodeField("color").setProtoField("color")))))))))
    .addChild(new ProtoDeclare("SymbolLabel").setName("SymbolLabel").setAppinfo("NTDS Symbology for label")
      .setProtoInterface(new ProtoInterface()
        .addField(new field().setName("labelColor").setType(field.TYPE_SFCOLOR).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new SFColor(0.8,0.8,0.8)).setAppinfo("Color for labels"))
        .addField(new field().setName("trackLabel").setType(field.TYPE_MFSTRING).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setAppinfo("Additional information for the track (i.e. track number entityID entity name)")))
      .setProtoBody(new ProtoBody()
        .addChild(new Transform().setRotation(1.0,0.0,0.0,-1.57).setTranslation(0.0,0.0,1.5)
          .addChild(new Shape()
            .setAppearance(new Appearance()
              .setMaterial(new Material()
                .setIS(new IS()
                  .addConnect(new connect().setNodeField("diffuseColor").setProtoField("labelColor")))))
            .setGeometry(new Text()
              .setIS(new IS()
                .addConnect(new connect().setNodeField("string").setProtoField("trackLabel")))
              .setFontStyle(new FontStyle().setJustify(FontStyle.JUSTIFY_MIDDLE_MIDDLE).setSize(0.8)))))))
    .addComments(" Sea Units ")
    .addChild(new ProtoDeclare("SurfacePending").setName("SurfacePending").setAppinfo("NTDS Symbology for surface vessel, classification pending")
      .setProtoInterface(new ProtoInterface()
        .addField(new field().setName("color").setType(field.TYPE_SFCOLOR).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new SFColor(0.8,0.8,0.8)).setAppinfo("Single color value for symbol"))
        .addField(new field().setName("labelColor").setType(field.TYPE_SFCOLOR).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new SFColor(0.8,0.8,0.8)).setAppinfo("Color for labels"))
        .addField(new field().setName("symbolModifier").setType(field.TYPE_MFSTRING).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setAppinfo("Symbol Modifier")))
      .setProtoBody(new ProtoBody()
        .addChild(new Transform()
          .addChild(new ProtoInstance("SymbolVector").setContainerField("children")
            .addFieldValue(new fieldValue().setName("color").setValue(new MFColor(new MFColor(new double[] {1.0,1.0,0.0}))))
            .addFieldValue(new fieldValue().setName("labelColor").setValue(new SFColor(1.0,1.0,0.0))))
          .addChild(new Billboard()
            .addComments(" Symbol Geometry Top arc ")
            .addChild(new Transform().setRotation(-1.0,0.0,0.0,1.57).setTranslation(0.0,0.0,-1.0)
              .addChild(new Shape("SemiCircle")
                .setGeometry(new Arc2D().setEndAngle(3.1415926536))
                .setAppearance(new Appearance()
                  .setMaterial(new Material()
                    .setIS(new IS()
                      .addConnect(new connect().setNodeField("emissiveColor").setProtoField("color")))))))
            .addComments(" Right arc ")
            .addChild(new Transform().setRotation(0.0,-1.0,0.0,1.57)
              .addChild(new Transform().setRotation(-1.0,0.0,0.0,1.57).setTranslation(0.0,0.0,-1.0)
                .addChild(new Shape().setUSE("SemiCircle"))))
            .addComments(" Left arc ")
            .addChild(new Transform().setRotation(0.0,1.0,0.0,1.57)
              .addChild(new Transform().setRotation(-1.0,0.0,0.0,1.57).setTranslation(0.0,0.0,-1.0)
                .addChild(new Shape().setUSE("SemiCircle"))))
            .addComments(" Bottom arc ")
            .addChild(new Transform().setRotation(1.0,0.0,0.0,1.57).setTranslation(0.0,0.0,1.0)
              .addChild(new Shape().setUSE("SemiCircle")))
            .addComments(" Symbol Modifier ")
            .addChild(new Transform().setRotation(1.0,0.0,0.0,-1.57).setTranslation(0.0,0.0,-1.1)
              .addChild(new Shape()
                .setAppearance(new Appearance()
                  .setMaterial(new Material()
                    .setIS(new IS()
                      .addConnect(new connect().setNodeField("diffuseColor").setProtoField("labelColor")))))
                .setGeometry(new Text()
                  .setIS(new IS()
                    .addConnect(new connect().setNodeField("string").setProtoField("symbolModifier")))
                  .setFontStyle(new FontStyle().setJustify(FontStyle.JUSTIFY_MIDDLE_MIDDLE).setSize(2)))))))))
    .addChild(new ProtoDeclare("SurfaceUnknown").setName("SurfaceUnknown").setAppinfo("NTDS Symbology for surface vessel, classification unknown")
      .setProtoInterface(new ProtoInterface()
        .addField(new field().setName("color").setType(field.TYPE_SFCOLOR).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new SFColor(0.8,0.8,0.8)).setAppinfo("Single color value for symbol")))
      .setProtoBody(new ProtoBody()
        .addChild(new Transform()
          .addChild(new ProtoInstance("SymbolVector").setContainerField("children")
            .addFieldValue(new fieldValue().setName("color").setValue(new MFColor(new MFColor(new double[] {1.0,1.0,0.0}))))
            .addFieldValue(new fieldValue().setName("labelColor").setValue(new SFColor(1.0,1.0,0.0))))
          .addChild(new Billboard()
            .addComments(" Symbol Geometry Top arc ")
            .addChild(new Transform().setRotation(-1.0,0.0,0.0,1.57).setTranslation(0.0,0.0,-1.0)
              .addChild(new Shape("SemiCircle2")
                .setGeometry(new Arc2D().setEndAngle(3.1415926536))
                .setAppearance(new Appearance()
                  .setMaterial(new Material()
                    .setIS(new IS()
                      .addConnect(new connect().setNodeField("emissiveColor").setProtoField("color")))))))
            .addComments(" Right arc ")
            .addChild(new Transform().setRotation(0.0,-1.0,0.0,1.57)
              .addChild(new Transform().setRotation(-1.0,0.0,0.0,1.57).setTranslation(0.0,0.0,-1.0)
                .addChild(new Shape().setUSE("SemiCircle2"))))
            .addComments(" Left arc ")
            .addChild(new Transform().setRotation(0.0,1.0,0.0,1.57)
              .addChild(new Transform().setRotation(-1.0,0.0,0.0,1.57).setTranslation(0.0,0.0,-1.0)
                .addChild(new Shape().setUSE("SemiCircle2"))))
            .addComments(" Bottom arc ")
            .addChild(new Transform().setRotation(1.0,0.0,0.0,1.57).setTranslation(0.0,0.0,1.0)
              .addChild(new Shape().setUSE("SemiCircle2")))))))
    .addChild(new ProtoDeclare("SurfaceFriend").setName("SurfaceFriend").setAppinfo("NTDS Symbology for surface vessel, classification friendly")
      .setProtoInterface(new ProtoInterface()
        .addField(new field().setName("color").setType(field.TYPE_MFCOLOR).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new MFColor(new MFColor(new double[] {0.8,0.8,0.8}))).setAppinfo("Single color value for symbol")))
      .setProtoBody(new ProtoBody()
        .addChild(new Transform()
          .addChild(new ProtoInstance("SymbolVector").setContainerField("children")
            .addFieldValue(new fieldValue().setName("color").setValue(new MFColor(new MFColor(new double[] {0.0,0.0,1.0}))))
            .addFieldValue(new fieldValue().setName("labelColor").setValue(new SFColor(0.0,0.0,1.0))))
          .addChild(new Billboard()
            .addChild(new Transform()
              .addComments(" Symbol Geometry ")
              .addChild(new Shape()
                .setGeometry(new IndexedLineSet().setColorPerVertex(false).setColorIndex(new int[] {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}).setCoordIndex(new int[] {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33})
                  .setCoord(new Coordinate().setPoint(new MFVec3f(new double[] {0.0,0.0,-1.0,0.195,0.0,-0.981,0.382,0.0,-0.924,0.555,0.0,-0.832,0.707,0.0,-0.708,0.831,0.0,-0.556,0.923,0.0,-0.383,0.98,0.0,-0.196,1.0,0.0,0.0,0.98,0.0,0.195,0.923,0.0,0.382,0.831,0.0,0.555,0.707,0.0,0.707,0.555,0.0,0.831,0.382,0.0,0.923,0.195,0.0,0.98,0.0,0.0,1.0,-0.195,0.0,0.98,-0.382,0.0,0.923,-0.555,0.0,0.831,-0.707,0.0,0.707,-0.831,0.0,0.555,-0.923,0.0,0.382,-0.98,0.0,0.195,-1.0,0.0,0.0,-0.981,0.0,-0.195,-0.924,0.0,-0.382,-0.832,0.0,-0.555,-0.708,0.0,-0.707,-0.556,0.0,-0.831,-0.383,0.0,-0.923,-0.196,0.0,-0.98,0.0,0.0,-1.0,0.195,0.0,-0.981})))
                  .setColor(new Color()
                    .setIS(new IS()
                      .addConnect(new connect().setNodeField("color").setProtoField("color")))))))))))
    .addChild(new ProtoDeclare("SurfaceNeutral").setName("SurfaceNeutral").setAppinfo("NTDS Symbology for surface vessel, classification neutral")
      .setProtoInterface(new ProtoInterface()
        .addField(new field().setName("color").setType(field.TYPE_MFCOLOR).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new MFColor(new MFColor(new double[] {0.8,0.8,0.8}))).setAppinfo("Single color value for symbol")))
      .setProtoBody(new ProtoBody()
        .addChild(new Transform()
          .addChild(new ProtoInstance("SymbolVector").setContainerField("children")
            .addFieldValue(new fieldValue().setName("color").setValue(new MFColor(new MFColor(new double[] {0.0,1.0,0.0}))))
            .addFieldValue(new fieldValue().setName("labelColor").setValue(new SFColor(0.0,1.0,0.0))))
          .addChild(new Billboard()
            .addChild(new Transform()
              .addComments(" Symbol Geometry ")
              .addChild(new Shape()
                .setGeometry(new IndexedLineSet().setColorPerVertex(false).setColorIndex(new int[] {0,0,0,0,0}).setCoordIndex(new int[] {0,1,2,3,0})
                  .setCoord(new Coordinate().setPoint(new MFVec3f(new double[] {-1.0,0.0,1.0,1.0,0.0,1.0,1.0,0.0,-1.0,-1.0,0.0,-1.0})))
                  .setColor(new Color()
                    .setIS(new IS()
                      .addConnect(new connect().setNodeField("color").setProtoField("color")))))))))))
    .addChild(new ProtoDeclare("SurfaceHostile").setName("SurfaceHostile")
      .setProtoInterface(new ProtoInterface()
        .addField(new field().setName("color").setType(field.TYPE_MFCOLOR).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new MFColor(new MFColor(new double[] {0.8,0.8,0.8}))).setAppinfo("Single color value for symbol")))
      .setProtoBody(new ProtoBody()
        .addChild(new Transform()
          .addChild(new ProtoInstance("SymbolVector").setContainerField("children")
            .addFieldValue(new fieldValue().setName("color").setValue(new MFColor(new MFColor(new double[] {1.0,0.0,0.0}))))
            .addFieldValue(new fieldValue().setName("labelColor").setValue(new SFColor(1.0,0.0,0.0))))
          .addChild(new Billboard()
            .addChild(new Transform().setRotation(0.0,1.0,0.0,.785)
              .addComments(" Symbol Geometry ")
              .addChild(new Shape()
                .setGeometry(new IndexedLineSet().setColorPerVertex(false).setColorIndex(new int[] {0,0,0,0,0}).setCoordIndex(new int[] {0,1,2,3,0})
                  .setCoord(new Coordinate().setPoint(new MFVec3f(new double[] {-1.0,0.0,1.0,1.0,0.0,1.0,1.0,0.0,-1.0,-1.0,0.0,-1.0})))
                  .setColor(new Color()
                    .setIS(new IS()
                      .addConnect(new connect().setNodeField("color").setProtoField("color")))))))))))
    .addChild(new ProtoDeclare("SurfaceAssumedFriend").setName("SurfaceAssumedFriend").setAppinfo("NTDS Symbology for surface vessel, classification assumed friendly")
      .setProtoInterface(new ProtoInterface()
        .addField(new field().setName("color").setType(field.TYPE_MFCOLOR).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new MFColor(new MFColor(new double[] {0.8,0.8,0.8}))).setAppinfo("Single color value for symbol"))
        .addField(new field().setName("labelColor").setType(field.TYPE_SFCOLOR).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new SFColor(0.8,0.8,0.8)).setAppinfo("Color for labels"))
        .addField(new field().setName("symbolModifier").setType(field.TYPE_MFSTRING).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setAppinfo("Symbol Modifier")))
      .setProtoBody(new ProtoBody()
        .addChild(new Transform()
          .addChild(new ProtoInstance("SymbolVector").setContainerField("children")
            .addFieldValue(new fieldValue().setName("color").setValue(new MFColor(new MFColor(new double[] {0.0,0.0,1.0}))))
            .addFieldValue(new fieldValue().setName("labelColor").setValue(new SFColor(0.0,0.0,1.0))))
          .addChild(new Billboard()
            .addChild(new Transform()
              .addComments(" TODO: Save -> Symbol Geometry (broken circle) ")
              .addComments(" Shape> <IndexedLineSet colorIndex='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0' colorPerVertex='false' coordIndex='0 1 -1 2 3 -1 4 5 -1 6 7 -1 8 9 -1 10 11 -1 12 13 -1 14 15 -1 16 17 -1 18 19 -1 20 21'> <Coordinate point='0 0 -1 0.195 0 -0.981 0.555 0 -0.832 0.707 0 -0.708 0.923 0 -0.383 0.98 0 -0.196 0.98 0 0.195 0.923 0 0.382 0.707 0 0.707 0.555 0 0.831 0.195 0 0.98 0 0 1 -0.382 0 0.923 -0.555 0 0.831 -0.831 0 0.555 -0.923 0 0.382 -1 0 0 -0.981 0 -0.195 -0.832 0 -0.555 -0.708 0 -0.707 -0.383 0 -0.923 -0.196 0 -0.98'/> <Color> <IS> <connect nodeField='color' protoField='color'/> </IS> </Color> </IndexedLineSet> </Shape ")
              .addComments(" Symbol Geometry ")
              .addChild(new Shape()
                .setGeometry(new IndexedLineSet().setColorPerVertex(false).setColorIndex(new int[] {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}).setCoordIndex(new int[] {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33})
                  .setCoord(new Coordinate().setPoint(new MFVec3f(new double[] {0.0,0.0,-1.0,0.195,0.0,-0.981,0.382,0.0,-0.924,0.555,0.0,-0.832,0.707,0.0,-0.708,0.831,0.0,-0.556,0.923,0.0,-0.383,0.98,0.0,-0.196,1.0,0.0,0.0,0.98,0.0,0.195,0.923,0.0,0.382,0.831,0.0,0.555,0.707,0.0,0.707,0.555,0.0,0.831,0.382,0.0,0.923,0.195,0.0,0.98,0.0,0.0,1.0,-0.195,0.0,0.98,-0.382,0.0,0.923,-0.555,0.0,0.831,-0.707,0.0,0.707,-0.831,0.0,0.555,-0.923,0.0,0.382,-0.98,0.0,0.195,-1.0,0.0,0.0,-0.981,0.0,-0.195,-0.924,0.0,-0.382,-0.832,0.0,-0.555,-0.708,0.0,-0.707,-0.556,0.0,-0.831,-0.383,0.0,-0.923,-0.196,0.0,-0.98,0.0,0.0,-1.0,0.195,0.0,-0.981})))
                  .setColor(new Color()
                    .setIS(new IS()
                      .addConnect(new connect().setNodeField("color").setProtoField("color")))))))
            .addComments(" Symbol Modifier ")
            .addChild(new Transform().setRotation(1.0,0.0,0.0,-1.57).setTranslation(1.0,0.0,-1.2)
              .addChild(new Shape()
                .setAppearance(new Appearance()
                  .setMaterial(new Material()
                    .setIS(new IS()
                      .addConnect(new connect().setNodeField("diffuseColor").setProtoField("labelColor")))))
                .setGeometry(new Text()
                  .setIS(new IS()
                    .addConnect(new connect().setNodeField("string").setProtoField("symbolModifier")))
                  .setFontStyle(new FontStyle().setJustify(FontStyle.JUSTIFY_BEGIN_BEGIN).setSize(0.5)))))))))
    .addChild(new ProtoDeclare("SurfaceSuspect").setName("SurfaceSuspect").setAppinfo("NTDS Symbology for surface vessel, classification suspected hostile")
      .setProtoInterface(new ProtoInterface()
        .addField(new field().setName("color").setType(field.TYPE_MFCOLOR).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new MFColor(new MFColor(new double[] {0.8,0.8,0.8}))).setAppinfo("Single color value for symbol"))
        .addField(new field().setName("labelColor").setType(field.TYPE_SFCOLOR).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new SFColor(0.8,0.8,0.8)).setAppinfo("Color for labels"))
        .addField(new field().setName("symbolModifier").setType(field.TYPE_MFSTRING).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setAppinfo("Symbol Modifier")))
      .setProtoBody(new ProtoBody()
        .addChild(new Transform()
          .addChild(new ProtoInstance("SymbolVector").setContainerField("children")
            .addFieldValue(new fieldValue().setName("color").setValue(new MFColor(new MFColor(new double[] {1.0,0.0,0.0}))))
            .addFieldValue(new fieldValue().setName("labelColor").setValue(new SFColor(1.0,0.0,0.0))))
          .addChild(new Billboard()
            .addChild(new Transform().setRotation(0.0,1.0,0.0,.785)
              .addComments(" TODO: Save -> Symbol Geometry (broken lined square) ")
              .addComments(" Shape> <IndexedLineSet colorIndex='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0' colorPerVertex='false' coordIndex='0 1 -1 2 3 -1 4 5 -1 6 7 8 -1 9 10 -1 11 12 -1 13 14 15 -1 16 17 -1 18 19 -1 20 21 22 -1 23 24 -1 25 26 -1 27 28'> <Coordinate point='-1.0 0 1.0 -0.8 0 1.0 -0.4 0 1.0 -0.2 0 1.0 0.2 0 1.0 0.4 0 1.0 0.8 0 1.0 1.0 0 1.0 1.0 0 0.8 1.0 0 0.4 1.0 0 0.2 1.0 0 -0.2 1.0 0 -0.4 1.0 0 -0.8 1.0 0 -1.0 0.8 0 -1.0 0.4 0 -1.0 0.2 0 -1.0 -0.2 0 -1.0 -0.4 0 -1.0 -0.8 0 -1.0 -1.0 0 -1.0 -1.0 0 -0.8 -1.0 0 -0.4 -1.0 0 -0.2 -1.0 0 0.2 -1.0 0 0.4 -1.0 0 0.8 -1.0 0 1.0'/> <Color> <IS> <connect nodeField='color' protoField='color'/> </IS> </Color> </IndexedLineSet> </Shape ")
              .addComments(" Symbol Geometry ")
              .addChild(new Shape()
                .setGeometry(new IndexedLineSet().setColorPerVertex(false).setColorIndex(new int[] {0,0,0,0,0}).setCoordIndex(new int[] {0,1,2,3,0})
                  .setCoord(new Coordinate().setPoint(new MFVec3f(new double[] {-1.0,0.0,1.0,1.0,0.0,1.0,1.0,0.0,-1.0,-1.0,0.0,-1.0})))
                  .setColor(new Color()
                    .setIS(new IS()
                      .addConnect(new connect().setNodeField("color").setProtoField("color")))))))
            .addComments(" Symbol Modifier ")
            .addChild(new Transform().setRotation(1.0,0.0,0.0,-1.57).setTranslation(1.0,0.0,-1.2)
              .addChild(new Shape()
                .setAppearance(new Appearance()
                  .setMaterial(new Material()
                    .setIS(new IS()
                      .addConnect(new connect().setNodeField("diffuseColor").setProtoField("labelColor")))))
                .setGeometry(new Text()
                  .setIS(new IS()
                    .addConnect(new connect().setNodeField("string").setProtoField("symbolModifier")))
                  .setFontStyle(new FontStyle().setJustify(FontStyle.JUSTIFY_BEGIN_BEGIN).setSize(0.5)))))))))
    .addComments(" Air Units ")
    .addChild(new ProtoDeclare("AirPending").setName("AirPending").setAppinfo("NTDS Symbology for air vessel, classification pending")
      .setProtoInterface(new ProtoInterface()
        .addField(new field().setName("color").setType(field.TYPE_SFCOLOR).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new SFColor(0.8,0.8,0.8)).setAppinfo("Single color value for symbol"))
        .addField(new field().setName("labelColor").setType(field.TYPE_SFCOLOR).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new SFColor(0.8,0.8,0.8)).setAppinfo("Color for labels"))
        .addField(new field().setName("symbolModifier").setType(field.TYPE_MFSTRING).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setAppinfo("Symbol Modifier")))
      .setProtoBody(new ProtoBody()
        .addChild(new Transform()
          .addChild(new ProtoInstance("SymbolVector").setContainerField("children")
            .addFieldValue(new fieldValue().setName("color").setValue(new MFColor(new MFColor(new double[] {1.0,1.0,0.0}))))
            .addFieldValue(new fieldValue().setName("labelColor").setValue(new SFColor(1.0,1.0,0.0))))
          .addChild(new Billboard()
            .addComments(" Symbol Geometry Top arc ")
            .addChild(new Transform().setRotation(-1.0,0.0,0.0,1.57).setTranslation(0.0,0.0,-1.0)
              .addChild(new Shape("SemiCircle3")
                .setGeometry(new Arc2D().setEndAngle(3.1415926536))
                .setAppearance(new Appearance()
                  .setMaterial(new Material()
                    .setIS(new IS()
                      .addConnect(new connect().setNodeField("emissiveColor").setProtoField("color")))))))
            .addComments(" Right arc ")
            .addChild(new Transform().setRotation(0.0,-1.0,0.0,1.57)
              .addChild(new Transform().setRotation(-1.0,0.0,0.0,1.57).setTranslation(0.0,0.0,-1.0)
                .addChild(new Shape().setUSE("SemiCircle3"))))
            .addComments(" Left arc ")
            .addChild(new Transform().setRotation(0.0,1.0,0.0,1.57)
              .addChild(new Transform().setRotation(-1.0,0.0,0.0,1.57).setTranslation(0.0,0.0,-1.0)
                .addChild(new Shape().setUSE("SemiCircle3"))))
            .addComments(" Symbol Modifier ")
            .addChild(new Transform().setRotation(1.0,0.0,0.0,-1.57).setTranslation(0.0,0.0,-1.1)
              .addChild(new Shape()
                .setAppearance(new Appearance()
                  .setMaterial(new Material()
                    .setIS(new IS()
                      .addConnect(new connect().setNodeField("diffuseColor").setProtoField("labelColor")))))
                .setGeometry(new Text()
                  .setIS(new IS()
                    .addConnect(new connect().setNodeField("string").setProtoField("symbolModifier")))
                  .setFontStyle(new FontStyle().setJustify(FontStyle.JUSTIFY_MIDDLE_MIDDLE).setSize(2)))))))))
    .addChild(new ProtoDeclare("AirUnknown").setName("AirUnknown").setAppinfo("NTDS Symbology for air vessel, classification unknown")
      .setProtoInterface(new ProtoInterface()
        .addField(new field().setName("color").setType(field.TYPE_SFCOLOR).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new SFColor(0.8,0.8,0.8)).setAppinfo("Single color value for symbol")))
      .setProtoBody(new ProtoBody()
        .addChild(new Transform()
          .addChild(new ProtoInstance("SymbolVector").setContainerField("children")
            .addFieldValue(new fieldValue().setName("color").setValue(new MFColor(new MFColor(new double[] {1.0,1.0,0.0}))))
            .addFieldValue(new fieldValue().setName("labelColor").setValue(new SFColor(1.0,1.0,0.0))))
          .addChild(new Billboard()
            .addComments(" Symbol Geometry Top arc ")
            .addChild(new Transform().setRotation(-1.0,0.0,0.0,1.57).setTranslation(0.0,0.0,-1.0)
              .addChild(new Shape("SemiCircle4")
                .setGeometry(new Arc2D().setEndAngle(3.1415926536))
                .setAppearance(new Appearance()
                  .setMaterial(new Material()
                    .setIS(new IS()
                      .addConnect(new connect().setNodeField("emissiveColor").setProtoField("color")))))))
            .addComments(" Right arc ")
            .addChild(new Transform().setRotation(0.0,-1.0,0.0,1.57)
              .addChild(new Transform().setRotation(-1.0,0.0,0.0,1.57).setTranslation(0.0,0.0,-1.0)
                .addChild(new Shape().setUSE("SemiCircle4"))))
            .addComments(" Left arc ")
            .addChild(new Transform().setRotation(0.0,1.0,0.0,1.57)
              .addChild(new Transform().setRotation(-1.0,0.0,0.0,1.57).setTranslation(0.0,0.0,-1.0)
                .addChild(new Shape().setUSE("SemiCircle4"))))))))
    .addChild(new ProtoDeclare("AirFriend").setName("AirFriend").setAppinfo("NTDS Symbology for air vessel, classification friendly")
      .setProtoInterface(new ProtoInterface()
        .addField(new field().setName("color").setType(field.TYPE_MFCOLOR).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new MFColor(new MFColor(new double[] {0.8,0.8,0.8}))).setAppinfo("Single color value for symbol")))
      .setProtoBody(new ProtoBody()
        .addChild(new Transform()
          .addChild(new ProtoInstance("SymbolVector").setContainerField("children")
            .addFieldValue(new fieldValue().setName("color").setValue(new MFColor(new MFColor(new double[] {0.0,0.0,1.0}))))
            .addFieldValue(new fieldValue().setName("labelColor").setValue(new SFColor(0.0,0.0,1.0))))
          .addChild(new Billboard()
            .addChild(new Transform().setRotation(0.0,1.0,0.0,3.14)
              .addComments(" Symbol Geometry ")
              .addChild(new Shape()
                .setGeometry(new IndexedLineSet().setColorPerVertex(false).setColorIndex(new int[] {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}).setCoordIndex(new int[] {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16})
                  .setCoord(new Coordinate().setPoint(new MFVec3f(new double[] {1.0,0.0,0.0,0.98,0.0,0.195,0.923,0.0,0.382,0.831,0.0,0.555,0.707,0.0,0.707,0.555,0.0,0.831,0.382,0.0,0.923,0.195,0.0,0.98,0.0,0.0,1.0,-0.195,0.0,0.98,-0.382,0.0,0.923,-0.555,0.0,0.831,-0.707,0.0,0.707,-0.831,0.0,0.555,-0.923,0.0,0.382,-0.98,0.0,0.195,-1.0,0.0,0.0})))
                  .setColor(new Color()
                    .setIS(new IS()
                      .addConnect(new connect().setNodeField("color").setProtoField("color")))))))))))
    .addChild(new ProtoDeclare("AirNeutral").setName("AirNeutral").setAppinfo("NTDS Symbology for air vessel, classification neutral")
      .setProtoInterface(new ProtoInterface()
        .addField(new field().setName("color").setType(field.TYPE_MFCOLOR).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new MFColor(new MFColor(new double[] {0.8,0.8,0.8}))).setAppinfo("Single color value for symbol")))
      .setProtoBody(new ProtoBody()
        .addChild(new Transform()
          .addChild(new ProtoInstance("SymbolVector").setContainerField("children")
            .addFieldValue(new fieldValue().setName("color").setValue(new MFColor(new MFColor(new double[] {0.0,1.0,0.0}))))
            .addFieldValue(new fieldValue().setName("labelColor").setValue(new SFColor(0.0,1.0,0.0))))
          .addChild(new Billboard()
            .addChild(new Transform()
              .addComments(" Symbol Geometry ")
              .addChild(new Shape()
                .setGeometry(new IndexedLineSet().setColorPerVertex(false).setColorIndex(new int[] {0,0,0,0}).setCoordIndex(new int[] {0,1,2,3})
                  .setCoord(new Coordinate().setPoint(new MFVec3f(new double[] {-1.0,0.0,0.0,-1.0,0.0,-1.0,1.0,0.0,-1.0,1.0,0.0,0.0})))
                  .setColor(new Color()
                    .setIS(new IS()
                      .addConnect(new connect().setNodeField("color").setProtoField("color")))))))))))
    .addChild(new ProtoDeclare("AirHostile").setName("AirHostile").setAppinfo("NTDS Symbology for air vessel, classification hostile")
      .setProtoInterface(new ProtoInterface()
        .addField(new field().setName("color").setType(field.TYPE_MFCOLOR).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new MFColor(new MFColor(new double[] {0.8,0.8,0.8}))).setAppinfo("Single color value for symbol")))
      .setProtoBody(new ProtoBody()
        .addChild(new Transform()
          .addChild(new ProtoInstance("SymbolVector").setContainerField("children")
            .addFieldValue(new fieldValue().setName("color").setValue(new MFColor(new MFColor(new double[] {1.0,0.0,0.0}))))
            .addFieldValue(new fieldValue().setName("labelColor").setValue(new SFColor(1.0,0.0,0.0))))
          .addChild(new Billboard()
            .addChild(new Transform().setRotation(0.0,1.0,0.0,2.295)
              .addComments(" Symbol Geometry ")
              .addChild(new Shape()
                .setGeometry(new IndexedLineSet().setColorPerVertex(false).setColorIndex(new int[] {0,0,0}).setCoordIndex(new int[] {0,1,2})
                  .setCoord(new Coordinate().setPoint(new MFVec3f(new double[] {-1.0,0.0,1.0,1.0,0.0,1.0,1.0,0.0,-1.0})))
                  .setColor(new Color()
                    .setIS(new IS()
                      .addConnect(new connect().setNodeField("color").setProtoField("color")))))))))))
    .addChild(new ProtoDeclare("AirAssumedFriend").setName("AirAssumedFriend").setAppinfo("NTDS Symbology for air vessel, classification assumed friendly")
      .setProtoInterface(new ProtoInterface()
        .addField(new field().setName("color").setType(field.TYPE_MFCOLOR).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new MFColor(new MFColor(new double[] {0.8,0.8,0.8}))).setAppinfo("Single color value for symbol"))
        .addField(new field().setName("labelColor").setType(field.TYPE_SFCOLOR).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new SFColor(0.8,0.8,0.8)).setAppinfo("Color for labels"))
        .addField(new field().setName("symbolModifier").setType(field.TYPE_MFSTRING).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setAppinfo("Symbol Modifier")))
      .setProtoBody(new ProtoBody()
        .addChild(new Transform()
          .addChild(new ProtoInstance("SymbolVector").setContainerField("children")
            .addFieldValue(new fieldValue().setName("color").setValue(new MFColor(new MFColor(new double[] {0.0,0.0,1.0}))))
            .addFieldValue(new fieldValue().setName("labelColor").setValue(new SFColor(0.0,0.0,1.0))))
          .addChild(new Billboard()
            .addChild(new Transform().setRotation(0.0,1.0,0.0,1.57)
              .addComments(" Symbol Geometry ")
              .addChild(new Shape()
                .setGeometry(new IndexedLineSet().setColorPerVertex(false).setColorIndex(new int[] {0,0,0,0,0,0,0,0,0,0,0,0}).setCoordIndex(new int[] {0,1,-1,2,3,-1,4,5,-1,6,7,-1,8,9,-1,10,11})
                  .setCoord(new Coordinate().setPoint(new MFVec3f(new double[] {0.0,0.0,-1.0,0.195,0.0,-0.981,0.555,0.0,-0.832,0.707,0.0,-0.708,0.923,0.0,-0.383,0.98,0.0,-0.196,0.98,0.0,0.195,0.923,0.0,0.382,0.707,0.0,0.707,0.555,0.0,0.831,0.195,0.0,0.98,0.0,0.0,1.0})))
                  .setColor(new Color()
                    .setIS(new IS()
                      .addConnect(new connect().setNodeField("color").setProtoField("color")))))))
            .addComments(" Symbol Modifier ")
            .addChild(new Transform().setRotation(1.0,0.0,0.0,-1.57).setTranslation(1.0,0.0,-1.2)
              .addChild(new Shape()
                .setAppearance(new Appearance()
                  .setMaterial(new Material()
                    .setIS(new IS()
                      .addConnect(new connect().setNodeField("diffuseColor").setProtoField("labelColor")))))
                .setGeometry(new Text()
                  .setIS(new IS()
                    .addConnect(new connect().setNodeField("string").setProtoField("symbolModifier")))
                  .setFontStyle(new FontStyle().setJustify(FontStyle.JUSTIFY_BEGIN_BEGIN).setSize(0.5)))))))))
    .addChild(new ProtoDeclare("AirSuspect").setName("AirSuspect").setAppinfo("NTDS Symbology for air vessel, classification suspect")
      .setProtoInterface(new ProtoInterface()
        .addField(new field().setName("color").setType(field.TYPE_MFCOLOR).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new MFColor(new MFColor(new double[] {0.8,0.8,0.8}))).setAppinfo("Single color value for symbol"))
        .addField(new field().setName("labelColor").setType(field.TYPE_SFCOLOR).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new SFColor(0.8,0.8,0.8)).setAppinfo("Color for labels"))
        .addField(new field().setName("symbolModifier").setType(field.TYPE_MFSTRING).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setAppinfo("Symbol Modifier")))
      .setProtoBody(new ProtoBody()
        .addChild(new Transform()
          .addChild(new ProtoInstance("SymbolVector").setContainerField("children")
            .addFieldValue(new fieldValue().setName("color").setValue(new MFColor(new MFColor(new double[] {1.0,0.0,0.0}))))
            .addFieldValue(new fieldValue().setName("labelColor").setValue(new SFColor(1.0,0.0,0.0))))
          .addChild(new Billboard()
            .addChild(new Transform().setRotation(0.0,1.0,0.0,2.295)
              .addChild(new Shape()
                .setGeometry(new IndexedLineSet().setColorPerVertex(false).setColorIndex(new int[] {0,0,0,0,0}).setCoordIndex(new int[] {0,1,2,3,0})
                  .setCoord(new Coordinate().setPoint(new MFVec3f(new double[] {-1.0,0.0,1.0,1.0,0.0,1.0,1.0,0.0,-1.0,-1.0,0.0,-1.0})))
                  .setColor(new Color()
                    .setIS(new IS()
                      .addConnect(new connect().setNodeField("color").setProtoField("color")))))))
            .addComments(" Symbol Modifier ")
            .addChild(new Transform().setRotation(1.0,0.0,0.0,-1.57).setTranslation(1.0,0.0,-1.2)
              .addChild(new Shape()
                .setAppearance(new Appearance()
                  .setMaterial(new Material()
                    .setIS(new IS()
                      .addConnect(new connect().setNodeField("diffuseColor").setProtoField("labelColor")))))
                .setGeometry(new Text()
                  .setIS(new IS()
                    .addConnect(new connect().setNodeField("string").setProtoField("symbolModifier")))
                  .setFontStyle(new FontStyle().setJustify(FontStyle.JUSTIFY_BEGIN_BEGIN).setSize(0.5)))))))))
    .addComments(" Sub-Surface Units ")
    .addChild(new ProtoDeclare("SubSurfacePending").setName("SubSurfacePending").setAppinfo("NTDS Symbology for subsurface vessel, classification pending")
      .setProtoInterface(new ProtoInterface()
        .addField(new field().setName("color").setType(field.TYPE_SFCOLOR).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new SFColor(0.8,0.8,0.8)).setAppinfo("Single color value for symbol"))
        .addField(new field().setName("labelColor").setType(field.TYPE_SFCOLOR).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new SFColor(0.8,0.8,0.8)).setAppinfo("Color for labels"))
        .addField(new field().setName("symbolModifier").setType(field.TYPE_MFSTRING).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setAppinfo("Symbol Modifier")))
      .setProtoBody(new ProtoBody()
        .addChild(new Transform()
          .addChild(new ProtoInstance("SymbolVector").setContainerField("children")
            .addFieldValue(new fieldValue().setName("color").setValue(new MFColor(new MFColor(new double[] {1.0,1.0,0.0}))))
            .addFieldValue(new fieldValue().setName("labelColor").setValue(new SFColor(1.0,1.0,0.0))))
          .addChild(new Billboard()
            .addComments(" Symbol Geometry Right arc ")
            .addChild(new Transform().setRotation(0.0,-1.0,0.0,1.57)
              .addChild(new Transform().setRotation(-1.0,0.0,0.0,1.57).setTranslation(0.0,0.0,-1.0)
                .addChild(new Shape("SemiCircle5")
                  .setGeometry(new Arc2D().setEndAngle(3.1415926536))
                  .setAppearance(new Appearance()
                    .setMaterial(new Material()
                      .setIS(new IS()
                        .addConnect(new connect().setNodeField("emissiveColor").setProtoField("color"))))))))
            .addComments(" Left arc ")
            .addChild(new Transform().setRotation(0.0,1.0,0.0,1.57)
              .addChild(new Transform().setRotation(-1.0,0.0,0.0,1.57).setTranslation(0.0,0.0,-1.0)
                .addChild(new Shape().setUSE("SemiCircle5"))))
            .addComments(" Bottom arc ")
            .addChild(new Transform().setRotation(1.0,0.0,0.0,1.57).setTranslation(0.0,0.0,1.0)
              .addChild(new Shape().setUSE("SemiCircle5")))
            .addComments(" Symbol Modifier ")
            .addChild(new Transform().setRotation(1.0,0.0,0.0,-1.57).setTranslation(0.0,0.0,-1.1)
              .addChild(new Shape()
                .setAppearance(new Appearance()
                  .setMaterial(new Material()
                    .setIS(new IS()
                      .addConnect(new connect().setNodeField("diffuseColor").setProtoField("labelColor")))))
                .setGeometry(new Text()
                  .setIS(new IS()
                    .addConnect(new connect().setNodeField("string").setProtoField("symbolModifier")))
                  .setFontStyle(new FontStyle().setJustify(FontStyle.JUSTIFY_MIDDLE_MIDDLE).setSize(2)))))))))
    .addChild(new ProtoDeclare("SubSurfaceUnknown").setName("SubSurfaceUnknown").setAppinfo("NTDS Symbology for subsurface vessel, classification unknown")
      .setProtoInterface(new ProtoInterface()
        .addField(new field().setName("color").setType(field.TYPE_SFCOLOR).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new SFColor(0.8,0.8,0.8)).setAppinfo("Single color value for symbol")))
      .setProtoBody(new ProtoBody()
        .addChild(new Transform()
          .addChild(new ProtoInstance("SymbolVector").setContainerField("children")
            .addFieldValue(new fieldValue().setName("color").setValue(new MFColor(new MFColor(new double[] {1.0,1.0,0.0}))))
            .addFieldValue(new fieldValue().setName("labelColor").setValue(new SFColor(1.0,1.0,0.0))))
          .addChild(new Billboard()
            .addComments(" Symbol Geometry Right arc ")
            .addChild(new Transform().setRotation(0.0,-1.0,0.0,1.57)
              .addChild(new Transform().setRotation(-1.0,0.0,0.0,1.57).setTranslation(0.0,0.0,-1.0)
                .addChild(new Shape("SemiCircle6")
                  .setGeometry(new Arc2D().setEndAngle(3.1415926536))
                  .setAppearance(new Appearance()
                    .setMaterial(new Material()
                      .setIS(new IS()
                        .addConnect(new connect().setNodeField("emissiveColor").setProtoField("color"))))))))
            .addComments(" Left arc ")
            .addChild(new Transform().setRotation(0.0,1.0,0.0,1.57)
              .addChild(new Transform().setRotation(-1.0,0.0,0.0,1.57).setTranslation(0.0,0.0,-1.0)
                .addChild(new Shape().setUSE("SemiCircle6"))))
            .addComments(" Bottom arc ")
            .addChild(new Transform().setRotation(1.0,0.0,0.0,1.57).setTranslation(0.0,0.0,1.0)
              .addChild(new Shape().setUSE("SemiCircle6")))))))
    .addChild(new ProtoDeclare("SubSurfaceFriend").setName("SubSurfaceFriend").setAppinfo("NTDS Symbology for subsurface vessel, classification friendly")
      .setProtoInterface(new ProtoInterface()
        .addField(new field().setName("color").setType(field.TYPE_MFCOLOR).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new MFColor(new MFColor(new double[] {0.8,0.8,0.8}))).setAppinfo("Single color value for symbol")))
      .setProtoBody(new ProtoBody()
        .addChild(new Transform()
          .addChild(new ProtoInstance("SymbolVector").setContainerField("children")
            .addFieldValue(new fieldValue().setName("color").setValue(new MFColor(new MFColor(new double[] {0.0,0.0,1.0}))))
            .addFieldValue(new fieldValue().setName("labelColor").setValue(new SFColor(0.0,0.0,1.0))))
          .addChild(new Billboard()
            .addChild(new Transform()
              .addComments(" Symbol Geometry ")
              .addChild(new Shape()
                .setGeometry(new IndexedLineSet().setColorPerVertex(false).setColorIndex(new int[] {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}).setCoordIndex(new int[] {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16})
                  .setCoord(new Coordinate().setPoint(new MFVec3f(new double[] {1.0,0.0,0.0,0.98,0.0,0.195,0.923,0.0,0.382,0.831,0.0,0.555,0.707,0.0,0.707,0.555,0.0,0.831,0.382,0.0,0.923,0.195,0.0,0.98,0.0,0.0,1.0,-0.195,0.0,0.98,-0.382,0.0,0.923,-0.555,0.0,0.831,-0.707,0.0,0.707,-0.831,0.0,0.555,-0.923,0.0,0.382,-0.98,0.0,0.195,-1.0,0.0,0.0})))
                  .setColor(new Color()
                    .setIS(new IS()
                      .addConnect(new connect().setNodeField("color").setProtoField("color")))))))))))
    .addChild(new ProtoDeclare("SubSurfaceNeutral").setName("SubSurfaceNeutral").setAppinfo("NTDS Symbology for subsurface vessel, classification neutral")
      .setProtoInterface(new ProtoInterface()
        .addField(new field().setName("color").setType(field.TYPE_MFCOLOR).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new MFColor(new MFColor(new double[] {0.8,0.8,0.8}))).setAppinfo("Single color value for symbol")))
      .setProtoBody(new ProtoBody()
        .addChild(new Transform()
          .addChild(new ProtoInstance("SymbolVector").setContainerField("children")
            .addFieldValue(new fieldValue().setName("color").setValue(new MFColor(new MFColor(new double[] {0.0,1.0,0.0}))))
            .addFieldValue(new fieldValue().setName("labelColor").setValue(new SFColor(0.0,1.0,0.0))))
          .addChild(new Billboard()
            .addChild(new Transform().setRotation(0.0,1.0,0.0,3.14)
              .addComments(" Symbol Geometry ")
              .addChild(new Shape()
                .setGeometry(new IndexedLineSet().setColorPerVertex(false).setColorIndex(new int[] {0,0,0,0}).setCoordIndex(new int[] {0,1,2,3})
                  .setCoord(new Coordinate().setPoint(new MFVec3f(new double[] {-1.0,0.0,0.0,-1.0,0.0,-1.0,1.0,0.0,-1.0,1.0,0.0,0.0})))
                  .setColor(new Color()
                    .setIS(new IS()
                      .addConnect(new connect().setNodeField("color").setProtoField("color")))))))))))
    .addChild(new ProtoDeclare("SubSurfaceHostile").setName("SubSurfaceHostile").setAppinfo("NTDS Symbology for subsurface vessel, classification hostile")
      .setProtoInterface(new ProtoInterface()
        .addField(new field().setName("color").setType(field.TYPE_MFCOLOR).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new MFColor(new MFColor(new double[] {0.8,0.8,0.8}))).setAppinfo("Single color value for symbol")))
      .setProtoBody(new ProtoBody()
        .addChild(new Transform()
          .addChild(new ProtoInstance("SymbolVector").setContainerField("children")
            .addFieldValue(new fieldValue().setName("color").setValue(new MFColor(new MFColor(new double[] {1.0,0.0,0.0}))))
            .addFieldValue(new fieldValue().setName("labelColor").setValue(new SFColor(1.0,0.0,0.0))))
          .addChild(new Billboard()
            .addChild(new Transform().setRotation(0.0,1.0,0.0,-.785)
              .addComments(" Symbol Geometry ")
              .addChild(new Shape()
                .setGeometry(new IndexedLineSet().setColorPerVertex(false).setColorIndex(new int[] {0,0,0}).setCoordIndex(new int[] {0,1,2})
                  .setCoord(new Coordinate().setPoint(new MFVec3f(new double[] {-1.0,0.0,1.0,1.0,0.0,1.0,1.0,0.0,-1.0})))
                  .setColor(new Color()
                    .setIS(new IS()
                      .addConnect(new connect().setNodeField("color").setProtoField("color")))))))))))
    .addChild(new ProtoDeclare("SubSurfaceAssumedFriend").setName("SubSurfaceAssumedFriend").setAppinfo("NTDS Symbology for subsurface vessel, classification assumed friendly")
      .setProtoInterface(new ProtoInterface()
        .addField(new field().setName("color").setType(field.TYPE_MFCOLOR).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new MFColor(new MFColor(new double[] {0.8,0.8,0.8}))).setAppinfo("Single color value for symbol"))
        .addField(new field().setName("labelColor").setType(field.TYPE_SFCOLOR).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new SFColor(0.8,0.8,0.8)).setAppinfo("Color for labels"))
        .addField(new field().setName("symbolModifier").setType(field.TYPE_MFSTRING).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setAppinfo("Symbol Modifier")))
      .setProtoBody(new ProtoBody()
        .addChild(new Transform()
          .addChild(new ProtoInstance("SymbolVector").setContainerField("children")
            .addFieldValue(new fieldValue().setName("color").setValue(new MFColor(new MFColor(new double[] {0.0,0.0,1.0}))))
            .addFieldValue(new fieldValue().setName("labelColor").setValue(new SFColor(0.0,0.0,1.0))))
          .addChild(new Billboard()
            .addChild(new Transform().setRotation(0.0,1.0,0.0,-1.57)
              .addComments(" Symbol Geometry ")
              .addChild(new Shape()
                .setGeometry(new IndexedLineSet().setColorPerVertex(false).setColorIndex(new int[] {0,0,0,0,0,0,0,0,0,0,0,0}).setCoordIndex(new int[] {0,1,-1,2,3,-1,4,5,-1,6,7,-1,8,9,-1,10,11})
                  .setCoord(new Coordinate().setPoint(new MFVec3f(new double[] {0.0,0.0,-1.0,0.195,0.0,-0.981,0.555,0.0,-0.832,0.707,0.0,-0.708,0.923,0.0,-0.383,0.98,0.0,-0.196,0.98,0.0,0.195,0.923,0.0,0.382,0.707,0.0,0.707,0.555,0.0,0.831,0.195,0.0,0.98,0.0,0.0,1.0})))
                  .setColor(new Color()
                    .setIS(new IS()
                      .addConnect(new connect().setNodeField("color").setProtoField("color")))))))
            .addComments(" Symbol Modifier ")
            .addChild(new Transform().setRotation(1.0,0.0,0.0,-1.57).setTranslation(1.0,0.0,-1.2)
              .addChild(new Shape()
                .setAppearance(new Appearance()
                  .setMaterial(new Material()
                    .setIS(new IS()
                      .addConnect(new connect().setNodeField("diffuseColor").setProtoField("labelColor")))))
                .setGeometry(new Text()
                  .setIS(new IS()
                    .addConnect(new connect().setNodeField("string").setProtoField("symbolModifier")))
                  .setFontStyle(new FontStyle().setJustify(FontStyle.JUSTIFY_BEGIN_BEGIN).setSize(0.5)))))))))
    .addChild(new ProtoDeclare("SubSurfaceSuspect").setName("SubSurfaceSuspect").setAppinfo("NTDS Symbology for subsurface vessel, classification suspect")
      .setProtoInterface(new ProtoInterface()
        .addField(new field().setName("color").setType(field.TYPE_MFCOLOR).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new MFColor(new MFColor(new double[] {0.8,0.8,0.8}))).setAppinfo("Single color value for symbol"))
        .addField(new field().setName("labelColor").setType(field.TYPE_SFCOLOR).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new SFColor(0.8,0.8,0.8)).setAppinfo("Color for labels"))
        .addField(new field().setName("symbolModifier").setType(field.TYPE_MFSTRING).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setAppinfo("Symbol Modifier")))
      .setProtoBody(new ProtoBody()
        .addChild(new Transform()
          .addChild(new ProtoInstance("SymbolVector").setContainerField("children")
            .addFieldValue(new fieldValue().setName("color").setValue(new MFColor(new MFColor(new double[] {1.0,0.0,0.0}))))
            .addFieldValue(new fieldValue().setName("labelColor").setValue(new SFColor(1.0,0.0,0.0))))
          .addChild(new Billboard()
            .addChild(new Transform().setRotation(0.0,1.0,0.0,-.785)
              .addChild(new Shape()
                .setGeometry(new IndexedLineSet().setColorPerVertex(false).setColorIndex(new int[] {0,0,0,0,0}).setCoordIndex(new int[] {0,1,2,3,0})
                  .setCoord(new Coordinate().setPoint(new MFVec3f(new double[] {-1.0,0.0,1.0,1.0,0.0,1.0,1.0,0.0,-1.0,-1.0,0.0,-1.0})))
                  .setColor(new Color()
                    .setIS(new IS()
                      .addConnect(new connect().setNodeField("color").setProtoField("color")))))))
            .addComments(" Symbol Modifier ")
            .addChild(new Transform().setRotation(1.0,0.0,0.0,-1.57).setTranslation(1.0,0.0,-1.2)
              .addChild(new Shape()
                .setAppearance(new Appearance()
                  .setMaterial(new Material()
                    .setIS(new IS()
                      .addConnect(new connect().setNodeField("diffuseColor").setProtoField("labelColor")))))
                .setGeometry(new Text()
                  .setIS(new IS()
                    .addConnect(new connect().setNodeField("string").setProtoField("symbolModifier")))
                  .setFontStyle(new FontStyle().setJustify(FontStyle.JUSTIFY_BEGIN_BEGIN).setSize(0.5)))))))))
    .addComments(" Ground Equipment (exactly the same as Sea Surface symbols) ")
    .addChild(new ProtoDeclare("GroundEquipmentPending").setName("GroundEquipmentPending").setAppinfo("NTDS Symbology for Ground Equipment, classification pending")
      .setProtoBody(new ProtoBody()
        .addChild(new Transform()
          .addChild(new ProtoInstance("SurfacePending").setContainerField("children")
            .addFieldValue(new fieldValue().setName("color").setValue(new SFColor(1.0,1.0,0.0)))
            .addFieldValue(new fieldValue().setName("labelColor").setValue(new SFColor(1.0,1.0,0.0)))
            .addFieldValue(new fieldValue().setName("symbolModifier").setValue(new String[] {"?"}))))))
    .addChild(new ProtoDeclare("GroundEquipmentUnknown").setName("GroundEquipmentUnknown").setAppinfo("NTDS Symbology for Ground Equipment, classification unknown")
      .setProtoBody(new ProtoBody()
        .addChild(new Transform()
          .addChild(new ProtoInstance("SurfaceUnknown").setContainerField("children")
            .addFieldValue(new fieldValue().setName("color").setValue(new SFColor(1.0,1.0,0.0)))))))
    .addChild(new ProtoDeclare("GroundEquipmentFriend").setName("GroundEquipmentFriend").setAppinfo("NTDS Symbology for Ground Equipment, classification friendly")
      .setProtoBody(new ProtoBody()
        .addChild(new Transform()
          .addChild(new ProtoInstance("SurfaceFriend").setContainerField("children")
            .addFieldValue(new fieldValue().setName("color").setValue(new MFColor(new MFColor(new double[] {0.0,0.0,1.0}))))))))
    .addChild(new ProtoDeclare("GroundEquipmentNeutral").setName("GroundEquipmentNeutral").setAppinfo("NTDS Symbology for Ground Equipment, classification neutral")
      .setProtoBody(new ProtoBody()
        .addChild(new Transform()
          .addChild(new ProtoInstance("SurfaceNeutral").setContainerField("children")
            .addFieldValue(new fieldValue().setName("color").setValue(new MFColor(new MFColor(new double[] {0.0,1.0,0.0}))))))))
    .addChild(new ProtoDeclare("GroundEquipmentHostile").setName("GroundEquipmentHostile").setAppinfo("NTDS Symbology for Ground Equipment, classification hostile")
      .setProtoBody(new ProtoBody()
        .addChild(new Transform()
          .addChild(new ProtoInstance("SurfaceHostile").setContainerField("children")
            .addFieldValue(new fieldValue().setName("color").setValue(new MFColor(new MFColor(new double[] {1.0,0.0,0.0}))))))))
    .addChild(new ProtoDeclare("GroundEquipmentAssumedFriend").setName("GroundEquipmentAssumedFriend").setAppinfo("NTDS Symbology for Ground Equipment, classification assumed friendly")
      .setProtoBody(new ProtoBody()
        .addChild(new Transform()
          .addChild(new ProtoInstance("SurfaceAssumedFriend").setContainerField("children")
            .addFieldValue(new fieldValue().setName("color").setValue(new MFColor(new MFColor(new double[] {0.0,0.0,1.0}))))
            .addFieldValue(new fieldValue().setName("labelColor").setValue(new SFColor(0.0,0.0,1.0)))
            .addFieldValue(new fieldValue().setName("symbolModifier").setValue(new String[] {"?"}))))))
    .addChild(new ProtoDeclare("GroundEquipmentSuspect").setName("GroundEquipmentSuspect").setAppinfo("NTDS Symbology for Ground Equipment, classification suspect")
      .setProtoBody(new ProtoBody()
        .addChild(new Transform()
          .addChild(new ProtoInstance("SurfaceSuspect").setContainerField("children")
            .addFieldValue(new fieldValue().setName("color").setValue(new MFColor(new MFColor(new double[] {1.0,0.0,0.0}))))
            .addFieldValue(new fieldValue().setName("labelColor").setValue(new SFColor(1.0,0.0,0.0)))
            .addFieldValue(new fieldValue().setName("symbolModifier").setValue(new String[] {"?"}))))))
    .addComments(" Viewable geometry for this scene is anchored text that links to an example showing ExternProtoDeclare usage of BeamCylinder ")
    .addChild(new Viewpoint().setDescription("NTDS Symbology Prototypes").setPosition(0.0,0.0,12.0))
    .addChild(new Anchor().setDescription("NTDS Symbology Examples").setUrl(new String[] {"NTDSExternProtoExamples.x3d","../../CommunicationsAndSensors/Beam/NTDSExternProtoExamples.x3d","https://www.web3d.org/x3d/content/examples/Savage/CommunicationsAndSensors/Beam/NTDSExternProtoExamples.x3d","NTDSExternProtoExamples.wrl","../../CommunicationsAndSensors/Beam/NTDSExternProtoExamples.wrl","https://www.web3d.org/x3d/content/examples/Savage/CommunicationsAndSensors/Beam/NTDSExternProtoExamples.wrl"})
      .addChild(new Shape()
        .setAppearance(new Appearance()
          .setMaterial(new Material().setDiffuseColor(0.0,1.0,1.0).setEmissiveColor(0.0,1.0,1.0)))
        .setGeometry(new Text().setString(new String[] {"BeamHemispherePrototype","is a Prototype definition file.","","Select this text to view","NTDSExternProtoExamples"})
          .setFontStyle(new FontStyle().setJustify(FontStyle.JUSTIFY_MIDDLE_MIDDLE))))
      .addComments(" Transparent box to simplify user selection (i.e. \"clickability\") ")
      .addChild(new Shape()
        .setGeometry(new Box().setSize(12.0,6.0,0.1))
        .setAppearance(new Appearance()
          .setMaterial(new Material().setTransparency(0.8)))))
    .addComments(" ***THE FOLLOWING NOT YET IMPLEMENTED*** ")
    .addComments(" Space Units ")
    .addComments(" Ground Installations ")
    .addComments(" Special Ops Units "));
            }
            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 NTDSPrototypes 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 NTDSPrototypes().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.Tools.Symbology.NTDSPrototypes\" 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.Tools.Symbology.NTDSPrototypes self-validation test confirmation: ");
                if (!validationResults.equals("success"))
                    System.out.println();
                System.out.println(validationResults.trim());

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