StaticObjectDetectionVisitor: make use of apply(Drawable) visitor function
This commit is contained in:
parent
764b2f60c6
commit
ff1a9a195a
@ -847,15 +847,12 @@ class OSGUTIL_EXPORT Optimizer
|
||||
BaseOptimizerVisitor(optimizer, STATIC_OBJECT_DETECTION) {}
|
||||
|
||||
virtual void apply(osg::Node& node);
|
||||
|
||||
virtual void apply(osg::Geode& geode);
|
||||
virtual void apply(osg::Drawable& drawable);
|
||||
|
||||
protected:
|
||||
|
||||
void applyStateSet(osg::StateSet& stateset);
|
||||
|
||||
void applyDrawable(osg::Drawable& drawable);
|
||||
|
||||
};
|
||||
|
||||
/** For all geometry apply settings.*/
|
||||
|
@ -4405,14 +4405,11 @@ void Optimizer::StaticObjectDetectionVisitor::apply(osg::Node& node)
|
||||
traverse(node);
|
||||
}
|
||||
|
||||
void Optimizer::StaticObjectDetectionVisitor::apply(osg::Geode& geode)
|
||||
void Optimizer::StaticObjectDetectionVisitor::apply(osg::Drawable& drawable)
|
||||
{
|
||||
if (geode.getStateSet()) applyStateSet(*geode.getStateSet());
|
||||
if (drawable.getStateSet()) applyStateSet(*drawable.getStateSet());
|
||||
|
||||
for(unsigned int i=0; i<geode.getNumDrawables(); ++i)
|
||||
{
|
||||
applyDrawable(*geode.getDrawable(i));
|
||||
}
|
||||
drawable.computeDataVariance();
|
||||
}
|
||||
|
||||
void Optimizer::StaticObjectDetectionVisitor::applyStateSet(osg::StateSet& stateset)
|
||||
@ -4421,15 +4418,6 @@ void Optimizer::StaticObjectDetectionVisitor::applyStateSet(osg::StateSet& state
|
||||
}
|
||||
|
||||
|
||||
void Optimizer::StaticObjectDetectionVisitor::applyDrawable(osg::Drawable& drawable)
|
||||
{
|
||||
|
||||
if (drawable.getStateSet()) applyStateSet(*drawable.getStateSet());
|
||||
|
||||
drawable.computeDataVariance();
|
||||
}
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// FlattenStaticTransformsDuplicatingSharedSubgraphsVisitor
|
||||
|
Loading…
Reference in New Issue
Block a user