[x3d-public] getContainerField()

Don Brutzman brutzman at nps.edu
Tue Oct 11 17:40:50 PDT 2016


Thanks for the containerField discussion.

a. Description, from _X3D for Web Authors_ page 24:

"Because contained nodes are themselves X3D fields of type SFNode/MFNode, the
name of the field relationship is listed in a containerField attribute. Default
containerField values for each node are correct in most cases, so overriding
containerField values is infrequent. This approach makes the X3D tagset terser,
easier to read, and less prone to error."

This appears in Chapter 1, which is freely available online.

	http://x3dgraphics.com/chapters/Chapter01-Technical_Introduction.pdf

Additional resources:

b.  The X3D Tooltips have a default values plus a number of containerField mentions.  Some examples:

	Collision
	Hint: apply containerField='proxy' to uniquely identify the proxy child Shape or grouping node.
	http://www.web3d.org/x3d/tooltips/X3dTooltips.html#Collision

I will continue to improve them with some of the points in this thread.  Today's update:

===================================
[containerField NMTOKEN "children"]
containerField is the field-label prefix indicating this node's field relationship to its parent node.
Hint: default containerField values for each node are correct in most cases, so overriding containerField values is infrequent.
Hint: example values include containerField='geometry' for Box node, containerField='children' for Group node, containerField='proxy' for hidden proxy Shape node within a Collision node, etc.
Hint: containerField attribute is only supported in XML encoding of X3D scenes, and corresponds to the always-declared field labels in the ClassicVRML and VRML97 file encodings.
===================================

Please let me know when you "find something missing" and I will add/fix/improve.


c. As discussed, X3D DTD and X3D XML Schema include default containerField attribute values for all nodes.

	http://www.web3d.org/specifications/X3dSchemaDocumentation3.3/x3d-3.3.html

	http://www.web3d.org/specifications/X3dDoctypeDocumentation3.3.html#BallJoint

Default containerField attribute values are also listed in the following (which are autogenerated from Schema and X3D Object Model), which can be helpful when building tools or documents.

	http://www.web3d.org/specifications/AllX3dElementsAttributes3.3.txt
	http://www.web3d.org/specifications/AllX3dElementsAttributes3.3.xml
and
	http://www.web3d.org/specifications/X3DObjectModel-3.3.xml

d. Additional assets.

X3D Schematron and X3D Validator include strict checking of containerField values in scenes.

	https://savage.nps.edu/X3dValidator

X3D-Edit shows alternatives for containerField in each node's editing panel.

	https://savage.nps.edu/X3D-Edit

source and example excerpt:

	https://svn.code.sf.net/p/x3d/code/www.web3d.org/x3d/tools/X3dEdit3.3/X3D/src/org/web3d/x3d/types/X3DSchemaData.java

===================================
   public static final String[]RIGIDBODY_ATTR_CONTAINERFIELD_CHOICES    = {"body1", "body2", "bodies"};
   public static final String  RIGIDBODY_ATTR_CONTAINERFIELD_TOOLTIP    = "'body1' or 'body2' for parent Contact or Joint node, 'bodies' for parent RigidBodyCollection";
   public static final String[]RIGIDBODY_ATTR_CONTAINERFIELD_TOOLTIPS   =
   {
       "body1 for parent Contact or Joint node",
       "body2 for parent Contact or Joint node",
       "bodies for parent RigidBodyCollection"
   };
===================================

e. TODO.  I will look at adding a section in the X3D Scene Authoring Hints.

f. Interestingly, when you consider the X3D scene graph very strictly from a specification perspective, there just aren't too many containerField options beyond the default values.

Of note is that each of the resources listed above that include such information were generated by hand, often painstakingly.

TODO.  Roy, let's consider if there are ways to represent that information in the X3D XML Schema and X3D Object Model.  That will help autogeneration of SAI codebases in turn.  TIA.

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