OpenSceneGraph  3.6.3
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
osgUtil::StateGraph Class Reference

StateGraph - contained in a renderBin, defines the scene to be drawn. More...

Inheritance diagram for osgUtil::StateGraph:
Inheritance graph
[legend]

Public Types

typedef std::map< const osg::StateSet *, osg::ref_ptr< StateGraph > > ChildList
 
typedef std::vector< osg::ref_ptr< RenderLeaf > > LeafList
 

Public Member Functions

 StateGraph ()
 
 StateGraph (StateGraph *parent, const osg::StateSet *stateset)
 
 ~StateGraph ()
 
StateGraphcloneType () const
 
void setUserData (osg::Referenced *obj)
 
osg::ReferencedgetUserData ()
 
const osg::ReferencedgetUserData () const
 
void setStateSet (const osg::StateSet *stateset)
 
const osg::StateSetgetStateSet () const
 
bool empty () const
 return true if all of drawables, lights and children are empty. More...
 
bool leaves_empty () const
 
float getAverageDistance () const
 
float getMinimumDistance () const
 
void sortFrontToBack ()
 
void reset ()
 Reset the internal contents of a StateGraph, including deleting all children. More...
 
void clean ()
 Recursively clean the StateGraph of all its drawables, lights and depths. More...
 
void prune ()
 Recursively prune the StateGraph of empty children. More...
 
StateGraphfind_or_insert (const osg::StateSet *stateset)
 
void addLeaf (RenderLeaf *leaf)
 add a render leaf. More...
 
- Public Member Functions inherited from osg::Referenced
 Referenced ()
 
 Referenced (bool threadSafeRefUnref)
 Deprecated, Referenced is now always uses thread safe ref/unref, use default Referenced() constructor instead. More...
 
 Referenced (const Referenced &)
 
Referencedoperator= (const Referenced &)
 
virtual void setThreadSafeRefUnref (bool)
 Deprecated, Referenced is always theadsafe so there method now has no effect and does not need to be called. More...
 
bool getThreadSafeRefUnref () const
 Get whether a mutex is used to ensure ref() and unref() are thread safe. More...
 
OpenThreads::Mutex * getRefMutex () const
 Get the mutex used to ensure thread safety of ref()/unref(). More...
 
int ref () const
 Increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
int unref () const
 Decrement the reference count by one, indicating that a pointer to this object is no longer referencing it. More...
 
int unref_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is no longer referencing it. More...
 
int referenceCount () const
 Return the number of pointers currently referencing this object. More...
 
ObserverSetgetObserverSet () const
 Get the ObserverSet if one is attached, otherwise return NULL. More...
 
ObserverSetgetOrCreateObserverSet () const
 Get the ObserverSet if one is attached, otherwise create an ObserverSet, attach it, then return this newly created ObserverSet. More...
 
void addObserver (Observer *observer) const
 Add a Observer that is observing this object, notify the Observer when this object gets deleted. More...
 
void removeObserver (Observer *observer) const
 Remove Observer that is observing this object. More...
 

Static Public Member Functions

static void moveStateGraph (osg::State &state, StateGraph *sg_curr, StateGraph *sg_new)
 
static void moveToRootStateGraph (osg::State &state, StateGraph *sg_curr)
 
static int numToPop (StateGraph *sg_curr)
 
- Static Public Member Functions inherited from osg::Referenced
static OpenThreads::Mutex * getGlobalReferencedMutex ()
 Get the optional global Referenced mutex, this can be shared between all osg::Referenced. More...
 
static void setDeleteHandler (DeleteHandler *handler)
 Set a DeleteHandler to which deletion of all referenced counted objects will be delegated. More...
 
static DeleteHandlergetDeleteHandler ()
 Get a DeleteHandler. More...
 

Public Attributes

StateGraph_parent
 
const osg::StateSet_stateset
 
int _depth
 
ChildList _children
 
LeafList _leaves
 
float _averageDistance
 
float _minimumDistance
 
osg::ref_ptr< osg::Referenced_userData
 
bool _dynamic
 

Additional Inherited Members

