[x3d-public] second release: X3DJSAIL Java translations, javadoc inX3DExamplesArchives. Bug in new X3dToJava.xlst

Don Brutzman brutzman at nps.edu
Fri May 5 02:48:58 PDT 2017


cc: x3d-public

On 5/4/2017 4:53 PM, yottzumm at gmail.com wrote:
> Looks good in your provided pp3.java, but not working in my project.   Is the version of X3dToJava.xslt on the website or the one in sourceforge more up-to-date?  I’m still seeing problems with the one from the repository.

The prior fix was insufficient/incorrect - offsetting errors.  Now corrected (I think), uploaded, running full test set again.

found and fixed an important deficiency: ROUTE was not properly searching for DEF names while within a ProtoBody.

as part of correction, added helpful new utility methods to X3DConcreteElement (i.e. available to both nodes and statements):

findAncestorProtoBody()
findAncestorElementByName(java.lang.String ancestorElementName)
http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/X3DConcreteElement.html#method.summary

> Maybe my svn update isn’t working? Attaching my version for comparison.  Providing another example attached.  Pp3.x3d is still a good example I think.

your svn wasn't the problem, my prior bugs were.

i was testing ArchPrototype.java, bub.java, flowers7.java, and pp3.java, all looking good and passing validation self-test as well.

one problem remains, flowers7.java, likely an issue with ComposedShader field names:
| flowers7 execution self-validation test results:  ROUTE details: FROM Animate.a_changed (Script.SFFloat.outputOnly) TO cobweb.set_a (ComposedShader.ERROR_UNKNOWN_FIELD_TYPE.ERROR_UNKNOWN_FIELD_ACCESSTYPE)

uploading new build now; .jars are there, javadoc to follow

> My Maven project is here: https://github.com/coderextreme/JavaSceneAuthoringInterfaceLibrary  You’ll need Eclipse to run the Jsweet build (CTRL-SHIFT-O on src/main/java to organize imports), and Bourne Shell and Perl run replaceclass.sh (to fix NeedClassName) and compile (or you can just look at the checked in code).  I will verify outside maven as well, because I think it may be better there, not sure.

am deep in throes of X3DJSAIL.  might someone else do this please?

please try to write all this up (as a README or as slides) in order to support Web3D 2017 tutorial in another few weeks.

onward...

> Also, it looks like there are unused variables in X3DJSAIL.  You may want to get Eclipse and look at warnings.
> 
> John
> 
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
> 
> *From: *Don Brutzman <mailto:brutzman at nps.edu>
> *Sent: *Thursday, May 4, 2017 3:51 AM
> *To: *yottzumm at gmail.com <mailto:yottzumm at gmail.com>
> *Cc: *Roy Walmsley <mailto:roy.walmsley at ntlworld.com>
> *Subject: *Re: second release: X3DJSAIL Java translations, javadoc inX3DExamplesArchives. Bug in new X3dToJava.xlst
> 
> Script node source code handling seems to be OK now, attached
> 
> On 5/3/2017 7:28 AM, yottzumm at gmail.com wrote:
> 
>  > Here’s another example.  The other one may show a different problem, I am not sure.  I’ve been playing with the stylesheet a bit, but I am unable to fix.  May try fixing source x3d.
> 
>  >
> 
>  > John
> 
>  >
> 
>  > Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
> 
>  >
> 
>  > *From: *yottzumm at gmail.com <mailto:yottzumm at gmail.com>
> 
>  > *Sent: *Wednesday, May 3, 2017 9:56 AM
> 
>  > *To: *Don Brutzman <mailto:brutzman at nps.edu>
> 
>  > *Cc: *Roy Walmsley <mailto:roy.walmsley at ntlworld.com>
> 
>  > *Subject: *RE: second release: X3DJSAIL Java translations, javadoc inX3DExamples Archives. Bug in new X3dToJava.xlst
> 
>  >
> 
>  > .setSourceCode() appears new in X3dToJava.xslt.  There’s a bug in it.  See attached sample (I have several examples).
> 
>  >
> 
>  > John
> 
>  >
> 
>  > Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
> 
>  >
> 
>  > *From: *Don Brutzman <mailto:brutzman at nps.edu>
> 
>  > *Sent: *Wednesday, May 3, 2017 4:47 AM
> 
>  > *To: *John Carlson <mailto:yottzumm at gmail.com>
> 
>  > *Cc: *Roy Walmsley <mailto:roy.walmsley at ntlworld.com>
> 
>  > *Subject: *Re: second release: X3DJSAIL Java translations, javadoc in X3DExamples Archives
> 
>  >
> 
>  > have cleaned up a lot of the .set and .add mishandling for curious SFNode/MFNode field.  includes some shader-related fixes.
> 
>  >
> 
>  > new X3DJSAIL build is uploading, updated .jar files are now there, rest should be done in about an hour.
> 
>  >
> 
>  > also am revving all .java again, will redeploy example archives when at work tomorrow.
> 
> all the best, Don
> 
> -- 
> 
> Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
> 
> Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
> 
> X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman
> 


all the best, Don
-- 
Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman
-------------- next part --------------
//package X3dForAdvancedModeling.Buildings;

/*
Copyright (c) 1995-2017 held by the author(s).  All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer
      in the documentation and/or other materials provided with the
      distribution.
    * Neither the name of the Web3D Consortium (http://www.web3D.org)
      nor the names of its contributors may be used to endorse or
      promote products derived from this software without specific
      prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/

import java.util.*;
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.Networking.*;
import org.web3d.x3d.jsail.Rendering.*;
import org.web3d.x3d.jsail.Scripting.*;
import org.web3d.x3d.jsail.Shape.*;

// Javadoc annotations follow, see below for source.
/**
 * <p> Create an arch. Can modify general parameters: clearSpanWidth, riseHeight, depth, topAbutmentHeight, pierWidth, pierHeight. See the reference file ArchModelingDiagrams.pdf to find further information. See also ArchPrototypeScript_more_readable.js. Possibility to create shapes related to arch: ArchHalf; IntradosOnly; ArchFilled; ArchHalfFilled; Lintel. See the reference file ArchModelingDiagrams.pdf to find further information. </p>
 <p> Related links: <a href="../../../Buildings/ArchPrototype.java">ArchPrototype.java</a> source, <a href="../../../Buildings/ArchPrototypeIndex.html" target="_top">ArchPrototype catalog page</a>, <a href="http://www.web3d.org/x3d/content/examples/X3dResources.html" target="_blank">X3D Resources</a>, <a href="http://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html" target="_blank">X3D Scene Authoring Hints</a> and <a href="http://www.web3d.org/x3d/content/X3dTooltips.html" target="_blank">X3D Tooltips</a>. </p>
	<table style="color:black; border:0px solid; border-spacing:10px 0px;" summary="Scene Metadata">
		<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;">  Document Metadata </td>
		</tr>

		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> title </i> </td>
			<td> <a href="../../../Buildings/ArchPrototype.x3d">ArchPrototype.x3d</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> description </i> </td>
			<td> Create an arch. Can modify general parameters: clearSpanWidth, riseHeight, depth, topAbutmentHeight, pierWidth, pierHeight. See the reference file ArchModelingDiagrams.pdf to find further information. See also ArchPrototypeScript_more_readable.js. Possibility to create shapes related to arch: ArchHalf; IntradosOnly; ArchFilled; ArchHalfFilled; Lintel. See the reference file ArchModelingDiagrams.pdf to find further information. </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> creator </i> </td>
			<td> Michele Foti, Don Brutzman </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> created </i> </td>
			<td> 15 December 2014 </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> modified </i> </td>
			<td> 27 November 2015 </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> <a href="../../../Buildings/ArchModelingDiagrams.pdf">ArchModelingDiagrams.pdf</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> <a href="https://en.wikipedia.org/wiki/Arch" target="_blank">https://en.wikipedia.org/wiki/Arch</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> identifier </i> </td>
			<td> <a href="http://X3dGraphics.com/examples/X3dForAdvancedModeling/Buildings/ArchPrototype.x3d" target="_blank">http://X3dGraphics.com/examples/X3dForAdvancedModeling/Buildings/ArchPrototype.x3d</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> generator </i> </td>
			<td> X3D-Edit 3.3, <a href="https://savage.nps.edu/X3D-Edit" target="_blank">https://savage.nps.edu/X3D-Edit</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> license </i> </td>
			<td> <a href="../../../Buildings/../license.html">../license.html</a> </td>
		</tr>
		<tr style="background-color:silver; border-color:silver;">
			<td style="text-align:center;" colspan="2">    </td>
		</tr>
	</table>

	<p>
		This program uses the
		<a href="http://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="http://www.web3d.org/x3d/stylesheets/X3dToJava.xslt" target="_blank">X3dToJava.xslt</a>
		stylesheet to create Java source code from an <code>.x3d</code> scene.
	</p>

	* @author Michele Foti, Don Brutzman
 */

public class ArchPrototype
{
  /** Default constructor to create this object. */
  public ArchPrototype ()
  {
    initialize();
  }
	
