<div dir="auto">I’m seeing some issues below, fixing.</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jun 24, 2024 at 5:21 AM John Carlson <<a href="mailto:yottzumm@gmail.com">yottzumm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">I will try again.<div><br></div><div>Problem: setting containerField on HAnimHumanoid children nodes to something besides "children" or default.</div><div><br></div><div>Constraint: do not set containerField in application code, instead use addSegments, addJoints.</div><div><br></div><div>Target client code:</div><div><br></div><div>Humanoid1.addJoints(HAnimJoint1)</div><div><br></div><div>Implementation:</div><div>==================================================================</div><div>HAnimHumanoid.java:</div><div><br></div><div>Map<HAnimHumanoidHAnimJointContainerFieldEnum,X3DGroupingNode> enumToContainerField = new Map<HAnimHumanoidHAnimJointContainerFieldEnum,X3DGroupingNode>();<br></div><div>{{</div><div>enumToContainerField .put(HAnimHumanoidHAnimJointContainerFieldEnum.joints, joints);<br></div><div>enumToContainerField .put(HAnimHumanoidHAnimJointContainerFieldEnum.skeleton, skeleton);<br></div><div>}}</div><div><br></div><div dir="auto">public HAnimHumanoid addJoints(HAnimJoint joint) throw new ContainerFieldException {<br></div><div dir="auto"> // the next line may throw an exception, not declared yet</div><div dir="auto"> if (joint.setTypeSafeContainerField(this.getClass(), HAnimHumanoidHAnimJointContainerFieldEnum.joints)) {</div><div dir="auto"> joints.add(joint);</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></blockquote><div dir="auto"> } else {</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div> throw new ContainerFieldException();</div><div dir="auto"> }</div><div dir="auto"> return this;</div><div>}</div><div>===================================================================</div><div>HAnimJoint.java:</div><div><br></div><div>Map<Class,Set<HAnimHumanoidHAnimJointContainerFieldEnum>> containerFieldMap = new HashMap<Class,Set<HAnimHumanoidHAnimJointContainerFieldEnum>>();</div><div><br></div><div><pre style="color:rgb(0,0,0);font-size:12px">public enum <span style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;font-size:small;white-space:normal">HAnimHumanoidHAnimJointContainerFieldEnum </span>{</pre><pre style="color:rgb(0,0,0);font-size:12px"> joints,</pre><pre style="color:rgb(0,0,0);font-size:12px"> skeleton</pre><pre style="color:rgb(0,0,0);font-size:12px">}</pre></div><div>Set<HAnimHumanoidHAnimJointContainerFieldEnum> cfEnumSet = HashSet<HAnimHumanoidHAnimJointContainerFieldEnum>()</div><div><br></div><div>cfEnumSet.add(HAnimHumanoidHAnimJointContainerFieldEnum.joints);</div><div>cfEnumSet.add(HAnimHumanoidHAnimJointContainerFieldEnum.skeleton);<br></div><div><br></div><div>containerFieldMap.put(HAnimHumanoid.class,cfEnumSet);</div><div><br></div><div>public boolean setTypeSafeContainerField(Class c, HAnimHumanoidHAnimJointContainerFieldEnum cf) {</div><div> return containerFieldMap.get(c).get(cf);</div><div>}</div><div><br></div><div>I can provide more detail if asked questions.</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div><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"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><br></div><div>John</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</blockquote></div></div>