Hi Jo,

On Mon, 2004-11-08 at 15:48, Jo Bard wrote:
> Hello, thank you very much for the answer. I just thought that a node would 
> be erased if it wasn't linked to the graph but it was stupid.
> So i created a parent node under which i have my models but this node is not 
> linked to the root node as it was before (i think you meant that when you 
> advised me to use 2 graphs). Like that, my models are supposed to survive 
> because they are referenced by their parent (which i called "modelesNode", 
> because i'm french). I also think it's important to call addRefCP onto 
> modelesNode because it's not referenced by any parent.
> But i have a problem now : when I initialize my instances, i'm reading a 
> file and each time I find an object (in a "for" loop), I traverse the 
> models' graph in order to know whether the model of this object has already 
> been created and put inside the models' graph or not. If not, i'm loading 
> the model and i put it under my "modelesNode". If yes, I just get the node 
> of the model. And then I tell the object (the instance) that its child is 
> this model, etc. And then my loop re-begins. But at the beginning of this 
> loop, when i check what's under my "modelesNode", there is nothing ! So what 
> happens? Why the models' graph is empty whereas it wasn't just the loop 
> before? Any ideas?
> Thank you very much.

it sounds like you're trying to attach an object to multiple places in
your graph. OpenSG doesn't support this kind of multi-parenting. We only
have one parent, so when you try to attach the object a second time it
is detached from the position you put it in first.

To get a copy of the object that only copies the Nodes and not the
expensive NodeCores you need to call shallowCopy() on the NodePtr you
want to copy.

Hope it helps

        Dirk




-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to