OpenSceneGraph 2.8.4
Classes | Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
osgDB::SharedStateManager Class Reference
Inheritance diagram for osgDB::SharedStateManager:
Inheritance graph
[legend]

List of all members.

Classes

struct  CompareStateAttributes
struct  CompareStateSets

Public Types

enum  ShareMode {
  SHARE_NONE = 0, SHARE_STATIC_TEXTURES = 1<<0, SHARE_UNSPECIFIED_TEXTURES = 1<<1, SHARE_DYNAMIC_TEXTURES = 1<<2,
  SHARE_STATIC_STATESETS = 1<<3, SHARE_UNSPECIFIED_STATESETS = 1<<4, SHARE_DYNAMIC_STATESETS = 1<<5, SHARE_TEXTURES = SHARE_STATIC_TEXTURES | SHARE_UNSPECIFIED_TEXTURES,
  SHARE_STATESETS = SHARE_STATIC_STATESETS | SHARE_UNSPECIFIED_STATESETS, SHARE_ALL
}

Public Member Functions

 SharedStateManager (unsigned int mode=SHARE_ALL)
 META_NodeVisitor ("osgDB","SharedStateManager") void setShareMode(unsigned int mode)
unsigned int getShareMode ()
void prune ()
void share (osg::Node *node, OpenThreads::Mutex *mt=0)
void apply (osg::Node &node)
void apply (osg::Geode &geode)
bool isShared (osg::StateSet *stateSet)

Protected Types

typedef std::set< osg::ref_ptr
< osg::StateAttribute >
, CompareStateAttributes
TextureSet
typedef std::set< osg::ref_ptr
< osg::StateSet >
, CompareStateSets
StateSetSet
typedef std::pair
< osg::StateAttribute *, bool > 
TextureSharePair
typedef std::map
< osg::StateAttribute
*, TextureSharePair
TextureTextureSharePairMap
typedef std::pair
< osg::StateSet *, bool > 
StateSetSharePair
typedef std::map
< osg::StateSet
*, StateSetSharePair
StateSetStateSetSharePairMap

Protected Member Functions

bool shareTexture (osg::Object::DataVariance variance)
bool shareStateSet (osg::Object::DataVariance variance)
void process (osg::StateSet *ss, osg::Object *parent)
osg::StateAttributefind (osg::StateAttribute *sa)
osg::StateSetfind (osg::StateSet *ss)
void setStateSet (osg::StateSet *ss, osg::Object *object)
void shareTextures (osg::StateSet *ss)

Protected Attributes

TextureSet _sharedTextureList
StateSetSet _sharedStateSetList
TextureTextureSharePairMap tmpSharedTextureList
StateSetStateSetSharePairMap tmpSharedStateSetList
unsigned int _shareMode
bool _shareTexture [3]
bool _shareStateSet [3]
OpenThreads::Mutex * _mutex
OpenThreads::Mutex _listMutex

Member Typedef Documentation

typedef std::pair<osg::StateSet*, bool> osgDB::SharedStateManager::StateSetSharePair [protected]

Member Enumeration Documentation

Enumerator:
SHARE_NONE 
SHARE_STATIC_TEXTURES 
SHARE_UNSPECIFIED_TEXTURES 
SHARE_DYNAMIC_TEXTURES 
SHARE_STATIC_STATESETS 
SHARE_UNSPECIFIED_STATESETS 
SHARE_DYNAMIC_STATESETS 
SHARE_TEXTURES 
SHARE_STATESETS 
SHARE_ALL 

Constructor & Destructor Documentation

osgDB::SharedStateManager::SharedStateManager ( unsigned int  mode = SHARE_ALL)

Member Function Documentation

void osgDB::SharedStateManager::apply ( osg::Node node) [virtual]

Reimplemented from osg::NodeVisitor.

void osgDB::SharedStateManager::apply ( osg::Geode geode) [virtual]

Reimplemented from osg::NodeVisitor.

osg::StateAttribute* osgDB::SharedStateManager::find ( osg::StateAttribute sa) [protected]
osg::StateSet* osgDB::SharedStateManager::find ( osg::StateSet ss) [protected]
unsigned int osgDB::SharedStateManager::getShareMode ( ) [inline]
bool osgDB::SharedStateManager::isShared ( osg::StateSet stateSet)
osgDB::SharedStateManager::META_NodeVisitor ( "osgDB"  ,
"SharedStateManager"   
)
void osgDB::SharedStateManager::process ( osg::StateSet ss,
osg::Object parent 
) [protected]
void osgDB::SharedStateManager::prune ( )
void osgDB::SharedStateManager::setStateSet ( osg::StateSet ss,
osg::Object object 
) [protected]
void osgDB::SharedStateManager::share ( osg::Node node,
OpenThreads::Mutex *  mt = 0 
)
bool osgDB::SharedStateManager::shareStateSet ( osg::Object::DataVariance  variance) [inline, protected]
bool osgDB::SharedStateManager::shareTexture ( osg::Object::DataVariance  variance) [inline, protected]
void osgDB::SharedStateManager::shareTextures ( osg::StateSet ss) [protected]

Member Data Documentation

OpenThreads::Mutex osgDB::SharedStateManager::_listMutex [mutable, protected]
OpenThreads::Mutex* osgDB::SharedStateManager::_mutex [protected]
unsigned int osgDB::SharedStateManager::_shareMode [protected]

The documentation for this class was generated from the following file:

osg logo
Generated at Sun Jan 8 2012 13:16:32 for the OpenSceneGraph by doxygen 1.7.4.