class OSGUTIL_EXPORT osgUtil::DisplayListVisitor

Visitor for traversing scene graph and setting each osg::GeoSet's _useDisplayList flag, with option to immediately compile osg::GeoSet's OpenGL Display lists.

Inheritance:


Public Methods

[more] DisplayListVisitor(DisplayListMode mode=SWITCH_ON_DISPLAY_LISTS)
Construct a CompileGeoSetsVisior to traverse all child, with set specfied display list mode.
[more]void setDisplayListMode(DisplayListMode mode)
Set the operational mode of how the visitor should set up osg::GeoSet's
[more]DisplayListMode getDisplayListMode() const
Get the operational mode
[more]void setState(osg::State* state)
Set the State to use during traversal.
[more]osg::State* getState()
[more]virtual void apply(osg::Node& node)
Simply traverse using standard NodeVisitor traverse method
[more]virtual void apply(osg::Geode& node)
For each Geode visited set the display list usage according to the _displayListMode

Public Members

[more]enum DisplayListMode
Operation modes of the DisplayListVisitor

Protected Fields

[more]DisplayListMode _displayListMode
[more]osg::ref_ptr<osg::State> _localState
local state is created in constructor and used as the default state during traversal
[more]osg::ref_ptr<osg::State> _externalState
external state is used to override the default state
[more]osg::ref_ptr<osg::State> _activeState
active state is equal to _externalState when it is valid, otherwise defaults to _localState


Documentation

Visitor for traversing scene graph and setting each osg::GeoSet's _useDisplayList flag, with option to immediately compile osg::GeoSet's OpenGL Display lists. The mode of operation of the vistor is controlled by setting the DisplayListMode either on visitor constructor or via the setDisplayListMode() method. DisplayListMode options are: _displayListMode == SWITCH_ON_AND_COMPILE_DISPLAY_LISTS cals gset->compile() on all Geode childern. Note, the visitor must only be used within a valid OpenGL context as compile uses OpenGL calls. _displayListMode == SWITCH_ON_DISPLAY_LISTS sets the Geode's children with gset->setUseDisplayList(true), this method does not directly create display list, or uses OpenGL calls so if safe to use before a valid OpenGL context has been set up. On the next redraw of the scene, the gset's draw methods will be called which then will respond to their _useDisplayList being set by creating display lists automatically. _displayListMode == SWITCH_OFF_DISPLAY_LISTS sets the Geode's children with gset->setUseDisplayList(false), this method does not directly create display list, or uses OpenGL calls so if safe to use before a valid OpenGL context has been set up.
oenum DisplayListMode
Operation modes of the DisplayListVisitor

o SWITCH_ON_AND_COMPILE_DISPLAY_LISTS

o COMPILE_ON_DISPLAY_LISTS

o SWITCH_ON_DISPLAY_LISTS

o SWITCH_OFF_DISPLAY_LISTS

o DisplayListVisitor(DisplayListMode mode=SWITCH_ON_DISPLAY_LISTS)
Construct a CompileGeoSetsVisior to traverse all child, with set specfied display list mode. Default mode is to gset->setUseDisplayList(true).

ovoid setDisplayListMode(DisplayListMode mode)
Set the operational mode of how the visitor should set up osg::GeoSet's

oDisplayListMode getDisplayListMode() const
Get the operational mode

ovoid setState(osg::State* state)
Set the State to use during traversal.

oosg::State* getState()

ovirtual void apply(osg::Node& node)
Simply traverse using standard NodeVisitor traverse method

ovirtual void apply(osg::Geode& node)
For each Geode visited set the display list usage according to the _displayListMode

oDisplayListMode _displayListMode

oosg::ref_ptr<osg::State> _localState
local state is created in constructor and used as the default state during traversal

oosg::ref_ptr<osg::State> _externalState
external state is used to override the default state

oosg::ref_ptr<osg::State> _activeState
active state is equal to _externalState when it is valid, otherwise defaults to _localState


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.