9 #ifndef TYPEDTRANSFORM_H
10 #define TYPEDTRANSFORM_H
12 #define TYPEDTRANSFORM_ADDCHILD_MACRO( OSGADDFUNC ) \
13 T* node = dynamic_cast<T*>( child ); \
14 if( node && !childrenAllowed() \
15 && !(node->getClassName().compare(getClassName())==0) )\
17 if( !OSGADDFUNC ) return false; \
18 if( node ) updateType( node->getType() ); \
21 #include <osg/MatrixTransform>
45 virtual bool replaceChild( osg::Node *origChild, osg::Node *child )
47 if( !MatrixTransform::replaceChild( origChild, child ) )
54 virtual bool removeChildren(
unsigned int pos,
unsigned int numChildrenToRemove )
56 if( !( (pos+numChildrenToRemove-1) < _children.size() && numChildrenToRemove > 0 ) )
59 bool atLeastOneTNodeRemoved =
false;
60 for(
unsigned int i=pos; i < pos+numChildrenToRemove; ++i )
62 T* child =
dynamic_cast<T*
>( getChild( i ) );
65 atLeastOneTNodeRemoved =
true;
70 if( !MatrixTransform::removeChildren( pos, numChildrenToRemove ) )
84 for(
unsigned int i=0; i < getNumChildren(); ++i )
86 T* child =
dynamic_cast<T*
>( getChild(i) );
88 acquired_type |= child->
getType();
97 for(
unsigned int i=0; i < getNumParents(); ++i )
99 T* parent =
dynamic_cast<T*
>( getParent(i) );