[x3d-public] Container Field alternate values for Shape. Correct in X3DUOM, incorrect in X3DJSAIL.

John Carlson yottzumm at gmail.com
Sun Apr 17 20:45:13 PDT 2022


Thanks, Don, I will look more into your patches later, so far, it looks
awesome.

I am mostly talking about several SquawLOD examples under Geospatial under
Basic.  Since you don’t like tons of examples spewed, I just listed one
near the the top of the stack trace in the first message.

There was another error (previously not included in this thread) where
setRootNode (not addRootNode) in my SquawLOD023.java file somehow got the
rootNode containerField overwritten with a children containerField in at
least JSON output.   The obvious fix to this is to not use setRootNode!  I
previously noted that I use “set” for the first “child” for an MFNode  in
Java.   Others use “add”.   This error needs to be reanalyzed.

You may wish to overwrite your addRootNode with setRootNode to see if you
get the same problem, but no need to make work for yourself when this could
use more analysis.

But for completeness, you might want to add a test for this.  I don’t know
yet if your patches have repaired this issue, I will look into both.

I realize that X3DJSAIL may not be able to be built by a casual user; I
think I posted a patch to build.xml with the xmlresolver jars (not sure
which one fixed it) being added to the classpath of the Transform(er?)
Saxon stylesheet processor.

So far, I have made two patches.   There may be more.

I’ve also posted to StackOverflow on the Saxon -? argument issue that I ran
across on Linux and Windows.   This remains commented out.

I have reverted to OpenJDK 17.0.2 for all cases.

On Sun, Apr 17, 2022 at 9:31 PM Brutzman, Donald (Don) (CIV) <
brutzman at nps.edu> wrote:

