package HumanoidAnimation.Skeleton;

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.PointingDeviceSensor.*;
import org.web3d.x3d.jsail.Rendering.*;
import org.web3d.x3d.jsail.Shape.*;

// Javadoc metadata annotations follow, see below for X3DJSAIL Java source code.
/**
 * <p> facial bone in the skull. </p>
 <p> Related links:  source vomer.java, <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;">HumanoidAnimation.Skeleton.vomer&nbsp; Document Metadata </td>
		</tr>

		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> title </i> </td>
			<td> <a href="https://www.web3d.org/x3d/content/examples/HumanoidAnimation/Skeleton/vomer.x3d">vomer.x3d</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> description </i> </td>
			<td> facial bone in the skull </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> creator </i> </td>
			<td> Joe Williams, John Carlson, Damon Hernandez, Don Brutzman </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> translator </i> </td>
			<td> Don Brutzman </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> created </i> </td>
			<td> 5 December 2013 </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> translated </i> </td>
			<td> 5 March 2026 </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> modified </i> </td>
			<td> 8 March 2026 </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> <a href="https://www.web3d.org/x3d/content/examples/HumanoidAnimation/Skeleton/originals/vom.x3d">originals/vom.x3d</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> <a href="https://en.wikipedia.org/wiki/Vomer" target="_blank">https://en.wikipedia.org/wiki/Vomer</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> <a href="https://en.wikipedia.org/wiki/Nasal_septum" target="_blank">https://en.wikipedia.org/wiki/Nasal_septum</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> <a href="https://en.wikipedia.org/wiki/List_of_bones_of_the_human_skeleton" target="_blank">https://en.wikipedia.org/wiki/List_of_bones_of_the_human_skeleton</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> <a href="https://www.web3d.org/x3d/content/examples/Basic/Medical" target="_blank">https://www.web3d.org/x3d/content/examples/Basic/Medical</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> <a href="https://www.web3d.org/x3d/content/examples/HumanoidAnimation/Medical" target="_blank">https://www.web3d.org/x3d/content/examples/HumanoidAnimation/Medical</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> generator </i> </td>
			<td> X3D-Edit 4.0, <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> X3D Tidy, <a href="https://www.web3d.org/x3d/stylesheets/X3dTidy.html" target="_blank">https://www.web3d.org/x3d/stylesheets/X3dTidy.html</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/HumanoidAnimation/Skeleton/vomer.x3d" target="_blank">https://www.web3d.org/x3d/content/examples/HumanoidAnimation/Skeleton/vomer.x3d</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> license </i> </td>
			<td> <a href="https://www.web3d.org/x3d/content/examples/HumanoidAnimation/Skeleton/../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 Joe Williams, John Carlson, Damon Hernandez, Don Brutzman
 */

