Added testing for Drawables in the CopyOp::operator(Node*) to replicate the old functionality.

git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14518 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield 2014-11-21 17:17:11 +00:00
parent e67466a74f
commit b37d6b1921

View File

@ -33,7 +33,6 @@ TYPE* CopyOp::operator() (const TYPE* obj) const \
}
COPY_OP( Object, DEEP_COPY_OBJECTS )
COPY_OP( Node, DEEP_COPY_NODES )
COPY_OP( StateSet, DEEP_COPY_STATESETS )
COPY_OP( Image, DEEP_COPY_IMAGES )
COPY_OP( Uniform, DEEP_COPY_UNIFORMS )
@ -49,6 +48,16 @@ Referenced* CopyOp::operator() (const Referenced* ref) const
return const_cast<Referenced*>(ref);
}
Node* CopyOp::operator() (const Node* node) const
{
if (!node) return 0;
const Drawable* drawable = node->asDrawable();
if (drawable) return operator()(drawable);
else if (_flags&DEEP_COPY_NODES) return osg::clone(node, *this);
else return const_cast<Node*>(node);
}
StateAttribute* CopyOp::operator() (const StateAttribute* attr) const
{
if (attr && _flags&DEEP_COPY_STATEATTRIBUTES)