  /** Create and initialize the X3D model. */
  public final void initialize()
  {
  x3dModel = new X3DObject().setProfile("Immersive").setVersion("3.3")
  .setHead(new headObject()
    .addMeta(new metaObject().setName("title").setContent("ArchPrototype.x3d"))
    .addMeta(new metaObject().setName("description").setContent("Create an arch. Can modify general parameters: clearSpanWidth, riseHeight, depth, topAbutmentHeight, pierWidth, pierHeight. See the reference file ArchModelingDiagrams.pdf to find further information. See also ArchPrototypeScript_more_readable.js. Possibility to create shapes related to arch: ArchHalf; IntradosOnly; ArchFilled; ArchHalfFilled; Lintel. See the reference file ArchModelingDiagrams.pdf to find further information."))
    .addMeta(new metaObject().setName("creator").setContent("Michele Foti, Don Brutzman"))
    .addMeta(new metaObject().setName("created").setContent("15 December 2014"))
    .addMeta(new metaObject().setName("modified").setContent("27 November 2015"))
    .addMeta(new metaObject().setName("reference").setContent("ArchModelingDiagrams.pdf"))
    .addMeta(new metaObject().setName("reference").setContent("https://en.wikipedia.org/wiki/Arch"))
    .addMeta(new metaObject().setName("identifier").setContent("http://X3dGraphics.com/examples/X3dForAdvancedModeling/Buildings/ArchPrototype.x3d"))
    .addMeta(new metaObject().setName("generator").setContent("X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit"))
    .addMeta(new metaObject().setName("license").setContent("../license.html")))
  .setScene(new SceneObject()
    .addChild(new ProtoDeclareObject().setName("ArchPrototype").setAppinfo(ProtoDeclare_ArchPrototype_3_12_appinfo)
      .setProtoInterface(new ProtoInterfaceObject()
        .addComments(" COLOR OF ARCH ")
        .addField(new fieldObject().setAccessType("inputOutput").setName("diffuseColor").setType("SFColor").setValue("0.2 0.8 0.8").setAppinfo("color of arch"))
        .addField(new fieldObject().setAccessType("inputOutput").setName("emissiveColor").setType("SFColor").setValue("0.2 0.8 0.8").setAppinfo("color of arch"))
        .addComments(" INPUT PARAMETERS ")
        .addComments(" General parameters: measures in meters ")
        .addField(new fieldObject().setAccessType("initializeOnly").setName("clearSpanWidth").setType("SFFloat").setValue("4").setAppinfo("clearSpanWidth: clearSpanWidth must be double of riseHeight to obtain an half circumference"))
        .addField(new fieldObject().setAccessType("initializeOnly").setName("riseHeight").setType("SFFloat").setValue("2").setAppinfo("riseHeight: riseHeight must be half of clearSpanWidth to obtain an half circumference"))
        .addField(new fieldObject().setAccessType("initializeOnly").setName("depth").setType("SFFloat").setValue("3").setAppinfo("depth"))
        .addField(new fieldObject().setAccessType("initializeOnly").setName("topAbutmentHeight").setType("SFFloat").setValue("0.5").setAppinfo("topAbutmentHeight:topAbutmentHeight=0 means no topAbutment"))
        .addField(new fieldObject().setAccessType("initializeOnly").setName("pierWidth").setType("SFFloat").setValue("0.5").setAppinfo("pierWidth:pierWidtht=0 means no pierWidth"))
        .addField(new fieldObject().setAccessType("initializeOnly").setName("pierHeight").setType("SFFloat").setValue("1").setAppinfo("pierHeight: pierHeight=0 means no pierHeight"))
        .addComments(" Parameters to create to create shapes related to arch: put true to apply ")
        .addField(new fieldObject().setAccessType("initializeOnly").setName("archHalf").setType("SFBool").setValue("false").setAppinfo(field_archHalf_5_20_appinfo))
        .addField(new fieldObject().setAccessType("initializeOnly").setName("archHalfExtensionWidth").setType("SFFloat").setValue("0").setAppinfo(field_archHalfExtensionWidth_5_21_appinfo))
        .addField(new fieldObject().setAccessType("initializeOnly").setName("onlyIntrados").setType("SFBool").setValue("false").setAppinfo(field_onlyIntrados_5_22_appinfo))
        .addField(new fieldObject().setAccessType("initializeOnly").setName("archFilled").setType("SFBool").setValue("false").setAppinfo(field_archFilled_5_23_appinfo))
        .addField(new fieldObject().setAccessType("initializeOnly").setName("archHalfFilled").setType("SFBool").setValue("false").setAppinfo(field_archHalfFilled_5_24_appinfo))
        .addField(new fieldObject().setAccessType("initializeOnly").setName("lintel").setType("SFBool").setValue("false").setAppinfo(field_lintel_5_25_appinfo)))
      .setProtoBody(new ProtoBodyObject()
        .addComments(" First node determines node type of this prototype ")
        .addComments(" IndexedFaceset creates arch ")
        .addChild(new TransformObject("ArchTransform")
          .addChild(new ShapeObject("Arch")
            .addComments(" note that convex='false' (meaning concave geometry) is crucial for this IFS of a geometric chord to render properly ")
            .setGeometry(new IndexedFaceSetObject("ArchIndex").setDEF("ArchIndex").setConvex(false).setSolid(false)
              .setCoord(new CoordinateObject("ArchChord")))
            .setAppearance(new AppearanceObject()
              .setMaterial(new MaterialObject("MaterialNode")
                .setIS(new ISObject()
                  .addConnect(new connectObject().setNodeField("emissiveColor").setProtoField("emissiveColor"))
                  .addConnect(new connectObject().setNodeField("diffuseColor").setProtoField("diffuseColor")))))))
        .addComments(" Subsequent nodes do not render, but still must be a valid X3D subgraph ")
        .addComments(" This embedded Script provides the X3D author with additional visibility and control over prototype inputs and outputs ")
        .addChild(new ScriptObject("ArchPrototypeScript").setUrl(new MFStringObject("\"ArchPrototypeScript.js\" \"http://X3dGraphics.com/examples/X3dForAdvancedModeling/Buildings/ArchPrototypeScript.js\""))
          .addComments(" INPUT PARAMETERS ")
          .addComments(" General parameters ")
          .addComments(" Parameters to create to create shapes related to arch: put true to apply ")
          .addComments(" OUTPUT PARAMETERS ")
          .addField(new fieldObject().setAccessType("initializeOnly").setName("clearSpanWidth").setType("SFFloat").setAppinfo("user or default input for clearSpanWidth parameter"))
          .addField(new fieldObject().setAccessType("initializeOnly").setName("riseHeight").setType("SFFloat").setAppinfo("user or default input for riseHeight parameter"))
          .addField(new fieldObject().setAccessType("initializeOnly").setName("depth").setType("SFFloat").setAppinfo("user or default input for depth parameter"))
          .addField(new fieldObject().setAccessType("initializeOnly").setName("topAbutmentHeight").setType("SFFloat").setAppinfo("user or default input for topAbutmentHeight parameter"))
          .addField(new fieldObject().setAccessType("initializeOnly").setName("pierWidth").setType("SFFloat").setAppinfo("user or default input for pierWidth parameter"))
          .addField(new fieldObject().setAccessType("initializeOnly").setName("pierHeight").setType("SFFloat").setAppinfo("user or default input for pierHeight parameter"))
          .addField(new fieldObject().setAccessType("initializeOnly").setName("archHalf").setType("SFBool").setAppinfo("user or default input for archHalf parameter"))
          .addField(new fieldObject().setAccessType("initializeOnly").setName("archHalfExtensionWidth").setType("SFFloat").setAppinfo("user or default input for archHalfExtensionWidth parameter"))
          .addField(new fieldObject().setAccessType("initializeOnly").setName("onlyIntrados").setType("SFBool").setAppinfo("user or default input for onlyIntrados parameter"))
          .addField(new fieldObject().setAccessType("initializeOnly").setName("archFilled").setType("SFBool").setAppinfo("user or default input for archFilled parameter"))
          .addField(new fieldObject().setAccessType("initializeOnly").setName("archHalfFilled").setType("SFBool").setAppinfo("user or default input for archHalfFilled parameter"))
          .addField(new fieldObject().setAccessType("initializeOnly").setName("lintel").setType("SFBool").setAppinfo("user or default input for lintel parameter"))
          .addField(new fieldObject().setAccessType("outputOnly").setName("computedScale").setType("SFVec3f").setAppinfo(field_computedScale_6_48_appinfo))
          .addField(new fieldObject().setAccessType("outputOnly").setName("pointOut").setType("MFVec3f").setAppinfo("send computed points to the Coordinate node"))
          .addField(new fieldObject().setAccessType("outputOnly").setName("indexOut").setType("MFInt32").setAppinfo("send computed indices to the IndexedFaceSet node"))
          .setIS(new ISObject()
            .addConnect(new connectObject().setNodeField("clearSpanWidth").setProtoField("clearSpanWidth"))
            .addConnect(new connectObject().setNodeField("riseHeight").setProtoField("riseHeight"))
            .addConnect(new connectObject().setNodeField("depth").setProtoField("depth"))
            .addConnect(new connectObject().setNodeField("pierWidth").setProtoField("pierWidth"))
            .addConnect(new connectObject().setNodeField("topAbutmentHeight").setProtoField("topAbutmentHeight"))
            .addConnect(new connectObject().setNodeField("pierHeight").setProtoField("pierHeight"))
            .addConnect(new connectObject().setNodeField("archHalf").setProtoField("archHalf"))
            .addConnect(new connectObject().setNodeField("archHalfExtensionWidth").setProtoField("archHalfExtensionWidth"))
            .addConnect(new connectObject().setNodeField("onlyIntrados").setProtoField("onlyIntrados"))
            .addConnect(new connectObject().setNodeField("archFilled").setProtoField("archFilled"))
            .addConnect(new connectObject().setNodeField("archHalfFilled").setProtoField("archHalfFilled"))
            .addConnect(new connectObject().setNodeField("lintel").setProtoField("lintel"))))
        .addChild(new ROUTEObject().setFromNode("ArchPrototypeScript").setFromField("computedScale").setToNode("ArchTransform").setToField("scale"))
        .addChild(new ROUTEObject().setFromNode("ArchPrototypeScript").setFromField("pointOut").setToNode("ArchChord").setToField("point"))
        .addChild(new ROUTEObject().setFromNode("ArchPrototypeScript").setFromField("indexOut").setToNode("ArchIndex").setToField("set_coordIndex"))))
    .addChild(new ProtoInstanceObject("ArchInstance", "ArchPrototype").setDEF("ArchInstance").setName("ArchPrototype")
      .addFieldValue(new fieldValueObject().setName("diffuseColor").setValue("0.5 0.3 0.6"))
      .addFieldValue(new fieldValueObject().setName("emissiveColor").setValue("0.5 0.3 0.6"))
      .addFieldValue(new fieldValueObject().setName("clearSpanWidth").setValue("5"))
      .addFieldValue(new fieldValueObject().setName("riseHeight").setValue("2.5"))
      .addFieldValue(new fieldValueObject().setName("depth").setValue("2"))
      .addFieldValue(new fieldValueObject().setName("topAbutmentHeight").setValue("0.6"))
      .addFieldValue(new fieldValueObject().setName("pierWidth").setValue("1"))
      .addFieldValue(new fieldValueObject().setName("pierHeight").setValue("2")))
    .addComments(" Add any ROUTEs here that connect ProtoInstance to/from prior nodes in Scene (and outside of ProtoDeclare) ")
    .addChild(new InlineObject("CoordinateAxes").setUrl(new MFStringObject("\"../../X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.x3d\" \"../../../Savage/Tools/Authoring/CoordinateAxes.x3d\" \"http://X3dGraphics.com/examples/X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.x3d\" \"https://savage.nps.edu/Savage/Tools/Authoring/CoordinateAxes.x3d\" \"../../X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.wrl\" \"../../../Savage/Tools/Authoring/CoordinateAxes.wrl\" \"http://X3dGraphics.com/examples/X3dForWebAuthors/Chapter03Grouping/CoordinateAxes.wrl\" \"https://savage.nps.edu/Savage/Tools/Authoring/CoordinateAxes.wrl\""))));
  }
  // end of initialize() method

	/** Large attribute array: ProtoDeclare appinfo field, scene-graph level=3, element #12, 39 total values */
	private SFStringObject ProtoDeclare_ArchPrototype_3_12_appinfo = new SFStringObject("Create an arch. Can modify general parameters: clearSpanWidth, riseHeight, depth, topAbutmentHeight, pierWidth, pierHeight. - Possibility to create shapes related to an arch: ArchHalf; IntradosOnly; ArchFilled; ArchHalfFilled; Lintel. See the reference file ArchModelingDiagrams.pdf to find further information. See also ArchPrototypeScript_more_readable.js.js.");

	/** Large attribute array: field appinfo field, scene-graph level=5, element #20, 26 total values */
	private SFStringObject field_archHalf_5_20_appinfo = new SFStringObject("archHalf: can modify also clearSpanWidth, riseHeight, depth, pierWidth, pierHeight, topAbutmentHeight, archHalfExtensionWidth at purpose, clearSpanWidth measure refers to a full arc, consider clearSpanWidth/2 for the archHalf width");

