[x3d-public] possibly missing items from X3D Object Model

Don Brutzman brutzman at nps.edu
Thu Mar 9 21:56:01 PST 2017


On 3/9/2017 4:09 PM, yottzumm at gmail.com wrote:
> Here are some parent/child relationships and related methods that were hand created from the X3D Resource JSON Examples and are overlaid on top of those generated from the X3D Object Model.  These may be missing from the Object Model and should not be there, or they may just not be generated from the object model properly—see ROUTE.  Please advise how to generate from the Object Model, or add to Object Model and advise how to generate from the Object Model.  Thanks, John!

Most of the methods in X3DJSAIL are autogenerated.  There are some rules for adding extra methods when the object model was apparently insufficiently strict (or relaxed) regarding X3D rules.

> Field children were addressed in a previous message, but should be addressed here as well.
>
>
>
> Syntax:
>
>
>
> “Parent” : {
>
>                 “Child” : “addMethod”,
>
>>
>
>
> Here it is:
>
>
>
>
>
> let mapToMethod2 = {
>
>         "Scene" : {
>
>                 "ROUTE" : "addChild",
>
>                 "IMPORT" : "addChild",
>
>                 "EXPORT" : "addChild",
>
>                 "ProtoDeclare" : "addChild",
>
>                 "ExternProtoDeclare" : "addChild"
>
>         },

I have the object hierarchy treating each of these listed child nodes to inherit from X3DChildNode.  This was performed by observing when X3D schema/spec content model treated statements in the same manner as regular-node X3DChildNode.

Was able to supress getDEF/getUSE/getCssClass methods, had to implement unnecessary setDEF/setUSE/setCssClass methods but they are marked as @Deprecated and the methods themselves are stubs with no effect.

	http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Core/ROUTEObject.html
	http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Core/ROUTEObject.html#setDEF-java.lang.String-

Result: strongly typed methods "work" as expected, both for nodes and statements.

You likely want to take a close look at the abstract lasses X3DConcreteElement, X3DConcreteNode and X3DConcreteStatement to see how this rippled out and aligned X3D statements (such as those above) with X3D nodes.

	http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/package-summary.html

Note that the nodes inherit from X3DConcreteNode, statements inherit from X3DConcreteStatement, and everything inherits from X3DConcreteElement.  These abstract superclasses can be helpful when you need to distinguish between discovered objects (such as children nodes/statements).

Overall tree is busy but is sometimes helpful; alphabetized by node name (look closely):

	http://www.web3d.org/specifications/java/javadoc/overview-tree.html

as discussed on today's call, we need a bit more work on Scene content model.  Spec is insufficiently defined wrt statements, Metadata* nodes and a few odds/ends.

	Mantis 836: 4.3.2 Root nodes - Additional nodes need to be allowed as root nodes
	http://www.web3d.org/member-only/mantis/view.php?id=836


>         "Billboard" : {
>
>                 "ROUTE" : "addChild"
>
>         },
>
>         "Anchor" : {
>
>                 "ROUTE" : "addChild"
>
>         },
>
>         "Switch" : {
>
>                 "ROUTE" : "addChild"
>
>         },
>
>         "Transform" : {
>
>                 "ProtoInstance": "addChild",
>
>                 "ROUTE": "addChild",
>
>                 "IS": "setIS",
>
>                 "ExternProtoDeclare" : "addChild",
>
>                 "IMPORT" : "addChild",
>
>         },
>
>         "Group" : {
>
>                 "ProtoInstance": "addChild",
>
>                 "ExternProtoDeclare": "addChild",
>
>                 "ProtoDeclare": "addChild",
>
>                 "ROUTE": "addChild",
>
>                 "IS": "setIS"
>
>         },
>
>         "Shape" : {
>
>                 "ProtoInstance": "setGeometry"
>
>         },
>
>         "ImageTexture" : {
>
>                 "IS": "setIS"
>
>         },
>
>         "Material" : {
>
>                 "IS": "setIS"
>
>         },
>
>         "Appearance" : {
>
>                 "IS": "setIS"
>
>         },
>
>         "HAnimJoint" : {
>
>                 "Transform" : "addChild"
>
>         },
>
>         "HAnimHumanoid" : {
>
>                  "HAnimViewpoint": "addViewpoints",
>
>        },
>
>         "ComposedShader" : {
>
>                 "field" : "addField",
>
>         },
>
>         "ProtoBody" : {
>
>                 "ROUTE" : "addChild",
>
>                 "ProtoDeclare" : "addChild"
>
>         },
>
>         "Script" : {
>
>                 "field" : "addField",
>
>                 "IS": "setIS"
>
>         },
>
>         "Text" : {
>
>                 "IS": "setIS"
>
>         },
>
>         "GeoLocation" : {
>
>                 "ROUTE" : "addChild",
>
>                 "ExternProtoDeclare" : "addChild"
>
>         },
>
>         "MetadataSet" : {
>
>                 "ProtoInstance" : "setMetadata"
>
>         }
>
> };

I think if you look in X3DJSAIL you will find methods for each of these, generated by implementing the statement::X3DChildNode correspondences.

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