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

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