	/** Large attribute array: field appinfo field, scene-graph level=5, element #21, 30 total values */
	private SFStringObject field_archHalfExtensionWidth_5_21_appinfo = new SFStringObject("archHalfExtensionWidth: measure in meters, use only if archHalf=true, it is the width of the etension of the abutment of the archHalf. See the reference file ArchModelingDiagrams.pdf to find further information.");

	/** Large attribute array: field appinfo field, scene-graph level=5, element #22, 20 total values */
	private SFStringObject field_onlyIntrados_5_22_appinfo = new SFStringObject("onlyIntrados: note it is a flat curved surface, can modify also clearSpanWidth, riseHeight, depth at purpose, if needed apply archHalf=true.");

	/** Large attribute array: field appinfo field, scene-graph level=5, element #23, 15 total values */
	private SFStringObject field_archFilled_5_23_appinfo = new SFStringObject("archFilled: note it is an half cylinder, can modify also clearSpanWidth, riseHeight, depth at purpose.");

	/** Large attribute array: field appinfo field, scene-graph level=5, element #24, 28 total values */
	private SFStringObject field_archHalfFilled_5_24_appinfo = new SFStringObject("archHalfFilled: note it is a quarter cylinder, can modify also clearSpanWidth, riseHeight, depth at purpose, clearSpanWidth measure refers to a full arc, consider clearSpanWidth/2 for the archHalfFilled width.");

	/** Large attribute array: field appinfo field, scene-graph level=5, element #25, 21 total values */
	private SFStringObject field_lintel_5_25_appinfo = new SFStringObject("lintel: no arc is rendered, but a lintel: topAbutmentHeight on pierHeight, total height is pierHeight + topAbutmentHeight, if needed apply archHalf=true.");

	/** Large attribute array: field appinfo field, scene-graph level=6, element #48, 29 total values */
	private SFStringObject field_computedScale_6_48_appinfo = new SFStringObject("computedScale: modify scale field - NOTE it is not used to modify the whole arch, but to modify clearSpanWidth, riseHeight, depth. It does not affect topAbutmentHeight, pierWidth, pierHeight, archHalfExtensionWidth");

  /** The initialized model object, created within initialize() method. */
  private X3DObject x3dModel;
  
  /** Provide a shallow copy of the X3D model.
   * @return ArchPrototype model
   */
  public X3DObject getX3dModel()
  {	  
	  return x3dModel;
  }
  
  /** Indicate X3DJSAIL validation results for this X3D model.
   * @return validation results plus exception information, if any
   */
  public String validateSelf()
  {
	String       metaResult = new String();
	String validationResult = new String();
	String  exceptionResult = new String();
	try
	{
		initialize();
		
		if ((getX3dModel() == null) || (getX3dModel().getHead() == null))
		{
			validationResult = "empty scene, nothing to validate. " + x3dModel.validate();
			return validationResult;
		}
		// first list informational meta elements of interest
		for (metaObject meta : getX3dModel().getHead().getMetaList())
		{
			if (meta.getName().equals(metaObject.NAME_ERROR) ||
				meta.getName().equals(metaObject.NAME_WARNING) ||
				meta.getName().equals(metaObject.NAME_HINT) ||
				meta.getName().equals(metaObject.NAME_INFO) ||
				meta.getName().equals(metaObject.NAME_TODO))
			{
				metaResult += meta.toStringX3D();
			}
		}
		validationResult += x3dModel.validate(); // walk entire tree to validate correctness
	}
	catch (Exception e)
	{
		exceptionResult = e.getMessage(); // report exception failures, if any
	}
	if  (metaResult.isEmpty() && exceptionResult.isEmpty() && validationResult.isEmpty())
	     return "success";
	else
	{
		String returnMessage = metaResult;
		if  (!exceptionResult.isEmpty() && !validationResult.isEmpty())
			returnMessage += "\n*** ";
		returnMessage += exceptionResult;
		if  (exceptionResult.isEmpty() && !validationResult.isEmpty())
			returnMessage = "\n" + returnMessage; // skip line before meta tags, etc.
		returnMessage += validationResult;
		return returnMessage;
	}
  }
    /** Default main() method provided for test purposes.
     * @param argv input parameters
     */
    public static void main(String argv[])
    {
		ArchPrototype testObject = new ArchPrototype();
		System.out.println ("ArchPrototype execution self-validation test results: " + testObject.validateSelf());
	}
}
-------------- next part --------------
//package X3dForAdvancedModeling.Animation;

/*
Copyright (c) 1995-2017 held by the author(s).  All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer
      in the documentation and/or other materials provided with the
      distribution.
    * Neither the name of the Web3D Consortium (http://www.web3D.org)
      nor the names of its contributors may be used to endorse or
      promote products derived from this software without specific
      prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/

import java.util.*;
import org.web3d.x3d.jsail.Core.*;
import org.web3d.x3d.jsail.CubeMapTexturing.*;
import org.web3d.x3d.jsail.EnvironmentalEffects.*;
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.Scripting.*;
import org.web3d.x3d.jsail.Shaders.*;
import org.web3d.x3d.jsail.Shape.*;
import org.web3d.x3d.jsail.Texturing.*;
import org.web3d.x3d.jsail.Time.*;

// Javadoc annotations follow, see below for source.
/**
 * <p> 3 prismatic spheres. </p>
 <p> Related links: bub.java source, <a href="http://www.web3d.org/x3d/content/examples/X3dResources.html" target="_blank">X3D Resources</a>, <a href="http://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html" target="_blank">X3D Scene Authoring Hints</a> and <a href="http://www.web3d.org/x3d/content/X3dTooltips.html" target="_blank">X3D Tooltips</a>. </p>
	<table style="color:black; border:0px solid; border-spacing:10px 0px;" summary="Scene Metadata">
		<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;">X3dForAdvancedModeling.Animation.bub  Document Metadata </td>
		</tr>

		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> title </i> </td>
			<td> <a href="http://coderextreme.net/X3DJSONLD/bub.x3d">bub.x3d</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> creator </i> </td>
			<td> John Carlson </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> description </i> </td>
			<td> 3 prismatic spheres </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> generator </i> </td>
			<td> X3D-Edit, <a href="https://savage.nps.edu/X3D-Edit" target="_blank">https://savage.nps.edu/X3D-Edit</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> identifier </i> </td>
			<td> <a href="http://coderextreme.net/X3DJSONLD/bub.x3d" target="_blank">http://coderextreme.net/X3DJSONLD/bub.x3d</a> </td>
		</tr>
		<tr style="background-color:silver; border-color:silver;">
			<td style="text-align:center;" colspan="2">    </td>
		</tr>
	</table>

	<p>
		This program uses the
		<a href="http://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="http://www.web3d.org/x3d/stylesheets/X3dToJava.xslt" target="_blank">X3dToJava.xslt</a>
		stylesheet to create Java source code from an <code>.x3d</code> scene.
	</p>

	* @author John Carlson
 */

public class bub
{
  /** Default constructor to create this object. */
  public bub ()
  {
    initialize();
  }
	
