<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">package X3dForAdvancedModeling.SanCarlosCathedral;

import org.web3d.x3d.jsail.Core.*;
import org.web3d.x3d.jsail.EnvironmentalEffects.*;
import org.web3d.x3d.jsail.EventUtilities.*;
import org.web3d.x3d.jsail.fields.*;
import org.web3d.x3d.jsail.Geometry3D.*;
import org.web3d.x3d.jsail.Grouping.*;
import org.web3d.x3d.jsail.Interpolation.*;
import org.web3d.x3d.jsail.PointingDeviceSensor.*;
import org.web3d.x3d.jsail.Shape.*;
import org.web3d.x3d.jsail.Sound.*;
import org.web3d.x3d.jsail.Time.*;

// Javadoc metadata annotations follow, see below for X3DJSAIL Java source code.
/**
 * &lt;p&gt; Bell for San Carlos Cathedral. &lt;/p&gt;
 &lt;p&gt; Related links: Catalog page &lt;a href="../../../SanCarlosCathedral/BellIndex.html" target="_blank"&gt;Bell&lt;/a&gt;,  source &lt;a href="../../../SanCarlosCathedral/Bell.java"&gt;Bell.java&lt;/a&gt;, &lt;a href="https://www.web3d.org/x3d/content/examples/X3dResources.html" target="_blank"&gt;X3D Resources&lt;/a&gt;, &lt;a href="https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html" target="_blank"&gt;X3D Scene Authoring Hints&lt;/a&gt;, and &lt;a href="https://www.web3d.org/x3d/content/X3dTooltips.html" target="_blank"&gt;X3D Tooltips&lt;/a&gt;. &lt;/p&gt;
	&lt;table style="color:black; border:0px solid; border-spacing:10px 0px;"&gt;
        &lt;caption&gt;Scene Meta Information&lt;/caption&gt;
		&lt;tr style="background-color:silver; border-color:silver;"&gt;
			&lt;td style="text-align:center; padding:10px 0px;"&gt;&lt;i&gt;meta tags&lt;/i&gt;&lt;/td&gt;
			&lt;td style="text-align:left;   padding:10px 0px;"&gt;&amp;nbsp; Document Metadata &lt;/td&gt;
		&lt;/tr&gt;

		&lt;tr&gt;
			&lt;td style="text-align:right; vertical-align: text-top;"&gt; &lt;i&gt; title &lt;/i&gt; &lt;/td&gt;
			&lt;td&gt; &lt;a href="../../../SanCarlosCathedral/Bell.x3d"&gt;Bell.x3d&lt;/a&gt; &lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td style="text-align:right; vertical-align: text-top;"&gt; &lt;i&gt; description &lt;/i&gt; &lt;/td&gt;
			&lt;td&gt; Bell for San Carlos Cathedral &lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td style="text-align:right; vertical-align: text-top;"&gt; &lt;i&gt; creator &lt;/i&gt; &lt;/td&gt;
			&lt;td&gt; Michele Foti &lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td style="text-align:right; vertical-align: text-top;"&gt; &lt;i&gt; created &lt;/i&gt; &lt;/td&gt;
			&lt;td&gt; 8 March 2012 &lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td style="text-align:right; vertical-align: text-top;"&gt; &lt;i&gt; modified &lt;/i&gt; &lt;/td&gt;
			&lt;td&gt; 8 December 2024 &lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td style="text-align:right; vertical-align: text-top;"&gt; &lt;i&gt; TODO &lt;/i&gt; &lt;/td&gt;
			&lt;td&gt; update bell sound with proper recording of actual bells at San Carlos &lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td style="text-align:right; vertical-align: text-top;"&gt; &lt;i&gt; reference &lt;/i&gt; &lt;/td&gt;
			&lt;td&gt; &lt;a href="../../../SanCarlosCathedral/TODO.html"&gt;TODO.html&lt;/a&gt; &lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td style="text-align:right; vertical-align: text-top;"&gt; &lt;i&gt; TODO &lt;/i&gt; &lt;/td&gt;
			&lt;td&gt; invert geometry? &lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td style="text-align:right; vertical-align: text-top;"&gt; &lt;i&gt; reference &lt;/i&gt; &lt;/td&gt;
			&lt;td&gt; &lt;a href="http://www.sancarloscathedral.net" target="_blank"&gt;http://www.sancarloscathedral.net&lt;/a&gt; &lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td style="text-align:right; vertical-align: text-top;"&gt; &lt;i&gt; reference &lt;/i&gt; &lt;/td&gt;
			&lt;td&gt; &lt;a href="../../../SanCarlosCathedral/RoyalPresidioChapelHistoricalReferences.pdf"&gt;RoyalPresidioChapelHistoricalReferences.pdf&lt;/a&gt; &lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td style="text-align:right; vertical-align: text-top;"&gt; &lt;i&gt; reference &lt;/i&gt; &lt;/td&gt;
			&lt;td&gt; &lt;a href="../../../SanCarlosCathedral/CulturalHeritageProjectSanCarlosCathedral.pdf"&gt;CulturalHeritageProjectSanCarlosCathedral.pdf&lt;/a&gt; &lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td style="text-align:right; vertical-align: text-top;"&gt; &lt;i&gt; reference &lt;/i&gt; &lt;/td&gt;
			&lt;td&gt; originals/ &lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td style="text-align:right; vertical-align: text-top;"&gt; &lt;i&gt; reference &lt;/i&gt; &lt;/td&gt;
			&lt;td&gt; &lt;a href="../../../SanCarlosCathedral/originals/ModelSanCarlosChurchFeb-3-2012.x3d"&gt;originals/ModelSanCarlosChurchFeb-3-2012.x3d&lt;/a&gt; &lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr style="color:burntorange"&gt;
			&lt;td style="text-align:right; vertical-align: text-top;"&gt; &lt;i&gt; warning &lt;/i&gt; &lt;/td&gt;
			&lt;td&gt; under development &lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td style="text-align:right; vertical-align: text-top;"&gt; &lt;i&gt; reference &lt;/i&gt; &lt;/td&gt;
			&lt;td&gt; &lt;a href="https://www.audiomicro.com/church-bell-horns-bells-church-bell-free-sound-effects-45577" target="_blank"&gt;https://www.audiomicro.com/church-bell-horns-bells-church-bell-free-sound-effects-45577&lt;/a&gt; &lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td style="text-align:right; vertical-align: text-top;"&gt; &lt;i&gt; generator &lt;/i&gt; &lt;/td&gt;
			&lt;td&gt; Audacity, &lt;a href="https://audacity.sourceforge.net" target="_blank"&gt;https://audacity.sourceforge.net&lt;/a&gt; &lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td style="text-align:right; vertical-align: text-top;"&gt; &lt;i&gt; identifier &lt;/i&gt; &lt;/td&gt;
			&lt;td&gt; &lt;a href="https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/SanCarlosCathedral/Bell.x3d" target="_blank"&gt;https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/SanCarlosCathedral/Bell.x3d&lt;/a&gt; &lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td style="text-align:right; vertical-align: text-top;"&gt; &lt;i&gt; generator &lt;/i&gt; &lt;/td&gt;
			&lt;td&gt; X3D-Edit 3.3, &lt;a href="https://savage.nps.edu/X3D-Edit" target="_blank"&gt;https://savage.nps.edu/X3D-Edit&lt;/a&gt; &lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td style="text-align:right; vertical-align: text-top;"&gt; &lt;i&gt; license &lt;/i&gt; &lt;/td&gt;
			&lt;td&gt; &lt;a href="../../../SanCarlosCathedral/../license.html"&gt;../license.html&lt;/a&gt; &lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr style="background-color:silver; border-color:silver;"&gt;
			&lt;td style="text-align:center;" colspan="2"&gt;  &amp;nbsp; &lt;/td&gt;
		&lt;/tr&gt;
	&lt;/table&gt;

	&lt;p&gt;
		This program uses the
		&lt;a href="https://www.web3d.org/specifications/java/X3DJSAIL.html" target="_blank"&gt;X3D Java Scene Access Interface Library (X3DJSAIL)&lt;/a&gt;.
		It has been produced using the 
		&lt;a href="https://www.web3d.org/x3d/stylesheets/X3dToJava.xslt" target="_blank"&gt;X3dToJava.xslt&lt;/a&gt;
		stylesheet
	       (&lt;a href="https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/X3dToJava.xslt" target="_blank"&gt;version control&lt;/a&gt;)
                which is used to create Java source code from an original &lt;code&gt;.x3d&lt;/code&gt; model.
	&lt;/p&gt;

	* @author Michele Foti
 */

