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

yottzumm at gmail.com yottzumm at gmail.com
Sun Feb 5 18:34:24 PST 2017


I am not sure this is fixed yet.  See attached Java, input JSON and diff -w (running the Java should produce a JSON.json to compare).   A new example.

John

Sent from Mail for Windows 10

From: Don Brutzman
Sent: Saturday, February 4, 2017 9:25 PM
To: yottzumm at gmail.com
Cc: Roy Walmsley; x3d-public at web3d.org
Subject: Re: X3DJSAIL. IS children of ProtoInstance not being exported

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20170205/f0de54bb/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: abox.diff
Type: application/octet-stream
Size: 464 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20170205/f0de54bb/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: abox.java
Type: application/octet-stream
Size: 6353 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20170205/f0de54bb/attachment-0003.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: abox.json
Type: application/json
Size: 3797 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20170205/f0de54bb/attachment-0001.json>


More information about the x3d-public mailing list