Reorganised the Group::removeChild and Geode::removeDrawable methods so
that removeChild(Node*), removeChild(uint) and equivilant Geode methods are now inline methods, not designed to be overriden, and seperated out the multiple remove method to be called removeChildren(uint, uint) which is now the only virtual method. There removeChildren is now the method to override in subclasses. This reorganisation requires some call code to be rename removeChild usage to removeChildren.
This commit is contained in:
@@ -92,15 +92,11 @@ bool ProxyNode::addChild(Node *child, const std::string& filename)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ProxyNode::removeChild( Node *child )
|
||||
bool ProxyNode::removeChildren(unsigned int pos,unsigned int numChildrenToRemove)
|
||||
{
|
||||
// find the child's position.
|
||||
unsigned int pos=getChildIndex(child);
|
||||
if (pos==_children.size()) return false;
|
||||
|
||||
if (pos<_filenameList.size()) _filenameList.erase(_filenameList.begin()+pos);
|
||||
|
||||
return Group::removeChild(child);
|
||||
if (pos<_filenameList.size()) _filenameList.erase(_filenameList.begin()+pos, osg::minimum(_filenameList.begin()+(pos+numChildrenToRemove), _filenameList.end()) );
|
||||
|
||||
return Group::removeChildren(pos,numChildrenToRemove);
|
||||
}
|
||||
|
||||
BoundingSphere ProxyNode::computeBound() const
|
||||
|
||||
Reference in New Issue
Block a user