osg::StateSet Class Reference

Stores a set of modes and attributes which respresent a set of OpenGL state. More...

Inheritance diagram for osg::StateSet:

Inheritance graph
[legend]

List of all members.

Public Types

enum  RenderingHint { DEFAULT_BIN = 0, OPAQUE_BIN = 1, TRANSPARENT_BIN = 2 }
enum  RenderBinMode { INHERIT_RENDERBIN_DETAILS, USE_RENDERBIN_DETAILS, OVERRIDE_RENDERBIN_DETAILS }
typedef std::vector
< Object * > 
ParentList
 A vector of osg::Object pointers which is used to store the parent(s) of this Stateset, the parents could be osg::Node or osg::Drawable.
typedef std::map
< StateAttribute::GLMode,
StateAttribute::GLModeValue
ModeList
 a container to map GLModes to their respective GLModeValues.
typedef std::pair
< ref_ptr
< StateAttribute >,
StateAttribute::OverrideValue
RefAttributePair
 Simple pairing between an attribute and its override flag.
typedef std::map
< StateAttribute::TypeMemberPair,
RefAttributePair
AttributeList
 a container to map <StateAttribyte::Types,Member> to their respective RefAttributePair.
typedef std::vector
< ModeList
TextureModeList
typedef std::vector
< AttributeList
TextureAttributeList
typedef std::pair
< ref_ptr< Uniform >,
StateAttribute::OverrideValue
RefUniformPair
 Simple pairing between a Uniform and its override flag.
typedef std::map
< std::string,
RefUniformPair
UniformList
 a container to map Uniform name to its respective RefUniformPair.

