Re: [osg-users] Copy Constructor Advice

2008-02-19 Thread Robert Osfield
Hi Jeremy, In your case where you have data being shared between a subclass and its base class I feel that this duplication of ref_ptr to the shared data is inappropriate. Rather what you should use in your own code is dynamic_castVec3Array* where you need access to the array, or to provide a

Re: [osg-users] Copy Constructor Advice

2008-02-19 Thread Jeremy Moles
On Tue, 2008-02-19 at 09:44 +, Robert Osfield wrote: Hi Jeremy, In your case where you have data being shared between a subclass and its base class I feel that this duplication of ref_ptr to the shared data is inappropriate. Rather what you should use in your own code is

[osg-users] Copy Constructor Advice

2008-02-18 Thread Jeremy Moles
I have a quick question that I may be over-thinking, of which I have yet to find a simple answer. Imagine that I have a class Derived from osg::MatrixTransform--let's call this osgWidget::Window. In my derived Window class, I have a number of osg::ref_ptr objects referencing various things that

Re: [osg-users] Copy Constructor Advice

2008-02-18 Thread Robert Osfield
Hi Jeremy, Most OSG objects implement the clone operator with CopyOp parameter so you can just pass this along. For objects like std::vector etc you would typically just implement a deep copy, i.e. copy all the contents, unless of course its a vector of ref_ptr's in which case copying the