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 lccart.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.lccart&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/lccart.x3d">lccart.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/lccart.x3d">originals/lccart.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/lccart.x3d" target="_blank">https://www.web3d.org/x3d/content/examples/HumanoidAnimation/Skeleton/lccart.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 lccart
{
	/** Default constructor to create this object. */
	public lccart ()
	{
	  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("lccart.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/lccart.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/lccart.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 lccart"))
    .addChild(new Transform("lccart")
      .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("lccart_geometry").setDEF("lccart_geometry").setCreaseAngle(1.571).setCoordIndex(getlccart_geometry_5_23_coordIndex())
          .setCoord(new Coordinate("lccart_coordinate").setPoint(getlccart_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='lccart_geometry' coordIndex field, scene-graph level=5, element #23, 676 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 getlccart_geometry_5_23_coordIndex()
		{
			MFInt32 lccart_geometry_5_23_coordIndex = new MFInt32(new int[] {0,1,2,-1,1,3,2,-1,4,5,6,-1,6,7,4,-1,8,9,10,-1,10,11,8,-1,12,13,14,-1,13,15,14,-1,16,17,18,-1,16,19,17,-1,20,21,22,-1,20,23,21,-1,20,24,18,-1,20,25,24,-1,21,26,27,-1,27,28,21,-1,23,29,26,-1,26,21,23,-1,30,31,15,-1,15,13,30,-1,32,33,19,-1,33,17,19,-1,34,35,36,-1,35,37,36,-1,4,38,39,-1,4,7,38,-1,17,29,23,-1,17,33,29,-1,24,40,16,-1,16,18,24,-1,18,23,20,-1,18,17,23,-1,41,42,12,-1,12,14,41,-1,43,2,44,-1,45,3,1,-1,45,32,3,-1,5,46,47,-1,46,48,47,-1,47,49,5,-1,49,6,5,-1,50,51,52,-1,50,53,51,-1,54,55,30,-1,55,56,30,-1,57,58,55,-1,55,54,57,-1,27,26,59,-1,26,60,59,-1,61,62,63,-1,63,64,61,-1,6,65,66,-1,6,49,65,-1,30,67,31,-1,30,56,67,-1,32,68,33,-1,32,45,68,-1,69,70,71,-1,39,70,69,-1,72,73,74,-1,75,73,72,-1,48,76,77,-1,48,46,76,-1,61,78,66,-1,78,61,79,-1,2,80,64,-1,80,2,43,-1,7,81,38,-1,7,78,81,-1,80,82,79,-1,82,80,83,-1,44,84,43,-1,84,44,10,-1,85,86,87,-1,85,88,86,-1,89,85,90,-1,85,89,91,-1,92,57,54,-1,93,57,92,-1,41,72,74,-1,72,41,14,-1,35,12,42,-1,12,35,34,-1,94,91,89,-1,91,94,22,-1,16,8,11,-1,16,40,8,-1,95,36,37,-1,36,95,87,-1,96,75,72,-1,96,77,75,-1,96,31,97,-1,15,31,96,-1,76,39,69,-1,39,76,4,-1,38,98,99,-1,81,98,38,-1,52,88,50,-1,88,52,86,-1,13,54,30,-1,92,54,13,-1,28,50,88,-1,28,27,50,-1,100,10,44,-1,100,11,10,-1,83,101,82,-1,83,102,101,-1,93,52,57,-1,86,52,93,-1,84,102,83,-1,84,103,102,-1,82,98,81,-1,82,101,98,-1,77,69,75,-1,77,76,69,-1,10,103,84,-1,10,9,103,-1,87,93,36,-1,87,86,93,-1,22,25,20,-1,22,94,25,-1,22,28,91,-1,22,21,28,-1,19,11,100,-1,11,19,16,-1,14,96,72,-1,14,15,96,-1,12,92,13,-1,34,92,12,-1,34,93,92,-1,34,36,93,-1,90,87,95,-1,87,90,85,-1,91,88,85,-1,91,28,88,-1,43,83,80,-1,83,43,84,-1,79,81,78,-1,81,79,82,-1,64,79,61,-1,79,64,80,-1,3,44,2,-1,44,3,100,-1,66,7,6,-1,7,66,78,-1,5,76,46,-1,76,5,4,-1,97,77,96,-1,97,48,77,-1,75,71,73,-1,69,71,75,-1,39,99,70,-1,38,99,39,-1,32,100,3,-1,19,100,32,-1,29,60,26,-1,29,104,60,-1,67,48,97,-1,67,47,48,-1,61,65,62,-1,66,65,61,-1,64,0,2,-1,64,63,0,-1,51,57,52,-1,51,58,57,-1,59,50,27,-1,59,53,50,-1,33,104,29,-1,33,68,104,-1});
			return lccart_geometry_5_23_coordIndex;
		}
		/** Large attribute array: Coordinate DEF='lccart_coordinate' point field, scene-graph level=6, element #23, 315 total numbers made up of 105 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 getlccart_coordinate_6_23_point()
		{
			MFVec3f lccart_coordinate_6_23_point = new MFVec3f(new double[] {0.0317,1.4487,0.0151,0.0336,1.4518,0.0155,0.0318,1.449,0.0149,0.0335,1.452,0.0152,0.0341,1.4393,0.0208,0.0281,1.4388,0.0219,0.0283,1.4393,0.0205,0.0337,1.4405,0.0192,0.0425,1.4572,0.012,0.0424,1.4569,0.0116,0.0388,1.455,0.0126,0.0394,1.4562,0.0132,0.0427,1.4388,0.0251,0.0359,1.4389,0.0257,0.0427,1.4379,0.0242,0.0353,1.4383,0.0246,0.0404,1.4557,0.0146,0.038,1.4544,0.0167,0.0408,1.4552,0.0155,0.0373,1.4544,0.0156,0.0415,1.4544,0.0168,0.0394,1.4536,0.0189,0.0419,1.4539,0.0172,0.0386,1.4541,0.018,0.0435,1.4554,0.0139,0.0442,1.4539,0.0155,0.0369,1.453,0.0201,0.0371,1.453,0.0204,0.0396,1.4531,0.0194,0.0364,1.453,0.0193,0.0295,1.4388,0.0256,0.0282,1.4384,0.0243,0.0344,1.4525,0.0164,0.0354,1.453,0.0176,0.0435,1.4405,0.0249,0.0484,1.4402,0.0238,0.0439,1.4444,0.0235,0.0475,1.4434,0.0224,0.0396,1.4417,0.0178,0.0406,1.4396,0.0197,0.0429,1.4566,0.0129,0.0501,1.4372,0.0229,0.0492,1.4382,0.0238,0.0351,1.4512,0.0136,0.0353,1.4524,0.0138,0.0344,1.4522,0.0165,0.028,1.4388,0.0219,0.0279,1.4389,0.022,0.028,1.4388,0.0219,0.0281,1.4394,0.0205,0.0375,1.4519,0.0218,0.0376,1.4487,0.0232,0.0377,1.4487,0.0234,0.0374,1.4517,0.0217,0.0334,1.4401,0.0255,0.0329,1.4404,0.0253,0.0293,1.439,0.0254,0.0365,1.4457,0.0245,0.0364,1.4457,0.0243,0.037,1.4527,0.0204,0.0367,1.4527,0.02,0.0299,1.4435,0.0166,0.0299,1.4435,0.0167,0.0307,1.4454,0.0158,0.0307,1.4454,0.0157,0.0281,1.4417,0.0184,0.0282,1.4417,0.0183,0.028,1.4385,0.0243,0.0353,1.4526,0.0177,0.0417,1.4384,0.021,0.047,1.4399,0.0184,0.0488,1.4378,0.0202,0.0428,1.4375,0.0236,0.0496,1.4369,0.0212,0.0502,1.4367,0.0222,0.0423,1.4378,0.0219,0.0347,1.4388,0.0216,0.035,1.4384,0.0221,0.0333,1.443,0.017,0.0343,1.4453,0.0153,0.0346,1.4476,0.0143,0.0388,1.4441,0.0158,0.039,1.4468,0.0143,0.0389,1.4495,0.0131,0.0388,1.4533,0.0123,0.0432,1.4507,0.0204,0.0406,1.4484,0.0229,0.0438,1.4477,0.0222,0.0403,1.4514,0.0213,0.0448,1.4525,0.0167,0.0459,1.4497,0.0193,0.0423,1.4529,0.0182,0.0383,1.4405,0.0255,0.0401,1.4452,0.0242,0.0442,1.4539,0.0155,0.0466,1.4469,0.0211,0.0353,1.4381,0.0243,0.0282,1.4383,0.0243,0.0442,1.4451,0.0148,0.0454,1.4427,0.0164,0.0363,1.4543,0.0143,0.0435,1.4482,0.0132,0.043,1.4513,0.012,0.0424,1.4553,0.0113,0.0363,1.4527,0.0193});
			return lccart_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 lccart 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 lccart().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.lccart\" 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.lccart self-validation test confirmation: ");
                if (!validationResults.equals("success"))
                    System.out.println();
                System.out.println(validationResults.trim());

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