Robert Osfield <[email protected]> writes:

> Hi Philipp
>
> On 25 January 2012 15:37, Philipp Moeller
> <[email protected]> wrote:
>> I'd like to back-up some osg::StateAttribute for the simple purpose of
>> restoring it, if some dialog in my application is rejected.
>>
>> I'd would like to have something as easy as
>>
>> Light* light;
>> ref_ptr<Light> backup = new Light(*light, 
>> osg::CopyOp(osg::CopyOp::DEEP_COPY_ALL));
>> //back up
>> *light = *backup;
>>
>> This obviously does not work, as Light has no assigment
>> operator.
>
> It should work as it has a copy constructor, it doesn't need a copy
> operator for this task.

The copy is not the problem the assignment is (The operator= is needed
here as this is not the point of declaration). osg::Objects operator= is
private which default deletes the assignment operator in all base
classes and I don't really get why. So it looks like this is by design
although it would be nice to have.

>
> You can also call clone() if you want.
>
> Robert.
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to