[x3d-public] Problem with X3D Java SAI. Setting IS statements on ProtoInstances (box.x3d)

Don Brutzman brutzman at nps.edu
Sun Jan 1 17:54:54 PST 2017


On 12/31/2016 2:40 PM, yottzumm at gmail.com wrote:
> See attached files for issues with setting IS statements on ProtoInstances.  Here are the compilation errors:

wow.  what an impressive test case, nested prototypes with nested IS/connect!!   Happy new year indeed... 8)

looks like the original-source excerpt causing the compilation failure is

	<ProtoInstance name="anyShape">
	  <fieldValue name="xtranslation" value="0 0 0"></fieldValue>
	  <IS>
	    <connect nodeField="myShape" protoField="myShape"></connect>
	  </IS>
	</ProtoInstance>

your scene passes all validation, so that is a good sign.  if the Schema and DTD allow something like this, it is likely permissible.

conceptually, since ProtoInstance is just another node, and since nested Prototypes are allowed, it would seem to be permissible.

looking at spec:

	4.4.4.3 PROTO definition semantics
	http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/concepts.html#PROTOdefinitionsemantics

	"IS statements may appear inside the prototype definition wherever fields may appear."
and
	4.4.4.4 Prototype scoping rules
	http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/concepts.html#Prototypescopingrules

	"Prototype definitions appearing inside a prototype definition (i.e., nested) are local to the enclosing prototype. IS statements inside a nested prototype's implementation may refer to the prototype declarations of the innermost prototype."

so yes, that looks to make it quite legal.  OK, onward to bugfix... successful.

updated and checked in CreateX3dSceneAccessInterfaceJava.xslt stylesheet changes to construct ProtoInstance methods getIs, setIs.

	http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/java/Core/ProtoInstanceObject.html
	http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/java/Core/ProtoInstanceObject.html#getIS--
	http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/java/Core/ProtoInstanceObject.html#setIS-org.web3d.x3d.java.Core.ISObject-

package update available at

	X3D Java Scene Access Interface (SAI) Library
	http://www.web3d.org/specifications/java/X3dJavaSceneAuthoringInterface.html

also updated to X3D Tooltips to make this point clear.

	http://www.web3d.org/x3d/tooltips/X3dTooltips.html#ProtoDeclare
	http://www.web3d.org/x3d/tooltips/X3dTooltips.html#ProtoInstance

have fun with X3D prototypes! 8)

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



More information about the x3d-public mailing list