From 46750d6b17e6b32f568210ad1ce479b04255ed61 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 23 Jun 2016 10:41:58 +0100 Subject: [PATCH] Removed dead code --- src/osg/Group.cpp | 126 ++++++++++++++++++++++------------------------ 1 file changed, 61 insertions(+), 65 deletions(-) diff --git a/src/osg/Group.cpp b/src/osg/Group.cpp index 97813444d..7b0ba606c 100644 --- a/src/osg/Group.cpp +++ b/src/osg/Group.cpp @@ -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(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(child)) + { + setNumChildrenWithOccluderNodes( + getNumChildrenWithOccluderNodes()+1 + ); + } + + return true; } unsigned int Group::getNumChildren() const