- Protected Member Functions inherited from osg::Referenced
virtual ~Referenced ()
 
void signalObserversAndDelete (bool signalDelete, bool doDelete) const
 
void deleteUsingDeleteHandler () const
 
- Protected Attributes inherited from osg::Referenced
OpenThreads::AtomicPtr _observerSet
 
OpenThreads::Atomic _refCount
 

Detailed Description

StateGraph - contained in a renderBin, defines the scene to be drawn.

Member Typedef Documentation

◆ ChildList

◆ LeafList

Constructor & Destructor Documentation

◆ StateGraph() [1/2]

osgUtil::StateGraph::StateGraph ( )
inline

◆ StateGraph() [2/2]

osgUtil::StateGraph::StateGraph ( StateGraph parent,
const osg::StateSet stateset 
)
inline

◆ ~StateGraph()

osgUtil::StateGraph::~StateGraph ( )
inline

Member Function Documentation

◆ addLeaf()

void osgUtil::StateGraph::addLeaf ( RenderLeaf leaf)
inline

add a render leaf.

◆ clean()

void osgUtil::StateGraph::clean ( )

Recursively clean the StateGraph of all its drawables, lights and depths.

Leaves children intact, and ready to be populated again.

◆ cloneType()

StateGraph* osgUtil::StateGraph::cloneType ( ) const
inline

◆ empty()

bool osgUtil::StateGraph::empty ( ) const
inline

return true if all of drawables, lights and children are empty.

◆ find_or_insert()

StateGraph* osgUtil::StateGraph::find_or_insert ( const osg::StateSet stateset)
inline

◆ getAverageDistance()

float osgUtil::StateGraph::getAverageDistance ( ) const
inline

◆ getMinimumDistance()

float osgUtil::StateGraph::getMinimumDistance ( ) const
inline

◆ getStateSet()

const osg::StateSet* osgUtil::StateGraph::getStateSet ( ) const
inline

◆ getUserData() [1/2]

osg::Referenced* osgUtil::StateGraph::getUserData ( )
inline

◆ getUserData() [2/2]

const osg::Referenced* osgUtil::StateGraph::getUserData ( ) const
inline

◆ leaves_empty()

bool osgUtil::StateGraph::leaves_empty ( ) const
inline

◆ moveStateGraph()

static void osgUtil::StateGraph::moveStateGraph ( osg::State state,
StateGraph sg_curr,
StateGraph sg_new 
)
inlinestatic

◆ moveToRootStateGraph()

static void osgUtil::StateGraph::moveToRootStateGraph ( osg::State state,
StateGraph sg_curr 
)
inlinestatic

◆ numToPop()

static int osgUtil::StateGraph::numToPop ( StateGraph sg_curr)
inlinestatic

◆ prune()

void osgUtil::StateGraph::prune ( )

Recursively prune the StateGraph of empty children.

◆ reset()

void osgUtil::StateGraph::reset ( )

Reset the internal contents of a StateGraph, including deleting all children.

◆ setStateSet()

void osgUtil::StateGraph::setStateSet ( const osg::StateSet stateset)
inline

◆ setUserData()

void osgUtil::StateGraph::setUserData ( osg::Referenced obj)
inline

◆ sortFrontToBack()

void osgUtil::StateGraph::sortFrontToBack ( )
inline

Member Data Documentation

◆ _averageDistance

float osgUtil::StateGraph::_averageDistance
mutable

◆ _children

ChildList osgUtil::StateGraph::_children

◆ _depth

int osgUtil::StateGraph::_depth

◆ _dynamic

bool osgUtil::StateGraph::_dynamic

◆ _leaves

LeafList osgUtil::StateGraph::_leaves

◆ _minimumDistance

float osgUtil::StateGraph::_minimumDistance
mutable

◆ _parent

StateGraph* osgUtil::StateGraph::_parent

◆ _stateset

const osg::StateSet* osgUtil::StateGraph::_stateset

◆ _userData

osg::ref_ptr<osg::Referenced> osgUtil::StateGraph::_userData

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

osg logo
Generated at Sat Mar 23 2019 10:43:09 for the OpenSceneGraph by doxygen 1.8.15.