package Savage.AircraftFixedWing.C130HerculesTunisia;

import org.web3d.x3d.jsail.Core.*;
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.Lighting.*;
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.Texturing.*;
import org.web3d.x3d.jsail.Time.*;

// Javadoc metadata annotations follow, see below for X3DJSAIL Java source code.
/**
 * <p> A simple combat zone to test the aircraft. </p>
 <p> Related links: Catalog page <a href="../../../../AircraftFixedWing/C130HerculesTunisia/CombatZoneIndex.html" target="_blank">CombatZone</a>,  source <a href="../../../../AircraftFixedWing/C130HerculesTunisia/CombatZone.java">CombatZone.java</a>, <a href="https://www.web3d.org/x3d/content/examples/X3dResources.html" target="_blank">X3D Resources</a>, <a href="https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html" target="_blank">X3D Scene Authoring Hints</a>, and <a href="https://www.web3d.org/x3d/content/X3dTooltips.html" target="_blank">X3D Tooltips</a>. </p>
	<table style="color:black; border:0px solid; border-spacing:10px 0px;">
        <caption>Scene Meta Information</caption>
		<tr style="background-color:silver; border-color:silver;">
			<td style="text-align:center; padding:10px 0px;"><i>meta tags</i></td>
			<td style="text-align:left;   padding:10px 0px;">&nbsp; Document Metadata </td>
		</tr>

		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> title </i> </td>
			<td> <a href="../../../../AircraftFixedWing/C130HerculesTunisia/CombatZone.x3d">CombatZone.x3d</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> description </i> </td>
			<td> A simple combat zone to test the aircraft. </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> creator </i> </td>
			<td> Maj. Mounir Sidhom, Tunisian Air Force </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> translator </i> </td>
			<td> Xeena VRML importer, X3D-Edit 3.1, <a href="https://www.web3d.org/x3d/content/README.X3D-Edit.html" target="_blank">https://www.web3d.org/x3d/content/README.X3D-Edit.html</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> created </i> </td>
			<td> 5 August 2004 </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> translated </i> </td>
			<td> 13 August 2004 </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> drawing </i> </td>
			<td> <a href="../../../../AircraftFixedWing/C130HerculesTunisia/char.png">char.png</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> drawing </i> </td>
			<td> <a href="../../../../AircraftFixedWing/C130HerculesTunisia/fleche.png">fleche.png</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> identifier </i> </td>
			<td> <a href="https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/C130HerculesTunisia/CombatZone.x3d" target="_blank">https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/C130HerculesTunisia/CombatZone.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> generator </i> </td>
			<td> Vrml97ToX3dNist, <a href="http://ovrt.nist.gov/v2_x3d.html" target="_blank">http://ovrt.nist.gov/v2_x3d.html</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> license </i> </td>
			<td> <a href="../../../../AircraftFixedWing/C130HerculesTunisia/../../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 Maj. Mounir Sidhom, Tunisian Air Force
 */

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

	/** Create and initialize the X3D model for this object. */
	public final void initialize()
	{
            try { // catch-all
  x3dModel = new X3D().setProfile(X3D.PROFILE_INTERACTIVE).setVersion(X3D.VERSION_3_0)
  .setHead(new head()
    .addMeta(new meta().setName(meta.NAME_TITLE      ).setContent("CombatZone.x3d"))
    .addMeta(new meta().setName(meta.NAME_DESCRIPTION).setContent("A simple combat zone to test the aircraft."))
    .addMeta(new meta().setName(meta.NAME_CREATOR    ).setContent("Maj. Mounir Sidhom, Tunisian Air Force"))
    .addMeta(new meta().setName(meta.NAME_TRANSLATOR ).setContent("Xeena VRML importer, X3D-Edit 3.1, https://www.web3d.org/x3d/content/README.X3D-Edit.html"))
    .addMeta(new meta().setName(meta.NAME_CREATED    ).setContent("5 August 2004"))
    .addMeta(new meta().setName(meta.NAME_TRANSLATED ).setContent("13 August 2004"))
    .addMeta(new meta().setName(meta.NAME_MODIFIED   ).setContent("28 November 2019"))
    .addMeta(new meta().setName(meta.NAME_DRAWING    ).setContent("char.png"))
    .addMeta(new meta().setName(meta.NAME_DRAWING    ).setContent("fleche.png"))
    .addMeta(new meta().setName(meta.NAME_IDENTIFIER ).setContent("https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/C130HerculesTunisia/CombatZone.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_GENERATOR  ).setContent("Vrml97ToX3dNist, http://ovrt.nist.gov/v2_x3d.html"))
    .addMeta(new meta().setName(meta.NAME_LICENSE    ).setContent("../../license.html")))
  .setScene(new Scene()
    .addChild(new WorldInfo().setTitle("CombatZone.x3d"))
    .addChild(new Viewpoint("MAIN_VP").setDescription("combat zone, main viewpoint").setOrientation(0.0,1.0,0.1,-0.47).setPosition(-9.5,3.0,30.0))
    .addChild(new Viewpoint("TURN_VP").setDescription("turning point").setOrientation(0.0,1.0,0.0,1.57).setPosition(35.0,3.5,12.5))
    .addChild(new Viewpoint("LIGHT_VP").setDescription("light").setOrientation(0.5,1.0,0.0,0.5).setPosition(35.0,2.0,30.0))
    .addChild(new SpotLight().setColor(0.5,0.7,0.0).setDirection(-1.0,-0.5,-0.5).setIntensity(0.5).setLocation(-8.0,5.0,15.0))
    .addChild(new Transform("ELEVATIONS").setTranslation(-15.0,0.0,0.0)
      .addChild(new Shape()
        .setAppearance(new Appearance()
          .setMaterial(new Material().setDiffuseColor(0.7,0.4,0.3)))
        .setGeometry(new ElevationGrid().setCreaseAngle(0.785).setXDimension(60).setZDimension(28).setHeight(getElevationGrid_5_22_height())))
      .addChild(new Transform().setTranslation(0.0,0.0,5.0)
        .addChild(new Shape()
          .setAppearance(new Appearance()
            .setMaterial(new Material().setDiffuseColor(0.7,0.4,0.3)))
          .setGeometry(new ElevationGrid().setCreaseAngle(0.785).setXDimension(12).setXSpacing(0.8).setZDimension(13).setZSpacing(0.8).setHeight(new double[] {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.0,0.0,0.0,0.0,0.5,0.2,0.5,0.0,0.0,0.0,0.5,0.0,0.0,0.0,0.0,0.0,0.0,2.5,0.5,0.0,0.0,0.0,0.5,0.2,0.0,0.0,0.0,0.0,0.5,0.5,3.0,1.0,0.5,0.0,1.0,0.1,0.0,0.0,0.0,0.0,0.5,2.1,4.5,2.5,1.0,1.5,0.5,0.4,0.0,0.0,1.0,0.1,3.5,4.5,5.5,3.5,3.0,1.5,0.0,0.1,0.0,0.0,0.5,0.0,2.5,2.7,3.5,4.1,2.0,0.7,0.0,0.1,0.0,0.0,0.0,0.0,0.5,1.5,1.0,2.0,3.0,1.4,0.0,0.5,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,2.0,1.3,0.0,0.1,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.5,0.0,0.0,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.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}))))
      .addChild(new Transform().setTranslation(20.0,0.0,10.0)
        .addChild(new Shape()
          .setAppearance(new Appearance()
            .setMaterial(new Material().setDiffuseColor(0.7,0.4,0.3)))
          .setGeometry(new ElevationGrid().setCreaseAngle(1.57).setXDimension(12).setZDimension(16).setHeight(new double[] {0.0,0.1,0.0,0.0,0.0,0.0,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.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.5,0.0,0.0,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.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,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.5,0.2,0.5,0.0,0.0,0.0,0.5,0.0,0.0,0.0,0.0,0.0,0.0,1.9,0.5,0.0,0.0,0.0,0.5,0.2,0.0,0.0,0.0,0.0,0.5,0.5,1.5,1.0,0.5,0.0,1.0,0.1,0.0,0.0,0.0,0.0,0.5,1.7,1.5,2.1,1.0,1.5,0.5,0.4,0.0,0.0,1.0,0.1,2.3,2.5,2.2,2.7,2.6,1.5,0.0,0.1,0.0,0.0,0.5,0.0,2.5,2.7,2.5,2.2,2.0,0.7,0.0,0.1,0.0,0.0,0.0,0.0,0.5,1.5,1.0,2.0,2.3,1.4,0.0,0.5,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,2.0,1.3,0.0,0.1,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.5,0.0,0.0,0.1,0.0,0.0})))))
    .addChild(new Transform("CBT").setScale(0.5,0.5,0.5).setTranslation(-8.0,0.0,12.0)
      .addChild(new Group("WHEEL_G")
        .addChild(new Transform().setRotation(1.0,0.0,0.0,-1.57).setTranslation(0.0,0.4,6.0)
          .addChild(new Transform("ROUET")
            .addChild(new Shape("ROUE")
              .setAppearance(new Appearance()
                .setMaterial(new Material().setDiffuseColor(0.4,0.4,0.0))
                .setTexture(new ImageTexture().setUrl(new String[] {"croix.png","https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/C130HerculesTunisia/croix.png"})))
              .setGeometry(new Cylinder().setHeight(0.4).setRadius(0.4)))
            .addChild(new TimeSensor("CLOCK2").setCycleInterval(2.0).setLoop(true))
            .addChild(new OrientationInterpolator("ROUEPATH").setKey(new double[] {0.0,0.5,1.0}).setKeyValue(new MFRotation(new double[] {0.0,1.0,0.0,0.0,0.0,1.0,0.0,3.14,0.0,1.0,0.0,6.28})))))
        .addChild(new Transform().setRotation(1.0,0.0,0.0,-1.57).setTranslation(4.0,0.4,6.0)
          .addChild(new Transform().setUSE("ROUET")))
        .addChild(new Transform().setRotation(1.0,0.0,0.0,-1.57).setTranslation(2.0,0.4,6.0)
          .addChild(new Transform().setUSE("ROUET"))))
      .addChild(new Transform("WHELL_D").setTranslation(0.0,0.0,-2.0)
        .addChild(new Group().setUSE("WHEEL_G")))
      .addChild(new Transform("BODY").setTranslation(2.0,1.1,5.0)
        .addChild(new Shape()
          .setAppearance(new Appearance()
            .setMaterial(new Material().setDiffuseColor(0.4,0.5,0.1)))
          .setGeometry(new Box().setSize(5.4,0.8,2.5))))
      .addChild(new Transform().setTranslation(2.0,1.5,5.0)
        .addChild(new Shape()
          .setAppearance(new Appearance()
            .setMaterial(new Material().setDiffuseColor(0.35,0.4,0.2)))
          .setGeometry(new Cylinder().setHeight(1.0).setRadius(0.9))))
      .addChild(new Transform("CANON").setRotation(0.0,0.0,1.0,-1.25).setTranslation(3.4,1.9,5.0)
        .addChild(new Shape()
          .setAppearance(new Appearance()
            .setMaterial(new Material().setDiffuseColor(0.35,0.37,0.2).setSpecularColor(0.5,0.5,0.0)))
          .setGeometry(new Cylinder().setRadius(0.15)))
        .addChild(new Transform().setTranslation(0.0,1.5,0.0)
          .addChild(new Shape()
            .setAppearance(new Appearance()
              .setMaterial(new Material().setDiffuseColor(0.35,0.37,0.2).setSpecularColor(0.5,0.5,0.0)))
            .setGeometry(new Cylinder().setRadius(0.1)))))
      .addChild(new Transform("TOP_GATE").setTranslation(2.0,1.8,5.0)
        .addChild(new Shape()
          .setAppearance(new Appearance()
            .setMaterial(new Material().setDiffuseColor(0.3,0.37,0.15).setSpecularColor(0.5,0.5,0.0)))
          .setGeometry(new Sphere().setRadius(0.5)))))
    .addChild(new TimeSensor("CLOCK").setCycleInterval(20.0).setLoop(true))
    .addChild(new PositionInterpolator("CbtPath").setKey(new double[] {0.0,0.45,0.55,1.0}).setKeyValue(new MFVec3f(new double[] {-10.0,0.0,12.0,15.0,0.0,12.0,15.0,0.0,8.0,-12.0,0.0,8.0})))
    .addChild(new OrientationInterpolator("OrientationPath").setKey(new double[] {0.0,0.45,0.55}).setKeyValue(new MFRotation(new double[] {0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,3.14})))
    .addChild(new ROUTE().setFromNode("CLOCK").setFromField("fraction_changed").setToNode("CbtPath").setToField("set_fraction"))
    .addChild(new ROUTE().setFromNode("CbtPath").setFromField("value_changed").setToNode("CBT").setToField("set_translation"))
    .addChild(new ROUTE().setFromNode("CLOCK").setFromField("fraction_changed").setToNode("OrientationPath").setToField("set_fraction"))
    .addChild(new ROUTE().setFromNode("OrientationPath").setFromField("value_changed").setToNode("CBT").setToField("set_rotation"))
    .addChild(new ROUTE().setFromNode("CLOCK2").setFromField("fraction_changed").setToNode("ROUEPATH").setToField("set_fraction"))
    .addChild(new ROUTE().setFromNode("ROUEPATH").setFromField("value_changed").setToNode("ROUET").setToField("set_rotation"))
    .addChild(new Anchor().setDescription("README gives description in how to use this scene").setUrl(new String[] {"readme.htm","https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/C130HerculesTunisia/readme.htm"})
      .addChild(new Group()
        .addChild(new Transform().setRotation(0.0,1.0,0.0,-1.57).setScale(0.5,0.5,0.5).setTranslation(25.05,1.5,12.25)
          .addChild(new Shape()
            .setAppearance(new Appearance()
              .setTexture(new ImageTexture().setUrl(new String[] {"fleche.png","https://www.web3d.org/x3d/content/examples/Savage/AircraftFixedWing/C130HerculesTunisia/fleche.png"})))
            .setGeometry(new IndexedFaceSet().setCoordIndex(new int[] {5,6,7,8,9,-1,0,4,3,2,1,-1,7,6,1,2,-1,7,2,3,8,-1,8,3,4,9,-1,9,4,0,5,-1,5,0,1,6,-1})
              .setCoord(new Coordinate().setPoint(new MFVec3f(new double[] {0.0,0.0,0.0,1.0,0.0,0.0,1.0,1.0,0.0,0.0,1.0,0.0,-0.7,0.5,0.0,0.0,0.0,0.2,1.0,0.0,0.2,1.0,1.0,0.2,0.0,1.0,0.2,-0.7,0.5,0.2}))))))
        .addChild(new Transform().setRotation(1.0,0.0,0.0,1.57).setScale(0.5,0.5,0.5).setTranslation(25.0,1.0,12.5)
          .addChild(new Shape()
            .setAppearance(new Appearance()
              .setMaterial(new Material().setDiffuseColor(0.1,0.15,0.2).setEmissiveColor(0.3,0.3,0.4)))
            .setGeometry(new Box().setSize(0.2,0.2,2.0)))))));
            }
            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[] getElevationGrid_5_22_height_1()
		{
			double[] value = {1.1,1.2,1.4,1.5,1.9,2.0,1.9,1.7,1.5,1.1,1.7,2.1,2.2,2.6,2.9,3.0,3.5,3.2,3.1,2.5,2.4,2.2,2.0,2.0,2.1,1.8,1.7,1.5,2.0,2.4,2.9,3.3,3.8,4.0,4.2,4.4,4.8,4.9,5.4,5.5,4.0,4.2,3.5,2.5,2.0,3.0,3.5,4.0,4.6,5.2,5.5,4.5,3.3,2.5,4.0,2.0,2.4,2.9,3.3,3.8,4.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,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.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,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.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,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0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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.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,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.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,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.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,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.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,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.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,0.0};
			return value;
		}

		/** Large attribute array: ElevationGrid height field, scene-graph level=5, element #22, 1680 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 getElevationGrid_5_22_height()
		{
			MFFloat ElevationGrid_5_22_height = new MFFloat()/*2.finalize*/
				.append(new MFFloat(getElevationGrid_5_22_height_1()))
				.append(new MFFloat(getElevationGrid_5_22_height_2()));
			return ElevationGrid_5_22_height;
		}

	/** 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 CombatZone 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 CombatZone().getX3dModel();
//      System.out.println("X3D model construction complete.");
	
        // next handle command line arguments
        boolean hasArguments = (args != null) && (args.length > 0);
        boolean validate = true; // default
        boolean argumentsLoadNewModel = false;
        String  fileName = new String();

        if (args != null)
        {
                for (String arg : args)
                {
                        if (arg.toLowerCase().startsWith("-v") || arg.toLowerCase().contains("validate"))
                        {
                                validate = true; // making sure
                        }
                        if (arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_X3D) ||
                                arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_CLASSICVRML) ||
                                arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_X3DB) ||
                                arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_VRML97) ||
                                arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_EXI) ||
                                arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_GZIP) ||
                                arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_ZIP) ||
                                arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_HTML) ||
                                arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_XHTML))
                        {
                                argumentsLoadNewModel = true;
                                fileName = arg;
                        }
                }
        }
        if      (argumentsLoadNewModel)
                System.out.println("WARNING: \"Savage.AircraftFixedWing.C130HerculesTunisia.CombatZone\" model invocation is attempting to load file \"" + fileName + "\" instead of simply validating itself... file loading ignored.");
        else if (hasArguments) // if no arguments provided, this method produces usage warning
                thisExampleX3dModel.handleArguments(args);
	
        if (validate)
        {
            //  System.out.println("--- TODO fix duplicated outputs ---"); // omit when duplicated outputs problem is solved/refactored
		String validationResults = thisExampleX3dModel.validationReport();
            //  System.out.println("-----------------------------------"); // omit when duplicated outputs problem is solved/refactored
                System.out.print("Savage.AircraftFixedWing.C130HerculesTunisia.CombatZone self-validation test confirmation: ");
                if (!validationResults.equals("success"))
                    System.out.println();
                System.out.println(validationResults.trim());

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