<div dir="auto">Perhaps “unlinked” would be better.  A node “inner” has two parents and one is unlinked.  So when you remove the parent node, you have to check for additional parents (more than 1) in all children of the removed parent node.</div><div dir="auto"><br></div><div dir="auto">And from there, it becomes an unholy mess…</div><div dir="auto"><br></div><div dir="auto">If i was 35 years younger, I could probably come up with an algorithm, this is called garbage collection.  My favorite graph algorithm back then was mark and sweep.   I also did garbage collection by reinitializing all object ids, and rewriting the database.</div><div dir="auto"><br></div><div dir="auto">One of my graph solutions was to create a “pseudoroot” from which all root nodes could be reached.</div><div dir="auto"><br></div><div dir="auto">I will try to analyze algorithms as the are posted.</div><div dir="auto"><br></div><div dir="auto">John</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jul 10, 2022 at 9:31 PM John Carlson <<a href="mailto:yottzumm@gmail.com">yottzumm@gmail.com</a>> wrote:<br></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:rgb(204,204,204)"><div dir="auto">It’s like a node “inner” has two parents and one is removed.</div><div dir="auto"><br></div><div dir="auto">I hope this helps!</div><div dir="auto"><br></div><div dir="auto">John.</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jul 10, 2022 at 6:04 PM Andreas Plesch <<a href="mailto:andreasplesch@gmail.com" target="_blank">andreasplesch@gmail.com</a>> wrote:<br></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:rgb(204,204,204)"><div dir="auto">A question for x3dom about removing nodes came up. Consider this fragment:<div dir="auto"><br></div><div dir="auto"><Group DEF='outer'></div><div dir="auto"><br></div><div dir="auto">  <Group DEF='inner'></div><div dir="auto"><br></div><div dir="auto">     ...</div><div dir="auto"><br></div><div dir="auto">  </Group></div><div dir="auto"><br></div><div dir="auto"></Group><br></div><div dir="auto"><br></div><div dir="auto"><Group USE='inner'/></div><div dir="auto"><br></div><div dir="auto">Now the SAI is used to remove 'outer' Group from the Scene, with a removeNamedNode('outer') call.</div><div dir="auto"><br></div><div dir="auto">Should the 'inner' DEF node also be removed? A) Yes. This would mean that the USE node also would be removed, and not rendered.</div><div dir="auto"><br></div><div dir="auto">B) No. Just the inner instance of the 'inner' node is removed but not the other USE instance.</div><div dir="auto"><br></div><div dir="auto">This ought to be well defined but I couldn't decide myself. I think x3dom does B).</div><div dir="auto"><br></div><div dir="auto">Andreas </div><div dir="auto"><br></div><div dir="auto"><br><br><div data-smartmail="gmail_signature" dir="auto">--on the phone---</div></div></div>
_______________________________________________<br>
x3d-public mailing list<br>
<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a><br>
<a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" rel="noreferrer" target="_blank">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a><br>
</blockquote></div></div>
</blockquote></div></div>