  /** Create and initialize the X3D model. */
  public final void initialize()
  {
  x3dModel = new X3DObject().setProfile("Immersive").setVersion("3.3")
  .setHead(new headObject()
    .addMeta(new metaObject().setName("title").setContent("bub.x3d"))
    .addMeta(new metaObject().setName("creator").setContent("John Carlson"))
    .addMeta(new metaObject().setName("description").setContent("3 prismatic spheres"))
    .addMeta(new metaObject().setName("generator").setContent("X3D-Edit, https://savage.nps.edu/X3D-Edit"))
    .addMeta(new metaObject().setName("identifier").setContent("http://coderextreme.net/X3DJSONLD/bub.x3d")))
  .setScene(new SceneObject()
    .addChild(new NavigationInfoObject())
    .addChild(new BackgroundObject().setBackUrl(new MFStringObject("\"cubemap/all_probes/stpeters_cross/stpeters_back.png\" \"http://coderextreme.net/X3DJSONLD/cubemap/all_probes/stpeters_cross/stpeters_back.png\"")).setBottomUrl(new MFStringObject("\"cubemap/all_probes/stpeters_cross/stpeters_bottom.png\" \"http://coderextreme.net/X3DJSONLD/cubemap/all_probes/stpeters_cross/stpeters_bottom.png\"")).setFrontUrl(new MFStringObject("\"cubemap/all_probes/stpeters_cross/stpeters_front.png\" \"http://coderextreme.net/X3DJSONLD/cubemap/all_probes/stpeters_cross/stpeters_front.png\"")).setLeftUrl(new MFStringObject("\"cubemap/all_probes/stpeters_cross/stpeters_left.png\" \"http://coderextreme.net/X3DJSONLD/cubemap/all_probes/stpeters_cross/stpeters_left.png\"")).setRightUrl(new MFStringObject("\"cubemap/all_probes/stpeters_cross/stpeters_right.png\" \"http://coderextreme.net/X3DJSONLD/cubemap/all_probes/stpeters_cross/stpeters_right.png\"")).setTopUrl(new MFStringObject("\"cubemap/all_probes/stpeters_cross/stpeters_top.png\" \"http://coderextreme.net/X3DJSONLD/cubemap/all_probes/stpeters_cross/stpeters_top.png\"")))
    .addChild(new ViewpointObject().setDescription("Look at the bubbles flying").setPosition(0.0f,0.0f,20.0f))
    .addChild(new ProtoDeclareObject().setName("Bubble")
      .setProtoBody(new ProtoBodyObject()
        .addChild(new TransformObject("transform")
          .addChild(new ShapeObject("myShape")
            .setAppearance(new AppearanceObject()
              .setMaterial(new MaterialObject().setSpecularColor(.5f,.5f,.5f).setDiffuseColor(.7f,.7f,.7f))
              .setTexture(new ComposedCubeMapTextureObject("texture")
                .setBack(new ImageTextureObject().setUrl(new MFStringObject("\"cubemap/all_probes/stpeters_cross/stpeters_back.png\" \"http://coderextreme.net/X3DJSONLD/cubemap/all_probes/stpeters_cross/stpeters_back.png\"")))
                .setBottom(new ImageTextureObject().setUrl(new MFStringObject("\"cubemap/all_probes/stpeters_cross/stpeters_bottom.png\" \"http://coderextreme.net/X3DJSONLD/cubemap/all_probes/stpeters_cross/stpeters_bottom.png\"")))
                .setFront(new ImageTextureObject().setUrl(new MFStringObject("\"cubemap/all_probes/stpeters_cross/stpeters_front.png\" \"http://coderextreme.net/X3DJSONLD/cubemap/all_probes/stpeters_cross/stpeters_front.png\"")))
                .setLeft(new ImageTextureObject().setUrl(new MFStringObject("\"cubemap/all_probes/stpeters_cross/stpeters_left.png\" \"http://coderextreme.net/X3DJSONLD/cubemap/all_probes/stpeters_cross/stpeters_left.png\"")))
                .setRight(new ImageTextureObject().setUrl(new MFStringObject("\"cubemap/all_probes/stpeters_cross/stpeters_right.png\" \"http://coderextreme.net/X3DJSONLD/cubemap/all_probes/stpeters_cross/stpeters_right.png\"")))
                .setTop(new ImageTextureObject().setUrl(new MFStringObject("\"cubemap/all_probes/stpeters_cross/stpeters_top.png\" \"http://coderextreme.net/X3DJSONLD/cubemap/all_probes/stpeters_cross/stpeters_top.png\""))))
              .addComments(new String[] {"",
"					<ComposedShader DEF='gl' language=\"GLSL\">",
"					  <field name='cube' type='SFInt32' accessType=\"inputOutput\" value='0'/>",
"					  <field name='chromaticDispertion' type='SFVec3f' accessType=\"inputOutput\" value='0.98 1.0 1.033'/>",
"					  <field name='bias' type='SFFloat' accessType=\"inputOutput\" value='0.5'/>",
"					  <field name='scale' type='SFFloat' accessType=\"inputOutput\" value='0.5'/>",
"					  <field name='power' type='SFFloat' accessType=\"inputOutput\" value='2.0'/>",
"",
"					  <ShaderPart url='\"gl.vs\" \"http://coderextreme.net/X3DJSONLD/gl.vs\"' type='VERTEX'></ShaderPart>",
"					  <ShaderPart url='\"pc_bubbles.fs\" \"http://coderextreme.net/X3DJSONLD/pc_bubbles.fs\"' type='FRAGMENT'></ShaderPart>",
"					</ComposedShader>",
"					<ComposedShader DEF='freewrl' language=\"GLSL\">",
"					  <field name='fw_textureCoodGenType' type='SFInt32' accessType=\"inputOutput\" value='0'/>",
"					  <field name='chromaticDispertion' type='SFVec3f' accessType=\"inputOutput\" value='0.98 1.0 1.033'/>",
"					  <field name='bias' type='SFFloat' accessType=\"inputOutput\" value='0.5'/>",
"					  <field name='scale' type='SFFloat' accessType=\"inputOutput\" value='0.5'/>",
"					  <field name='power' type='SFFloat' accessType=\"inputOutput\" value='2.0'/>",
"",
"					  <ShaderPart url='\"freewrl.vs\" \"http://coderextreme.net/X3DJSONLD/freewrl.vs\"' type='VERTEX'></ShaderPart>",
"					  <ShaderPart url='\"pc_bubbles.fs\" \"http://coderextreme.net/X3DJSONLD/pc_bubbles.fs\"' type='FRAGMENT'></ShaderPart>",
"					</ComposedShader>",
"					<ComposedShader DEF='x3dom' language=\"GLSL\">",
"					  <field name='cube' type='SFInt32' accessType=\"inputOutput\" value='0'/>",
"					  <field name='chromaticDispertion' type='SFVec3f' accessType=\"inputOutput\" value='0.98 1.0 1.033'/>",
"					  <field name='bias' type='SFFloat' accessType=\"inputOutput\" value='0.5'/>",
"					  <field name='scale' type='SFFloat' accessType=\"inputOutput\" value='0.5'/>",
"					  <field name='power' type='SFFloat' accessType=\"inputOutput\" value='2.0'/>",
"",
"					  <ShaderPart url='\"x3dom.vs\" \"http://coderextreme.net/X3DJSONLD/x3dom.vs\"' type='VERTEX'></ShaderPart>",
"					  <ShaderPart url='\"pc_bubbles.fs\" \"http://coderextreme.net/X3DJSONLD/pc_bubbles.fs\"' type='FRAGMENT'></ShaderPart>",
"					</ComposedShader>",
"					<ComposedShader DEF='instant' language=\"GLSL\">",
"					  <field name='cube' type='SFInt32' accessType=\"inputOutput\" value='0'/>",
"					  <field name='chromaticDispertion' type='SFVec3f' accessType=\"inputOutput\" value='0.98 1.0 1.033'/>",
"					  <field name='bias' type='SFFloat' accessType=\"inputOutput\" value='0.5'/>",
"					  <field name='scale' type='SFFloat' accessType=\"inputOutput\" value='0.5'/>",
"					  <field name='power' type='SFFloat' accessType=\"inputOutput\" value='2.0'/>",
"",
"                              <ShaderPart url='\"instant.vs\" \"http://coderextreme.net/X3DJSONLD/instant.vs\"' type='VERTEX'></ShaderPart>",
"                              <ShaderPart url='\"pc_bubbles.fs\" \"http://coderextreme.net/X3DJSONLD/pc_bubbles.fs\"' type='FRAGMENT'></ShaderPart>",
"                            </ComposedShader>"})
              .addShaders(new ComposedShaderObject("cobweb").setLanguage("GLSL")
                .addField(new fieldObject().setAccessType("inputOutput").setName("cube").setType("SFNode")
                  .addChild(new ComposedCubeMapTextureObject().setUSE("texture")))
                .addField(new fieldObject().setAccessType("inputOutput").setName("chromaticDispertion").setType("SFVec3f").setValue("0.98 1.0 1.033"))
                .addField(new fieldObject().setAccessType("inputOutput").setName("bias").setType("SFFloat").setValue("0.5"))
                .addField(new fieldObject().setAccessType("inputOutput").setName("scale").setType("SFFloat").setValue("0.5"))
                .addField(new fieldObject().setAccessType("inputOutput").setName("power").setType("SFFloat").setValue("2.0"))
                .addParts(new ShaderPartObject().setUrl(new MFStringObject("\"cobweb.vs\" \"http://coderextreme.net/X3DJSONLD/cobweb.vs\"")))
                .addParts(new ShaderPartObject().setType("FRAGMENT").setUrl(new MFStringObject("\"pc_bubbles.fs\" \"http://coderextreme.net/X3DJSONLD/pc.fs\"")))))
            .setGeometry(new SphereObject())))
        .addChild(new ScriptObject("Bounce").setSourceCode(
"<![CDATA[" + "\n" +
/* here 3 */ "\n" + 
/* here 3 */ "ecmascript:" + "\n" + 
/* here 3 */ "			function set_translation(value) {" + "\n" + 
/* here 3 */ "				translation = value;" + "\n" + 
/* here 3 */ "			}" + "\n" + 
/* here 3 */ "			function translation_changed() {" + "\n" + 
/* here 3 */ "				return translation;" + "\n" + 
/* here 3 */ "			}" + "\n" + 
/* here 3 */ "			function initialize() {" + "\n" + 
/* here 3 */ "			    translation = new SFVec3f(0, 0, 0);" + "\n" + 
/* here 3 */ "			    velocity = new SFVec3f(" + "\n" + 
/* here 3 */ "			    	Math.random() - 0.5," + "\n" + 
/* here 3 */ "				Math.random() - 0.5," + "\n" + 
/* here 3 */ "				Math.random() - 0.5);" + "\n" + 
/* here 3 */ "			}" + "\n" + 
/* here 3 */ "			function set_fraction() {" + "\n" + 
/* here 3 */ "			    translation = new SFVec3f(" + "\n" + 
/* here 3 */ "			    	translation[0] + velocity[0]," + "\n" + 
/* here 3 */ "				translation[1] + velocity[1]," + "\n" + 
/* here 3 */ "				translation[2] + velocity[2]);" + "\n" + 
/* here 3 */ "			    for (var j = 0; j <= 2; j++) {" + "\n" + 
/* here 3 */ "				    if (Math.abs(translation[j]) > 10) {" + "\n" + 
/* here 3 */ "					initialize();" + "\n" + 
/* here 3 */ "				    } else {" + "\n" + 
/* here 3 */ "					velocity[0] += Math.random() * 0.2 - 0.1;" + "\n" + 
/* here 3 */ "					velocity[1] += Math.random() * 0.2 - 0.1;" + "\n" + 
/* here 3 */ "					velocity[2] += Math.random() * 0.2 - 0.1;" + "\n" + 
/* here 3 */ "				    }" + "\n" + 
/* here 3 */ "			    }" + "\n" + 
/* here 3 */ "			}" + "\n" + "]]>"
)
          .addField(new fieldObject().setAccessType("inputOutput").setName("translation").setType("SFVec3f").setValue("0 0 0"))
          .addField(new fieldObject().setAccessType("inputOutput").setName("velocity").setType("SFVec3f").setValue("0 0 0"))
          .addField(new fieldObject().setAccessType("inputOnly").setName("set_fraction").setType("SFTime")))
        .addChild(new TimeSensorObject("TourTime").setCycleInterval(0.150).setLoop(true))
        .addChild(new ROUTEObject().setFromNode("TourTime").setFromField("cycleTime").setToNode("Bounce").setToField("set_fraction"))
        .addChild(new ROUTEObject().setFromNode("Bounce").setFromField("translation_changed").setToNode("transform").setToField("set_translation"))))
    .addChild(new ProtoInstanceObject().setName("Bubble"))
    .addChild(new ProtoInstanceObject().setName("Bubble"))
    .addChild(new ProtoInstanceObject().setName("Bubble")));
  }
  // end of initialize() method

  /** The initialized model object, created within initialize() method. */
  private X3DObject x3dModel;
  
  /** Provide a shallow copy of the X3D model.
   * @return bub model
   */
  public X3DObject getX3dModel()
  {	  
	  return x3dModel;
  }
  
  /** Indicate X3DJSAIL validation results for this X3D model.
   * @return validation results plus exception information, if any
   */
  public String validateSelf()
  {
	String       metaResult = new String();
	String validationResult = new String();
	String  exceptionResult = new String();
	try
	{
		initialize();
		
		if ((getX3dModel() == null) || (getX3dModel().getHead() == null))
		{
			validationResult = "empty scene, nothing to validate. " + x3dModel.validate();
			return validationResult;
		}
		// first list informational meta elements of interest
		for (metaObject meta : getX3dModel().getHead().getMetaList())
		{
			if (meta.getName().equals(metaObject.NAME_ERROR) ||
				meta.getName().equals(metaObject.NAME_WARNING) ||
				meta.getName().equals(metaObject.NAME_HINT) ||
				meta.getName().equals(metaObject.NAME_INFO) ||
				meta.getName().equals(metaObject.NAME_TODO))
			{
				metaResult += meta.toStringX3D();
			}
		}
		validationResult += x3dModel.validate(); // walk entire tree to validate correctness
	}
	catch (Exception e)
	{
		exceptionResult = e.getMessage(); // report exception failures, if any
	}
	if  (metaResult.isEmpty() && exceptionResult.isEmpty() && validationResult.isEmpty())
	     return "success";
	else
	{
		String returnMessage = metaResult;
		if  (!exceptionResult.isEmpty() && !validationResult.isEmpty())
			returnMessage += "\n*** ";
		returnMessage += exceptionResult;
		if  (exceptionResult.isEmpty() && !validationResult.isEmpty())
			returnMessage = "\n" + returnMessage; // skip line before meta tags, etc.
		returnMessage += validationResult;
		return returnMessage;
	}
  }
    /** Default main() method provided for test purposes.
     * @param argv input parameters
     */
    public static void main(String argv[])
    {
		bub testObject = new bub();
		System.out.println ("bub execution self-validation test results: " + testObject.validateSelf());
	}
}
-------------- next part --------------
//package X3dForAdvancedModeling.Animation;

