From 7611f950789c013d65dcdd9c2f2636da94f84a3b Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 20 Jan 2017 20:57:03 +0100 Subject: [PATCH] RemoveEmptyNodesVisitor: remove redundant code for Geode handling --- include/osgUtil/Optimizer | 1 - src/osgUtil/Optimizer.cpp | 17 ----------------- 2 files changed, 18 deletions(-) diff --git a/include/osgUtil/Optimizer b/include/osgUtil/Optimizer index 75328b933..4113f4589 100644 --- a/include/osgUtil/Optimizer +++ b/include/osgUtil/Optimizer @@ -360,7 +360,6 @@ class OSGUTIL_EXPORT Optimizer RemoveEmptyNodesVisitor(Optimizer* optimizer=0): BaseOptimizerVisitor(optimizer, REMOVE_REDUNDANT_NODES) {} - virtual void apply(osg::Geode& geode); virtual void apply(osg::Group& group); void removeEmptyNodes(); diff --git a/src/osgUtil/Optimizer.cpp b/src/osgUtil/Optimizer.cpp index 997ac55f2..31854ebbf 100644 --- a/src/osgUtil/Optimizer.cpp +++ b/src/osgUtil/Optimizer.cpp @@ -1329,23 +1329,6 @@ bool Optimizer::CombineStaticTransformsVisitor::removeTransforms(osg::Node* node // RemoveEmptyNodes. //////////////////////////////////////////////////////////////////////////// -void Optimizer::RemoveEmptyNodesVisitor::apply(osg::Geode& geode) -{ - for(int i=geode.getNumDrawables()-1;i>=0;--i) - { - osg::Geometry* geom = geode.getDrawable(i)->asGeometry(); - if (geom && geom->empty() && isOperationPermissibleForObject(geom)) - { - geode.removeDrawables(i,1); - } - } - - if (geode.getNumParents()>0) - { - if (geode.getNumDrawables()==0 && isOperationPermissibleForObject(&geode)) _redundantNodeList.insert(&geode); - } -} - void Optimizer::RemoveEmptyNodesVisitor::apply(osg::Group& group) { if (group.getNumParents()>0)