[x3d-public] More Object Model Work.

Don Brutzman brutzman at nps.edu
Sun Aug 20 20:33:56 PDT 2017


Lots of good thinking on future possibilities here.

Before splitting into separate jars, it would be good to understand the use case first.  Perhaps really lightweight subset implementations for each X3D profile.  Conceptualizing a unit test for ensuring .jar correctness would be good, also don't want collisions if multiple .jars are employed simultaneously.

Meanwhile each node definition in object model includes component and baseline level information.  Example excerpt:

       <ConcreteNode name="Anchor">
          <InterfaceDefinition specificationUrl="http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/networking.html#Anchor">
             <componentInfo name="Networking" level="2"/>
             <Inheritance baseType="X3DGroupingNode"/>
             <AdditionalInheritance baseType="X3DUrlObject"/>
             <field type="MFNode"
                    accessType="inputOnly"
                    name="addChildren"
                    acceptableNodeTypes="X3DChildNode"
                    inheritedFrom="X3DGroupingNode">
                <componentInfo name="Grouping" level="2"/>
             </field>
             <field type="SFVec3f"
                    accessType="initializeOnly"
                    name="bboxCenter"
                    default="0 0 0"
                    inheritedFrom="X3DGroupingNode"/>
             <field type="SFVec3f"
                    accessType="initializeOnly"
                    name="bboxSize"
                    default="-1 -1 -1"
                    inheritedFrom="X3DGroupingNode"
                    baseType="boundingBoxSizeType"/>
             <field type="MFNode"
                    accessType="inputOutput"
                    name="children"
                    acceptableNodeTypes="X3DChildNode"
                    inheritedFrom="X3DGroupingNode"/>
             <field type="SFString" accessType="inputOutput" name="description"/>
             <field type="SFNode"
                    accessType="inputOutput"
                    name="metadata"
                    default="NULL"
                    acceptableNodeTypes="X3DMetadataObject"
                    inheritedFrom="X3DNode"/>
             <field type="MFString" accessType="inputOutput" name="parameter"/>
             <field type="MFNode"
                    accessType="inputOnly"
                    name="removeChildren"
                    acceptableNodeTypes="X3DChildNode"
                    inheritedFrom="X3DGroupingNode">
                <componentInfo name="Grouping" level="2"/>
             </field>
             <field type="MFString" accessType="inputOutput" name="url">
                <componentInfo name="Networking" level="4"/>
             </field>
             <field type="SFString"
                    accessType="inputOutput"
                    name="DEF"
                    inheritedFrom="DEF_USE"/>
             <field type="SFString"
                    accessType="inputOutput"
                    name="USE"
                    inheritedFrom="DEF_USE"/>
             <field type="SFString"
                    accessType="inputOutput"
                    name="class"
                    inheritedFrom="globalAttributes"/>
             <containerFieldDefault name="children"/>
             <ContentModel>
                <GroupContentModel name="ChildContentModel" minOccurs="0" maxOccurs="unbounded"/>
                <GroupContentModel name="ChildContentModelCore" minOccurs="0"/>
             </ContentModel>
          </InterfaceDefinition>
       </ConcreteNode>

TODO:
a. The component info should get added as a convenience in X3DJSAIL.  Example: final String AnchorObject.COMPONENT = "Networking";
b. The level info is a bit trickier, since different attributes can be at different levels.  Needs more thought.  Level listed as above makes sense; level on a per-attribute basis seems overly complex.
c. Path to deciding on how to best handle level is to make such level checking on non-default attribute values part of node self-validation.


On 8/20/2017 5:02 PM, John Carlson wrote:
> So all levels of a component up to the profile supported level can go into it’s profile jar under the same named packages (perhaps numbered, but modules themselves aren’t supposed to have versions). Profile jars cannot be mixed unless they contain separate packages.  We might have to give packages a level number, which would be unfortunate, but clearer.
> 
> I think that’s right. Corrections are welcome.
> 
> John
> 
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
> 
> *From: *John Carlson <mailto:yottzumm at gmail.com>
> *Sent: *Sunday, August 20, 2017 7:12 PM
> *To: *X3D Graphics public mailing list <mailto:x3d-public at web3d.org>; Don Brutzman <mailto:brutzman at nps.edu>; Roy Walmsley <mailto:roy.walmsley at ntlworld.com>
> *Subject: *More Object Model Work.
> 
> One problem with CreateX3dSceneAccessInterfaceJava.xslt currently is that it generates code for all of the XML schema AFAIK.  Options to only include various profiles, (X3D) components and levels might be desirable in X3DJSAIL, perhaps by splitting out different jars. I guess we can wait until Java 9 modules.  We might want to think about how to generate Java 9 module-info.java’s from the object model for various profiles. [ exercise left to the reader ]. Note: packages cannot be split between modules, last I heard.
> 
> We also might want to think about how to have JSON schemas for the various profiles, and reject nodes and statements which don’t match the profile.
> 
> In other words, I  don’t see links between component(+level) and specific profiles in the object model.
> 
> Perhaps this is intentional?
> 
> In the XML schema, there is
> 
>        <xs:group name="ChildContentModelDIS">
> 
>          <xs:group name="ChildContentModelFull">
> 
>          <xs:group name="ChildContentModelGeoSpatial">
> 
>          <xs:group name="ChildContentModelHumanoidAnimation">
> 
>          <xs:group name="ChildContentModelImmersive">
> 
>          <xs:group name="ChildContentModelInteractive">
> 
>          <xs:group name="ChildContentModelInterchange">
> 
>          <xs:group name="ChildContentModelNurbs">
> 
>          <xs:group name="ChildContentModelProtoInstance">
> 
> And many ref’s.
> 
>              <xs:group ref="ChildContentModelDIS"/>
> 
>                          <xs:group ref="ChildContentModelFull"/>
> 
>                          <xs:group ref="ChildContentModelGeoSpatial"/>
> 
>                          <xs:group ref="ChildContentModelHumanoidAnimation"/>
> 
>                          <xs:group ref="ChildContentModelImmersive"/>
> 
>                          <xs:group ref="ChildContentModelInteractive"/>
> 
>                          <xs:group ref="ChildContentModelInterchange"/>
> 
>                          <xs:group ref="ChildContentModelNurbs"/>
> 
>                          <xs:group ref="ChildContentModelProtoInstance"/>
> 
> But in the object model, I don’t see the above:
> 
> $ grep ChildContent X3DObjectModel-3.3.xml |sort -u
> 
>                 <GroupContentModel name="AppearanceChildContentModel"
> 
>                 <GroupContentModel name="ChildContentModel" minOccurs="0" maxOccurs="unbounded"/>
> 
>                 <GroupContentModel name="ChildContentModelCore" minOccurs="0" maxOccurs="unbounded"/>
> 
>                 <GroupContentModel name="ChildContentModelCore" minOccurs="0"/>
> 
>                 <GroupContentModel name="ChildContentModelCore"/>
> 
>                 <GroupContentModel name="GroupingNodeChildContentModel"/>
> 
>                 <GroupContentModel name="LoadSensorChildContentModel"
> 
>                 <GroupContentModel name="ShapeChildContentModel" minOccurs="0"/>
> 
>                 <GroupContentModel name="SoundChildContentModel" minOccurs="0"/>
> 
>                 <GroupContentModel name="TextChildContentModel"/>
> 
>                 <GroupContentModel name="TextureBackgroundChildContentModel"
> 
> And I see no reference to ChildContent in the JSON schema:
> 
> $ grep ChildContent x3d-3.3-JSONSchema.json
> 
> $
> 
> 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