27 #include <osg/ShapeDrawable>
28 #include <osg/MatrixTransform>
31 #include "WGEGroupNode.h"
34 osg::MatrixTransform(),
35 m_childOperationQueueDirty( false ),
38 setDataVariance( osg::Object::DYNAMIC );
93 boost::unique_lock<boost::shared_mutex> lock;
118 for(
size_t i = 0; i < rootNode->getNumChildren(); )
123 rootNode->removeChild( i );
134 rootNode->removeChild( 0, rootNode->getNumChildren() );
141 rootNode->dirtyBound();
151 traverse( node, nv );
Update callback which inserts and removes nodes from m_childRemovalQueue and m_childInsertionQueue to...
remove all items where the predicate evaluates to true
virtual ~WGEGroupNode()
Destructor.
remove the specified node
A struct denoting an operation on this group.
virtual void operator()(osg::Node *node, osg::NodeVisitor *nv)
Callback method called by the NodeVisitor when visiting a node.
std::queue< boost::shared_ptr< ChildOperation > > m_childOperationQueue
Queue of childs that need to be added/removed during the next update cycle.
boost::shared_mutex m_childOperationQueueLock
Lock used for inserting and removing childs into the child insertion/removal queue.
void insert(osg::ref_ptr< osg::Node > node)
Adds the specified node to the child list of this node in a safe manner.
osg::ref_ptr< SafeUpdaterCallback > m_nodeUpdater
Node callback used to update this root node.
Class to wrap around the osg Group node and providing a thread safe add/removal mechanism.
void clear()
Removes all children from this node.
WGEGroupNode()
Default constructor.
bool m_removeAll
True whenever all child nodes should be removed.
insert the specified node
bool m_childOperationQueueDirty
Flag denoting whether the m_childOperationQueue should be considered during the next update of the no...
void remove_if(boost::shared_ptr< WGEGroupNode::NodePredicate > predicate)
Removes a node if the specified predicate evaluates to true.
void remove(osg::ref_ptr< osg::Node > node)
Removes the specified node from this group in a thread safe manner.