Changed the Node::ParentList to be a list of osg::Node rather than osg::Group, and added addChild, removeChild, replaceChild virtual method to Node to enable code

to user code compile with minimal modifications to account for the new change to the Node ParentList.
This commit is contained in:
Robert Osfield
2014-05-13 08:43:07 +00:00
parent b2c7bacfe9
commit 12a737ae02
6 changed files with 43 additions and 18 deletions

View File

@@ -145,6 +145,20 @@ bool Group::insertChild( unsigned int index, Node *child )
else return false;
}
unsigned int Group::getNumChildren() const
{
return static_cast<unsigned int>(_children.size());
}
bool Group::removeChild( Node *child )
{
unsigned int pos = getChildIndex(child);
if (pos<_children.size()) return removeChildren(pos,1);
else return false;
}
bool Group::removeChildren(unsigned int pos,unsigned int numChildrenToRemove)
{
if (pos<_children.size() && numChildrenToRemove>0)