openscenegraph
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
osgUtil::StateGraph Class Reference
Inheritance diagram for osgUtil::StateGraph:
osg::Object osg::Referenced

Public Types

typedef std::map< const osg::StateSet *, osg::ref_ptr< StateGraph > > ChildList
 
typedef std::vector< osg::ref_ptr< RenderLeaf > > LeafList
 
- Public Types inherited from osg::Object
enum  DataVariance { DYNAMIC, STATIC, UNSPECIFIED }
 

Public Member Functions

 StateGraph ()
 
 StateGraph (StateGraph *parent, const osg::StateSet *stateset)
 
 ~StateGraph ()
 
virtual osg::Object * cloneType () const
 
virtual StateGraph * cloneStateGraph () const
 
virtual osg::Object * clone (const osg::CopyOp &) const
 
virtual bool isSameKindAs (const osg::Object *obj) const
 
virtual const char * libraryName () const
 
virtual const char * className () const
 
void setUserData (osg::Referenced *obj)
 
osg::Referenced * getUserData ()
 
const osg::Referenced * getUserData () const
 
void setStateSet (const osg::StateSet *stateset)
 
const osg::StateSet * getStateSet () const
 
bool empty () const
 
bool leaves_empty () const
 
float getAverageDistance () const
 
float getMinimumDistance () const
 
void sortFrontToBack ()
 
void reset ()
 
void clean ()
 
void prune ()
 
void resizeGLObjectBuffers (unsigned int maxSize)
 
void releaseGLObjects (osg::State *state=0) const
 
StateGraph * find_or_insert (const osg::StateSet *stateset)
 
void addLeaf (RenderLeaf *leaf)
 
