It's not so much copying the children I'm worried about.  It's ensuring
that all other fields get copied, such as the StateSet, node mask, name,
and all other member variables that accumulate through the inheritance
tree.  I'm worried that if I try to code the copying myself, then I
might omit some key information.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Robert
Osfield
Sent: Monday, February 19, 2007 1:37 AM
To: osg users
Subject: Re: [osg-users] Converting node types

Hi Chase,

I'd create a new MatrixTransfrom and set its matrix up to the same
value as the PositionAttitudeTransform then copy across the children.
Rather than deep copy I'd recommend sharing as much as possible -
ideally just adding the PAT's children directly to the
MatrixTransform.

Robert.

On 2/18/07, Bradford, Chase <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> Hi Everyone,
>
>  I was wondering if there is a safe technique for converting between
node
> types.  I would like to substitute all PAT nodes with
MatrixTransforms, but
> I can't think of any elegant way of ensuring that all data defined in
their
> common base (ie. Transform), gets copied in full.  Essentially, I
don't care
> about data specific to the PAT, other than the position and attitude,
which
> is very easy to translate with special code.
>
>  What I want is a way to deep copy all data that they both inherit
from
> their common ancestors (descriptions, statesets, reference frame,
etc.),
> then I can explicitly translate the info of interest from the PAT to
the
> MatrixTransform.  I'm sure C++ doesn't have any builtin ways of doing
this,
> but I thought I might see if something like this has been added to
OSG.
>
>  Thanks,
>  Chase Bradford
>
>
> _______________________________________________
> 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/
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to