[x3d-public] removeNamedNode removes DEF children?

John Carlson yottzumm at gmail.com
Mon Jul 11 14:30:17 PDT 2022


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.

And from there, it becomes an unholy mess…

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.

One of my graph solutions was to create a “pseudoroot” from which all root
nodes could be reached.

I will try to analyze algorithms as the are posted.

John

On Sun, Jul 10, 2022 at 9:31 PM John Carlson <yottzumm at gmail.com> wrote:

> It’s like a node “inner” has two parents and one is removed.
>
> I hope this helps!
>
> John.
>
> On Sun, Jul 10, 2022 at 6:04 PM Andreas Plesch <andreasplesch at gmail.com>
> wrote:
>
>> A question for x3dom about removing nodes came up. Consider this fragment:
>>
>> <Group DEF='outer'>
>>
>>   <Group DEF='inner'>
>>
>>      ...
>>
>>   </Group>
>>
>> </Group>
>>
>> <Group USE='inner'/>
>>
>> Now the SAI is used to remove 'outer' Group from the Scene, with a
>> removeNamedNode('outer') call.
>>
>> Should the 'inner' DEF node also be removed? A) Yes. This would mean that
>> the USE node also would be removed, and not rendered.
>>
>> B) No. Just the inner instance of the 'inner' node is removed but not the
>> other USE instance.
>>
>> This ought to be well defined but I couldn't decide myself. I think x3dom
>> does B).
>>
>> Andreas
>>
>>
>>
>> --on the phone---
>> _______________________________________________
>> x3d-public mailing list
>> x3d-public at web3d.org
>> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20220711/7632dd5f/attachment.html>


More information about the x3d-public mailing list