- Public Member Functions inherited from osg::Object
 Object ()
 
 Object (bool threadSafeRefUnref)
 
 Object (const Object &, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
 
std::string getCompoundClassName () const
 
virtual Node * asNode ()
 
virtual const Node * asNode () const
 
virtual NodeVisitor * asNodeVisitor ()
 
virtual const NodeVisitor * asNodeVisitor () const
 
virtual StateSet * asStateSet ()
 
virtual const StateSet * asStateSet () const
 
virtual StateAttribute * asStateAttribute ()
 
virtual const StateAttribute * asStateAttribute () const
 
virtual Uniform * asUniform ()
 
virtual const Uniform * asUniform () const
 
virtual Camera * asCamera ()
 
virtual const Camera * asCamera () const
 
virtual Drawable * asDrawable ()
 
virtual const Drawable * asDrawable () const
 
virtual Callback * asCallback ()
 
virtual const Callback * asCallback () const
 
virtual CallbackObject * asCallbackObject ()
 
virtual const CallbackObject * asCallbackObject () const
 
virtual UserDataContainer * asUserDataContainer ()
 
virtual const UserDataContainer * asUserDataContainer () const
 
virtual ValueObject * asValueObject ()
 
virtual const ValueObject * asValueObject () const
 
virtual Image * asImage ()
 
virtual const Image * asImage () const
 
virtual void setThreadSafeRefUnref (bool threadSafe)
 
virtual void setName (const std::string &name)
 
void setName (const char *name)
 
const std::string & getName () const
 
void setDataVariance (DataVariance dv)
 
DataVariance getDataVariance () const
 
virtual void computeDataVariance ()
 
void setUserDataContainer (osg::UserDataContainer *udc)
 
template<class T >
void setUserDataContainer (const ref_ptr< T > &udc)
 
osg::UserDataContainer * getUserDataContainer ()
 
const osg::UserDataContainer * getUserDataContainer () const
 
osg::UserDataContainer * getOrCreateUserDataContainer ()
 
template<class T >
void setUserData (const ref_ptr< T > &ud)
 
template<typename T >
bool getUserValue (const std::string &name, T &value) const
 
template<typename T >
void setUserValue (const std::string &name, const T &value)
 
template<typename T >
BoolValueObject UCharValueObject UShortValueObject UIntValueObject DoubleValueObject Vec3fValueObject Vec2dValueObject Vec4dValueObject PlaneValueObject MatrixdValueObject BoundingBoxdValueObject BoundingSpheredValueObject bool getUserValue (const std::string &name, T &value) const
 
- Public Member Functions inherited from osg::Referenced
 Referenced ()
 
 Referenced (bool threadSafeRefUnref)
 
 Referenced (const Referenced &)
 
Referenced & operator= (const Referenced &)
 
bool getThreadSafeRefUnref () const
 
OpenThreads::Mutex * getRefMutex () const
 
int ref () const
 
int unref () const
 
int unref_nodelete () const
 
int referenceCount () const
 
ObserverSet * getObserverSet () const
 
ObserverSet * getOrCreateObserverSet () const
 
void addObserver (Observer *observer) const
 
void removeObserver (Observer *observer) const
 

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 ()
 
static void setDeleteHandler (DeleteHandler *handler)
 
static DeleteHandler * getDeleteHandler ()
 

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::Object
virtual ~Object ()
 
- Protected Member Functions inherited from osg::Referenced
virtual ~Referenced ()
 
void signalObserversAndDelete (bool signalDelete, bool doDelete) const
 
void deleteUsingDeleteHandler () const
 
- Protected Attributes inherited from osg::Object
std::string _name
 
DataVariance _dataVariance
 
osg::UserDataContainer * _userDataContainer
 
- 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.

◆ className()

virtual const char* osgUtil::StateGraph::className ( ) const
inlinevirtual

return the name of the object's class type. Must be defined by derived classes.

Implements osg::Object.

◆ 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.

◆ clone()

virtual osg::Object* osgUtil::StateGraph::clone ( const osg::CopyOp &  ) const
inlinevirtual

Clone an object, with Object* return type. Must be defined by derived classes.

Implements osg::Object.

◆ cloneStateGraph()

virtual StateGraph* osgUtil::StateGraph::cloneStateGraph ( ) const
inlinevirtual

◆ cloneType()

virtual osg::Object* osgUtil::StateGraph::cloneType ( ) const
inlinevirtual

Clone the type of an object, with Object* return type. Must be defined by derived classes.

Implements osg::Object.

◆ 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 ( )
inlinevirtual

Get user data.

Reimplemented from osg::Object.

◆ getUserData() [2/2]

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

Get const user data.

Reimplemented from osg::Object.

◆ isSameKindAs()

virtual bool osgUtil::StateGraph::isSameKindAs ( const osg::Object *  obj) const
inlinevirtual

Reimplemented from osg::Object.

◆ leaves_empty()

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

◆ libraryName()

virtual const char* osgUtil::StateGraph::libraryName ( ) const
inlinevirtual

return the name of the object's library. Must be defined by derived classes. The OpenSceneGraph convention is that the namespace of a library is the same as the library name.

Implements osg::Object.

◆ 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.

◆ releaseGLObjects()

void osgUtil::StateGraph::releaseGLObjects ( osg::State *  = 0) const
inlinevirtual

If State is non-zero, this function releases any associated OpenGL objects for the specified graphics context. Otherwise, releases OpenGL objects for all graphics contexts.

Reimplemented from osg::Object.

◆ reset()

void osgUtil::StateGraph::reset ( )

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

◆ resizeGLObjectBuffers()

void osgUtil::StateGraph::resizeGLObjectBuffers ( unsigned int  )
inlinevirtual

Resize any per context GLObject buffers to specified size.

Reimplemented from osg::Object.

◆ setStateSet()

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

◆ setUserData()

void osgUtil::StateGraph::setUserData ( osg::Referenced *  obj)
inlinevirtual

Set user data, data must be subclassed from Referenced to allow automatic memory handling. If your own data isn't directly subclassed from Referenced then create an adapter object which points to your own object and handles the memory addressing.

Reimplemented from osg::Object.

◆ 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: