RemoveEmptyNodesVisitor: remove redundant code for Geode handling
This commit is contained in:
parent
255a86cbe2
commit
7611f95078
@ -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();
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user