[x3d-public] X3DJSAIL. IS children of ProtoInstance not being exported

Don Brutzman brutzman at nps.edu
Sat Feb 4 18:25:22 PST 2017


John, took some footstep-following to agree with your diagnosis below, plus there was some additional trickiness involved (as usual).  This omission should be fixed and checked in now too.

ProtoInstance child ordering is special and requires special handling, since IS/connect must follow any fieldValue overrides.

Pretty impressive that you were able to spot something missing!

Hopefully it now works for both toStringX3D() and toStringClassicVRML() cases.  The ClassicVRML encoding handles IS as part of fieldValue seriealization, I think.

Source code inspection looks good, but I was not able to test fully however.  Retests welcome.

	http://www.web3d.org/specifications/java/src/org/web3d/x3d/java/Core/ProtoInstanceObject.java

Roaring through thousands of scenes in the X3D Examples Archive is a heckuva unit test suite!  Thanks for the tag-team efforts, very helpful.

	https://en.wikipedia.org/wiki/Test_suite

	http://www.web3d.org/x3d/content/examples/X3dResources.html#Examples

Onward we go...


On 2/2/2017 8:26 AM, yottzumm at gmail.com wrote:
> Although IS children of Transform are being exported, IS children of ProtoInstance are not being exported to XML or JSON in X3DJSAIL.  See attached Java example (I didn’t see that my Java was wrong, but I should probably use the new Declarative syntax to be sure).  Perhaps the IS variable is missing from toStringX3D()?
>
> I believe ProtoInstanceObject.java is missing the line:
>
>                           if (getIS() != null)
>
>                                   stringX3D.append(getIS().toStringX3D(level + indentIncrement));
> Found in TransformObject.java
>
>
> I believe this Java derives from these lines in: CreateX3dSceneAccessInterfaceJava.xslt:
>
>
>
> <xsl:if test="not($isX3dStatement = 'true') and not($name = 'CommentsBlock') and not($name = 'Script')">
>
>                         <xsl:text>
>
>                         if (getIS() != null)
>
>                                 stringX3D.append(getIS().toStringX3D(level + indentIncrement));</xsl:text>
>                 </xsl:if>
>
> Probably ProtoInstance should be included instead of excluded as a statement?   We’ve been revisiting this several times.  Is ProtoInstance actually as statement?  I think ProtoInstance should be included in this test case.
>
> Will provide diffs for your own perusal soon.
>
> John


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