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

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