[osg-users] DEEP_COPY_USERDATA isn't that deep

Robert Osfield robert.osfield at gmail.com
Fri Dec 13 02:59:02 PST 2019


Hi Chris,


I'm not seeing a particularly easy way to deep-copy the rest of the stuff 
> in osg::DefaultUserDataContainer, either. The description list is a vector 
> of strings, which are deep-copied, so that's fine, but the object list is 
> harder as I'd need to cast the const off the CopyOp if I were to deep-copy 
> those objects (which is undesirable) or copy the CopyOp to get a non-const 
> version, which I can't do, as there's no way to determine if it's actually 
> a user-provided derived class. 
>


I have had a chance to look at the 
DefaultUserDataContainer::DefaultUserDataContainer(const 
DefaultUserDataContainer& udc, const osg::CopyOp& copyop) implementation 
and it looks fine for me.  Could it be that you are just interepreting 
things a bit different than the implementation provides.  

The CopyOp::Options::DEEP_COPY_ALL is what you should use if you want to 
copy all the contents of a subgraph, including a UserDataContainer.  
DEEP_COPY_ALL enables deep copy of all options.

At this point I think the implementation is correct and there is nothing to 
fix.

Robert.
 
 

-- 
You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osg-users+unsubscribe at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/osg-users/510d2ba3-e4b2-4251-942b-7bd59443f5d4%40googlegroups.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20191213/4f9b3574/attachment.html>


More information about the osg-users mailing list