<div dir="auto">Joe the actual issue is, we want to restrict the application programmer’s ability to set the containerField in XML to something typesafe. I outlined a possible solution (not using a string parameter in setContainerField*). Perhaps I should create a more formal, compilable solution for HAnim. It seems to be the hardest to solve. I thought my solution needed some work, but it looked pretty typesafe (I think I missed an if/then). The main thing was to have a set of enumerated containerField values for any pair of parent/child node types.</div><div dir="auto"><br></div><div dir="auto">I think this will be well hidden behind addJoints(), addSkeleton, etc. reviews or new designs from anywhere are possible.</div><div dir="auto"><br></div><div dir="auto">I am pretty sure this is up to a particular private SAI implementation, and does not need to be exposed to the SAI standard. Indeed, it may only be applicable to HAnim. Textures?</div><div dir="auto"><br></div><div dir="auto">The point of not having a children field is to prevent a top level HAnimJoint field from setting a containerField value = “children”. There’s no “children” field at the HAnimHumanoid allowing HAnimJoints as children. As you say, there’s no addChildren.</div><div dir="auto"><br></div><div dir="auto">This really becomes ambiguous when trying to output a “children” HAnimHumanoid field in VRML. Don’t go there, use the fields that actually exist, please, otherwise things aren’t typesafe. I’ve already patched that.</div><div dir="auto"><br></div><div dir="auto">The reason Don’s current code is correct and it sneaks under the radar is that it doesn’t output anything. Sure, it “validates,” but there’s no external checks to make sure. Try adding JSON, VRML or XML output instructions and see what happens. The code itself starts complaining when you add output encodings. My guess is, there’s a sticky-wicky in the X3DJSAIL stylesheet. I’m hoping my solution outlined elsewhere can help.</div><div dir="auto"><br></div><div dir="auto">Vince also has a marvelous solution for container fields. Set them, but then remove the ones that have default values, then when you validate, you don’t have to validate a bunch of defaulted containerFields.</div><div dir="auto"><br></div><div dir="auto">Anyway, learning something new with each go round.</div><div dir="auto"><br></div><div dir="auto">John </div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jun 24, 2024 at 3:37 PM Joe D Williams <<a href="mailto:joedwil@earthlink.net">joedwil@earthlink.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:12pt"><p style="margin:0.1rem 0;line-height:1.0">Hi John,</p>
<p style="margin:0.1rem 0;line-height:1.0"> </p>
<p style="margin:0.1rem 0;line-height:1.0">> <span style="font-size:12pt">This is WRONG!</span></p>
</div>
<p style="margin:0.1rem 0px;line-height:1">> containerField_ALLOWED_VALUES = new String[] { "children" }; // type xs:NMTOKEN</p>
<p style="margin:0.1rem 0px;line-height:1"> </p>
<p style="margin:0.1rem 0;line-height:1.0">The containerField names the 'legal' parent type: </p>
<p style="margin:0.1rem 0;line-height:1.0">Humanoid can be a child of a node that can have children, like Transform, or the host scene, for instances. So the Humanoid containerField default is 'children' as listed. </p>
<p style="margin:0.1rem 0;line-height:1.0"> </p>
<p style="margin:0.1rem 0;line-height:1.0">Note that the containerField for the first Joint is skeleton, it contains the Joint hierarchy and all following Joint containerField are children. </p>
<p style="margin:0.1rem 0;line-height:1.0"> </p>
<p style="margin:0.1rem 0;line-height:1.0">Humanoid 'children' nodes all have specific names.</p>
<p style="margin:0.1rem 0;line-height:1.0">Humanoid does not show the add/remove children field because no general-purpose nodes wanted </p>
<p style="margin:0.1rem 0;line-height:1.0">only the listed ones, but all is alive and available.</p>
<p style="margin:0.1rem 0;line-height:1.0">Thanks, </p>
<p style="margin:0.1rem 0;line-height:1.0">Joe</p>
<p style="margin:0.1rem 0;line-height:1.0"> </p>
<p style="margin:0.1rem 0;line-height:1.0"> </p>
<div style="border-left:1px solid #aaa;box-sizing:border-box;padding:10px 0 10px 15px;margin:0">
<p>-----Original Message-----<br>From: John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>><br>Sent: Jun 24, 2024 2:47 AM<br>To: Joe D Williams <<a href="mailto:joedwil@earthlink.net" target="_blank">joedwil@earthlink.net</a>>, Michalis Kamburelis <<a href="mailto:michalis.kambi@gmail.com" target="_blank">michalis.kambi@gmail.com</a>>, X3D Graphics public mailing list <<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a>><br>Subject: Re: Isolating problems with HAnimHumanoid.java and X3DUOM, etc.</p>
<p style="margin:0.1rem 0;line-height:1.0"> </p>
<div dir="auto">Weird, sorry, I thought I didn’t send this message.</div>
<div><br>
<div class="gmail_quote">
<div class="gmail_attr" dir="ltr">On Mon, Jun 24, 2024 at 3:58 AM John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>> wrote:</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:#cccccc">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">The beginning of actually solving the problem.</div>
<div dir="ltr"> </div>
<div dir="ltr">HAnimHumanoid.java:</div>
<div dir="ltr"> </div>
<div>This is WRONG!</div>
<div> </div>
<div dir="ltr">public static final String containerField_DEFAULT_VALUE = "children"; // type xs:NMTOKEN</div>
<div dir="ltr"> </div>
<div>This is WRONG!</div>
<div> </div>
<div>containerField_ALLOWED_VALUES = new String[] { "children" }; // type xs:NMTOKEN</div>
<div> </div>
<div>X3DUOM:</div>
<div> </div>
<div><ConcreteNode name="HAnimHumanoid"></div>
<div>[ snip ]</div>
<div><!-- THIS IS WRONG! --></div>
<div><containerField default="children" type="xs:NMTOKEN"/></div>
<div>[ snip ]</div>
<div>
<div> </ConcreteNode> </div>
<div> </div>
<div>[ There's NO children field here!--And that may be ok! ]</div>
<pre style="font-size:11.05px;margin-left:25px;font-family:monospace;color:#000000">HAnimHumanoid : X3DChildNode, X3DBoundedObject {
SFVec3f [in,out] center 0 0 0 (-∞,∞)
SFString [in,out] description ""
SFBool [in,out] bboxDisplay FALSE
MFString [in,out] info []
MFVec3f [in,out] jointBindingPositions [] (-∞,∞)
MFRotation [in,out] jointBindingRotations [] [-1,1] or (-∞,∞)
MFVec3f [in,out] jointBindingScales [] (0,∞)
MFNode [in,out] joints [] [HAnimJoint]
SFInt32 [in,out] loa -1 [-1,4]
SFNode [in,out] metadata NULL [X3DMetadataObject]
MFNode [in,out] motions [] [HAnimMotion]
MFBool [in,out] motionsEnabled []
SFString [in,out] name ""
SFRotation [in,out] rotation 0 0 1 0 [-1,1] or (-∞,∞)
SFVec3f [in,out] scale 1 1 1 (0,∞)
SFRotation [in,out] scaleOrientation 0 0 1 0 [-1,1] or (-∞,∞)
MFNode [in,out] segments [] [HAnimSegment]
MFNode [in,out] sites [] [HAnimSite]
SFString [in,out] skeletalConfiguration "BASIC"
MFNode [in,out] skeleton [] [HAnimJoint, HAnimSite]
MFNode [in,out] skin [] [Group, LOD, Shape, Switch, Transform, IndexedFaceSet, IndexedFanSet, IndexedLineSet, IndexedQuadSet, IndexedTriangleSet, IndexedTriangleStripSet]
SFNode [in,out] skinBindingCoords NULL [Coordinate|CoordinateDouble]
SFNode [in,out] skinBindingNormals NULL [X3DNormalNode]
SFNode [in,out] skinCoord NULL [Coordinate|CoordinateDouble]
SFNode [in,out] skinNormal NULL [X3DNormalNode]
SFVec3f [in,out] translation 0 0 0 (-∞,∞)
SFString [in,out] version "2.0" ["2.0"]
MFNode [in,out] viewpoints [] [HAnimSite]
SFBool [in,out] visible TRUE
SFVec3f [] bboxCenter 0 0 0 (-∞,∞)
SFVec3f [] bboxSize -1 -1 -1 [0,∞) or −1 −1 −1 </pre>
<div><span style="font-size:11.05px;color:#000000">}</span> </div>
</div>
<div> </div>
<div>======================================================</div>
<div>Here's containerField for Group in X3DUOM. HAnimHumanoid needs something like this.</div>
<div> </div>
<div> <containerField default="children" type="containerFieldChoicesGroupLODShapeTransformSwitch"/></div>
<div> </div>
<div>[ refers to: ]</div>
<div> </div>
<div>
<div> <SimpleType name="containerFieldChoicesGroupLODShapeTransformSwitch"</div>
<div> baseType="xs:NMTOKEN"</div>
<div> appinfo="containerFieldChoicesGroupLODShapeTransformSwitch lists the allowed containerField enumeration values for Shape, Transform and LOD nodes: "children" if parent node has abstract type X3DGroupingNode, otherwise "metadata" default."</div>
<div> documentation="<a href="https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#containerField" rel="noopener" target="_blank">https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#containerField</a>"></div>
<div> <enumeration value="children"</div>
<div> appinfo="parent node has abstract type X3DGroupingNode"/></div>
<div> <enumeration value="proxy" appinfo="parent node is Collision"/></div>
<div> <enumeration value="rootNode" appinfo="parent node is GeoLOD"/></div>
<div> <enumeration value="shape" appinfo="parent node is CADFace or CollidableShape"/></div>
<div> <enumeration value="skin" appinfo="parent node is HAnimHumanoid"/></div>
<div> </SimpleType></div>
</div>
<div>======================================================</div>
<div> </div>
<div>We need something like:</div>
<div> </div>
<div><SimpleType name="containerFieldChoicesHAnimHumanoid"</div>
<div> </div>
<div>with enumerations, then refer to the node in the HAnimHumanoid type.</div>
<div> </div>
<div>Have I isolated the problem, or do I need to step into X3D Schema?</div>
<div> </div>
<div>Hmm? Do we need a default container field for HAnimHumanoid? Can we leave off a default?</div>
<div> </div>
<div>I don't want to program XML, no thanks!</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
<p style="margin:0.1rem 0;line-height:1.0"> </p></blockquote></div></div>