Public Member Functions

 StateSet ()
 StateSet (const StateSet &, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
virtual ObjectcloneType () const
 Clone the type of an object, with Object* return type.
virtual Objectclone (const CopyOp &copyop) const
 Clone an object, with Object* return type.
virtual bool isSameKindAs (const Object *obj) const
virtual const char * libraryName () const
 return the name of the object's library.
virtual const char * className () const
 return the name of the object's class type.
int compare (const StateSet &rhs, bool compareAttributeContents=false) const
 return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.
bool operator< (const StateSet &rhs) const
bool operator== (const StateSet &rhs) const
bool operator!= (const StateSet &rhs) const
const ParentListgetParents () const
 Get the parent list of this StateSet.
ParentList getParents ()
 Get the a copy of parent list of node.
ObjectgetParent (unsigned int i)
const ObjectgetParent (unsigned int i) const
 Get a single const parent of this StateSet.
unsigned int getNumParents () const
 Get the number of parents of this StateSet.
virtual void computeDataVariance ()
 Compute the DataVariance based on an assestment of callback etc.
void setGlobalDefaults ()
 Set all the modes to on or off so that it defines a complete state, typically used for a default global state.
void clear ()
 Clear the StateSet of all modes and attributes.
void merge (const StateSet &rhs)
 Merge this StateSet with the StateSet passed as parameter.
void setMode (StateAttribute::GLMode mode, StateAttribute::GLModeValue value)
 Set this StateSet to contain the specified GLMode with a given value.
void removeMode (StateAttribute::GLMode mode)
 Remove mode from this StateSet.
StateAttribute::GLModeValue getMode (StateAttribute::GLMode mode) const
 Get the value for a given GLMode.
void setModeList (ModeList &ml)
 Set the list of all GLModes contained in this StateSet.
ModeListgetModeList ()
 Return the list of all GLModes contained in this StateSet.
const ModeListgetModeList () const
 Return the const list of all GLModes contained in this const StateSet.
void setAttribute (StateAttribute *attribute, StateAttribute::OverrideValue value=StateAttribute::OFF)
 Set this StateSet to contain specified attribute and override flag.
void setAttributeAndModes (StateAttribute *attribute, StateAttribute::GLModeValue value=StateAttribute::ON)
 Set this StateSet to contain specified attribute and set the associated GLMode's to specified value.
void removeAttribute (StateAttribute::Type type, unsigned int member=0)
 remove attribute of specified type from StateSet.
void removeAttribute (StateAttribute *attribute)
 remove attribute from StateSet.
StateAttributegetAttribute (StateAttribute::Type type, unsigned int member=0)
 Get specified StateAttribute for specified type.
const StateAttributegetAttribute (StateAttribute::Type type, unsigned int member=0) const
 Get specified const StateAttribute for specified type.
const RefAttributePairgetAttributePair (StateAttribute::Type type, unsigned int member=0) const
 Get specified RefAttributePair for specified type.
void setAttributeList (AttributeList &al)
 set the list of all StateAttributes contained in this StateSet.
AttributeListgetAttributeList ()
 return the list of all StateAttributes contained in this StateSet.
const AttributeListgetAttributeList () const
 return the const list of all StateAttributes contained in this const StateSet.
void setTextureMode (unsigned int unit, StateAttribute::GLMode mode, StateAttribute::GLModeValue value)
 Set this StateSet to contain specified GLMode with a given value.
void removeTextureMode (unsigned int unit, StateAttribute::GLMode mode)
 Remove texture mode from StateSet.
StateAttribute::GLModeValue getTextureMode (unsigned int unit, StateAttribute::GLMode mode) const
 Get specified GLModeValue for specified GLMode.
void setTextureModeList (TextureModeList &tml)
 set the list of all Texture related GLModes contained in this StateSet.
TextureModeListgetTextureModeList ()
 return the list of all Texture related GLModes contained in this StateSet.
const TextureModeListgetTextureModeList () const
 return the const list of all Texture related GLModes contained in this const StateSet.
void setTextureAttribute (unsigned int unit, StateAttribute *attribute, StateAttribute::OverrideValue value=StateAttribute::OFF)
 Set this StateSet to contain specified attribute and override flag.
void setTextureAttributeAndModes (unsigned int unit, StateAttribute *attribute, StateAttribute::GLModeValue value=StateAttribute::ON)
 Set this StateSet to contain specified attribute and set the associated GLMode's to specified value.
void removeTextureAttribute (unsigned int unit, StateAttribute::Type type)
 remove texture attribute of specified type from StateSet.
void removeTextureAttribute (unsigned int unit, StateAttribute *attribute)
 remove texture attribute from StateSet.
StateAttributegetTextureAttribute (unsigned int unit, StateAttribute::Type type)
 Get specified Texture related StateAttribute for specified type.
const StateAttributegetTextureAttribute (unsigned int unit, StateAttribute::Type type) const
 Get specified Texture related const StateAttribute for specified type.
const RefAttributePairgetTextureAttributePair (unsigned int unit, StateAttribute::Type type) const
 Get specified Texture related RefAttributePair for specified type.
void setTextureAttributeList (TextureAttributeList &tal)
 Set the list of all Texture related StateAttributes contained in this StateSet.
TextureAttributeListgetTextureAttributeList ()
 Return the list of all Texture related StateAttributes contained in this StateSet.
const
TextureAttributeList
getTextureAttributeList () const
 Return the const list of all Texture related StateAttributes contained in this const StateSet.
void setAssociatedModes (const StateAttribute *attribute, StateAttribute::GLModeValue value)
void setAssociatedTextureModes (unsigned int unit, const StateAttribute *attribute, StateAttribute::GLModeValue value)
void addUniform (Uniform *uniform, StateAttribute::OverrideValue value=StateAttribute::ON)
 Set this StateSet to contain specified uniform and override flag.
void removeUniform (const std::string &name)
 remove uniform of specified name from StateSet.
void removeUniform (Uniform *uniform)
 remove Uniform from StateSet.
UniformgetUniform (const std::string &name)
 Get Uniform for specified name.
UniformgetOrCreateUniform (const std::string &name, Uniform::Type type, unsigned int numElements=1)
 Get Uniform for specified name, if one is not available create it, add it to this StateSet and return a pointer to it.
const UniformgetUniform (const std::string &name) const
 Get const Uniform for specified name.
const RefUniformPairgetUniformPair (const std::string &name) const
 Get specified RefUniformPair for specified Uniform name.
void setUniformList (UniformList &al)
 set the list of all Uniforms contained in this StateSet.
UniformListgetUniformList ()
 return the list of all Uniforms contained in this StateSet.
const UniformListgetUniformList () const
 return the const list of all Uniforms contained in this const StateSet.
void setRenderingHint (int hint)
 Set the RenderingHint of this StateSet.
int getRenderingHint () const
 Get the RenderingHint of this StateSet.
void setRenderBinDetails (int binNum, const std::string &binName, RenderBinMode mode=USE_RENDERBIN_DETAILS)
 Set the render bin details.
void setRenderBinToInherit ()
 Set the render bin details to inherit.
bool useRenderBinDetails () const
 Get whether the render bin details are set and should be used.
void setRenderBinMode (RenderBinMode mode)
 Set the render bin mode.
RenderBinMode getRenderBinMode () const
 Get the render bin mode.
void setBinNumber (int num)
 Set the render bin number.
int getBinNumber () const
 Get the render bin number.
void setBinName (const std::string &name)
 Set the render bin name.
const std::string & getBinName () const
 Get the render bin name.
void setUpdateCallback (Callback *ac)
 Set the Update Callback which allows users to attach customize the updating of an object during the update traversal.
CallbackgetUpdateCallback ()
 Get the non const Update Callback.
const CallbackgetUpdateCallback () const
 Get the const Update Callback.
bool requiresUpdateTraversal () const
 Return whether this StateSet has update callbacks associated with it, and therefore must be traversed.
unsigned int getNumChildrenRequiringUpdateTraversal () const
 Get the number of Objects of this StateSet which require Update traversal, since they have an Update Callback attached to them or their children.
void runUpdateCallbacks (osg::NodeVisitor *nv)
 Run the update callbacks attached directly to this StateSet or to its children.
void setEventCallback (Callback *ac)
 Set the Event Callback which allows users to attach customize the updating of an object during the event traversal.
CallbackgetEventCallback ()
 Get the non const Event Callback.
const CallbackgetEventCallback () const
 Get the const Event Callback.
bool requiresEventTraversal () const
 Return whether this StateSet has event callbacks associated with it, and therefore must be traversed.
unsigned int getNumChildrenRequiringEventTraversal () const
 Get the number of Objects of this StateSet which require Event traversal, since they have an Eevnt Callback attached to them or their children.
void runEventCallbacks (osg::NodeVisitor *nv)
 Run the event callbacks attached directly to this StateSet or to its children.
bool checkValidityOfAssociatedModes (State &state) const
 Check the modes associated with this StateSet are supported by current OpenGL drivers, and if not set the associated mode in osg::State to be black listed/invalid.
virtual void setThreadSafeRefUnref (bool threadSafe)
 Set whether to use a mutex to ensure ref() and unref() are thread safe.
void compileGLObjects (State &state) const
 call compile on all StateAttributes contained within this StateSet.
virtual void resizeGLObjectBuffers (unsigned int maxSize)
 Resize any per context GLObject buffers to specified size.
virtual void releaseGLObjects (State *state=0) const
 call release on all StateAttributes contained within this StateSet.

Protected Member Functions

virtual ~StateSet ()
StateSetoperator= (const StateSet &)
void addParent (osg::Object *object)
void removeParent (osg::Object *object)
ModeListgetOrCreateTextureModeList (unsigned int unit)
AttributeListgetOrCreateTextureAttributeList (unsigned int unit)
int compareModes (const ModeList &lhs, const ModeList &rhs)
int compareAttributePtrs (const AttributeList &lhs, const AttributeList &rhs)
int compareAttributeContents (const AttributeList &lhs, const AttributeList &rhs)
void setMode (ModeList &modeList, StateAttribute::GLMode mode, StateAttribute::GLModeValue value)
void setModeToInherit (ModeList &modeList, StateAttribute::GLMode mode)
StateAttribute::GLModeValue getMode (const ModeList &modeList, StateAttribute::GLMode mode) const
void setAttribute (AttributeList &attributeList, StateAttribute *attribute, const StateAttribute::OverrideValue value=StateAttribute::OFF)
StateAttributegetAttribute (AttributeList &attributeList, const StateAttribute::Type type, unsigned int member)
const StateAttributegetAttribute (const AttributeList &attributeList, const StateAttribute::Type type, unsigned int member) const
const RefAttributePairgetAttributePair (const AttributeList &attributeList, const StateAttribute::Type type, unsigned int member) const
void setNumChildrenRequiringUpdateTraversal (unsigned int num)
void setNumChildrenRequiringEventTraversal (unsigned int num)

Protected Attributes

ParentList _parents
ModeList _modeList
AttributeList _attributeList
TextureModeList _textureModeList
TextureAttributeList _textureAttributeList
UniformList _uniformList
int _renderingHint
RenderBinMode _binMode
int _binNum
std::string _binName
ref_ptr< Callback_updateCallback
unsigned int _numChildrenRequiringUpdateTraversal
ref_ptr< Callback_eventCallback
unsigned int _numChildrenRequiringEventTraversal

Friends

class osg::Node
class osg::Drawable
class osg::Uniform
class osg::StateAttribute

Classes

struct  Callback


Detailed Description

Stores a set of modes and attributes which respresent a set of OpenGL state.

Notice that a StateSet contains just a subset of the whole OpenGL state.

In OSG, each Drawable and each Node has a reference to a StateSet. These StateSets can be shared between different Drawables and Nodes (that is, several Drawables and Nodes can reference the same StateSet). Indeed, this practice is recommended whenever possible, as this minimizes expensive state changes in the graphics pipeline.


Member Typedef Documentation

typedef std::vector<Object*> osg::StateSet::ParentList

A vector of osg::Object pointers which is used to store the parent(s) of this Stateset, the parents could be osg::Node or osg::Drawable.

typedef std::map<StateAttribute::GLMode,StateAttribute::GLModeValue> osg::StateSet::ModeList

a container to map GLModes to their respective GLModeValues.

typedef std::pair<ref_ptr<StateAttribute>,StateAttribute::OverrideValue> osg::StateSet::RefAttributePair

Simple pairing between an attribute and its override flag.

typedef std::map<StateAttribute::TypeMemberPair,RefAttributePair> osg::StateSet::AttributeList

a container to map <StateAttribyte::Types,Member> to their respective RefAttributePair.

typedef std::vector<ModeList> osg::StateSet::TextureModeList

typedef std::vector<AttributeList> osg::StateSet::TextureAttributeList

typedef std::pair<ref_ptr<Uniform>,StateAttribute::OverrideValue> osg::StateSet::RefUniformPair

Simple pairing between a Uniform and its override flag.

typedef std::map<std::string,RefUniformPair> osg::StateSet::UniformList

a container to map Uniform name to its respective RefUniformPair.


Member Enumeration Documentation

enum osg::StateSet::RenderingHint

Enumerator:
DEFAULT_BIN 
OPAQUE_BIN 
TRANSPARENT_BIN 

enum osg::StateSet::RenderBinMode

Enumerator:
INHERIT_RENDERBIN_DETAILS 
USE_RENDERBIN_DETAILS 
OVERRIDE_RENDERBIN_DETAILS 


Constructor & Destructor Documentation

osg::StateSet::StateSet (  ) 

osg::StateSet::StateSet ( const StateSet ,
const CopyOp copyop = CopyOp::SHALLOW_COPY 
)

virtual osg::StateSet::~StateSet (  )  [protected, virtual]


Member Function Documentation

virtual Object* osg::StateSet::cloneType (  )  const [inline, virtual]

Clone the type of an object, with Object* return type.

Must be defined by derived classes.

Implements osg::Object.

virtual Object* osg::StateSet::clone ( const CopyOp  )  const [inline, virtual]

Clone an object, with Object* return type.

Must be defined by derived classes.

Implements osg::Object.

virtual bool osg::StateSet::isSameKindAs ( const Object obj  )  const [inline, virtual]

Reimplemented from osg::Object.

virtual const char* osg::StateSet::libraryName (  )  const [inline, virtual]

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.

virtual const char* osg::StateSet::className (  )  const [inline, virtual]

return the name of the object's class type.

Must be defined by derived classes.

Implements osg::Object.

int osg::StateSet::compare ( const StateSet rhs,
bool  compareAttributeContents = false 
) const

return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.

bool osg::StateSet::operator< ( const StateSet rhs  )  const [inline]

bool osg::StateSet::operator== ( const StateSet rhs  )  const [inline]

bool osg::StateSet::operator!= ( const StateSet rhs  )  const [inline]

const ParentList& osg::StateSet::getParents (  )  const [inline]

Get the parent list of this StateSet.

ParentList osg::StateSet::getParents (  )  [inline]

Get the a copy of parent list of node.

A copy is returned to prevent modification of the parent list.

Object* osg::StateSet::getParent ( unsigned int  i  )  [inline]

const Object* osg::StateSet::getParent ( unsigned int  i  )  const [inline]

Get a single const parent of this StateSet.

Parameters:
i index of the parent to get.
Returns:
the parent i.

unsigned int osg::StateSet::getNumParents (  )  const [inline]

Get the number of parents of this StateSet.

Returns:
the number of parents of this StateSet.

virtual void osg::StateSet::computeDataVariance (  )  [virtual]

Compute the DataVariance based on an assestment of callback etc.

Reimplemented from osg::Object.

void osg::StateSet::setGlobalDefaults (  ) 

Set all the modes to on or off so that it defines a complete state, typically used for a default global state.

void osg::StateSet::clear (  ) 

Clear the StateSet of all modes and attributes.

void osg::StateSet::merge ( const StateSet rhs  ) 

Merge this StateSet with the StateSet passed as parameter.

Every mode and attribute in this StateSet that is marked with StateAttribute::OVERRIDE is replaced with the equivalent mode or attribute from rhs.

void osg::StateSet::setMode ( StateAttribute::GLMode  mode,
StateAttribute::GLModeValue  value 
)

Set this StateSet to contain the specified GLMode with a given value.

Note:
Don't use this method to set modes related to textures. For this purpose, use setTextureMode(), that accepts an extra parameter specifying which texture unit shall be affected by the call.

void osg::StateSet::removeMode ( StateAttribute::GLMode  mode  ) 

Remove mode from this StateSet.

Note:
Don't use this method to remove modes related to textures. For this purpose, use removeTextureMode(), that accepts an extra parameter specifying which texture unit shall be affected by the call.

StateAttribute::GLModeValue osg::StateSet::getMode ( StateAttribute::GLMode  mode  )  const

Get the value for a given GLMode.

Parameters:
mode The GLMode whose value is desired.
Returns:
If mode is contained within this StateSet, returns the value associated with it. Otherwise, returns StateAttribute::INHERIT.
Note:
Don't use this method to get the value of modes related to textures. For this purpose, use removeTextureMode(), that accepts an extra parameter specifying which texture unit shall be affected by the call.

void osg::StateSet::setModeList ( ModeList ml  )  [inline]

Set the list of all GLModes contained in this StateSet.

ModeList& osg::StateSet::getModeList (  )  [inline]

Return the list of all GLModes contained in this StateSet.

const ModeList& osg::StateSet::getModeList (  )  const [inline]

Return the const list of all GLModes contained in this const StateSet.

void osg::StateSet::setAttribute ( StateAttribute attribute,
StateAttribute::OverrideValue  value = StateAttribute::OFF 
)

Set this StateSet to contain specified attribute and override flag.

void osg::StateSet::setAttributeAndModes ( StateAttribute attribute,
StateAttribute::GLModeValue  value = StateAttribute::ON 
)

Set this StateSet to contain specified attribute and set the associated GLMode's to specified value.

void osg::StateSet::removeAttribute ( StateAttribute::Type  type,
unsigned int  member = 0 
)

remove attribute of specified type from StateSet.

void osg::StateSet::removeAttribute ( StateAttribute attribute  ) 

remove attribute from StateSet.

StateAttribute* osg::StateSet::getAttribute ( StateAttribute::Type  type,
unsigned int  member = 0 
)

Get specified StateAttribute for specified type.

Returns NULL if no type is contained within StateSet.

const StateAttribute* osg::StateSet::getAttribute ( StateAttribute::Type  type,
unsigned int  member = 0 
) const

Get specified const StateAttribute for specified type.

Returns NULL if no type is contained within const StateSet.

const RefAttributePair* osg::StateSet::getAttributePair ( StateAttribute::Type  type,
unsigned int  member = 0 
) const

Get specified RefAttributePair for specified type.

Returns NULL if no type is contained within StateSet.

void osg::StateSet::setAttributeList ( AttributeList al  )  [inline]

set the list of all StateAttributes contained in this StateSet.

AttributeList& osg::StateSet::getAttributeList (  )  [inline]

return the list of all StateAttributes contained in this StateSet.

const AttributeList& osg::StateSet::getAttributeList (  )  const [inline]

return the const list of all StateAttributes contained in this const StateSet.

void osg::StateSet::setTextureMode ( unsigned int  unit,
StateAttribute::GLMode  mode,
StateAttribute::GLModeValue  value 
)

Set this StateSet to contain specified GLMode with a given value.

Parameters:
unit The texture unit to be affected (used with multi-texturing).
mode The OpenGL mode to be added to the StateSet.
value The value to be assigned to mode.

void osg::StateSet::removeTextureMode ( unsigned int  unit,
StateAttribute::GLMode  mode 
)

Remove texture mode from StateSet.

StateAttribute::GLModeValue osg::StateSet::getTextureMode ( unsigned int  unit,
StateAttribute::GLMode  mode 
) const

Get specified GLModeValue for specified GLMode.

returns INHERIT if no GLModeValue is contained within StateSet.

void osg::StateSet::setTextureModeList ( TextureModeList tml  )  [inline]

set the list of all Texture related GLModes contained in this StateSet.

TextureModeList& osg::StateSet::getTextureModeList (  )  [inline]

return the list of all Texture related GLModes contained in this StateSet.

const TextureModeList& osg::StateSet::getTextureModeList (  )  const [inline]

return the const list of all Texture related GLModes contained in this const StateSet.

void osg::StateSet::setTextureAttribute ( unsigned int  unit,
StateAttribute attribute,
StateAttribute::OverrideValue  value = StateAttribute::OFF 
)

Set this StateSet to contain specified attribute and override flag.

void osg::StateSet::setTextureAttributeAndModes ( unsigned int  unit,
StateAttribute attribute,
StateAttribute::GLModeValue  value = StateAttribute::ON 
)

Set this StateSet to contain specified attribute and set the associated GLMode's to specified value.

void osg::StateSet::removeTextureAttribute ( unsigned int  unit,
StateAttribute::Type  type 
)

remove texture attribute of specified type from StateSet.

void osg::StateSet::removeTextureAttribute ( unsigned int  unit,
StateAttribute attribute 
)

remove texture attribute from StateSet.

StateAttribute* osg::StateSet::getTextureAttribute ( unsigned int  unit,
StateAttribute::Type  type 
)

Get specified Texture related StateAttribute for specified type.

Returns NULL if no type is contained within StateSet.

const StateAttribute* osg::StateSet::getTextureAttribute ( unsigned int  unit,
StateAttribute::Type  type 
) const

Get specified Texture related const StateAttribute for specified type.

Returns NULL if no type is contained within const StateSet.

const RefAttributePair* osg::StateSet::getTextureAttributePair ( unsigned int  unit,
StateAttribute::Type  type 
) const

Get specified Texture related RefAttributePair for specified type.

Returns NULL if no type is contained within StateSet.

void osg::StateSet::setTextureAttributeList ( TextureAttributeList tal  )  [inline]

Set the list of all Texture related StateAttributes contained in this StateSet.

TextureAttributeList& osg::StateSet::getTextureAttributeList (  )  [inline]

Return the list of all Texture related StateAttributes contained in this StateSet.

const TextureAttributeList& osg::StateSet::getTextureAttributeList (  )  const [inline]

Return the const list of all Texture related StateAttributes contained in this const StateSet.

void osg::StateSet::setAssociatedModes ( const StateAttribute attribute,
StateAttribute::GLModeValue  value 
)

void osg::StateSet::setAssociatedTextureModes ( unsigned int  unit,
const StateAttribute attribute,
StateAttribute::GLModeValue  value 
)

void osg::StateSet::addUniform ( Uniform uniform,
StateAttribute::OverrideValue  value = StateAttribute::ON 
)

Set this StateSet to contain specified uniform and override flag.

void osg::StateSet::removeUniform ( const std::string &  name  ) 

remove uniform of specified name from StateSet.

void osg::StateSet::removeUniform ( Uniform uniform  ) 

remove Uniform from StateSet.

Uniform* osg::StateSet::getUniform ( const std::string &  name  ) 

Get Uniform for specified name.

Returns NULL if no matching Uniform is contained within StateSet.

Uniform* osg::StateSet::getOrCreateUniform ( const std::string &  name,
Uniform::Type  type,
unsigned int  numElements = 1 
)

Get Uniform for specified name, if one is not available create it, add it to this StateSet and return a pointer to it.

const Uniform* osg::StateSet::getUniform ( const std::string &  name  )  const

Get const Uniform for specified name.

Returns NULL if no matching Uniform is contained within StateSet.

const RefUniformPair* osg::StateSet::getUniformPair ( const std::string &  name  )  const

Get specified RefUniformPair for specified Uniform name.

Returns NULL if no Uniform is contained within StateSet.

void osg::StateSet::setUniformList ( UniformList al  )  [inline]

set the list of all Uniforms contained in this StateSet.

UniformList& osg::StateSet::getUniformList (  )  [inline]

return the list of all Uniforms contained in this StateSet.

const UniformList& osg::StateSet::getUniformList (  )  const [inline]

return the const list of all Uniforms contained in this const StateSet.

void osg::StateSet::setRenderingHint ( int  hint  ) 

Set the RenderingHint of this StateSet.

RenderingHint is used by the renderer to determine which draw bin to drop associated osg::Drawables in. Typically, users will set this to either StateSet::OPAQUE_BIN or StateSet::TRANSPARENT_BIN. Drawables in the opaque bin are sorted by their StateSet, so that the number of expensive changes in the OpenGL state is minimized. Drawables in the transparent bin are sorted by depth, so that objects farther from the viewer are rendered first (and hence alpha blending works nicely for translucent objects).

int osg::StateSet::getRenderingHint (  )  const [inline]

Get the RenderingHint of this StateSet.

void osg::StateSet::setRenderBinDetails ( int  binNum,
const std::string &  binName,
RenderBinMode  mode = USE_RENDERBIN_DETAILS 
)

Set the render bin details.

void osg::StateSet::setRenderBinToInherit (  ) 

Set the render bin details to inherit.

bool osg::StateSet::useRenderBinDetails (  )  const [inline]

Get whether the render bin details are set and should be used.

void osg::StateSet::setRenderBinMode ( RenderBinMode  mode  )  [inline]

Set the render bin mode.

RenderBinMode osg::StateSet::getRenderBinMode (  )  const [inline]

Get the render bin mode.

void osg::StateSet::setBinNumber ( int  num  )  [inline]

Set the render bin number.

int osg::StateSet::getBinNumber (  )  const [inline]

Get the render bin number.

void osg::StateSet::setBinName ( const std::string &  name  )  [inline]

Set the render bin name.

const std::string& osg::StateSet::getBinName (  )  const [inline]

Get the render bin name.

void osg::StateSet::setUpdateCallback ( Callback ac  ) 

Set the Update Callback which allows users to attach customize the updating of an object during the update traversal.

Callback* osg::StateSet::getUpdateCallback (  )  [inline]

Get the non const Update Callback.

const Callback* osg::StateSet::getUpdateCallback (  )  const [inline]

Get the const Update Callback.

bool osg::StateSet::requiresUpdateTraversal (  )  const [inline]

Return whether this StateSet has update callbacks associated with it, and therefore must be traversed.

unsigned int osg::StateSet::getNumChildrenRequiringUpdateTraversal (  )  const [inline]

Get the number of Objects of this StateSet which require Update traversal, since they have an Update Callback attached to them or their children.

void osg::StateSet::runUpdateCallbacks ( osg::NodeVisitor nv  ) 

Run the update callbacks attached directly to this StateSet or to its children.

void osg::StateSet::setEventCallback ( Callback ac  ) 

Set the Event Callback which allows users to attach customize the updating of an object during the event traversal.

Callback* osg::StateSet::getEventCallback (  )  [inline]

Get the non const Event Callback.

const Callback* osg::StateSet::getEventCallback (  )  const [inline]

Get the const Event Callback.

bool osg::StateSet::requiresEventTraversal (  )  const [inline]

Return whether this StateSet has event callbacks associated with it, and therefore must be traversed.

unsigned int osg::StateSet::getNumChildrenRequiringEventTraversal (  )  const [inline]

Get the number of Objects of this StateSet which require Event traversal, since they have an Eevnt Callback attached to them or their children.

void osg::StateSet::runEventCallbacks ( osg::NodeVisitor nv  ) 

Run the event callbacks attached directly to this StateSet or to its children.

bool osg::StateSet::checkValidityOfAssociatedModes ( State state  )  const

Check the modes associated with this StateSet are supported by current OpenGL drivers, and if not set the associated mode in osg::State to be black listed/invalid.

Return true if all associated modes are valid.

virtual void osg::StateSet::setThreadSafeRefUnref ( bool  threadSafe  )  [virtual]

Set whether to use a mutex to ensure ref() and unref() are thread safe.

Reimplemented from osg::Referenced.

void osg::StateSet::compileGLObjects ( State state  )  const

call compile on all StateAttributes contained within this StateSet.

virtual void osg::StateSet::resizeGLObjectBuffers ( unsigned int  maxSize  )  [virtual]

Resize any per context GLObject buffers to specified size.

Reimplemented from osg::Object.

virtual void osg::StateSet::releaseGLObjects ( State state = 0  )  const [virtual]

call release on all StateAttributes contained within this StateSet.

Reimplemented from osg::Object.

StateSet& osg::StateSet::operator= ( const StateSet  )  [inline, protected]

void osg::StateSet::addParent ( osg::Object object  )  [protected]

void osg::StateSet::removeParent ( osg::Object object  )  [protected]

ModeList& osg::StateSet::getOrCreateTextureModeList ( unsigned int  unit  )  [inline, protected]

AttributeList& osg::StateSet::getOrCreateTextureAttributeList ( unsigned int  unit  )  [inline, protected]

int osg::StateSet::compareModes ( const ModeList lhs,
const ModeList rhs 
) [protected]

int osg::StateSet::compareAttributePtrs ( const AttributeList lhs,
const AttributeList rhs 
) [protected]

int osg::StateSet::compareAttributeContents ( const AttributeList lhs,
const AttributeList rhs 
) [protected]

void osg::StateSet::setMode ( ModeList modeList,
StateAttribute::GLMode  mode,
StateAttribute::GLModeValue  value 
) [protected]

void osg::StateSet::setModeToInherit ( ModeList modeList,
StateAttribute::GLMode  mode 
) [protected]

StateAttribute::GLModeValue osg::StateSet::getMode ( const ModeList modeList,
StateAttribute::GLMode  mode 
) const [protected]

void osg::StateSet::setAttribute ( AttributeList attributeList,
StateAttribute attribute,
const StateAttribute::OverrideValue  value = StateAttribute::OFF 
) [protected]

StateAttribute* osg::StateSet::getAttribute ( AttributeList attributeList,
const StateAttribute::Type  type,
unsigned int  member 
) [protected]

const StateAttribute* osg::StateSet::getAttribute ( const AttributeList attributeList,
const StateAttribute::Type  type,
unsigned int  member 
) const [protected]

const RefAttributePair* osg::StateSet::getAttributePair ( const AttributeList attributeList,
const StateAttribute::Type  type,
unsigned int  member 
) const [protected]

void osg::StateSet::setNumChildrenRequiringUpdateTraversal ( unsigned int  num  )  [protected]

void osg::StateSet::setNumChildrenRequiringEventTraversal ( unsigned int  num  )  [protected]


Friends And Related Function Documentation

friend class osg::Node [friend]

friend class osg::Drawable [friend]

friend class osg::Uniform [friend]

friend class osg::StateAttribute [friend]


Member Data Documentation

ParentList osg::StateSet::_parents [protected]

ModeList osg::StateSet::_modeList [protected]

AttributeList osg::StateSet::_attributeList [protected]

TextureModeList osg::StateSet::_textureModeList [protected]

TextureAttributeList osg::StateSet::_textureAttributeList [protected]

UniformList osg::StateSet::_uniformList [protected]

int osg::StateSet::_renderingHint [protected]

RenderBinMode osg::StateSet::_binMode [protected]

int osg::StateSet::_binNum [protected]

std::string osg::StateSet::_binName [protected]

ref_ptr<Callback> osg::StateSet::_updateCallback [protected]

unsigned int osg::StateSet::_numChildrenRequiringUpdateTraversal [protected]

ref_ptr<Callback> osg::StateSet::_eventCallback [protected]

unsigned int osg::StateSet::_numChildrenRequiringEventTraversal [protected]


The documentation for this class was generated from the following file:
Generated at Sun Oct 14 02:12:16 2007 for the OpenSceneGraph by doxygen 1.5.3.