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.Navigation.*;
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> usage examples <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_4_0)
  .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("usage examples 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*"))
    .addComments(" user hovering reveals description, user selection/deselection temporarily binds/unbinds a hidden close-up viewpoint ")
    .addChild(new TouchSensor("UserTouchSensor").setDescription("cartilage rccart"))
    .addChild(new Transform("rccart").setTranslation(-0.0391,1.4470,0.0185)
      .addChild(new Viewpoint("HiddenViewpoint").setNearDistance(0.001).setPosition(0.0,0.0,0.3)
        .setNavigationInfo(new NavigationInfo().setTransitionType(new String[] {"ANIMATE"}).setType(new String[] {"EXAMINE"})))
      .addChild(new ROUTE().setFromNode("UserTouchSensor").setFromField("isActive").setToNode("HiddenViewpoint").setToField("set_bind"))
      .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_25_coordIndex())
          .setCoord(new Coordinate("rccart_coordinate").setPoint(getrccart_coordinate_6_25_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 #25, 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_25_coordIndex()
		{
			MFInt32 rccart_geometry_5_25_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_25_coordIndex;
		}
		/** Large attribute array: Coordinate DEF='rccart_coordinate' point field, scene-graph level=6, element #25, 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_25_point()
		{
			MFVec3f rccart_coordinate_6_25_point = new MFVec3f(new double[] {0.0111,-0.0082,0.0034,0.0110,-0.0082,0.0034,0.0108,-0.0077,0.0020,0.0110,-0.0076,0.0020,0.0112,-0.0081,0.0035,0.0111,-0.0082,0.0034,0.0055,0.0048,-0.0030,0.0047,0.0055,-0.0021,0.0047,0.0052,-0.0020,0.0055,0.0050,-0.0033,0.0038,0.0054,-0.0047,0.0072,0.0020,-0.0036,0.0040,0.0042,-0.0049,-0.0101,-0.0088,0.0053,-0.0110,-0.0098,0.0044,-0.0037,-0.0091,0.0057,-0.0037,-0.0082,0.0066,0.0018,0.0074,-0.0029,0.0028,0.0073,-0.0042,-0.0003,0.0092,-0.0053,-0.0013,0.0087,-0.0039,0.0004,0.0071,-0.0005,0.0011,0.0074,-0.0018,-0.0018,0.0082,-0.0030,-0.0025,0.0074,-0.0017,-0.0038,0.0096,-0.0056,-0.0044,0.0084,-0.0046,0.0026,0.0060,0.0008,0.0037,0.0060,-0.0009,-0.0015,-0.0074,0.0012,0.0054,-0.0065,0.0007,0.0050,-0.0077,0.0023,-0.0006,-0.0053,-0.0007,-0.0049,-0.0026,0.0050,-0.0093,-0.0068,0.0053,-0.0044,-0.0065,0.0064,-0.0084,-0.0036,0.0039,0.0109,-0.0086,0.0058,0.0096,-0.0082,0.0071,0.0032,-0.0081,0.0072,0.0038,-0.0087,0.0061,0.0021,0.0060,0.0016,-0.0003,0.0066,0.0004,0.0020,0.0060,0.0019,-0.0006,0.0061,0.0009,-0.0035,0.0102,-0.0065,-0.0052,0.0069,-0.0030,-0.0028,0.0069,-0.0013,-0.0033,0.0099,-0.0069,0.0003,0.0080,-0.0059,0.0074,0.0017,-0.0034,0.0111,-0.0085,0.0058,0.0098,-0.0080,0.0069,0.0109,-0.0053,-0.0002,0.0110,-0.0053,-0.0001,0.0083,-0.0016,-0.0028,0.0092,-0.0035,-0.0018,0.0092,-0.0035,-0.0019,0.0083,-0.0016,-0.0027,0.0026,-0.0013,0.0058,0.0026,-0.0013,0.0060,0.0057,-0.0069,0.0070,0.0062,-0.0066,0.0068,0.0014,0.0017,0.0049,0.0016,0.0047,0.0032,0.0016,0.0049,0.0033,0.0014,0.0017,0.0047,-0.0064,-0.0043,-0.0021,-0.0079,-0.0071,-0.0001,-0.0098,-0.0092,0.0017,-0.0032,-0.0092,0.0034,-0.0105,-0.0101,0.0027,-0.0026,-0.0086,0.0025,0.0040,-0.0086,0.0036,0.0109,-0.0087,0.0058,0.0038,-0.0089,0.0058,0.0043,-0.0082,0.0031,0.0057,-0.0040,-0.0015,0.0048,-0.0017,-0.0032,0.0045,0.0006,-0.0042,0.0003,-0.0029,-0.0027,0.0001,-0.0002,-0.0042,0.0002,0.0025,-0.0054,0.0003,0.0063,-0.0062,-0.0013,0.0044,0.0028,-0.0032,0.0059,-0.0003,-0.0042,0.0037,0.0019,-0.0047,0.0007,0.0037,-0.0069,0.0027,0.0008,-0.0076,-0.0001,0.0026,-0.0010,-0.0018,0.0057,0.0008,-0.0065,0.0070,-0.0037,-0.0095,0.0051,-0.0052,0.0069,-0.0030,-0.0015,0.0014,0.0044,-0.0033,0.0083,-0.0072,-0.0052,-0.0019,-0.0037,-0.0044,0.0012,-0.0053,-0.0039,0.0043,-0.0065,-0.0057,0.0055,-0.0018,-0.0112,-0.0103,0.0037,0.0038,0.0056,-0.0008,0.0028,0.0057,0.0008,0.0021,0.0057,0.0019,0.0023,0.0057,0.0015});
			return rccart_coordinate_6_25_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);
        }
    }
}