/*
Copyright (c) 1995-2017 held by the author(s).  All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer
      in the documentation and/or other materials provided with the
      distribution.
    * Neither the name of the Web3D Consortium (http://www.web3D.org)
      nor the names of its contributors may be used to endorse or
      promote products derived from this software without specific
      prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/

import java.util.*;
import org.web3d.x3d.jsail.Core.*;
import org.web3d.x3d.jsail.CubeMapTexturing.*;
import org.web3d.x3d.jsail.EnvironmentalEffects.*;
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.Scripting.*;
import org.web3d.x3d.jsail.Shaders.*;
import org.web3d.x3d.jsail.Shape.*;
import org.web3d.x3d.jsail.Texturing.*;
import org.web3d.x3d.jsail.Time.*;

// Javadoc annotations follow, see below for source.
/**
 * <p> a flower. </p>
 <p> Related links: flowers7.java source, <a href="http://www.web3d.org/x3d/content/examples/X3dResources.html" target="_blank">X3D Resources</a>, <a href="http://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html" target="_blank">X3D Scene Authoring Hints</a> and <a href="http://www.web3d.org/x3d/content/X3dTooltips.html" target="_blank">X3D Tooltips</a>. </p>
	<table style="color:black; border:0px solid; border-spacing:10px 0px;" summary="Scene Metadata">
		<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;">X3dForAdvancedModeling.Animation.flowers7  Document Metadata </td>
		</tr>

		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> title </i> </td>
			<td> <a href="http://coderextreme.net/X3DJSONLD/flowers7.x3d">flowers7.x3d</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> creator </i> </td>
			<td> John Carlson </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> generator </i> </td>
			<td> manual </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> identifier </i> </td>
			<td> <a href="http://coderextreme.net/X3DJSONLD/flowers7.x3d" target="_blank">http://coderextreme.net/X3DJSONLD/flowers7.x3d</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> description </i> </td>
			<td> a flower </td>
		</tr>
		<tr style="background-color:silver; border-color:silver;">
			<td style="text-align:center;" colspan="2">    </td>
		</tr>
	</table>

	<p>
		This program uses the
		<a href="http://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="http://www.web3d.org/x3d/stylesheets/X3dToJava.xslt" target="_blank">X3dToJava.xslt</a>
		stylesheet to create Java source code from an <code>.x3d</code> scene.
	</p>

	* @author John Carlson
 */

public class flowers7
{
  /** Default constructor to create this object. */
  public flowers7 ()
  {
    initialize();
  }
	
  /** Create and initialize the X3D model. */
  public final void initialize()
  {
  x3dModel = new X3DObject().setProfile("Immersive").setVersion("3.3")
  .setHead(new headObject()
    .addMeta(new metaObject().setName("title").setContent("flowers7.x3d"))
    .addMeta(new metaObject().setName("creator").setContent("John Carlson"))
    .addMeta(new metaObject().setName("generator").setContent("manual"))
    .addMeta(new metaObject().setName("identifier").setContent("http://coderextreme.net/X3DJSONLD/flowers7.x3d"))
    .addMeta(new metaObject().setName("description").setContent("a flower")))
  .setScene(new SceneObject()
    .addChild(new NavigationInfoObject())
    .addComments(" Images courtesy of Paul Debevec's Light Probe Image Gallery ")
    .addChild(new BackgroundObject("background").setBackUrl(new MFStringObject("\"cubemap/all_probes/beach_cross/beach_back.png\" \"http://coderextreme.net/X3DJSONLD/cubemap/all_probes/beach_cross/beach_back.png\"")).setBottomUrl(new MFStringObject("\"cubemap/all_probes/beach_cross/beach_bottom.png\" \"http://coderextreme.net/X3DJSONLD/cubemap/all_probes/beach_cross/beach_bottom.png\"")).setFrontUrl(new MFStringObject("\"cubemap/all_probes/beach_cross/beach_front.png\" \"http://coderextreme.net/X3DJSONLD/cubemap/all_probes/beach_cross/beach_front.png\"")).setLeftUrl(new MFStringObject("\"cubemap/all_probes/beach_cross/beach_left.png\" \"http://coderextreme.net/X3DJSONLD/cubemap/all_probes/beach_cross/beach_left.png\"")).setRightUrl(new MFStringObject("\"cubemap/all_probes/beach_cross/beach_right.png\" \"http://coderextreme.net/X3DJSONLD/cubemap/all_probes/beach_cross/beach_right.png\"")).setTopUrl(new MFStringObject("\"cubemap/all_probes/beach_cross/beach_top.png\" \"http://coderextreme.net/X3DJSONLD/cubemap/all_probes/beach_cross/beach_top.png\"")))
    .addChild(new ViewpointObject().setDescription("Transparent rose").setPosition(0.0f,0.0f,40.0f))
    .addChild(new TransformObject("Rose01")
      .addChild(new ShapeObject()
        .setAppearance(new AppearanceObject()
          .setMaterial(new MaterialObject().setSpecularColor(.5f,.5f,.5f).setDiffuseColor(.7f,.7f,.7f))
          .setTexture(new ComposedCubeMapTextureObject()
            .setBack(new ImageTextureObject("backShader").setUrl(new MFStringObject("\"cubemap/all_probes/beach_cross/beach_back.png\" \"http://coderextreme.net/X3DJSONLD/cubemap/all_probes/beach_cross/beach_back.png\"")))
            .setBottom(new ImageTextureObject("bottomShader").setUrl(new MFStringObject("\"cubemap/all_probes/beach_cross/beach_bottom.png\" \"http://coderextreme.net/X3DJSONLD/cubemap/all_probes/beach_cross/beach_bottom.png\"")))
            .setFront(new ImageTextureObject("frontShader").setUrl(new MFStringObject("\"cubemap/all_probes/beach_cross/beach_front.png\" \"http://coderextreme.net/X3DJSONLD/cubemap/all_probes/beach_cross/beach_front.png\"")))
            .setLeft(new ImageTextureObject("leftShader").setUrl(new MFStringObject("\"cubemap/all_probes/beach_cross/beach_left.png\" \"http://coderextreme.net/X3DJSONLD/cubemap/all_probes/beach_cross/beach_left.png\"")))
            .setRight(new ImageTextureObject("rightShader").setUrl(new MFStringObject("\"cubemap/all_probes/beach_cross/beach_right.png\" \"http://coderextreme.net/X3DJSONLD/cubemap/all_probes/beach_cross/beach_right.png\"")))
            .setTop(new ImageTextureObject("topShader").setUrl(new MFStringObject("\"cubemap/all_probes/beach_cross/beach_top.png\" \"http://coderextreme.net/X3DJSONLD/cubemap/all_probes/beach_cross/beach_top.png\""))))
          .addShaders(new ComposedShaderObject("cobweb").setLanguage("GLSL")
            .addField(new fieldObject().setAccessType("inputOnly").setName("set_cube").setType("SFInt32").setValue("0"))
            .addField(new fieldObject().setAccessType("initializeOnly").setName("set_chromaticDispertion").setType("SFVec3f").setValue("0.98 1.0 1.033"))
            .addField(new fieldObject().setAccessType("inputOnly").setName("set_bias").setType("SFFloat").setValue("0.5"))
            .addField(new fieldObject().setAccessType("inputOnly").setName("set_scale").setType("SFFloat").setValue("0.5"))
            .addField(new fieldObject().setAccessType("inputOnly").setName("set_power").setType("SFFloat").setValue("2"))
            .addField(new fieldObject().setAccessType("inputOnly").setName("set_a").setType("SFFloat").setValue("10"))
            .addField(new fieldObject().setAccessType("inputOnly").setName("set_b").setType("SFFloat").setValue("1"))
            .addField(new fieldObject().setAccessType("inputOnly").setName("set_c").setType("SFFloat").setValue("20"))
            .addField(new fieldObject().setAccessType("inputOnly").setName("set_d").setType("SFFloat").setValue("20"))
            .addField(new fieldObject().setAccessType("inputOnly").setName("set_tdelta").setType("SFFloat").setValue("0"))
            .addField(new fieldObject().setAccessType("inputOnly").setName("set_pdelta").setType("SFFloat").setValue("0"))
            .addParts(new ShaderPartObject().setUrl(new MFStringObject("\"cobweb_flowers_input.vs\" \"http://coderextreme.net/X3DJSONLD/cobweb_flowers_input.vs\"")))
            .addParts(new ShaderPartObject().setType("FRAGMENT").setUrl(new MFStringObject("\"pc_input_flowers.fs\" \"http://coderextreme.net/X3DJSONLD/pc_input_flowers.fs\"")))))
        .setGeometry(new SphereObject().setRadius(20f).setSolid(false))))
    .addChild(new ScriptObject("UrlSelector").setDirectOutput(true).setSourceCode(
"<![CDATA[" + "\n" +
/* here 3 */ "\n" + 
/* here 3 */ "\n" + 
/* here 3 */ "ecmascript:" + "\n" + 
/* here 3 */ "        function set_fraction( f, tm ) {" + "\n" + 
/* here 3 */ "            var side = Math.floor(f*frontUrls.length);" + "\n" + 
/* here 3 */ "            if (side > frontUrls.length-1) {" + "\n" + 
/* here 3 */ "                side = 0;" + "\n" + 
/* here 3 */ "            }" + "\n" + 
/* here 3 */ "            if (side != old) {" + "\n" + 
/* here 3 */ "                    old = side;" + "\n" + 
/* here 3 */ "                    front_changed[0] = frontUrls[side];" + "\n" + 
/* here 3 */ "                    back_changed[0] = backUrls[side];" + "\n" + 
/* here 3 */ "                    left_changed[0] = leftUrls[side];" + "\n" + 
/* here 3 */ "                    right_changed[0] = rightUrls[side];" + "\n" + 
/* here 3 */ "                    top_changed[0] = topUrls[side];" + "\n" + 
/* here 3 */ "                    bottom_changed[0] = bottomUrls[side];" + "\n" + 
/* here 3 */ "            }" + "\n" + 
/* here 3 */ "        }" + "\n" + "]]>"
)
      .addField(new fieldObject().setAccessType("initializeOnly").setName("frontUrls").setType("MFString").setValue(field_frontUrls_4_36_value))
      .addField(new fieldObject().setAccessType("initializeOnly").setName("backUrls").setType("MFString").setValue(field_backUrls_4_37_value))
      .addField(new fieldObject().setAccessType("initializeOnly").setName("leftUrls").setType("MFString").setValue(field_leftUrls_4_38_value))
      .addField(new fieldObject().setAccessType("initializeOnly").setName("rightUrls").setType("MFString").setValue(field_rightUrls_4_39_value))
      .addField(new fieldObject().setAccessType("initializeOnly").setName("topUrls").setType("MFString").setValue(field_topUrls_4_40_value))
      .addField(new fieldObject().setAccessType("initializeOnly").setName("bottomUrls").setType("MFString").setValue(field_bottomUrls_4_41_value))
      .addField(new fieldObject().setAccessType("outputOnly").setName("front_changed").setType("MFString"))
      .addField(new fieldObject().setAccessType("outputOnly").setName("back_changed").setType("MFString"))
      .addField(new fieldObject().setAccessType("outputOnly").setName("left_changed").setType("MFString"))
      .addField(new fieldObject().setAccessType("outputOnly").setName("right_changed").setType("MFString"))
      .addField(new fieldObject().setAccessType("outputOnly").setName("top_changed").setType("MFString"))
      .addField(new fieldObject().setAccessType("outputOnly").setName("bottom_changed").setType("MFString"))
      .addField(new fieldObject().setAccessType("inputOnly").setName("set_fraction").setType("SFFloat"))
      .addField(new fieldObject().setAccessType("inputOutput").setName("old").setType("SFInt32").setValue("-1")))
    .addChild(new TimeSensorObject("Clock").setCycleInterval(45).setLoop(true))
    .addChild(new ROUTEObject().setFromNode("Clock").setFromField("fraction_changed").setToNode("UrlSelector").setToField("set_fraction"))
    .addChild(new ROUTEObject().setFromNode("UrlSelector").setFromField("front_changed").setToNode("background").setToField("frontUrl"))
    .addChild(new ROUTEObject().setFromNode("UrlSelector").setFromField("back_changed").setToNode("background").setToField("backUrl"))
    .addChild(new ROUTEObject().setFromNode("UrlSelector").setFromField("left_changed").setToNode("background").setToField("leftUrl"))
    .addChild(new ROUTEObject().setFromNode("UrlSelector").setFromField("right_changed").setToNode("background").setToField("rightUrl"))
    .addChild(new ROUTEObject().setFromNode("UrlSelector").setFromField("top_changed").setToNode("background").setToField("topUrl"))
    .addChild(new ROUTEObject().setFromNode("UrlSelector").setFromField("bottom_changed").setToNode("background").setToField("bottomUrl"))
    .addChild(new ROUTEObject().setFromNode("UrlSelector").setFromField("front_changed").setToNode("frontShader").setToField("url"))
    .addChild(new ROUTEObject().setFromNode("UrlSelector").setFromField("back_changed").setToNode("backShader").setToField("url"))
    .addChild(new ROUTEObject().setFromNode("UrlSelector").setFromField("left_changed").setToNode("leftShader").setToField("url"))
    .addChild(new ROUTEObject().setFromNode("UrlSelector").setFromField("right_changed").setToNode("rightShader").setToField("url"))
    .addChild(new ROUTEObject().setFromNode("UrlSelector").setFromField("top_changed").setToNode("topShader").setToField("url"))
    .addChild(new ROUTEObject().setFromNode("UrlSelector").setFromField("bottom_changed").setToNode("bottomShader").setToField("url"))
    .addChild(new ScriptObject("Animate").setDirectOutput(true).setSourceCode(
"<![CDATA[" + "\n" +
/* here 3 */ "\n" + 
/* here 3 */ "\n" + 
/* here 3 */ "ecmascript:" + "\n" + 
/* here 3 */ "\n" + 
/* here 3 */ "function set_a(value) {" + "\n" + 
/* here 3 */ "	a = value;" + "\n" + 
/* here 3 */ "}" + "\n" + 
/* here 3 */ "\n" + 
/* here 3 */ "function set_b(value) {" + "\n" + 
/* here 3 */ "	b = value;" + "\n" + 
/* here 3 */ "}" + "\n" + 
/* here 3 */ "\n" + 
/* here 3 */ "function set_c(value) {" + "\n" + 
/* here 3 */ "	c = value;" + "\n" + 
/* here 3 */ "}" + "\n" + 
/* here 3 */ "\n" + 
/* here 3 */ "function set_d(value) {" + "\n" + 
/* here 3 */ "	d = value;" + "\n" + 
/* here 3 */ "}" + "\n" + 
/* here 3 */ "\n" + 
/* here 3 */ "function set_tdelta(value) {" + "\n" + 
/* here 3 */ "	tdelta = value;" + "\n" + 
/* here 3 */ "}" + "\n" + 
/* here 3 */ "\n" + 
/* here 3 */ "function set_tdelta(value) {" + "\n" + 
/* here 3 */ "	tdelta = value;" + "\n" + 
/* here 3 */ "}" + "\n" + 
/* here 3 */ "\n" + 
/* here 3 */ "function set_fraction() {" + "\n" + 
/* here 3 */ "	var choice = Math.floor(Math.random() * 4);" + "\n" + 
/* here 3 */ "	if (choice == 0) {" + "\n" + 
/* here 3 */ "		set_a(a + Math.floor(Math.random() * 2) * 2 - 1);" + "\n" + 
/* here 3 */ "	} else if (choice == 1) {" + "\n" + 
/* here 3 */ "		set_b(b + Math.floor(Math.random() * 2) * 2 - 1);" + "\n" + 
/* here 3 */ "	} else if (choice == 2) {" + "\n" + 
/* here 3 */ "		set_c(c + Math.floor(Math.random() * 2) * 2 - 1);" + "\n" + 
/* here 3 */ "	} else if (choice == 3) {" + "\n" + 
/* here 3 */ "		set_d(d + Math.floor(Math.random() * 2) * 2 - 1);" + "\n" + 
/* here 3 */ "	}" + "\n" + 
/* here 3 */ "	set_tdelta(tdelta + 0.5);" + "\n" + 
/* here 3 */ "	set_pdelta(pdelta + 0.5);" + "\n" + 
/* here 3 */ "	if (a < 1) {" + "\n" + 
/* here 3 */ "		set_a(10);" + "\n" + 
/* here 3 */ "	}" + "\n" + 
/* here 3 */ "	if (b < 1) {" + "\n" + 
/* here 3 */ "		set_b(10);" + "\n" + 
/* here 3 */ "	}" + "\n" + 
/* here 3 */ "	if (c < 1) {" + "\n" + 
/* here 3 */ "		set_c(4);" + "\n" + 
/* here 3 */ "	}" + "\n" + 
/* here 3 */ "	if (c > 20) {" + "\n" + 
/* here 3 */ "		set_c(4);" + "\n" + 
/* here 3 */ "	}" + "\n" + 
/* here 3 */ "	if (d < 1) {" + "\n" + 
/* here 3 */ "		set_d(4);" + "\n" + 
/* here 3 */ "	}" + "\n" + 
/* here 3 */ "	if (d > 20) {" + "\n" + 
/* here 3 */ "		set_d(4);" + "\n" + 
/* here 3 */ "	}" + "\n" + 
/* here 3 */ "	// console.log(a, b, c, d, tdelta, pdelta);" + "\n" + 
/* here 3 */ "}" + "\n" + "]]>"
)
      .addField(new fieldObject().setAccessType("inputOnly").setName("set_fraction").setType("SFFloat"))
      .addField(new fieldObject().setAccessType("outputOnly").setName("a_changed").setType("SFFloat").setValue("10"))
      .addField(new fieldObject().setAccessType("outputOnly").setName("b_changed").setType("SFFloat").setValue("1"))
      .addField(new fieldObject().setAccessType("outputOnly").setName("c_changed").setType("SFFloat").setValue("20"))
      .addField(new fieldObject().setAccessType("outputOnly").setName("d_changed").setType("SFFloat").setValue("20"))
      .addField(new fieldObject().setAccessType("outputOnly").setName("tdelta_changed").setType("SFFloat").setValue("0"))
      .addField(new fieldObject().setAccessType("outputOnly").setName("pdelta_changed").setType("SFFloat").setValue("0"))
      .addField(new fieldObject().setAccessType("inputOnly").setName("set_a").setType("SFFloat").setValue("10"))
      .addField(new fieldObject().setAccessType("inputOnly").setName("set_b").setType("SFFloat").setValue("1"))
      .addField(new fieldObject().setAccessType("inputOnly").setName("set_c").setType("SFFloat").setValue("20"))
      .addField(new fieldObject().setAccessType("inputOnly").setName("set_d").setType("SFFloat").setValue("20"))
      .addField(new fieldObject().setAccessType("inputOnly").setName("set_tdelta").setType("SFFloat").setValue("0"))
      .addField(new fieldObject().setAccessType("inputOnly").setName("set_pdelta").setType("SFFloat").setValue("0")))
    .addChild(new ROUTEObject().setFromNode("Animate").setFromField("a_changed").setToNode("cobweb").setToField("set_a"))
    .addChild(new ROUTEObject().setFromNode("Animate").setFromField("b_changed").setToNode("cobweb").setToField("set_b"))
    .addChild(new ROUTEObject().setFromNode("Animate").setFromField("c_changed").setToNode("cobweb").setToField("set_c"))
    .addChild(new ROUTEObject().setFromNode("Animate").setFromField("d_changed").setToNode("cobweb").setToField("set_d"))
    .addChild(new ROUTEObject().setFromNode("Animate").setFromField("pdelta_changed").setToNode("cobweb").setToField("set_pdelta"))
    .addChild(new ROUTEObject().setFromNode("Animate").setFromField("tdelta_changed").setToNode("cobweb").setToField("set_tdelta")));
  }
  // end of initialize() method