public class Bell
{
	/** Default constructor to create this object. */
	public Bell ()
	{
	  initialize();
	}

	/** Create and initialize the X3D model for this object. */
	public final void initialize()
	{
            try { // catch-all
  x3dModel = new X3D().setProfile(X3D.PROFILE_IMMERSIVE).setVersion(X3D.VERSION_3_3)
  .setHead(new head()
    .addMeta(new meta().setName(meta.NAME_TITLE      ).setContent("Bell.x3d"))
    .addMeta(new meta().setName(meta.NAME_DESCRIPTION).setContent("Bell for San Carlos Cathedral"))
    .addMeta(new meta().setName(meta.NAME_CREATOR    ).setContent("Michele Foti"))
    .addMeta(new meta().setName(meta.NAME_CREATED    ).setContent("8 March 2012"))
    .addMeta(new meta().setName(meta.NAME_MODIFIED   ).setContent("8 December 2024"))
    .addMeta(new meta().setName(meta.NAME_TODO       ).setContent("update bell sound with proper recording of actual bells at San Carlos"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("TODO.html"))
    .addMeta(new meta().setName(meta.NAME_TODO       ).setContent("invert geometry?"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("http://www.sancarloscathedral.net"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("RoyalPresidioChapelHistoricalReferences.pdf"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("CulturalHeritageProjectSanCarlosCathedral.pdf"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("originals/"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("originals/ModelSanCarlosChurchFeb-3-2012.x3d"))
    .addMeta(new meta().setName(meta.NAME_WARNING    ).setContent("under development"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("https://www.audiomicro.com/church-bell-horns-bells-church-bell-free-sound-effects-45577"))
    .addMeta(new meta().setName(meta.NAME_GENERATOR  ).setContent("Audacity, https://audacity.sourceforge.net"))
    .addMeta(new meta().setName(meta.NAME_IDENTIFIER ).setContent("https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/SanCarlosCathedral/Bell.x3d"))
    .addMeta(new meta().setName(meta.NAME_GENERATOR  ).setContent("X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit"))
    .addMeta(new meta().setName(meta.NAME_LICENSE    ).setContent("../license.html")))
  .setScene(new Scene()
    .addChild(new WorldInfo().setTitle("Bell.x3d"))
    .addChild(new Background().setSkyColor(new MFColor(new double[] {1.0,1.0,1.0})))
    .addChild(new Transform("Bell").setRotation(0.0,1.0,0.0,-1.57).setTranslation(0.75,-0.8,0.0)
      .addComments(" Bell shape ")
      .addChild(new TouchSensor("TouchButton").setDescription("touch to activate"))
      .addChild(new Transform("BellShape").setCenter(0.0,0.55,0.0).setScale(4.2,1.2,4.2).setTranslation(-0.14,0.55,0.75)
        .addChild(new Shape()
          .setGeometry(new Extrusion().setBeginCap(false).setConvex(false).setCreaseAngle(1.57).setCrossSection(getExtrusion_6_24_crossSection()).setScale(new MFVec2f(new double[] {1.0,1.0,0.9,0.9,0.8,0.8,0.73,0.73,0.68,0.68,0.65,0.65,0.595,0.595,0.5,0.5})).setSolid(false).setSpine(new MFVec3f(new double[] {0.0,0.0,0.0,0.0,0.08,0.0,0.0,0.1,0.0,0.0,0.183,0.0,0.0,0.266,0.0,0.0,0.35,0.0,0.0,0.6,0.0,0.0,0.65,0.0})))
          .setAppearance(new Appearance()
            .setMaterial(new Material("BellColor").setDiffuseColor(0.6,0.6,0.6)))))
      .addComments(" Support ")
      .addChild(new Transform("BellSupport").setRotation(0.0,1.0,0.0,1.57).setScale(1.12,0.85,0.85).setTranslation(-0.15,0.27,-0.286)
        .addChild(new Transform("BellSupportOrizzontal").setRotation(0.0,0.0,1.0,1.57).setTranslation(-0.92,0.975,0.0)
          .addChild(new Shape()
            .setGeometry(new Cylinder().setHeight(1.5).setRadius(0.05))
            .setAppearance(new Appearance()
              .setMaterial(new Material("Gray1").setDiffuseColor(0.333,0.266,0.274)))))
        .addChild(new Transform("BellSupportArc").setTranslation(0.0,-0.05,0.0)
          .addChild(new Transform("BellSupportArc1").setTranslation(-0.93,1.37,0.0)
            .addChild(new Shape()
              .setGeometry(new Box().setSize(0.553,0.07,0.07))
              .setAppearance(new Appearance()
                .setMaterial(new Material().setUSE("Gray1")))))
          .addChild(new Transform("BellSupportArc2").setRotation(0.0,0.0,1.0,0.785).setTranslation(-1.25,1.31,0.0)
            .addChild(new Shape()
              .setGeometry(new Box().setSize(0.2,0.07,0.07))
              .setAppearance(new Appearance()
                .setMaterial(new Material().setUSE("Gray1")))))
          .addChild(new Transform("BellSupportArc3").setRotation(0.0,0.0,1.0,1.57).setTranslation(-1.31,1.163,0.0)
            .addChild(new Shape()
              .setGeometry(new Box().setSize(0.2,0.07,0.07))
              .setAppearance(new Appearance()
                .setMaterial(new Material().setUSE("Gray1")))))
          .addChild(new Transform("BellSupportArc4").setRotation(0.0,0.0,1.0,-0.785).setTranslation(-0.61,1.31,0.0)
            .addChild(new Shape()
              .setGeometry(new Box().setSize(0.2,0.07,0.07))
              .setAppearance(new Appearance()
                .setMaterial(new Material().setUSE("Gray1")))))
          .addChild(new Transform("BellSupportArc5").setRotation(0.0,0.0,1.0,1.57).setTranslation(-0.55,1.163,0.0)
            .addChild(new Shape()
              .setGeometry(new Box().setSize(0.2,0.07,0.07))
              .setAppearance(new Appearance()
                .setMaterial(new Material().setUSE("Gray1")))))))
      .addComments(" Clapper ")
      .addChild(new Transform("BellClapper").setCenter(0.0,0.2,0.0).setTranslation(-0.15,0.87,0.75)
        .addChild(new Transform("BellClapper1")
          .addChild(new Shape()
            .setGeometry(new Cylinder().setHeight(0.4).setRadius(0.03))
            .setAppearance(new Appearance()
              .setMaterial(new Material("BellColor2").setDiffuseColor(0.558,0.500,0.500)))))
        .addChild(new Transform("BellClapper2").setTranslation(0.0,-0.2,0.0)
          .addChild(new Shape()
            .setGeometry(new Sphere().setRadius(0.05))
            .setAppearance(new Appearance()
              .setMaterial(new Material().setUSE("BellColor2"))))))
      .addChild(new Sound().setLocation(0.0,0.5,0.0)
        .addComments(" TODO update sound source using actual San Carlos recording ")
        .addComments(" This bell recording is 3 seconds and matches our TimeSensor cycleInterval ")
        .setSource(new AudioClip("ChurchBellOneTime").setDescription("Church bell tolling").setUrl(new String[] {"ChurchBellOneTime.wav","https://www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/SanCarlosCathedral/ChurchBellOneTime.wav"})))
      .addComments(" Animation ")
      .addChild(new BooleanToggle("Toggler"))
      .addChild(new ROUTE().setFromNode("TouchButton").setFromField("isActive").setToNode("Toggler").setToField("set_boolean"))
      .addChild(new TimeSensor("TimeSensor").setCycleInterval(3))
      .addChild(new ROUTE().setFromNode("Toggler").setFromField("toggle_changed").setToNode("TimeSensor").setToField("loop"))
      .addChild(new ROUTE().setFromNode("TimeSensor").setFromField("cycleTime").setToNode("ChurchBellOneTime").setToField("startTime"))
      .addChild(new OrientationInterpolator("RotateBell").setKey(new double[] {0.0,0.10,0.20,0.30,0.40,0.50,0.60,0.70,0.80,0.90,1.0}).setKeyValue(new MFRotation(new double[] {0.0,0.0,1.0,0.0,0.0,0.0,1.0,-0.5,0.0,0.0,1.0,-0.7,0.0,0.0,1.0,-0.9,0.0,0.0,1.0,-1.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,1.0,0.0,0.0,1.0,0.9,0.0,0.0,1.0,0.7,0.0,0.0,1.0,0.2,0.0,0.0,1.0,0.0})))
      .addChild(new OrientationInterpolator("RotateClapper").setKey(new double[] {0.0,0.05,0.1,0.15,0.25,0.35,0.48,0.52,0.55,0.64,0.70,0.75,0.80,0.90,1.0}).setKeyValue(new MFRotation(new double[] {0.0,0.0,1.0,0.0,0.0,0.0,1.0,-0.5,0.0,0.0,1.0,-0.8,0.0,0.0,1.0,-0.8,0.0,0.0,1.0,-1.0,0.0,0.0,1.0,-0.5,0.0,0.0,1.0,0.3,0.0,0.0,1.0,0.8,0.0,0.0,1.0,1.6,0.0,0.0,1.0,2.1,0.0,0.0,1.0,1.5,0.0,0.0,1.0,1.0,0.0,0.0,1.0,0.4,0.0,0.0,1.0,0.2,0.0,0.0,1.0,0.0})))
      .addChild(new ROUTE().setFromNode("TimeSensor").setFromField("fraction_changed").setToNode("RotateClapper").setToField("set_fraction"))
      .addChild(new ROUTE().setFromNode("TimeSensor").setFromField("fraction_changed").setToNode("RotateBell").setToField("set_fraction"))
      .addChild(new ROUTE().setFromNode("RotateBell").setFromField("value_changed").setToNode("BellShape").setToField("rotation"))
      .addChild(new ROUTE().setFromNode("RotateClapper").setFromField("value_changed").setToNode("BellClapper").setToField("rotation"))));
            }
            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: Extrusion crossSection field, scene-graph level=6, element #24, 166 total numbers made up of 83 2-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 MFVec2f getExtrusion_6_24_crossSection()
		{
			MFVec2f Extrusion_6_24_crossSection = new MFVec2f(new double[] {0.142,0.0,0.141822,0.0071,0.141288,0.0142,0.140393,0.0213,0.139131,0.0284,0.137491,0.0355,0.135459,0.0426,0.133018,0.0497,0.130145,0.0568,0.12681,0.0639,0.122976,0.071,0.118593,0.0781,0.1136,0.0852,0.107911,0.0923,0.101408,0.0994,0.093924,0.1065,0.0852,0.1136,0.074803,0.1207,0.061896,0.1278,0.044339,0.1349,0.0,0.142,-0.0,0.142,-0.044339,0.1349,-0.061896,0.1278,-0.074803,0.1207,-0.0852,0.1136,-0.093924,0.1065,-0.101408,0.0994,-0.107911,0.0923,-0.1136,0.0852,-0.118593,0.0781,-0.122976,0.071,-0.12681,0.0639,-0.130145,0.0568,-0.133018,0.0497,-0.135459,0.0426,-0.137491,0.0355,-0.139131,0.0284,-0.140393,0.0213,-0.141288,0.0142,-0.141822,0.0071,-0.142,0.0,-0.142,0.0,-0.1349,-0.044339,-0.1278,-0.061896,-0.1207,-0.074803,-0.1136,-0.0852,-0.1065,-0.093924,-0.0994,-0.101408,-0.0923,-0.107911,-0.0852,-0.1136,-0.0781,-0.118593,-0.071,-0.122976,-0.0639,-0.12681,-0.0568,-0.130145,-0.0497,-0.133018,-0.0426,-0.135459,-0.0355,-0.137491,-0.0284,-0.139131,-0.0213,-0.140393,-0.0142,-0.141288,-0.0071,-0.141822,0.0,-0.142,0.044339,-0.1349,0.061896,-0.1278,0.074803,-0.1207,0.0852,-0.1136,0.093924,-0.1065,0.101408,-0.0994,0.107911,-0.0923,0.1136,-0.0852,0.118593,-0.0781,0.122976,-0.071,0.12681,-0.0639,0.130145,-0.0568,0.133018,-0.0497,0.135459,-0.0426,0.137491,-0.0355,0.139131,-0.0284,0.140393,-0.0213,0.141288,-0.0142,0.141822,-0.0071,0.142,0.0});
			return Extrusion_6_24_crossSection;
		}

	/** The initialized model object, created within initialize() method. */
	private X3D x3dModel;

	/** 
	 * Provide a 
	 * &lt;a href="https://dzone.com/articles/java-copy-shallow-vs-deep-in-which-you-will-swim" target="_blank"&gt;shallow copy&lt;/a&gt;
	 * of the X3D model.
	 * @see &lt;a href="https://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Core/X3D.html"&gt;X3D&lt;/a&gt;
	 * @return Bell 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 &lt;a href="https://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Core/X3D.html#handleArguments-java.lang.String:A-"&gt;X3D.handleArguments(args)&lt;/a&gt;
     * @see &lt;a href="https://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Core/X3D.html#validationReport--"&gt;X3D.validationReport()&lt;/a&gt;
     * @see &lt;a href="https://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/CommandLine.html"&gt;CommandLine&lt;/a&gt;
     * @see &lt;a href="https://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/CommandLine.html#USAGE"&gt;CommandLine.USAGE&lt;/a&gt;
     * @see &lt;a href="https://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/ConfigurationProperties.html"&gt;ConfigurationProperties&lt;/a&gt;
     */
    public static void main(String args[])
    {
        System.out.println("Build this X3D model, showing validation diagnostics...");
        X3D thisExampleX3dModel = new Bell().getX3dModel();
//      System.out.println("X3D model construction complete.");
	
        // next handle command line arguments
        boolean hasArguments = (args != null) &amp;&amp; (args.length &gt; 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: \"X3dForAdvancedModeling.SanCarlosCathedral.Bell\" 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("X3dForAdvancedModeling.SanCarlosCathedral.Bell self-validation test confirmation: ");
                if (!validationResults.equals("success"))
                    System.out.println();
                System.out.println(validationResults.trim());

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