public class vomer
{
	/** Default constructor to create this object. */
	public vomer ()
	{
	  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_3)
  .setHead(new head()
    .addMeta(new meta().setName(meta.NAME_TITLE      ).setContent("vomer.x3d"))
    .addMeta(new meta().setName(meta.NAME_DESCRIPTION).setContent("facial bone in the skull"))
    .addMeta(new meta().setName(meta.NAME_CREATOR    ).setContent("Joe Williams, John Carlson, Damon Hernandez, Don Brutzman"))
    .addMeta(new meta().setName(meta.NAME_TRANSLATOR ).setContent("Don Brutzman"))
    .addMeta(new meta().setName(meta.NAME_CREATED    ).setContent("5 December 2013"))
    .addMeta(new meta().setName(meta.NAME_TRANSLATED ).setContent("5 March 2026"))
    .addMeta(new meta().setName(meta.NAME_MODIFIED   ).setContent("8 March 2026"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("originals/vom.x3d"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("https://en.wikipedia.org/wiki/Vomer"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("https://en.wikipedia.org/wiki/Nasal_septum"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("https://en.wikipedia.org/wiki/List_of_bones_of_the_human_skeleton"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("https://www.web3d.org/x3d/content/examples/Basic/Medical"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("https://www.web3d.org/x3d/content/examples/HumanoidAnimation/Medical"))
    .addMeta(new meta().setName(meta.NAME_GENERATOR  ).setContent("X3D-Edit 4.0, https://www.web3d.org/x3d/tools/X3D-Edit"))
    .addMeta(new meta().setName(meta.NAME_GENERATOR  ).setContent("X3D Tidy, https://www.web3d.org/x3d/stylesheets/X3dTidy.html"))
    .addMeta(new meta().setName(meta.NAME_IDENTIFIER ).setContent("https://www.web3d.org/x3d/content/examples/HumanoidAnimation/Skeleton/vomer.x3d"))
    .addMeta(new meta().setName(meta.NAME_LICENSE    ).setContent("../license.html")))
  .setScene(new Scene()
    .addChild(new WorldInfo().setTitle("vomer.x3d"))
    .addChild(new TouchSensor().setDescription("bone vomer"))
    .addChild(new Transform("vomer")
      .addChild(new Shape()
        .setAppearance(new Appearance()
          .setMaterial(new Material("BoneMaterial").setAmbientIntensity(0.965).setDiffuseColor(1.0,0.9765,0.8667).setShininess(0.05).setSpecularColor(0.349,0.349,0.349)))
        .setGeometry(new IndexedFaceSet("vomer_geometry").setDEF("vomer_geometry").setCreaseAngle(1.571).setCoordIndex(getvomer_geometry_5_23_coordIndex())
          .setCoord(new Coordinate("vomer_coordinate").setPoint(getvomer_coordinate_6_23_point()))))));
            }
            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

		/** Large attribute array: IndexedFaceSet DEF='vomer_geometry' coordIndex field, scene-graph level=5, element #23, 528 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 MFInt32 getvomer_geometry_5_23_coordIndex()
		{
			MFInt32 vomer_geometry_5_23_coordIndex = new MFInt32(new int[] {0,1,2,-1,3,4,5,-1,6,7,8,-1,9,10,11,-1,12,13,14,-1,15,16,17,-1,0,18,19,-1,2,20,21,-1,22,23,2,-1,22,24,25,-1,25,26,27,-1,28,29,30,-1,5,4,29,-1,31,32,26,-1,26,33,31,-1,34,35,36,-1,37,16,38,-1,39,40,41,-1,42,19,39,-1,20,43,44,-1,33,25,24,-1,45,38,34,-1,46,35,34,-1,25,33,26,-1,14,5,31,-1,4,30,29,-1,47,28,30,-1,27,26,48,-1,43,49,50,-1,51,45,36,-1,52,35,46,-1,7,11,25,-1,6,5,14,-1,3,30,4,-1,53,47,54,-1,55,7,27,-1,1,56,2,-1,17,56,57,-1,55,8,7,-1,54,30,53,-1,14,9,6,-1,52,51,36,-1,17,16,58,-1,24,22,21,-1,40,49,37,-1,48,55,27,-1,30,54,47,-1,5,32,31,-1,36,45,34,-1,58,16,37,-1,21,44,24,-1,24,44,33,-1,20,44,21,-1,43,59,44,-1,19,60,39,-1,37,38,61,-1,14,62,12,-1,33,63,31,-1,48,26,32,-1,29,32,5,-1,43,50,39,-1,25,11,22,-1,2,21,22,-1,0,19,42,-1,64,57,0,-1,15,51,16,-1,36,35,52,-1,9,11,7,-1,7,6,9,-1,3,5,6,-1,30,3,53,-1,27,7,25,-1,55,53,8,-1,47,53,55,-1,52,16,51,-1,16,52,46,-1,2,65,20,-1,2,56,65,-1,40,61,41,-1,61,40,37,-1,41,66,67,-1,66,41,61,-1,19,62,60,-1,19,12,62,-1,33,59,63,-1,33,44,59,-1,59,39,60,-1,39,59,43,-1,50,40,39,-1,50,49,40,-1,61,45,66,-1,61,38,45,-1,23,11,10,-1,23,22,11,-1,0,23,18,-1,2,23,0,-1,57,1,0,-1,57,56,1,-1,45,15,66,-1,45,51,15,-1,53,6,8,-1,6,53,3,-1,9,13,10,-1,14,13,9,-1,56,58,65,-1,56,17,58,-1,67,0,42,-1,0,67,64,-1,18,10,13,-1,10,18,23,-1,32,28,48,-1,29,28,32,-1,62,31,63,-1,31,62,14,-1,58,49,65,-1,58,37,49,-1,39,67,42,-1,41,67,39,-1,63,60,62,-1,59,60,63,-1,65,43,20,-1,65,49,43,-1,16,34,38,-1,46,34,16,-1,28,55,48,-1,55,28,47,-1,13,19,18,-1,13,12,19,-1,66,64,67,-1,15,64,66,-1,15,57,64,-1,17,57,15,-1});
			return vomer_geometry_5_23_coordIndex;
		}
		/** Large attribute array: Coordinate DEF='vomer_coordinate' point field, scene-graph level=6, element #23, 204 total numbers made up of 68 3-tuple values.
		 * 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 MFVec3f getvomer_coordinate_6_23_point()
		{
			MFVec3f vomer_coordinate_6_23_point = new MFVec3f(new double[] {0.0013,1.6293,0.0648,0.0012,1.627,0.0658,0.0013,1.6238,0.0633,0.0011,1.6355,0.0375,0.0,1.6381,0.0384,0.0,1.6393,0.0421,0.0014,1.6345,0.0407,0.0016,1.625,0.0456,0.0031,1.6292,0.0397,0.0009,1.6333,0.0469,0.0011,1.6309,0.0507,0.0013,1.6241,0.0487,0.0,1.6427,0.0537,0.0011,1.6384,0.0524,0.0,1.6432,0.049,0.0006,1.6277,0.0789,0.0,1.6242,0.0831,0.0007,1.6255,0.0776,0.0014,1.6324,0.0582,0.0,1.6401,0.06,0.0,1.6206,0.0627,0.0,1.6198,0.0577,0.0014,1.6211,0.0556,0.0017,1.6253,0.057,0.0,1.6191,0.0547,0.0,1.619,0.0478,-0.0016,1.625,0.0456,0.0,1.6242,0.0459,-0.0021,1.6328,0.0365,-0.0011,1.6355,0.0375,0.0,1.6369,0.0345,-0.0009,1.6333,0.0469,-0.0014,1.6345,0.0407,-0.0013,1.6241,0.0487,-0.0006,1.625,0.0876,0.0,1.6235,0.0929,0.0,1.6261,0.088,-0.0007,1.6255,0.0776,-0.0006,1.6264,0.0836,-0.0013,1.6293,0.0647,-0.001,1.6265,0.0721,-0.0009,1.629,0.0728,0.0,1.6329,0.0652,-0.0013,1.6238,0.0633,-0.0014,1.6211,0.0556,0.0,1.6284,0.0837,0.0,1.6234,0.0869,0.0,1.6337,0.037,-0.0031,1.6292,0.0397,-0.001,1.6254,0.0713,-0.0012,1.627,0.0658,0.0006,1.6264,0.0836,0.0006,1.625,0.0877,0.0021,1.6328,0.0365,0.0,1.637,0.0339,0.0,1.6314,0.0401,0.001,1.6254,0.0713,0.001,1.6265,0.0721,0.0,1.6236,0.0777,-0.0017,1.6253,0.057,-0.0014,1.6324,0.0582,-0.0006,1.6277,0.0788,-0.0011,1.6384,0.0523,-0.0011,1.6309,0.0507,0.0009,1.629,0.0729,0.0,1.6222,0.0707,0.0,1.6302,0.0792,0.0,1.6316,0.0733});
			return vomer_coordinate_6_23_point;
		}

	/** 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 vomer 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 vomer().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: \"HumanoidAnimation.Skeleton.vomer\" 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("HumanoidAnimation.Skeleton.vomer self-validation test confirmation: ");
                if (!validationResults.equals("success"))
                    System.out.println();
                System.out.println(validationResults.trim());

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