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> *enter description here, short-sentence summaries preferred*. </p>
 <p> Related links:  source lccart2.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.lccart2&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/lccart2.x3d">lccart2.x3d</a> </td>
		</tr>
		<tr style="color:burntorange">
			<td style="text-align:right; vertical-align: text-top;"> <i> warning </i> </td>
			<td> fix naming </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> description </i> </td>
			<td> *enter description here, short-sentence summaries preferred* </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/lccart2.x3d">originals/lccart2.x3d</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> *enter reference citation or relative/online url here* </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/lccart2.x3d" target="_blank">https://www.web3d.org/x3d/content/examples/HumanoidAnimation/Skeleton/lccart2.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 lccart2
{
	/** Default constructor to create this object. */
	public lccart2 ()
	{
	  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("lccart2.x3d"))
    .addMeta(new meta().setName(meta.NAME_WARNING    ).setContent("fix naming"))
    .addMeta(new meta().setName(meta.NAME_DESCRIPTION).setContent("*enter description here, short-sentence summaries preferred*"))
    .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/lccart2.x3d"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("*enter reference citation or relative/online url here*"))
    .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/lccart2.x3d"))
    .addMeta(new meta().setName(meta.NAME_LICENSE    ).setContent("../license.html")))
  .setScene(new Scene()
    .addChild(new WorldInfo().setTitle("*TODO_add_title*"))
    .addChild(new TouchSensor().setDescription("cartilage lccart2"))
    .addChild(new Transform("lccart2")
      .addChild(new Shape()
        .setAppearance(new Appearance()
          .setMaterial(new Material("CartilageMaterial").setAmbientIntensity(0.965).setDiffuseColor(0.9843,0.949,0.7843).setShininess(0.05).setSpecularColor(0.9647,0.949,0.9098)))
        .setGeometry(new IndexedFaceSet("lccart2_geometry").setDEF("lccart2_geometry").setCreaseAngle(1.571).setCoordIndex(getlccart2_geometry_5_23_coordIndex())
          .setCoord(new Coordinate("lccart2_coordinate").setPoint(getlccart2_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='lccart2_geometry' coordIndex field, scene-graph level=5, element #23, 732 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 getlccart2_geometry_5_23_coordIndex()
		{
			MFInt32 lccart2_geometry_5_23_coordIndex = new MFInt32(new int[] {0,1,2,-1,3,4,5,-1,5,6,3,-1,7,8,9,-1,9,10,7,-1,11,12,13,-1,13,14,11,-1,15,16,17,-1,18,19,7,-1,18,20,19,-1,21,22,4,-1,21,23,22,-1,24,25,26,-1,26,27,24,-1,1,28,29,-1,1,30,28,-1,7,19,31,-1,31,8,7,-1,1,0,30,-1,32,33,34,-1,32,35,33,-1,36,37,38,-1,38,39,36,-1,40,41,42,-1,40,43,41,-1,44,45,46,-1,47,48,49,-1,50,51,37,-1,50,52,51,-1,53,54,13,-1,13,55,53,-1,56,57,58,-1,58,59,56,-1,60,61,62,-1,60,63,61,-1,15,17,64,-1,64,65,15,-1,35,66,67,-1,35,32,66,-1,68,36,69,-1,69,14,68,-1,70,71,46,-1,37,51,72,-1,72,38,37,-1,54,68,14,-1,14,13,54,-1,10,45,6,-1,73,74,75,-1,75,76,73,-1,43,77,41,-1,46,45,78,-1,79,43,40,-1,79,49,43,-1,80,31,81,-1,80,8,31,-1,82,83,5,-1,84,85,11,-1,85,86,11,-1,29,25,24,-1,29,28,25,-1,87,88,21,-1,88,23,21,-1,62,17,16,-1,5,83,18,-1,7,10,6,-1,21,4,3,-1,67,60,89,-1,2,15,0,-1,2,16,15,-1,67,90,35,-1,89,90,67,-1,60,66,63,-1,67,66,60,-1,27,91,24,-1,91,27,73,-1,92,93,87,-1,74,93,92,-1,80,69,94,-1,80,84,69,-1,35,55,33,-1,55,35,90,-1,24,95,29,-1,95,24,91,-1,39,46,78,-1,39,38,46,-1,87,96,88,-1,93,96,87,-1,85,80,81,-1,80,85,84,-1,50,54,97,-1,54,50,68,-1,53,98,99,-1,100,98,53,-1,101,49,79,-1,101,47,49,-1,76,102,103,-1,102,76,58,-1,71,75,104,-1,59,75,71,-1,103,73,76,-1,103,91,73,-1,105,41,77,-1,41,105,98,-1,97,106,107,-1,99,106,97,-1,74,104,75,-1,74,92,104,-1,3,45,44,-1,3,6,45,-1,9,39,78,-1,9,94,39,-1,102,57,108,-1,58,57,102,-1,95,79,2,-1,79,95,101,-1,40,2,79,-1,2,40,16,-1,42,16,40,-1,42,89,16,-1,53,90,100,-1,90,53,55,-1,0,65,30,-1,0,15,65,-1,17,61,64,-1,17,62,61,-1,18,82,20,-1,18,83,82,-1,100,89,42,-1,100,90,89,-1,101,91,103,-1,101,95,91,-1,59,70,56,-1,59,71,70,-1,69,39,94,-1,69,36,39,-1,44,92,3,-1,104,92,44,-1,52,97,107,-1,97,52,50,-1,106,98,105,-1,98,106,99,-1,102,48,47,-1,102,108,48,-1,46,104,44,-1,46,71,104,-1,76,59,58,-1,76,75,59,-1,47,103,102,-1,103,47,101,-1,41,100,42,-1,41,98,100,-1,54,99,97,-1,53,99,54,-1,68,37,36,-1,68,50,37,-1,33,86,34,-1,12,86,33,-1,26,93,27,-1,26,96,93,-1,4,82,5,-1,4,22,82,-1,10,78,45,-1,9,78,10,-1,46,72,70,-1,72,46,38,-1,77,49,48,-1,43,49,77,-1,29,2,1,-1,2,29,95,-1,13,33,55,-1,13,12,33,-1,11,69,84,-1,69,11,14,-1,94,8,80,-1,9,8,94,-1,5,7,6,-1,5,18,7,-1,3,87,21,-1,3,92,87,-1,74,27,93,-1,73,27,74,-1,89,62,16,-1,89,60,62,-1});
			return lccart2_geometry_5_23_coordIndex;
		}
		/** Large attribute array: Coordinate DEF='lccart2_coordinate' point field, scene-graph level=6, element #23, 327 total numbers made up of 109 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 getlccart2_coordinate_6_23_point()
		{
			MFVec3f lccart2_coordinate_6_23_point = new MFVec3f(new double[] {0.0148,1.4182,0.0449,0.015,1.4177,0.0452,0.0196,1.4152,0.0462,0.0182,1.4141,0.0399,0.0133,1.4187,0.0362,0.0129,1.4195,0.0361,0.0181,1.4158,0.039,0.0136,1.4195,0.0358,0.0136,1.4198,0.0355,0.0189,1.4181,0.0379,0.0183,1.4167,0.0385,0.0196,1.4277,0.0334,0.0195,1.4277,0.0333,0.0222,1.4234,0.0373,0.0221,1.4235,0.0366,0.0149,1.4183,0.0448,0.0198,1.4162,0.0454,0.0152,1.4184,0.0445,0.0127,1.4196,0.036,0.0136,1.4195,0.0358,0.013,1.4196,0.0361,0.0132,1.4182,0.0363,0.0133,1.4186,0.0362,0.0133,1.4183,0.0364,0.0162,1.4054,0.05,0.016,1.4055,0.0498,0.0173,1.4043,0.0476,0.0176,1.404,0.0477,0.0146,1.4105,0.0488,0.0147,1.4106,0.049,0.0148,1.418,0.0448,0.0135,1.4199,0.0355,0.0177,1.4242,0.0385,0.0189,1.4267,0.0354,0.0186,1.4265,0.0354,0.0179,1.4244,0.0386,0.0247,1.4204,0.0384,0.0384,1.4182,0.0398,0.0375,1.4169,0.0398,0.024,1.4192,0.0386,0.0238,1.4145,0.046,0.0381,1.4147,0.0455,0.0244,1.4163,0.0445,0.0377,1.4135,0.0462,0.0228,1.4138,0.0406,0.0227,1.4142,0.0404,0.0365,1.412,0.0413,0.0381,1.4093,0.0479,0.0523,1.4104,0.0461,0.0378,1.4118,0.047,0.0388,1.4188,0.0403,0.0474,1.418,0.0388,0.048,1.4188,0.0398,0.0252,1.4202,0.0402,0.0252,1.4209,0.0389,0.0219,1.4224,0.0389,0.05,1.4077,0.0429,0.0524,1.4073,0.0456,0.0394,1.4055,0.0474,0.038,1.4064,0.0448,0.0154,1.4194,0.0437,0.0151,1.4185,0.0442,0.0152,1.4185,0.0444,0.0153,1.4192,0.0436,0.0151,1.4183,0.0444,0.0148,1.4181,0.0447,0.0154,1.4194,0.0435,0.0154,1.4195,0.0436,0.0252,1.4208,0.0388,0.0214,1.4228,0.0364,0.0479,1.4108,0.0401,0.0367,1.4096,0.0424,0.0471,1.4169,0.0385,0.0208,1.4055,0.0473,0.0197,1.4069,0.0448,0.0247,1.4065,0.0449,0.0258,1.4057,0.0473,0.0512,1.4138,0.0448,0.0227,1.4146,0.0402,0.0239,1.4133,0.0468,0.0167,1.4256,0.0331,0.0165,1.4255,0.0333,0.013,1.4195,0.0361,0.0127,1.4196,0.036,0.0183,1.4273,0.0326,0.0182,1.4273,0.0328,0.0191,1.4275,0.0333,0.0124,1.4113,0.0402,0.0124,1.4114,0.0403,0.0203,1.4179,0.0439,0.0212,1.4204,0.0413,0.0207,1.4066,0.0488,0.0186,1.4104,0.0421,0.0141,1.4058,0.0436,0.0202,1.4209,0.0369,0.02,1.4099,0.0485,0.0141,1.4059,0.0437,0.039,1.419,0.0408,0.0383,1.4174,0.0434,0.0388,1.4187,0.0415,0.0249,1.4186,0.0424,0.0243,1.4095,0.0485,0.0393,1.4066,0.0482,0.0254,1.4065,0.0486,0.0231,1.41,0.0426,0.0496,1.4175,0.0425,0.0485,1.419,0.0407,0.0485,1.419,0.0406,0.0528,1.4081,0.0461});
			return lccart2_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 lccart2 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 lccart2().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.lccart2\" 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.lccart2 self-validation test confirmation: ");
                if (!validationResults.equals("success"))
                    System.out.println();
                System.out.println(validationResults.trim());

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