	/** Large attribute array: field value field, scene-graph level=4, element #36, 9 total values */
	private SFStringObject field_frontUrls_4_36_value = new SFStringObject("\"cubemap/all_probes/beach_cross/beach_front.png\" \"cubemap/all_probes/building_cross/building_front.png\" \"cubemap/all_probes/campus_cross/campus_front.png\" \"cubemap/all_probes/galileo_cross/galileo_front.png\" \"cubemap/all_probes/grace_cross/grace_front.png\" \"cubemap/all_probes/kitchen_cross/kitchen_front.png\" \"cubemap/all_probes/rnl_cross/rnl_front.png\" \"cubemap/all_probes/stpeters_cross/stpeters_front.png\" \"cubemap/all_probes/uffizi_cross/uffizi_front.png\"");

	/** Large attribute array: field value field, scene-graph level=4, element #37, 9 total values */
	private SFStringObject field_backUrls_4_37_value = new SFStringObject("\"cubemap/all_probes/beach_cross/beach_back.png\" \"cubemap/all_probes/building_cross/building_back.png\" \"cubemap/all_probes/campus_cross/campus_back.png\" \"cubemap/all_probes/galileo_cross/galileo_back.png\" \"cubemap/all_probes/grace_cross/grace_back.png\" \"cubemap/all_probes/kitchen_cross/kitchen_back.png\" \"cubemap/all_probes/rnl_cross/rnl_back.png\" \"cubemap/all_probes/stpeters_cross/stpeters_back.png\" \"cubemap/all_probes/uffizi_cross/uffizi_back.png\"");

	/** Large attribute array: field value field, scene-graph level=4, element #38, 9 total values */
	private SFStringObject field_leftUrls_4_38_value = new SFStringObject("\"cubemap/all_probes/beach_cross/beach_left.png\" \"cubemap/all_probes/building_cross/building_left.png\" \"cubemap/all_probes/campus_cross/campus_left.png\" \"cubemap/all_probes/galileo_cross/galileo_left.png\" \"cubemap/all_probes/grace_cross/grace_left.png\" \"cubemap/all_probes/kitchen_cross/kitchen_left.png\" \"cubemap/all_probes/rnl_cross/rnl_left.png\" \"cubemap/all_probes/stpeters_cross/stpeters_left.png\" \"cubemap/all_probes/uffizi_cross/uffizi_left.png\"");