> Hi John.  I do appreciate your troubleshooting, thanks.  As ever, am
> replying when circumstances permit.
>
>
>
> I must admit that after a number of minutes looking at this post and
> related posts, I am not really sure what error you are reporting, nor what
> X3D scene snippet caused it.
>
>
>
> Let’s start with your subject line first: “Container Field alternate
> values for Shape. Correct in X3DUOM, incorrect in X3DJSAIL.”
>
>
>
> When we go into X3dUnifiedObjectModel-4.0.xml on line 35151
>
>
>
>       <ConcreteNode name="Shape">
>
>          <InterfaceDefinition specificationUrl=
> https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-CD1/Part01/components/shape.html#Shape
>
>                                appinfo="Shape can appear under any
> grouping node.">
>
>             <componentInfo name="Shape" level="1"/>
>
>             <Inheritance baseType="X3DShapeNode"/>
>
> <!--field definitions -->
>
>             <containerField default="children" type="
> containerFieldChoicesGroupLODShapeTransform"/>
>
>             <ContentModel>
>
>                <GroupContentModel name="ChildContentModelCore"
> minOccurs="0"/>
>
>                <GroupContentModel name="ShapeChildContentModel"
> minOccurs="0"/>
>
>             </ContentModel>
>
>          </InterfaceDefinition>
>
>       </ConcreteNode>
>
>
>
> Then line 253
>
>
>
>       <SimpleType name="containerFieldChoicesGroupLODShapeTransform"
>
>                    baseType="xs:NMTOKEN"
>
>                    appinfo="containerFieldChoicesGroupLODShapeTransform
> lists the allowed containerField enumeration values for Shape, Transform
> and LOD nodes: "children" if parent node has abstract type
> X3DGroupingNode, otherwise "metadata" default."
>
>                    documentation=
> https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#containerField
> >
>
>          <enumeration value="children"
>
>                        appinfo="parent node has abstract type
> X3DGroupingNode"/>
>
>          <enumeration value="proxy" appinfo="parent node is Collision"/>
>
>          <enumeration value="rootNode" appinfo="parent node is GeoLOD"/>
>
>          <enumeration value="shape" appinfo="parent node is CADFace or
> CollidableShape"/>
>
>          <enumeration value="skin" appinfo="parent node is HAnimHumanoid"/>
>
>       </SimpleType>
>
>
>
> These indicate that Shape might be contained by five different parent
> nodes, with each case described in appinfo, with corresponding field name
> children or proxy or rootNode or shape or skin
>
>
>
> OK now let’s to into X3DJSAIL Java source and find Shape.java to see if it
> matches.  Lines 33 and 412:
>
>
>
> package org.web3d.x3d.jsail.Shape;
>
>
>
> containerField_ALTERNATE_VALUES = new String[] { "children", "proxy",
> "shape" }; // type containerFieldChoicesGroupLODShapeTransform
>
>
>
> So boom: hardest part is accomplished, have isolated a bug.  Somehow we
> are missing “rootNode” and “skin” enumerations from
> containerField_ALTERNATE_VALUES.
>
>
>
> The comment you listed “TODO once recorded” etc. is found in
> CreateSceneAccessInterfaceJava.xslt on line 3650.
>
>
>
> The code block that erroneously defined the necessary values appears
> immediately after that.  I worked on improving that, with apparent success
> getting values out of X3DUOM.
>
>
>
> Corrected output in Shape.java looks good:
>
>
>
> containerField_ALTERNATE_VALUES = new String[] { "children", "proxy",
> "shape", "rootNode", "skin" }; // type
> containerFieldChoicesGroupLODShapeTransform
>
>
>
> This correction to properly use X3DUOM likely fixed other hidden errors as
> well.
>
>
>
> Also fixed incorrect field defaults: SFBool default is false,
> SFVec4f/SFVec4d is 0 0 0 1
>
>
>
> I’d like to post a new release but other problems are occurring in the
> build tests that I need to resolve first.
>
>
>
> Meanwhile have committed all corrections that I have, hopefully that helps
> you get farther.  If you would like an intermediate (not fully tested)
> x3djsail.4.0 jar update, please let me know.
>
>
>
> Hope this helps.
>
>
>
> 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 https://
> faculty.nps.edu/brutzman
>
>
>
> *From:* John Carlson <yottzumm at gmail.com>
> *Sent:* Saturday, April 16, 2022 11:37 PM
> *To:* Brutzman, Donald (Don) (CIV) <brutzman at nps.edu>; X3D Graphics
> public mailing list <x3d-public at web3d.org>
> *Subject:* Re: Container Field alternate values for Shape. Correct in
> X3DUOM, incorrect in X3DJSAIL.
>
>
>
> It appears that this is yet to be addressed in the X3DJSAIL stylesheet
>
>
>
> <!-- TODO once recorded in X3D XML Schema and X3D Object Model, iterate
> over values and add to array -->
>
>
>
> Thanks for looking into/repairing this!
>
>
>
> John
>
>
>
> On Sun, Apr 17, 2022 at 1:29 AM John Carlson <yottzumm at gmail.com> wrote:
>
> I don't think that containerField_ALTERNATE_VALUES is correct for Shape.
> This is perhaps related to the other rootNode issue, where rootNode gets
> overridden by children?
>
>
>
> Look at X3DUOM possibilities for Shape containerFields.
>
>
>
> Thanks for looking into this.   I'm going to start digging in
>
>
>
> runone:
>      [echo] Validate C:\x3d-code\www.web3d.org\x3d\content\examples\Basic\Geospatial\SquawLOD023.json
> with classpath .:/x3d-code/
> www.web3d.org/x3d/stylesheets/java/jars/X3DJSAIL.4.0.full.jar
>      [java] Validating C:\x3d-code\www.web3d.org
> \x3d\content\examples\Basic\Geospatial\SquawLOD023.json
>      [java] org.web3d.x3d.sai.InvalidFieldValueException: Invalid
> setContainerFieldOverride() value='rootNode', legal values for Shape are
> containerField_ALTERNATE_VALUES='"children" "proxy" "shape"'
>      [java]     at
> org.web3d.x3d.jsail.X3DConcreteNode.setContainerFieldOverride(X3DConcreteNode.java:401)
>      [java]     at
> org.web3d.x3d.jsail.X3DLoaderDOM.toX3dModelInstance(X3DLoaderDOM.java:631)
>      [java]     at
> org.web3d.x3d.jsail.X3DLoaderDOM.toX3dModelInstance(X3DLoaderDOM.java:619)
>      [java]     at
> org.web3d.x3d.jsail.X3DLoaderDOM.toX3dModelInstance(X3DLoaderDOM.java:619)
>      [java]     at
> org.web3d.x3d.jsail.X3DLoaderDOM.toX3dModelInstance(X3DLoaderDOM.java:490)
>      [java]     at
> org.web3d.x3d.jsail.X3DLoaderDOM.toX3dModelInstance(X3DLoaderDOM.java:453)
>      [java]     at Validate.main(Validate.java:18)
>      [java]     at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
>      [java]     at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
>      [java]     at
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>      [java]     at
> java.base/java.lang.reflect.Method.invoke(Method.java:568)
>      [java]     at
> org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:218)
>      [java]     at
> org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:155)
>      [java]     at org.apache.tools.ant.taskdefs.Java.run(Java.java:891)
>      [java]     at
> org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:231)
>      [java]     at
> org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:135)
>      [java]     at
> org.apache.tools.ant.taskdefs.Java.execute(Java.java:108)
>      [java]     at
> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:299)
>      [java]     at
> jdk.internal.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
>      [java]     at
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>      [java]     at
> java.base/java.lang.reflect.Method.invoke(Method.java:568)
>      [java]     at
> org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
>      [java]     at org.apache.tools.ant.Task.perform(Task.java:350)
>      [java]     at org.apache.tools.ant.Target.execute(Target.java:449)
>      [java]     at
> org.apache.tools.ant.Target.performTasks(Target.java:470)
>      [java]     at
> org.apache.tools.ant.Project.executeSortedTargets(Project.java:1401)
>      [java]     at
> org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:36)
>      [java]     at
> org.apache.tools.ant.Project.executeTargets(Project.java:1264)
>      [java]     at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:437)
>      [java]     at
> org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:106)
>      [java]     at
> jdk.internal.reflect.GeneratedMethodAccessor60.invoke(Unknown Source)
>      [java]     at
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>      [java]     at
> java.base/java.lang.reflect.Method.invoke(Method.java:568)
>      [java]     at
> org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
>      [java]     at org.apache.tools.ant.Task.perform(Task.java:350)
>      [java]     at java.base/java.util.Vector.forEach(Vector.java:1365)
>      [java]     at
> org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:67)
>      [java]     at
> net.sf.antcontrib.logic.ForEach.executeSequential(ForEach.java:178)
>      [java]     at
> net.sf.antcontrib.logic.ForEach.execute(ForEach.java:254)
>      [java]     at
> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:299)
>      [java]     at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20220417/fb7d7905/attachment-0001.html>


More information about the x3d-public mailing list