package Savage.Locations.CampPendletonCalifornia;

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

// Javadoc metadata annotations follow, see below for X3DJSAIL Java source code.
/**
 * <p> Manually derived bathymetry offshore Camp Pendleton California. </p>
 <p> Related links: Catalog page <a href="../../../../Locations/CampPendletonCalifornia/ChartletTranscribedIndex.html" target="_blank">ChartletTranscribed</a>,  source <a href="../../../../Locations/CampPendletonCalifornia/ChartletTranscribed.java">ChartletTranscribed.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="../../../../Locations/CampPendletonCalifornia/ChartletTranscribed.x3d">ChartletTranscribed.x3d</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> description </i> </td>
			<td> Manually derived bathymetry offshore Camp Pendleton California. </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> creator </i> </td>
			<td> Don Brutzman and OS3 Bruce Goldin USN </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> identifier </i> </td>
			<td> <a href="https://www.web3d.org/x3d/content/examples/Savage/Locations/CampPendletonCalifornia/ChartletTranscribed.x3d" target="_blank">https://www.web3d.org/x3d/content/examples/Savage/Locations/CampPendletonCalifornia/ChartletTranscribed.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="../../../../Locations/CampPendletonCalifornia/../../license.html">../../license.html</a> </td>
		</tr>
		<tr style="background-color:silver; border-color:silver;">
			<td style="text-align:center;" colspan="2">  &nbsp; </td>
		</tr>
	</table>

	<p>
		This program uses the
		<a href="https://www.web3d.org/specifications/java/X3DJSAIL.html" target="_blank">X3D Java Scene Access Interface Library (X3DJSAIL)</a>.
		It has been produced using the 
		<a href="https://www.web3d.org/x3d/stylesheets/X3dToJava.xslt" target="_blank">X3dToJava.xslt</a>
		stylesheet
	       (<a href="https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/X3dToJava.xslt" target="_blank">version control</a>)
                which is used to create Java source code from an original <code>.x3d</code> model.
	</p>

	* @author Don Brutzman and OS3 Bruce Goldin USN
 */

public class ChartletTranscribed
{
	/** Default constructor to create this object. */
	public ChartletTranscribed ()
	{
	  initialize();
	}