	/** Large attribute array: field value field, scene-graph level=4, element #39, 9 total values */
	private SFStringObject field_rightUrls_4_39_value = new SFStringObject("\"cubemap/all_probes/beach_cross/beach_right.png\" \"cubemap/all_probes/building_cross/building_right.png\" \"cubemap/all_probes/campus_cross/campus_right.png\" \"cubemap/all_probes/galileo_cross/galileo_right.png\" \"cubemap/all_probes/grace_cross/grace_right.png\" \"cubemap/all_probes/kitchen_cross/kitchen_right.png\" \"cubemap/all_probes/rnl_cross/rnl_right.png\" \"cubemap/all_probes/stpeters_cross/stpeters_right.png\" \"cubemap/all_probes/uffizi_cross/uffizi_right.png\"");

	/** Large attribute array: field value field, scene-graph level=4, element #40, 9 total values */
	private SFStringObject field_topUrls_4_40_value = new SFStringObject("\"cubemap/all_probes/beach_cross/beach_top.png\" \"cubemap/all_probes/building_cross/building_top.png\" \"cubemap/all_probes/campus_cross/campus_top.png\" \"cubemap/all_probes/galileo_cross/galileo_top.png\" \"cubemap/all_probes/grace_cross/grace_top.png\" \"cubemap/all_probes/kitchen_cross/kitchen_top.png\" \"cubemap/all_probes/rnl_cross/rnl_top.png\" \"cubemap/all_probes/stpeters_cross/stpeters_top.png\" \"cubemap/all_probes/uffizi_cross/uffizi_top.png\"");

	/** Large attribute array: field value field, scene-graph level=4, element #41, 9 total values */
	private SFStringObject field_bottomUrls_4_41_value = new SFStringObject("\"cubemap/all_probes/beach_cross/beach_bottom.png\" \"cubemap/all_probes/building_cross/building_bottom.png\" \"cubemap/all_probes/campus_cross/campus_bottom.png\" \"cubemap/all_probes/galileo_cross/galileo_bottom.png\" \"cubemap/all_probes/grace_cross/grace_bottom.png\" \"cubemap/all_probes/kitchen_cross/kitchen_bottom.png\" \"cubemap/all_probes/rnl_cross/rnl_bottom.png\" \"cubemap/all_probes/stpeters_cross/stpeters_bottom.png\" \"cubemap/all_probes/uffizi_cross/uffizi_bottom.png\"");

  /** The initialized model object, created within initialize() method. */
  private X3DObject x3dModel;
  
  /** Provide a shallow copy of the X3D model.
   * @return flowers7 model
   */
  public X3DObject getX3dModel()
  {	  
	  return x3dModel;
  }
  
  /** Indicate X3DJSAIL validation results for this X3D model.
   * @return validation results plus exception information, if any
   */
  public String validateSelf()
  {
	String       metaResult = new String();
	String validationResult = new String();
	String  exceptionResult = new String();
	try
	{
		initialize();
		
		if ((getX3dModel() == null) || (getX3dModel().getHead() == null))
		{
			validationResult = "empty scene, nothing to validate. " + x3dModel.validate();
			return validationResult;
		}
		// first list informational meta elements of interest
		for (metaObject meta : getX3dModel().getHead().getMetaList())
		{
			if (meta.getName().equals(metaObject.NAME_ERROR) ||
				meta.getName().equals(metaObject.NAME_WARNING) ||
				meta.getName().equals(metaObject.NAME_HINT) ||
				meta.getName().equals(metaObject.NAME_INFO) ||
				meta.getName().equals(metaObject.NAME_TODO))
			{
				metaResult += meta.toStringX3D();
			}
		}
		validationResult += x3dModel.validate(); // walk entire tree to validate correctness
	}
	catch (Exception e)
	{
		exceptionResult = e.getMessage(); // report exception failures, if any
	}
	if  (metaResult.isEmpty() && exceptionResult.isEmpty() && validationResult.isEmpty())
	     return "success";
	else
	{
		String returnMessage = metaResult;
		if  (!exceptionResult.isEmpty() && !validationResult.isEmpty())
			returnMessage += "\n*** ";
		returnMessage += exceptionResult;
		if  (exceptionResult.isEmpty() && !validationResult.isEmpty())
			returnMessage = "\n" + returnMessage; // skip line before meta tags, etc.
		returnMessage += validationResult;
		return returnMessage;
	}
  }
    /** Default main() method provided for test purposes.
     * @param argv input parameters
     */
    public static void main(String argv[])
    {
		flowers7 testObject = new flowers7();
		System.out.println ("flowers7 execution self-validation test results: " + testObject.validateSelf());
	}
}
-------------- next part --------------
//package X3dForAdvancedModeling.Animation;

/*
Copyright (c) 1995-2017 held by the author(s).  All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer
      in the documentation and/or other materials provided with the
      distribution.
    * Neither the name of the Web3D Consortium (http://www.web3D.org)
      nor the names of its contributors may be used to endorse or
      promote products derived from this software without specific
      prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/

import java.util.*;
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.KeyDeviceSensor.*;
import org.web3d.x3d.jsail.Navigation.*;
import org.web3d.x3d.jsail.PointingDeviceSensor.*;
import org.web3d.x3d.jsail.Scripting.*;
import org.web3d.x3d.jsail.Shape.*;
import org.web3d.x3d.jsail.Text.*;

// Javadoc annotations follow, see below for source.
/**
 * <p> A process pipeline between three spheres (try typing on spheres and blue. </p>
 <p> Related links: pp3.java source, <a href="http://www.web3d.org/x3d/content/examples/X3dResources.html" target="_blank">X3D Resources</a>, <a href="http://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html" target="_blank">X3D Scene Authoring Hints</a> and <a href="http://www.web3d.org/x3d/content/X3dTooltips.html" target="_blank">X3D Tooltips</a>. </p>
	<table style="color:black; border:0px solid; border-spacing:10px 0px;" summary="Scene Metadata">
		<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;">X3dForAdvancedModeling.Animation.pp3  Document Metadata </td>
		</tr>

		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> title </i> </td>
			<td> <a href="http://coderextreme.net/x3d/pp3.x3d">pp3.x3d</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> creator </i> </td>
			<td> John Carlson </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> translator </i> </td>
			<td> John Carlson </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> created </i> </td>
			<td> 5 May 2015 </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> revised </i> </td>
			<td> 2 Dec 2015 </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> description </i> </td>
			<td> A process pipeline between three spheres (try typing on spheres and blue </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> identifier </i> </td>
			<td> <a href="http://coderextreme.net/x3d/pp3.x3d" target="_blank">http://coderextreme.net/x3d/pp3.x3d</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> generator </i> </td>
			<td> manual </td>
		</tr>
		<tr style="background-color:silver; border-color:silver;">
			<td style="text-align:center;" colspan="2">    </td>
		</tr>
	</table>

	<p>
		This program uses the
		<a href="http://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="http://www.web3d.org/x3d/stylesheets/X3dToJava.xslt" target="_blank">X3dToJava.xslt</a>
		stylesheet to create Java source code from an <code>.x3d</code> scene.
	</p>

	* @author John Carlson
 */

public class pp3
{
  /** Default constructor to create this object. */
  public pp3 ()
  {
    initialize();
  }
	
