From ff1a9a195a3217fd1632b4540a1747ea680f9987 Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 20 Jan 2017 21:48:45 +0100 Subject: [PATCH] StaticObjectDetectionVisitor: make use of apply(Drawable) visitor function --- include/osgUtil/Optimizer | 5 +---- src/osgUtil/Optimizer.cpp | 18 +++--------------- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/include/osgUtil/Optimizer b/include/osgUtil/Optimizer index 0a7c97748..d0a1937b5 100644 --- a/include/osgUtil/Optimizer +++ b/include/osgUtil/Optimizer @@ -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.*/ diff --git a/src/osgUtil/Optimizer.cpp b/src/osgUtil/Optimizer.cpp index 179d74b6e..9c7d525ac 100644 --- a/src/osgUtil/Optimizer.cpp +++ b/src/osgUtil/Optimizer.cpp @@ -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