	/** Create and initialize the X3D model for this object. */
	public final void initialize()
	{
            try { // catch-all
  x3dModel = new X3D().setProfile(X3D.PROFILE_IMMERSIVE).setVersion(X3D.VERSION_3_0)
  .setHead(new head()
    .addMeta(new meta().setName(meta.NAME_TITLE      ).setContent("ChartletTranscribed.x3d"))
    .addMeta(new meta().setName(meta.NAME_DESCRIPTION).setContent("Manually derived bathymetry offshore Camp Pendleton California."))
    .addMeta(new meta().setName(meta.NAME_CREATOR    ).setContent("Don Brutzman and OS3 Bruce Goldin USN"))
    .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_IDENTIFIER ).setContent("https://www.web3d.org/x3d/content/examples/Savage/Locations/CampPendletonCalifornia/ChartletTranscribed.x3d"))
    .addMeta(new meta().setName(meta.NAME_GENERATOR  ).setContent("X3D-Edit 3.2, https://www.web3d.org/x3d/tools/X3D-Edit"))
    .addMeta(new meta().setName(meta.NAME_LICENSE    ).setContent("../../license.html")))
  .setScene(new Scene()
    .addChild(new WorldInfo().setTitle("ChartletTranscribed.x3d"))
    .addChild(new Background().setGroundColor(new MFColor(new double[] {0.2,0.2,0.5})).setSkyColor(new MFColor(new double[] {0.4,0.4,1.0})))
    .addChild(new DirectionalLight().setDirection(0.0,-1.0,0.0))
    .addChild(new NavigationInfo().setSpeed(100).setType(new String[] {"EXAMINE","WALK","FLY","ANY"}))
    .addChild(new Transform().setRotation(0.0,1.0,0.0,-1.57).setTranslation(-2000.0,1000.0,2464.0)
      .addChild(new Viewpoint().setDescription("Chartlet view").setOrientation(1.0,0.0,0.0,-0.3)))
    .addComments(" Soundings in feet, converted to meters (1m = 39.3\", 39.3\" / 12\" = 3.275). ")
    .addChild(new Switch().setWhichChoice(0)
      .addComments(" Simple ElevationGrid, not georeferenced to latitude/longitude ")
      .addChild(new Group()
        .addChild(new Transform().setScale(1.0,3.275,1.0)
          .addChild(new Shape()
            .setGeometry(new ElevationGrid("BathymetryGrid").setCreaseAngle(3.14).setSolid(false).setXDimension(31).setXSpacing(154).setZDimension(29).setZSpacing(184)
              .setColor(new Color("BathymetryGridColorNodeCalculated").setColor(new MFColor(new double[] {0.0,0.0,0.0}))))
            .setAppearance(new Appearance()
              .setMaterial(new Material().setDiffuseColor(0.0,0.0,0.25))))
          .addChild(new Script("CalculateColorSchemeMEDAL").setSourceCode("""
ecmascript:

function initialize ()
{
	totalHeights=heightValues.length;
	heightValuesHold = new MFFloat (0);
//	Browser.println ('totalHeights=heightValues.length=' + totalHeights);

  // this depth band defined to match fathoms to 60 feet, then 10' increments, doesn't match MEDAL
  depthBand = new MFFloat (0,-6,-12,-18,-24,-30,-36,-42,-48,-54,-60,-70,-80,-90,-100);

  if (inputUnits == 'feet')
  {
	for ( index = 1; index <= totalHeights ; index++ )
	{
		// 1 meter = 39.3 inches
		heightValuesHold[index] = heightValues[index] * (12.0 / 39.3);
	}
	heightValuesOutput = heightValuesHold;
  }
  else
  {
	for ( index = 1; index <= depthBand.length ; index++ )
	{
		// 1 meter = 39.3 inches
		depthBand[index] *= (39.31 / 2.0);
	}
	heightValuesOutput = heightValues;
  }
  brown		= new SFColor (0.2, 0.2, 0);
  white		= new SFColor (1, 1, 1);
  red		= new SFColor (1, 0, 0);
  orange	= new SFColor (1, .529, 0);
  yellow	= new SFColor (1, 1, 0);
  green		= new SFColor (0, 1, 0);
  cyan		= new SFColor (0, 1, 1);
  blue		= new SFColor (0, 0, 1);
  magenta	= new SFColor (1, 0, 1);
  maroon	= new SFColor (0.561, 0, 0.322);
  tan		= new SFColor (0.871, 0.721, 0.529);
  seaGreen	= new SFColor (0.322, 0.584, 0.517);
  slateBlue	= new SFColor (0.494, 0.533, 0.671);
  navyBlue	= new SFColor (0.137, 0.137, 0.459);
  grey		= new SFColor (0.5,   0.5,   0.5);
  slateGrey	= new SFColor (0.439, 0.502, 0.565);
  skyBlue	= new SFColor (0.6, 0.6, 1.0);
  olive		= new SFColor (0.1, 0.4, 0);
  black		= new SFColor (0.1, 0.1, 0.1);

  colorValuesOutput = new MFColor (); // array gets dynamically expanded
  for ( index = 1; index <= totalHeights ; index++ )
  {
	if      (heightValues[index] > depthBand[1])  colorValuesOutput [index] = brown;
	else if (heightValues[index] > depthBand[2])  colorValuesOutput [index] = cyan;
	else if (heightValues[index] > depthBand[3])  colorValuesOutput [index] = red;
	else if (heightValues[index] > depthBand[4])  colorValuesOutput [index] = orange;
	else if (heightValues[index] > depthBand[5])  colorValuesOutput [index] = yellow;
	else if (heightValues[index] > depthBand[6])  colorValuesOutput [index] = tan;
	else if (heightValues[index] > depthBand[7])  colorValuesOutput [index] = grey;
	else if (heightValues[index] > depthBand[8])  colorValuesOutput [index] = olive;
	else if (heightValues[index] > depthBand[9])  colorValuesOutput [index] = green;
	else if (heightValues[index] > depthBand[10]) colorValuesOutput [index] = seaGreen;
	else if (heightValues[index] > depthBand[11]) colorValuesOutput [index] = navyBlue;
	else if (heightValues[index] > depthBand[12]) colorValuesOutput [index] = blue;
	else if (heightValues[index] > depthBand[13]) colorValuesOutput [index] = slateBlue;
	else if (heightValues[index] > depthBand[14]) colorValuesOutput [index] = skyBlue;
	else if (heightValues[index] > depthBand[15]) colorValuesOutput [index] = slateGrey;
	else                                          colorValuesOutput [index] = black;

//	if      (heightValues[index] > depthBand[1])  colorValuesOutput [index] = brown;
//	else if (heightValues[index] > depthBand[2])  colorValuesOutput [index] = yellow;
//	else if (heightValues[index] > depthBand[3])  colorValuesOutput [index] = green;
//	else if (heightValues[index] > depthBand[4])  colorValuesOutput [index] = cyan;
//	else if (heightValues[index] > depthBand[5])  colorValuesOutput [index] = magenta;
//	else if (heightValues[index] > depthBand[6])  colorValuesOutput [index] = tan;
//	else if (heightValues[index] > depthBand[7])  colorValuesOutput [index] = skyBlue;
//	else if (heightValues[index] > depthBand[8])  colorValuesOutput [index] = red;
//	else if (heightValues[index] > depthBand[9])  colorValuesOutput [index] = grey;
//	else if (heightValues[index] > depthBand[10]) colorValuesOutput [index] = seaGreen;
//	else if (heightValues[index] > depthBand[11]) colorValuesOutput [index] = slateBlue;
//	else if (heightValues[index] > depthBand[12]) colorValuesOutput [index] = olive;
//	else if (heightValues[index] > depthBand[13]) colorValuesOutput [index] = black;
//	else if (heightValues[index] > depthBand[14]) colorValuesOutput [index] = navyBlue;
//	else if (heightValues[index] > depthBand[15]) colorValuesOutput [index] = slateGrey;
//	else                                          colorValuesOutput [index] = orange;
  }
}
""")
            .addComments(" inputUnits are 'feet' or 'meters' - heightValuesOutput is always in meters. ")
            .addField(new field().setName("inputUnits").setType(field.TYPE_SFSTRING).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setValue("feet"))
            .addField(new field().setName("heightValues").setType(field.TYPE_MFFLOAT).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setValue(getfield_heightValues_7_22_value()))
            .addField(new field().setName("heightValuesOutput").setType(field.TYPE_MFFLOAT).setAccessType(field.ACCESSTYPE_OUTPUTONLY))
            .addField(new field().setName("colorValuesOutput").setType(field.TYPE_MFCOLOR).setAccessType(field.ACCESSTYPE_OUTPUTONLY))))
        .addComments(" A new configurable prototype is needed for surface coordinate grids. ")
        .addChild(new Transform().setScale(250.0,250.0,250.0).setTranslation(2500.0,0.0,2500.0)
          .addChild(new Inline("GridXZ_20x20Fixed").setUrl(new String[] {"../../../Savage/Tools/Authoring/GridXZ_20x20Fixed.x3d","https://www.web3d.org/x3d/content/examples/Savage/Tools/Authoring/GridXZ_20x20Fixed.x3d","../../../Savage/Tools/Authoring/GridXZ_20x20Fixed.wrl","https://www.web3d.org/x3d/content/examples/Savage/Tools/Authoring/GridXZ_20x20Fixed.wrl"})))
        .addChild(new Transform().setScale(1000.0,1000.0,1000.0)
          .addChild(new Inline("CoordinateAxes").setUrl(new String[] {"../../../Savage/Tools/Authoring/CoordinateAxes.x3d","../../../X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.x3d","https://www.web3d.org/x3d/content/examples/Savage/Tools/Authoring/CoordinateAxes.x3d","https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.x3d","../../../Savage/Tools/Authoring/CoordinateAxes.wrl","../../../X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.wrl","https://www.web3d.org/x3d/content/examples/Savage/Tools/Authoring/CoordinateAxes.wrl","https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.wrl"}))))
      .addComments(" GeoElevationGrid, georeferenced to latitude/longitude. Switched off, awaiting further work. ")
      .addComments(" <Shape> <GeoElevationGrid geoGridOrigin=\"-117.5 33.2666666666667 1000000\" geoSystem='\"GD\" \"WE\"' solid=\"false\" xDimension=\"31\" xSpacing=\"154\" yScale=\"3.275\" zDimension=\"29\" zSpacing=\"184\"/> </Shape> "))
    .addComments(" HTML Color Codes Black = \"#000000\" = 0 0 0 Green = \"#008000\" = 0 0.5 0 Silver = \"#C0C0C0\" = 0.75 0.75 0.75 Lime = \"#00FF00\" = 0 1 0 Gray = \"#808080\" = 0.5 0.5 0.5 Olive = \"#808000\" = 0.5 0.5 0 White = \"#FFFFFF\" = 1 1 1 Yellow = \"#FFFF00\" = 1 1 0 Maroon = \"#800000\" = 0.5 0 0 Navy = \"#000080\" = 0 0 0.5 Red = \"#FF0000\" = 1 0 0 Blue = \"#0000FF\" = 0 0 1 Purple = \"#800080\" = 0.5 0 0.5 Teal = \"#008080\" = 0 0.5 0.5 Fuchsia = \"#FF00FF\" = 1 0 1 Aqua = \"#00FFFF\" = 0 1 1 ")
    .addComments(" MEDAL Color Codes depth 0-2m orange 2-3 yellow 3-4 bright green 4-5 cyan 5-6 magenta 6-7 tan 7-8 sky blue 8-9 red 9-10 grey 10-11 teal/seagreen 11-12 slateblue 12-13 olivedrab 13-14 black 14-20 navyblue 20-30 slategrey 0.5 0.5 0 1 0.5 0 1 1 0 0 1 0 0 1 1 1 0 1 0.75 0.75 0 1 0.5 0.5 1 0 0 0.5 0.5 0.5 0 0.5 0.5 0 0 0.25 0.5 0.5 0 0.1 0.1 0.1 0 0 0.5 0.25 0.25 0.25 ")
    .addChild(new ROUTE().setFromNode("CalculateColorSchemeMEDAL").setFromField("heightValuesOutput").setToNode("BathymetryGrid").setToField("set_height"))
    .addChild(new ROUTE().setFromNode("CalculateColorSchemeMEDAL").setFromField("colorValuesOutput").setToNode("BathymetryGridColorNodeCalculated").setToField("set_color")));
            }
            catch (Exception ex)
            {       
                System.err.println ("*** Further hints on X3DJSAIL errors and exceptions at");
                System.err.println ("*** https://www.web3d.org/specifications/java/X3DJSAIL.html");
                throw (ex);
            }
	}
	// end of initialize() method

		/** Define subarrays using type double[] */
		private double[] getfield_heightValues_7_22_value_1()
		{
			double[] value = {-101.0,-90.0,-84.0,-78.0,-72.0,-72.0,-70.0,-65.0,-62.0,-63.0,-55.0,-53.0,-50.0,-50.0,-47.0,-45.0,-45.0,-43.0,-42.0,-41.0,-38.0,-37.0,-37.0,-36.0,-34.0,-31.0,-31.0,-27.0,-26.0,-25.0,-23.0,-101.0,-90.0,-84.0,-78.0,-72.0,-72.0,-66.0,-66.0,-64.0,-58.0,-55.0,-53.0,-50.0,-48.0,-46.0,-45.0,-43.0,-42.0,-42.0,-39.0,-39.0,-37.0,-36.0,-34.0,-32.0,-31.0,-27.0,-26.0,-21.0,-24.0,-19.0,-86.0,-84.0,-78.0,-73.0,-72.0,-66.0,-66.0,-61.0,-57.0,-55.0,-52.0,-49.0,-48.0,-46.0,-45.0,-46.0,-45.0,-38.0,-38.0,-36.0,-33.0,-32.0,-32.0,-31.0,-30.0,-30.0,-25.0,-24.0,-22.0,-15.0,-9.0,-84.0,-78.0,-75.0,-72.0,-66.0,-65.0,-63.0,-58.0,-55.0,-53.0,-49.0,-47.0,-47.0,-45.0,-43.0,-42.0,-40.0,-39.0,-37.5,-35.5,-34.0,-32.5,-31.0,-32.0,-28.0,-26.0,-24.0,-21.0,-20.0,-8.5,-5.0,-79.0,-72.0,-70.0,-66.0,-66.0,-60.0,-57.0,-54.0,-52.0,-49.0,-48.0,-46.0,-44.0,-43.0,-43.0,-40.0,-40.0,-39.0,-36.0,-34.0,-33.0,-32.0,-31.0,-28.0,-26.0,-24.0,-22.0,-20.0,-10.0,-5.0,0.0,-81.0,-72.0,-66.0,-63.0,-60.0,-58.0,-57.0,-54.0,-51.0,-49.0,-46.0,-46.0,-44.0,-42.0,-41.0,-40.0,-40.0,-41.0,-35.5,-35.0,-33.0,-31.0,-28.0,-27.0,-25.0,-23.0,-18.0,-13.0,-5.0,0.0,0.0,-72.0,-66.0,-64.5,-60.0,-59.0,-55.0,-54.0,-52.0,-48.0,-48.0,-45.0,-44.0,-42.0,-42.0,-41.0,-40.0,-39.5,-38.0,-36.0,-35.0,-34.0,-29.0,-28.0,-24.0,-23.0,-18.0,-12.0,-5.0,0.0,0.0,0.0,-70.0,-65.0,-62.0,-61.0,-54.0,-54.0,-51.0,-49.0,-48.0,-45.0,-45.0,-44.0,-43.0,-40.0,-39.7,-39.0,-38.0,-35.0,-34.0,-33.0,-31.0,-28.7,-26.0,-23.0,-19.0,-14.0,-5.0,0.0,0.0,0.0,0.0,-63.0,-61.0,-60.0,-55.0,-54.0,-51.0,-50.0,-50.0,-47.0,-44.0,-43.0,-41.0,-39.0,-38.0,-37.0,-36.0,-36.0,-36.0,-33.0,-33.0,-31.0,-27.0,-24.0,-19.0,-12.0,-5.0,0.0,0.0,0.0,0.0,0.0,-60.0,-59.0,-55.0,-53.0,-50.0,-50.0,-49.0,-48.0,-45.0,-44.0,-41.0,-39.5,-39.0,-37.0,-36.5,-36.0,-34.0,-34.0,-32.0,-30.5,-29.0,-27.0,-20.0,-15.0,-8.0,-2.0,0.0,0.0,0.0,0.0,0.0,-58.0,-56.5,-54.0,-50.0,-50.0,-49.0,-48.0,-47.0,-44.0,-42.0,-39.0,-38.5,-37.0,-36.0,-36.0,-29.7,-33.0,-32.0,-31.0,-29.0,-27.7,-22.0,-16.0,-9.0,-2.0,0.0,0.0,0.0,0.0,0.0,0.0,-55.0,-53.0,-50.0,-49.0,-48.0,-47.0,-43.0,-44.0,-44.0,-40.0,-39.0,-38.0,-37.0,-36.0,-34.0,-33.5,-31.0,-30.0,-27.5,-26.0,-23.0,-17.0,-11.0,-2.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-54.0,-51.0,-50.0,-47.0,-47.0,-47.0,-45.0,-45.0,-43.0,-41.0,-39.0,-37.0,-36.0,-35.0,-33.0,-32.0,-30.0,-29.0,-27.0,-24.5,-21.0,-15.0,-5.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-53.0,-51.0,-48.0,-46.0,-44.0,-44.5,-43.0,-42.0,-41.0,-40.0,-36.5,-35.0,-34.5,-35.0,-18.0,-31.0,-29.0,-26.0,-24.0,-20.0,-13.0,-5.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-52.0,-50.0,-47.0,-45.0,-44.0,-44.0,-43.0,-42.0,-40.0,-38.0,-36.5,-34.0,-32.5,-31.0,-31.0,-29.5,-26.7,-24.5,-20.0,-13.0,-7.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-49.5,-49.0,-47.0,-45.0,-43.0,-41.5,-40.0,-39.5,-37.5,-34.0,-34.0,-33.0,-33.0,-32.0,-28.5,-28.0,-26.0,-21.0,-15.0,-8.0,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-49.0,-48.0,-46.0,-46.0,-44.0,-40.0,-41.0,-38.5,-37.0,-37.0,-36.5,-33.0,-32.5,-30.0,-27.0,-26.0,-22.0,-14.0,-10.0,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-47.0,-46.0,-45.0,-45.0,-44.0,-41.0,-40.0,-38.0,-37.0,-34.0,-33.0,-32.5,-31.0,-28.7,-26.0,-22.0,-19.0,-10.0,-3.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,-45.0,-44.5,-42.0,-42.0,-42.0,-40.0,-39.0,-37.5,-36.0,-32.5,-31.0,-31.0,-29.0,-26.0,-23.0,-20.0,-10.0,-5.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,-44.0,-45.0,-40.0,-40.0,-39.0,-38.0,-37.5,-35.0,-33.0,-31.5,-30.0,-29.0,-26.0,-24.0,-20.0,-12.0,-6.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,-43.0,-41.0,-39.5,-39.0,-38.0,-36.0,-35.0,-32.0,-32.0,-30.0,-28.0,-27.0,-24.0,-20.0,-12.0,-5.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,-40.0,-39.0,-39.0,-39.0,-36.0,-34.0,-32.0,-31.0,-30.0,-27.0,-26.0,-24.0,-20.0,-12.0,-5.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,-39.0,-38.5,-38.0,-38.0,-34.0,-33.0,-31.0,-30.0,-27.0,-25.0,-24.0,-21.0,-13.0,-6.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,0.0,-38.0,-37.0,-36.5,-34.0,-32.0,-31.0,-29.7,-28.0,-26.0,-24.0,-20.5,-14.0,-7.0,-2.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,0.0,-37.0,-37.0,-33.8,-33.0,-31.0,-29.0,-28.5,-26.7,-25.5,-20.0,-14.0,-7.0,-2.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,0.0,0.0,-34.0,-39.0,-33.0,-31.0,-29.0,-27.0,-27.0,-24.0,-21.0,-16.0,-7.0,-2.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,0.0,0.0,0.0,-34.0,-36.0,-33.0,-30.0,-28.0,-26.0,-26.0,-22.0,-15.0,-8.0,-2.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,0.0,0.0,0.0,0.0,-32.0,-32.0,-29.0,-27.5,-25.7,-25.0,-23.0,-15.0,-8.0,-2.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,0.0,0.0,0.0,0.0,0.0,-33.0,-30.0,-27.0,-26.0,-24.0,-21.0,-16.0,-9.0,-2.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,0.0,0.0,0.0,0.0,0.0,0.0};
			return value;
		}

		/** Large attribute array: field value field, scene-graph level=7, element #22, 899 total numbers.
		 * Reassemble split array as single method to improve readability and runnability.
		 * Provide large array values via separate methods, hoping to avoid 'code too large' Java compilation errors. 
		 * Individual Java methods (including aggregated initializations) are limited to 64KB.
		 * @see https://stackoverflow.com/questions/2407912/code-too-large-compilation-error-in-java
		 * @see https://stackoverflow.com/questions/11437905/java-too-many-constants-jvm-error
		 */
		private MFFloat getfield_heightValues_7_22_value()
		{
			MFFloat field_heightValues_7_22_value = new MFFloat()/*2.finalize*/
				.append(new MFFloat(getfield_heightValues_7_22_value_1()));
			return field_heightValues_7_22_value;
		}

	/** The initialized model object, created within initialize() method. */
	private X3D x3dModel;

	/** 
	 * Provide a 
	 * <a href="https://dzone.com/articles/java-copy-shallow-vs-deep-in-which-you-will-swim" target="_blank">shallow copy</a>
	 * of the X3D model.
	 * @see <a href="https://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Core/X3D.html">X3D</a>
	 * @return ChartletTranscribed 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 ChartletTranscribed().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.Locations.CampPendletonCalifornia.ChartletTranscribed\" 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.Locations.CampPendletonCalifornia.ChartletTranscribed self-validation test confirmation: ");
                if (!validationResults.equals("success"))
                    System.out.println();
                System.out.println(validationResults.trim());

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