  /** Create and initialize the X3D model. */
  public final void initialize()
  {
  x3dModel = new X3DObject().setProfile("Immersive").setVersion("3.3")
  .setHead(new headObject()
    .addMeta(new metaObject().setName("title").setContent("pp3.x3d"))
    .addMeta(new metaObject().setName("creator").setContent("John Carlson"))
    .addMeta(new metaObject().setName("translator").setContent("John Carlson"))
    .addMeta(new metaObject().setName("created").setContent("5 May 2015"))
    .addMeta(new metaObject().setName("revised").setContent("2 Dec 2015"))
    .addMeta(new metaObject().setName("description").setContent("A process pipeline between three spheres (try typing on spheres and blue"))
    .addMeta(new metaObject().setName("identifier").setContent("http://coderextreme.net/x3d/pp3.x3d"))
    .addMeta(new metaObject().setName("generator").setContent("manual")))
  .setScene(new SceneObject()
    .addChild(new ProtoDeclareObject().setName("Process")
      .setProtoBody(new ProtoBodyObject()
        .addChild(new GroupObject()
          .addComments("left")
          .addChild(new TransformObject().setScale(0.5f,0.5f,0.5f)
            .addChild(new ShapeObject()
              .setAppearance(new AppearanceObject()
                .setMaterial(new MaterialObject().setTransparency(0.5f).setDiffuseColor(0.7f,1.0f,0.0f)))
              .setGeometry(new ExtrusionObject().setSpine(new MFVec3fObject(new float[] {-2.5f,0.0f,0.0f,-1.5f,0.0f,0.0f})).setCreaseAngle(0.785f).setCrossSection(Extrusion_8_12_crossSection)))
            .addComments("<Transform translation=\"-2.5 0 0\"> <Shape> <Text DEF=\"LeftString\" string='\"l\"'/> </Shape> </Transform> <StringSensor DEF=\"LeftSensor\" enabled=\"false\"/> <TouchSensor DEF=\"LeftTouch\" enabled=\"true\"/>"))
          .addComments("right")
          .addChild(new TransformObject().setScale(0.5f,0.5f,0.5f)
            .addChild(new ShapeObject()
              .setAppearance(new AppearanceObject()
                .setMaterial(new MaterialObject().setDiffuseColor(0.0f,0.7f,1.0f).setTransparency(0.5f)))
              .setGeometry(new ExtrusionObject().setCreaseAngle(0.785f).setCrossSection(Extrusion_8_17_crossSection).setSpine(new MFVec3fObject(new float[] {1.5f,0.0f,0.0f,2.5f,0.0f,0.0f}))))
            .addChild(new TransformObject().setTranslation(2.0f,0.0f,0.0f)
              .addChild(new ShapeObject()
                .setAppearance(new AppearanceObject()
                  .setMaterial(new MaterialObject("MaterialLightBlue").setDiffuseColor(1.0f,1.0f,1.0f)))
                .setGeometry(new TextObject("RightString").setString(new MFStringObject("\"r\"")))))
            .addChild(new StringSensorObject("RightSensor").setEnabled(false))
            .addChild(new TouchSensorObject("RightTouch").setDescription("touch to activate")))
          .addComments("up")
          .addChild(new TransformObject().setScale(0.5f,0.5f,0.5f)
            .addChild(new ShapeObject()
              .setAppearance(new AppearanceObject()
                .setMaterial(new MaterialObject().setDiffuseColor(0.0f,0.7f,1.0f).setTransparency(0.5f)))
              .setGeometry(new ExtrusionObject().setSpine(new MFVec3fObject(new float[] {0.0f,1.5f,0.0f,0.0f,2.5f,0.0f})).setCreaseAngle(0.785f).setCrossSection(Extrusion_8_29_crossSection)))
            .addChild(new TransformObject().setTranslation(-0.5f,2.0f,0.0f)
              .addChild(new ShapeObject()
                .setAppearance(new AppearanceObject()
                  .setMaterial(new MaterialObject().setUSE("MaterialLightBlue")))
                .setGeometry(new TextObject("UpString").setString(new MFStringObject("\"u\"")))))
            .addChild(new StringSensorObject("UpSensor").setEnabled(false))
            .addChild(new TouchSensorObject("UpTouch").setDescription("touch to activate")))
          .addComments("down")
          .addChild(new TransformObject().setScale(0.5f,0.5f,0.5f)
            .addChild(new ShapeObject()
              .setAppearance(new AppearanceObject()
                .setMaterial(new MaterialObject().setTransparency(0.5f).setDiffuseColor(0.7f,1.0f,0.0f)))
              .setGeometry(new ExtrusionObject().setSpine(new MFVec3fObject(new float[] {0.0f,-2.5f,0.0f,0.0f,-1.5f,0.0f})).setCreaseAngle(0.785f).setCrossSection(Extrusion_8_41_crossSection)))
            .addComments("<Transform translation=\"-0.5 -2.5 0\"> <Shape> <Text DEF=\"DownString\" string='\"d\"'/> </Shape> </Transform> <StringSensor DEF=\"DownSensor\" enabled=\"false\"/> <TouchSensor description='touch to activate' DEF=\"DownTouch\" enabled=\"true\"/>"))
          .addComments("center")
          .addChild(new TransformObject()
            .addChild(new ShapeObject()
              .setAppearance(new AppearanceObject()
                .setMaterial(new MaterialObject().setDiffuseColor(1.0f,0.0f,0.7f)))
              .setGeometry(new SphereObject()))
            .addChild(new TransformObject().setTranslation(-0.5f,0.0f,1.0f).setScale(0.5f,0.5f,0.5f)
              .addChild(new ShapeObject()
                .setAppearance(new AppearanceObject()
                  .setMaterial(new MaterialObject().setUSE("MaterialLightBlue")))
                .setGeometry(new TextObject("CenterString"))))
            .addChild(new StringSensorObject("CenterSensor").setEnabled(false))
            .addChild(new TouchSensorObject("CenterTouch").setDescription("touch to activate"))))
        .addChild(new ScriptObject("RightSingleToMultiString").setSourceCode(
"<![CDATA[" + "\n" +
"\n" + 
"ecmascript:" + "\n" + 
"\n" + 
"function initialize() {" + "\n" + 
"	rightlines = new MFString(\"\");" + "\n" + 
"}" + "\n" + 
"\n" + 
"function set_rightstring(rightstr) {" + "\n" + 
"	rightlines = new MFString(rightstr);" + "\n" + 
"}" + "\n" + "]]>"
)
          .addField(new fieldObject().setAccessType("inputOnly").setName("set_rightstring").setType("SFString"))
          .addField(new fieldObject().setAccessType("outputOnly").setName("rightlines").setType("MFString")))
        .addChild(new ScriptObject("UpSingleToMultiString").setSourceCode(
"<![CDATA[" + "\n" +
"\n" + 
"ecmascript:" + "\n" + 
"\n" + 
"function initialize() {" + "\n" + 
"	uplines = new MFString(\"\");" + "\n" + 
"}" + "\n" + 
"\n" + 
"function set_upstring(upstr) {" + "\n" + 
"	uplines = new MFString(upstr);" + "\n" + 
"}" + "\n" + "]]>"
)
          .addField(new fieldObject().setAccessType("inputOnly").setName("set_upstring").setType("SFString"))
          .addField(new fieldObject().setAccessType("outputOnly").setName("uplines").setType("MFString")))
        .addChild(new ScriptObject("CenterSingleToMultiString").setSourceCode(
"<![CDATA[" + "\n" +
"\n" + 
"ecmascript:" + "\n" + 
"\n" + 
"function initialize() {" + "\n" + 
"	centerlines = new MFString(\"\");" + "\n" + 
"}" + "\n" + 
"\n" + 
"function set_centerstring(centerstr) {" + "\n" + 
"	centerlines = new MFString(centerstr);" + "\n" + 
"}" + "\n" + "]]>"
)
          .addField(new fieldObject().setAccessType("inputOnly").setName("set_centerstring").setType("SFString"))
          .addField(new fieldObject().setAccessType("outputOnly").setName("centerlines").setType("MFString")))
        .addChild(new ROUTEObject().setFromNode("CenterSensor").setFromField("enteredText").setToNode("CenterSingleToMultiString").setToField("set_centerstring"))
        .addChild(new ROUTEObject().setFromNode("CenterSingleToMultiString").setFromField("centerlines").setToNode("CenterString").setToField("set_string"))
        .addChild(new ROUTEObject().setFromNode("CenterTouch").setFromField("isOver").setToNode("CenterSensor").setToField("set_enabled"))
        .addChild(new ROUTEObject().setFromNode("RightSensor").setFromField("enteredText").setToNode("RightSingleToMultiString").setToField("set_rightstring"))
        .addChild(new ROUTEObject().setFromNode("RightSingleToMultiString").setFromField("rightlines").setToNode("RightString").setToField("set_string"))
        .addChild(new ROUTEObject().setFromNode("RightTouch").setFromField("isOver").setToNode("RightSensor").setToField("set_enabled"))
        .addChild(new ROUTEObject().setFromNode("UpSensor").setFromField("enteredText").setToNode("UpSingleToMultiString").setToField("set_upstring"))
        .addChild(new ROUTEObject().setFromNode("UpSingleToMultiString").setFromField("uplines").setToNode("UpString").setToField("set_string"))
        .addChild(new ROUTEObject().setFromNode("UpTouch").setFromField("isOver").setToNode("UpSensor").setToField("set_enabled"))))
    .addChild(new NavigationInfoObject())
    .addChild(new ViewpointObject().setDescription("Process pipes").setPosition(0.0f,5.0f,12.0f).setOrientation(1.0f,0.0f,0.0f,-0.4f))
    .addChild(new TransformObject().setTranslation(0.0f,-2.5f,0.0f)
      .addChild(new ProtoInstanceObject().setName("Process")))
    .addChild(new TransformObject()
      .addChild(new ProtoInstanceObject().setName("Process")))
    .addChild(new TransformObject().setTranslation(0.0f,2.5f,0.0f)
      .addChild(new ProtoInstanceObject().setName("Process"))));
  }
  // end of initialize() method

	/** Large attribute array: Extrusion crossSection field, scene-graph level=8, element #12, 34 total numbers made up of 17 2-tuple values */
	private MFVec2fObject Extrusion_8_12_crossSection = new MFVec2fObject() /* splitting up long array to improve readability */
	.append(new MFVec2fObject(new float[] {1.0f,0.0f,0.92f,-0.38f,0.71f,-0.71f,0.38f,-0.92f,0.0f,-1.0f,-0.38f,-0.92f,-0.71f,-0.71f,-0.92f,-0.38f,-1.0f,0.0f,-0.92f,0.38f}))
	.append(new MFVec2fObject(new float[] {-0.71f,0.71f,-0.38f,0.92f,0.0f,1.0f,0.38f,0.92f,0.71f,0.71f,0.92f,0.38f,1.0f,0.0f}));

	/** Large attribute array: Extrusion crossSection field, scene-graph level=8, element #17, 34 total numbers made up of 17 2-tuple values */
	private MFVec2fObject Extrusion_8_17_crossSection = new MFVec2fObject() /* splitting up long array to improve readability */
	.append(new MFVec2fObject(new float[] {1.0f,0.0f,0.92f,-0.38f,0.71f,-0.71f,0.38f,-0.92f,0.0f,-1.0f,-0.38f,-0.92f,-0.71f,-0.71f,-0.92f,-0.38f,-1.0f,0.0f,-0.92f,0.38f}))
	.append(new MFVec2fObject(new float[] {-0.71f,0.71f,-0.38f,0.92f,0.0f,1.0f,0.38f,0.92f,0.71f,0.71f,0.92f,0.38f,1.0f,0.0f}));

	/** Large attribute array: Extrusion crossSection field, scene-graph level=8, element #29, 34 total numbers made up of 17 2-tuple values */
	private MFVec2fObject Extrusion_8_29_crossSection = new MFVec2fObject() /* splitting up long array to improve readability */
	.append(new MFVec2fObject(new float[] {1.0f,0.0f,0.92f,-0.38f,0.71f,-0.71f,0.38f,-0.92f,0.0f,-1.0f,-0.38f,-0.92f,-0.71f,-0.71f,-0.92f,-0.38f,-1.0f,0.0f,-0.92f,0.38f}))
	.append(new MFVec2fObject(new float[] {-0.71f,0.71f,-0.38f,0.92f,0.0f,1.0f,0.38f,0.92f,0.71f,0.71f,0.92f,0.38f,1.0f,0.0f}));

	/** Large attribute array: Extrusion crossSection field, scene-graph level=8, element #41, 34 total numbers made up of 17 2-tuple values */
	private MFVec2fObject Extrusion_8_41_crossSection = new MFVec2fObject() /* splitting up long array to improve readability */
	.append(new MFVec2fObject(new float[] {1.0f,0.0f,0.92f,-0.38f,0.71f,-0.71f,0.38f,-0.92f,0.0f,-1.0f,-0.38f,-0.92f,-0.71f,-0.71f,-0.92f,-0.38f,-1.0f,0.0f,-0.92f,0.38f}))
	.append(new MFVec2fObject(new float[] {-0.71f,0.71f,-0.38f,0.92f,0.0f,1.0f,0.38f,0.92f,0.71f,0.71f,0.92f,0.38f,1.0f,0.0f}));

  /** The initialized model object, created within initialize() method. */
  private X3DObject x3dModel;
  
  /** Provide a shallow copy of the X3D model.
   * @return pp3 model
   */
  public X3DObject getX3dModel()
  {	  
	  return x3dModel;
  }
  
  /** Indicate X3DJSAIL validation results for this X3D model.
   * @return validation results plus exception information, if any
   */
  public String validateSelf()
  {
	String       metaResult = new String();
	String validationResult = new String();
	String  exceptionResult = new String();
	try
	{
		initialize();
		
		if ((getX3dModel() == null) || (getX3dModel().getHead() == null))
		{
			validationResult = "empty scene, nothing to validate. " + x3dModel.validate();
			return validationResult;
		}
		// first list informational meta elements of interest
		for (metaObject meta : getX3dModel().getHead().getMetaList())
		{
			if (meta.getName().equals(metaObject.NAME_ERROR) ||
				meta.getName().equals(metaObject.NAME_WARNING) ||
				meta.getName().equals(metaObject.NAME_HINT) ||
				meta.getName().equals(metaObject.NAME_INFO) ||
				meta.getName().equals(metaObject.NAME_TODO))
			{
				metaResult += meta.toStringX3D();
			}
		}
		validationResult += x3dModel.validate(); // walk entire tree to validate correctness
	}
	catch (Exception e)
	{
		exceptionResult = e.getMessage(); // report exception failures, if any
	}
	if  (metaResult.isEmpty() && exceptionResult.isEmpty() && validationResult.isEmpty())
	     return "success";
	else
	{
		String returnMessage = metaResult;
		if  (!exceptionResult.isEmpty() && !validationResult.isEmpty())
			returnMessage += "\n*** ";
		returnMessage += exceptionResult;
		if  (exceptionResult.isEmpty() && !validationResult.isEmpty())
			returnMessage = "\n" + returnMessage; // skip line before meta tags, etc.
		returnMessage += validationResult;
		return returnMessage;
	}
  }
    /** Default main() method provided for test purposes.
     * @param argv input parameters
     */
    public static void main(String argv[])
    {
		pp3 testObject = new pp3();
		System.out.println ("pp3 execution self-validation test results: " + testObject.validateSelf());
	}
}


More information about the x3d-public mailing list