<div dir="ltr"><div><div>Hi,<br><br></div><div>following up on adding support for sensors in inlines, I also added support for sensor which were added to an initial scene:<br></div><div><br></div><a href="https://andreasplesch.github.io/cobweb_dom/tests/cobweb_d3.xhtml" target="_blank">https://andreasplesch.github.i<wbr>o/cobweb_dom/tests/cobweb_d3.x<wbr>html</a><br><br></div><div>The toggle box sensor adds and removes a TouchSensor to the last box added, and then adds an event handler to change the color of the box when 'touched'.<br><br></div><div>This also required support for adding nodes which are ChildNodes of grouping nodes, and not root nodes.<br><br></div><div>Now, in addition to ChildNodes I would like to add other nodes which are not root nodes, eg. field values of parent nodes. This requires determining which field of a parent node should be set, and I am looking for a good strategy to make this determination.<br><br></div><div>If there is containerField attribute, one can just use its value as the field name of the parent node to be set.<br><br></div><div>Otherwise, use the node name as the field name ? Works for Material and many other nodes but does not work for Box, for example.<br></div><div>It is probably possible to make a big map of which nodes can be values of which fields. Is there such an explicit map (other than implicit in the XML schema) ?<br></div><div>Using this map, it would be possible to look up he field(s) a node can be the value of and then check and set the appropriate parent's field, if any.<br><br></div><div>What are other strategies for determining the field in a container node which should (most likely) be set given just the identity of a new node and its containing (parent) node ?<br><br></div><div>Any ideas or feedback welcome,<br><br></div><div>-Andreas<br></div><div> <br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Oct 9, 2016 at 7:22 PM, Andreas Plesch <span dir="ltr"><<a href="mailto:andreasplesch@gmail.com" target="_blank">andreasplesch@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">Hi list, Holger,</p>
<p dir="ltr">I worked on reproducing this x3dom inline example:</p>
<p dir="ltr"><a href="http://examples.x3dom.org/example/x3dom_inlineReflection.xhtml" target="_blank">http://examples.x3dom.org/<wbr>example/x3dom_<wbr>inlineReflection.xhtml</a></p>
<p dir="ltr">with cobweb_dom:</p>
<p dir="ltr"><a href="https://andreasplesch.github.io/cobweb_dom/tests/inline_reflection/cobwebdom_inlineReflection.xhtml" target="_blank">https://andreasplesch.github.<wbr>io/cobweb_dom/tests/inline_<wbr>reflection/cobwebdom_<wbr>inlineReflection.xhtml</a></p>
<p dir="ltr">This required adding support for multiple scenes on a single web page, and adding support for relaying sensor events to dom events from within inlines.<br>
Also, there is now a x3dload Event dispatched to signal when all inlines are loaded into the dom. This is necessary for user code to know when it is possible to access inlined elements.</p>
<p dir="ltr">The main difference between x3dom and cobweb user code is still that listeners need to be added with addEventListener rather than using a onevent attribute and that actual TouchSensor nodes are required.</p>
<p dir="ltr">I think this completes work on dom integration of inline. Next I want to look into better support of adding non-root nodes.</p><span class="HOEnZb"><font color="#888888">
<p dir="ltr">-Andreas </p>
<p dir="ltr">-- <br>
Andreas Plesch<br>
39 Barbara Rd.<br>
Waltham, MA 02453</p>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Andreas Plesch<br>39 Barbara Rd.<br>Waltham, MA 02453</div>
</div>