Hi Yegei,
I don't know how you plan to go about writing a customized clone, but
one wouldn't customize the Node::clone() operation itself, rather
build a custom NodeVisitor which would traversal the scene and do what
it thinks is appropriate. It might be that you traverse the whole
scene and accumlate data about it, then run pass on this data to do
the actual cloning/sharing.
Robert.
On 1/24/07, Yefei He <[EMAIL PROTECTED]> wrote:
Robert,
Thanks. I looked at the CopyOp a little bit. I haven't grasped
the details of the whole procedure but it appears to be a simple
traversal and cloning whatever nodes that is marked deep copy.
Without some sort of a check list of what nodes have already been
cloned, a node with multiple parents will be cloned again and
again each time it is traversed. The CopyOp turns the graph into
a tree. I don't know if it should be expected that cloning will
not preserve the graph structure, though. I'll take a dab at a
custom cloning operation that preserves the graph, at least at the
node level.
Best Regards,
Yefei
>
> Message: 27
> Date: Wed, 24 Jan 2007 09:05:32 +0000
> From: "Robert Osfield" <[EMAIL PROTECTED]>
> Subject: Re: [osg-users] Preserving child sharing during cloning?
> To: "osg users" <[email protected]>
> Message-ID:
> <[EMAIL PROTECTED]>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hi Yefei,
>
> If you are cloning using deep copy then pretty well all the
> scene graph elements will be cloned.
>
> There are limits on how much "intelligence" you can add to
> general purpose routines like cloning, it might be that its
> simply inappropriate to use in this instance, and custome
> clone would be much more appropriate.
>
> Robert.
>
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/