package ConformanceNist.Appearance.ImageTexture;

/*
Copyright (c) 1995-2020 held by the author(s).  All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer
      in the documentation and/or other materials provided with the
      distribution.
    * Neither the name of the Web3D Consortium (https://www.web3d.org)
      nor the names of its contributors may be used to endorse or
      promote products derived from this software without specific
      prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/

import java.util.*;
import org.web3d.x3d.jsail.Core.*;
import org.web3d.x3d.jsail.fields.*;
import org.web3d.x3d.jsail.Geometry3D.*;
import org.web3d.x3d.jsail.Navigation.*;
import org.web3d.x3d.jsail.Shape.*;
import org.web3d.x3d.jsail.Texturing.*;

// Javadoc annotations follow, see below for source.
/**
 * <p> Map a JPG image to an ElevationGrid. An ElevationGrid is default texture mapped by aligning the S (horizontal) axis of the VTS logo with the X axis of the ElevationGrid and the T (vertical) axis of the VTS logo with the Z axis of the ElevationGrid. The bottom of the VTS logo coincides with the first row of grid points and the top of the VTS logo maps to the last row of grid points. </p>
 <p> Related links: <a href="../../../../Appearance/ImageTexture/ElevationGrid.java">ElevationGrid.java</a> source, <a href="../../../../Appearance/ImageTexture/ElevationGridIndex.html" target="_top">ElevationGrid catalog page</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="../../../../Appearance/ImageTexture/ElevationGrid.x3d">ElevationGrid.x3d</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> Image </i> </td>
			<td> <a href="../../../../Appearance/ImageTexture/ElevationGrid-front.jpg">ElevationGrid-front.jpg</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> Image </i> </td>
			<td> <a href="../../../../Appearance/ImageTexture/ElevationGrid-rear.jpg">ElevationGrid-rear.jpg</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> Image </i> </td>
			<td> <a href="../../../../Appearance/ImageTexture/ElevationGrid-top.jpg">ElevationGrid-top.jpg</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> Image </i> </td>
			<td> <a href="../../../../Appearance/ImageTexture/ElevationGrid-bottom.jpg">ElevationGrid-bottom.jpg</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> Image </i> </td>
			<td> <a href="../../../../Appearance/ImageTexture/ElevationGrid-left.jpg">ElevationGrid-left.jpg</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> Image </i> </td>
			<td> <a href="../../../../Appearance/ImageTexture/ElevationGrid-right.jpg">ElevationGrid-right.jpg</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> <a href="http://www.nist.gov/vrml.html" target="_blank">http://www.nist.gov/vrml.html</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> <a href="http://www.itl.nist.gov/div897/ctg/vrml/vrml.html" target="_blank">http://www.itl.nist.gov/div897/ctg/vrml/vrml.html</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> creator </i> </td>
			<td> <a href="http://www.itl.nist.gov/div897/ctg/vrml/members.html" target="_blank">http://www.itl.nist.gov/div897/ctg/vrml/members.html</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> disclaimer </i> </td>
			<td> This file was provided by the National Institute of Standards and Technology, and is part of the X3D Conformance Test Suite, available at <a href="http://www.nist.gov/vrml.html" target="_blank">http://www.nist.gov/vrml.html</a> The information contained within this file is provided for use in establishing conformance to the ISO VRML97 Specification. Conformance to this test does not imply recommendation or endorsement by the National Institute of Standards and Technology. This software can be redistributed and/or modified freely provided that any derivative works bear some notice that they are derived from it, and any modified versions bear some notice that they have been modified. </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> info </i> </td>
			<td> Correct definition and compliance of this conformance scene is maintained by the X3D Working Group, <a href="https://www.web3d.org/working-groups/x3d" target="_blank">https://www.web3d.org/working-groups/x3d</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> translator </i> </td>
			<td> Michael Kass NIST, Don Brutzman NPS </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> translated </i> </td>
			<td> 21 January 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> description </i> </td>
			<td> Map a JPG image to an ElevationGrid. An ElevationGrid is default texture mapped by aligning the S (horizontal) axis of the VTS logo with the X axis of the ElevationGrid and the T (vertical) axis of the VTS logo with the Z axis of the ElevationGrid. The bottom of the VTS logo coincides with the first row of grid points and the top of the VTS logo maps to the last row of grid points </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/ConformanceNist/Appearance/ImageTexture/ElevationGrid.x3d" target="_blank">https://www.web3d.org/x3d/content/examples/ConformanceNist/Appearance/ImageTexture/ElevationGrid.x3d</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> generator </i> </td>
			<td> X3D-Edit 3.3, <a href="https://savage.nps.edu/X3D-Edit" target="_blank">https://savage.nps.edu/X3D-Edit</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> license </i> </td>
			<td> <a href="../../../../Appearance/ImageTexture/../../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 to create Java source code from an <code>.x3d</code> model.
	</p>

	* @author http://www.itl.nist.gov/div897/ctg/vrml/members.html
 */

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

	/** Create and initialize the X3D model for this object. */
	public final void initialize()
	{
  x3dModel = new X3D().setProfile(X3D.PROFILE_INTERACTIVE).setVersion(X3D.VERSION_3_0)
  .setHead(new head()
    .addMeta(new meta().setName(meta.NAME_TITLE      ).setContent("ElevationGrid.x3d"))
    .addMeta(new meta().setName(meta.NAME_IMAGE      ).setContent("ElevationGrid-front.jpg"))
    .addMeta(new meta().setName(meta.NAME_IMAGE      ).setContent("ElevationGrid-rear.jpg"))
    .addMeta(new meta().setName(meta.NAME_IMAGE      ).setContent("ElevationGrid-top.jpg"))
    .addMeta(new meta().setName(meta.NAME_IMAGE      ).setContent("ElevationGrid-bottom.jpg"))
    .addMeta(new meta().setName(meta.NAME_IMAGE      ).setContent("ElevationGrid-left.jpg"))
    .addMeta(new meta().setName(meta.NAME_IMAGE      ).setContent("ElevationGrid-right.jpg"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("http://www.nist.gov/vrml.html"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("http://www.itl.nist.gov/div897/ctg/vrml/vrml.html"))
    .addMeta(new meta().setName(meta.NAME_CREATOR    ).setContent("http://www.itl.nist.gov/div897/ctg/vrml/members.html"))
    .addMeta(new meta().setName("disclaimer").setContent("This file was provided by the National Institute of Standards and Technology, and is part of the X3D Conformance Test Suite, available at http://www.nist.gov/vrml.html The information contained within this file is provided for use in establishing conformance to the ISO VRML97 Specification. Conformance to this test does not imply recommendation or endorsement by the National Institute of Standards and Technology. This software can be redistributed and/or modified freely provided that any derivative works bear some notice that they are derived from it, and any modified versions bear some notice that they have been modified."))
    .addMeta(new meta().setName(meta.NAME_INFO       ).setContent("Correct definition and compliance of this conformance scene is maintained by the X3D Working Group, https://www.web3d.org/working-groups/x3d"))
    .addMeta(new meta().setName(meta.NAME_TRANSLATOR ).setContent("Michael Kass NIST, Don Brutzman NPS"))
    .addMeta(new meta().setName(meta.NAME_TRANSLATED ).setContent("21 January 2001"))
    .addMeta(new meta().setName(meta.NAME_MODIFIED   ).setContent("20 October 2019"))
    .addMeta(new meta().setName(meta.NAME_DESCRIPTION).setContent("Map a JPG image to an ElevationGrid. An ElevationGrid is default texture mapped by aligning the S (horizontal) axis of the VTS logo with the X axis of the ElevationGrid and the T (vertical) axis of the VTS logo with the Z axis of the ElevationGrid. The bottom of the VTS logo coincides with the first row of grid points and the top of the VTS logo maps to the last row of grid points"))
    .addMeta(new meta().setName(meta.NAME_IDENTIFIER ).setContent("https://www.web3d.org/x3d/content/examples/ConformanceNist/Appearance/ImageTexture/ElevationGrid.x3d"))
    .addMeta(new meta().setName(meta.NAME_GENERATOR  ).setContent("Vrml97ToX3dNist, http://ovrt.nist.gov/v2_x3d.html"))
    .addMeta(new meta().setName(meta.NAME_GENERATOR  ).setContent("X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit"))
    .addMeta(new meta().setName(meta.NAME_LICENSE    ).setContent("../../license.html")))
  .setScene(new Scene()
    .addChild(new WorldInfo().setTitle("ElevationGrid.x3d"))
    .addChild(new NavigationInfo().setType(new String[] {"EXAMINE","WALK","FLY","ANY"}))
    .addChild(new Shape()
      .setAppearance(new Appearance()
        .setMaterial(new Material())
        .setTexture(new ImageTexture().setUrl(new String[] {"../../vts.jpg","https://www.web3d.org/x3d/content/examples/ConformanceNist/vts.jpg"})))
      .setGeometry(new /*avoid name collision with file name*/org.web3d.x3d.jsail.Rendering.ElevationGrid().setSolid(false).setXDimension(21).setXSpacing(0.2f).setZDimension(21).setZSpacing(0.15f).setHeight(getElevationGrid_4_27_height()))));
    }
	// end of initialize() method

		/** Define subarrays using type float[] */
		private float[] getElevationGrid_4_27_height_1()
		{
			float[] value = {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0233242f,0.0461275f,0.0679003f,0.0881563f,0.106443f,0.122352f,0.135528f,0.145676f,0.152571f,0.156057f,0.156057f,0.152571f,0.145676f,0.135528f,0.122352f,0.106443f,0.0881566f,0.0679006f,0.0461278f,0.0233246f,0.0f,0.0461275f,0.0912245f,0.134284f,0.174343f,0.210508f,0.241971f,0.268028f,0.288098f,0.301733f,0.308627f,0.308627f,0.301733f,0.288099f,0.268029f,0.241971f,0.210509f,0.174344f,0.134284f,0.0912253f,0.0461283f,0.0f,0.0679003f,0.134284f,0.197668f,0.256636f,0.309871f,0.356185f,0.394542f,0.424085f,0.444155f,0.454304f,0.454304f,0.444155f,0.424085f,0.394542f,0.356185f,0.309872f,0.256637f,0.197669f,0.134285f,0.0679015f,0.0f,0.0881563f,0.174343f,0.256636f,0.333195f,0.402312f,0.462442f,0.512241f,0.550598f,0.576656f,0.589832f,0.589832f,0.576656f,0.550599f,0.512242f,0.462443f,0.402313f,0.333197f,0.256637f,0.174345f,0.0881578f,0.0f,0.106443f,0.210508f,0.309871f,0.402312f,0.485766f,0.558369f,0.618498f,0.664812f,0.696275f,0.712184f,0.712184f,0.696275f,0.664813f,0.618499f,0.55837f,0.485767f,0.402314f,0.309873f,0.21051f,0.106445f,0.0f,0.122352f,0.241971f,0.356185f,0.462442f,0.558369f,0.641823f,0.710939f,0.764175f,0.80034f,0.818627f,0.818627f,0.800341f,0.764176f,0.710941f,0.641824f,0.55837f,0.462444f,0.356187f,0.241973f,0.122354f,0.0f,0.135528f,0.268028f,0.394542f,0.512241f,0.618498f,0.710939f,0.787499f,0.846468f,0.886527f,0.906783f,0.906784f,0.886528f,0.846468f,0.7875f,0.710941f,0.6185f,0.512243f,0.394544f,0.268031f,0.13553f,0.0f,0.145676f,0.288098f,0.424085f,0.550598f,0.664812f,0.764175f,0.846468f,0.909852f,0.952911f,0.974684f,0.974684f,0.952911f,0.909852f,0.846469f,0.764177f,0.664814f,0.5506f,0.424087f,0.288101f,0.145679f,0.0f,0.152571f,0.301733f,0.444155f,0.576656f,0.696275f,0.80034f,0.886527f,0.952911f,0.998008f,1.02081f,1.02081f,0.998009f,0.952912f,0.886529f,0.800342f,0.696277f,0.576658f,0.444158f,0.301736f,0.152573f,0.0f,0.156057f,0.308627f,0.454304f,0.589832f,0.712184f,0.818627f,0.906783f,0.974684f,1.02081f,1.04414f,1.04414f,1.02081f,0.974685f,0.906785f,0.818629f,0.712186f,0.589834f,0.454306f,0.30863f,0.156059f,0.0f,0.156057f,0.308627f,0.454304f,0.589832f,0.712184f,0.818627f,0.906784f,0.974684f,1.02081f,1.04414f,1.04414f,1.02081f,0.974685f,0.906785f,0.818629f,0.712186f,0.589834f,0.454306f,0.30863f,0.156059f,0.0f,0.152571f,0.301733f,0.444155f,0.576656f,0.696275f,0.800341f,0.886528f,0.952911f,0.998009f,1.02081f,1.02081f,0.998009f,0.952912f,0.886529f,0.800342f,0.696277f,0.576658f,0.444158f,0.301736f,0.152573f,0.0f,0.145676f,0.288099f,0.424085f,0.550599f,0.664813f,0.764176f,0.846468f,0.909852f,0.952912f,0.974685f,0.974685f,0.952912f,0.909853f,0.84647f,0.764177f,0.664815f,0.550601f,0.424088f,0.288101f,0.145679f,0.0f,0.135528f,0.268029f,0.394542f,0.512242f,0.618499f,0.710941f,0.7875f,0.846469f,0.886529f,0.906785f,0.906785f,0.886529f,0.84647f,0.787502f,0.710942f,0.618501f,0.512244f,0.394544f,0.268031f,0.135531f,0.0f,0.122352f,0.241971f,0.356185f,0.462443f,0.55837f,0.641824f,0.710941f,0.764177f,0.800342f,0.818629f,0.818629f,0.800342f,0.764177f,0.710942f,0.641825f,0.558372f,0.462445f,0.356187f,0.241974f,0.122354f,0.0f,0.106443f,0.210509f,0.309872f,0.402313f,0.485767f,0.55837f,0.6185f,0.664814f,0.696277f,0.712186f,0.712186f,0.696277f,0.664815f,0.618501f,0.558372f,0.485769f,0.402315f,0.309874f,0.210511f,0.106445f,0.0f,0.0881566f,0.174344f,0.256637f,0.333197f,0.402314f,0.462444f,0.512243f,0.5506f,0.576658f,0.589834f,0.589834f,0.576658f,0.550601f,0.512244f,0.462445f,0.402315f,0.333198f,0.256638f,0.174345f,0.0881582f,0.0f,0.0679006f,0.134284f,0.197669f,0.256637f,0.309873f,0.356187f,0.394544f,0.424087f,0.444158f,0.454306f,0.454306f,0.444158f,0.424088f,0.394544f,0.356187f,0.309874f,0.256638f,0.19767f,0.134286f,0.0679018f,0.0f,0.0461278f,0.0912253f,0.134285f,0.174345f,0.21051f,0.241973f,0.268031f,0.288101f,0.301736f,0.30863f,0.30863f,0.301736f,0.288101f,0.268031f,0.241974f,0.210511f,0.174345f,0.134286f,0.0912261f,0.0461287f,0.0f,0.0233246f,0.0461283f,0.0679015f,0.0881578f,0.106445f,0.122354f,0.13553f,0.145679f,0.152573f,0.156059f,0.156059f,0.152573f,0.145679f,0.135531f,0.122354f,0.106445f,0.0881582f,0.0679018f,0.0461287f,0.0233251f};
			return value;
		}

		/** Large attribute array: ElevationGrid height field, scene-graph level=4, element #27, 441 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_4_27_height()
		{
			MFFloat ElevationGrid_4_27_height = new MFFloat()/*2.finalize*/
				.append(new MFFloat(getElevationGrid_4_27_height_1()));
			return ElevationGrid_4_27_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 ElevationGrid 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[])
    {
        X3D thisExampleX3dModel = new ElevationGrid().getX3dModel();

		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: \"ElevationGrid\" 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.print("Java program \"ElevationGrid\" self-validation test results: ");
			String validationResults = thisExampleX3dModel.validationReport();
			System.out.println(validationResults);
		}
    }
}
