Removed dead code
This commit is contained in:
@@ -82,73 +82,69 @@ bool Group::insertChild( unsigned int index, Node *child )
|
||||
}
|
||||
#endif
|
||||
|
||||
if (child)
|
||||
// handle deprecated geometry configurations by calling fixDeprecatedData().
|
||||
osg::Geometry* geometry = child->asGeometry();
|
||||
if (geometry && geometry->containsDeprecatedData()) geometry->fixDeprecatedData();
|
||||
|
||||
|
||||
// note ref_ptr<> automatically handles incrementing child's reference count.
|
||||
if (index >= _children.size())
|
||||
{
|
||||
// handle deprecated geometry configurations by calling fixDeprecatedData().
|
||||
osg::Geometry* geometry = child->asGeometry();
|
||||
if (geometry && geometry->containsDeprecatedData()) geometry->fixDeprecatedData();
|
||||
|
||||
|
||||
// note ref_ptr<> automatically handles incrementing child's reference count.
|
||||
if (index >= _children.size())
|
||||
{
|
||||
index = _children.size(); // set correct index value to be passed to the "childInserted" method
|
||||
_children.push_back(child);
|
||||
}
|
||||
else
|
||||
{
|
||||
_children.insert(_children.begin()+index, child);
|
||||
}
|
||||
|
||||
// register as parent of child.
|
||||
child->addParent(this);
|
||||
|
||||
// tell any subclasses that a child has been inserted so that they can update themselves.
|
||||
childInserted(index);
|
||||
|
||||
dirtyBound();
|
||||
|
||||
// could now require app traversal thanks to the new subgraph,
|
||||
// so need to check and update if required.
|
||||
if (child->getNumChildrenRequiringUpdateTraversal()>0 ||
|
||||
child->getUpdateCallback())
|
||||
{
|
||||
setNumChildrenRequiringUpdateTraversal(
|
||||
getNumChildrenRequiringUpdateTraversal()+1
|
||||
);
|
||||
}
|
||||
|
||||
// could now require app traversal thanks to the new subgraph,
|
||||
// so need to check and update if required.
|
||||
if (child->getNumChildrenRequiringEventTraversal()>0 ||
|
||||
child->getEventCallback())
|
||||
{
|
||||
setNumChildrenRequiringEventTraversal(
|
||||
getNumChildrenRequiringEventTraversal()+1
|
||||
);
|
||||
}
|
||||
|
||||
// could now require disabling of culling thanks to the new subgraph,
|
||||
// so need to check and update if required.
|
||||
if (child->getNumChildrenWithCullingDisabled()>0 ||
|
||||
!child->getCullingActive())
|
||||
{
|
||||
setNumChildrenWithCullingDisabled(
|
||||
getNumChildrenWithCullingDisabled()+1
|
||||
);
|
||||
}
|
||||
|
||||
if (child->getNumChildrenWithOccluderNodes()>0 ||
|
||||
dynamic_cast<osg::OccluderNode*>(child))
|
||||
{
|
||||
setNumChildrenWithOccluderNodes(
|
||||
getNumChildrenWithOccluderNodes()+1
|
||||
);
|
||||
}
|
||||
|
||||
return true;
|
||||
index = _children.size(); // set correct index value to be passed to the "childInserted" method
|
||||
_children.push_back(child);
|
||||
}
|
||||
else return false;
|
||||
else
|
||||
{
|
||||
_children.insert(_children.begin()+index, child);
|
||||
}
|
||||
|
||||
// register as parent of child.
|
||||
child->addParent(this);
|
||||
|
||||
// tell any subclasses that a child has been inserted so that they can update themselves.
|
||||
childInserted(index);
|
||||
|
||||
dirtyBound();
|
||||
|
||||
// could now require app traversal thanks to the new subgraph,
|
||||
// so need to check and update if required.
|
||||
if (child->getNumChildrenRequiringUpdateTraversal()>0 ||
|
||||
child->getUpdateCallback())
|
||||
{
|
||||
setNumChildrenRequiringUpdateTraversal(
|
||||
getNumChildrenRequiringUpdateTraversal()+1
|
||||
);
|
||||
}
|
||||
|
||||
// could now require app traversal thanks to the new subgraph,
|
||||
// so need to check and update if required.
|
||||
if (child->getNumChildrenRequiringEventTraversal()>0 ||
|
||||
child->getEventCallback())
|
||||
{
|
||||
setNumChildrenRequiringEventTraversal(
|
||||
getNumChildrenRequiringEventTraversal()+1
|
||||
);
|
||||
}
|
||||
|
||||
// could now require disabling of culling thanks to the new subgraph,
|
||||
// so need to check and update if required.
|
||||
if (child->getNumChildrenWithCullingDisabled()>0 ||
|
||||
!child->getCullingActive())
|
||||
{
|
||||
setNumChildrenWithCullingDisabled(
|
||||
getNumChildrenWithCullingDisabled()+1
|
||||
);
|
||||
}
|
||||
|
||||
if (child->getNumChildrenWithOccluderNodes()>0 ||
|
||||
dynamic_cast<osg::OccluderNode*>(child))
|
||||
{
|
||||
setNumChildrenWithOccluderNodes(
|
||||
getNumChildrenWithOccluderNodes()+1
|
||||
);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
unsigned int Group::getNumChildren() const
|
||||
|
||||
Reference in New Issue
Block a user