OpenSceneGraph 2.8.4
|
Optimize State in the scene graph by removing duplicate state, replacing it with shared instances, both for StateAttributes, and whole StateSets. More...
Public Member Functions | |
StateVisitor (bool combineDynamicState, bool combineStaticState, bool combineUnspecifiedState, Optimizer *optimizer=0) | |
default to traversing all children. | |
virtual void | reset () |
empty visitor, make it ready for next traversal. | |
virtual void | apply (osg::Node &node) |
virtual void | apply (osg::Geode &geode) |
void | optimize () |
Protected Types | |
typedef std::set< osg::Object * > | ObjectSet |
typedef std::map < osg::StateSet *, ObjectSet > | StateSetMap |
Protected Member Functions | |
void | addStateSet (osg::StateSet *stateset, osg::Object *obj) |
bool | optimize (osg::Object::DataVariance variance) |
Protected Attributes | |
bool | _optimize [3] |
StateSetMap | _statesets |
Optimize State in the scene graph by removing duplicate state, replacing it with shared instances, both for StateAttributes, and whole StateSets.
typedef std::set<osg::Object*> osgUtil::Optimizer::StateVisitor::ObjectSet [protected] |
typedef std::map<osg::StateSet*,ObjectSet> osgUtil::Optimizer::StateVisitor::StateSetMap [protected] |
osgUtil::Optimizer::StateVisitor::StateVisitor | ( | bool | combineDynamicState, |
bool | combineStaticState, | ||
bool | combineUnspecifiedState, | ||
Optimizer * | optimizer = 0 |
||
) | [inline] |
default to traversing all children.
References osg::Object::DYNAMIC, osg::Object::STATIC, and osg::Object::UNSPECIFIED.
void osgUtil::Optimizer::StateVisitor::addStateSet | ( | osg::StateSet * | stateset, |
osg::Object * | obj | ||
) | [protected] |
virtual void osgUtil::Optimizer::StateVisitor::apply | ( | osg::Node & | node | ) | [virtual] |
Reimplemented from osg::NodeVisitor.
virtual void osgUtil::Optimizer::StateVisitor::apply | ( | osg::Geode & | geode | ) | [virtual] |
Reimplemented from osg::NodeVisitor.
bool osgUtil::Optimizer::StateVisitor::optimize | ( | osg::Object::DataVariance | variance | ) | [inline, protected] |
void osgUtil::Optimizer::StateVisitor::optimize | ( | ) |
virtual void osgUtil::Optimizer::StateVisitor::reset | ( | ) | [virtual] |
empty visitor, make it ready for next traversal.
Reimplemented from osg::NodeVisitor.
bool osgUtil::Optimizer::StateVisitor::_optimize[3] [protected] |
![]() | Generated at Sun Jan 8 2012 13:17:01 for the OpenSceneGraph by doxygen 1.7.4. |