class SG_EXPORT osg::StateSet

Encapsulates OpenGL state modes and attributes.

Inheritance:


Public Methods

[more] StateSet()
[more] StateSet(const StateSet&)
[more]virtual Object* clone() const
[more]virtual bool isSameKindAs(const Object* obj) const
[more]virtual const char* className() const
[more]int compare(const StateSet& rhs, bool compareAttributeContents=false) const
return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs
[more]bool operator < (const StateSet& rhs) const
[more]bool operator == (const StateSet& rhs) const
[more]bool operator != (const StateSet& rhs) const
[more]void setGlobalDefaults()
set all the modes to on or off so that it defines a complete state, typically used for a default global state
[more]void setAllToInherit()
set all the modes to inherit, typically used to signify nodes which inherit all of their modes for the global state
[more]void merge(const StateSet& rhs)
merge this stateset with stateset rhs, this overrides the rhs if OVERRIDE is specified, otherwise rhs takes precedence
[more]void setMode(const StateAttribute::GLMode mode, const StateAttribute::GLModeValue value)
set this StateSet to contain specified GLMode and value
[more]void setModeToInherit(const StateAttribute::GLMode mode)
set this StateSet to inherit specified GLMode type from parents.
[more]const StateAttribute::GLModeValue getMode(const StateAttribute::GLMode mode) const
get specified GLModeValue for specified GLMode.
[more]inline ModeList& getModeList()
return the list of all GLModes contained in this StateSet
[more]inline const ModeList& getModeList() const
return the const list of all GLModes contained in this const StateSet
[more]void setAttribute(StateAttribute* attribute, const StateAttribute::OverrideValue value=StateAttribute::OFF)
set this StateSet to contain specified attribute and override flag
[more]void setAttributeAndModes(StateAttribute* attribute, const StateAttribute::GLModeValue value=StateAttribute::ON)
set this StateSet to contain specified attribute and set the associated GLMode's to specified value
[more]void setAttributeToInherit(const StateAttribute::Type type)
set this StateSet to inherit specified attribute type from parents.
[more]StateAttribute* getAttribute(const StateAttribute::Type type)
get specified StateAttribute for specified type.
[more]const StateAttribute* getAttribute(const StateAttribute::Type type) const
get specified const StateAttribute for specified type.
[more]const RefAttributePair* getAttributePair(const StateAttribute::Type type) const
get specified RefAttributePair for specified type.
[more]inline AttributeList& getAttributeList()
return the list of all StateAttributes contained in this StateSet
[more]inline const AttributeList& getAttributeList() const
return the const list of all StateAttributes contained in this const StateSet
[more]void setRenderingHint(const int hint)
set the RenderingHint of the StateSet.
[more]inline const int getRenderingHint() const
get the RenderingHint of the StateSet
[more]void setRenderBinDetails(const int binNum, const std::string& binName, const RenderBinMode mode=USE_RENDERBIN_DETAILS)
set the render bin details
[more]void setRendingBinToInherit()
set the render bin details to inherit
[more]inline const RenderBinMode getRenderBinMode() const
get the render bin mode
[more]inline const bool useRenderBinDetails() const
get whether the render bin details are set and should be used
[more]inline const int getBinNumber() const
get the render bin number
[more]inline const std::string& getBinName() const
get the render bin name
[more]void compile(State& state) const
call compile on all StateAttributes contained within this StateSet

Public Members

[more]typedef std::map<StateAttribute::GLMode,StateAttribute::GLModeValue> ModeList
a container to map GLModes to their respective GLModeValues
[more]typedef std::pair<ref_ptr<StateAttribute>,StateAttribute::OverrideValue> RefAttributePair
simple pairing between an attribute and its override flag
[more]typedef std::map<StateAttribute::Type,RefAttributePair> AttributeList
a container to map StateAttribyte::Types to their respective RefAttributePair
[more]enum RenderingHint
[more]enum RenderBinMode

Protected Fields

[more]ModeList _modeList
[more]AttributeList _attributeList
[more]int _renderingHint
[more]RenderBinMode _binMode
[more]int _binNum
[more]std::string _binName

Protected Methods

[more]virtual ~StateSet()
[more]StateSet& operator = (const StateSet&)


Inherited from Object:


Inherited from Referenced:

Public Methods

oinline void ref() const
oinline void unref() const
oinline const int referenceCount() const

Protected Fields

omutable int _refCount


Documentation

Encapsulates OpenGL state modes and attributes. Used to specific textures etc of osg::Drawable's which hold references to a single osg::StateSet. StateSet can be shared between Drawable's and is recommend if possible as it minimize expensive state changes in the graphics pipeline.
o StateSet()

o StateSet(const StateSet&)

ovirtual Object* clone() const

ovirtual bool isSameKindAs(const Object* obj) const

ovirtual const char* className() const

oint compare(const StateSet& rhs, bool compareAttributeContents=false) const
return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs

obool operator < (const StateSet& rhs) const

obool operator == (const StateSet& rhs) const

obool operator != (const StateSet& rhs) const

ovoid setGlobalDefaults()
set all the modes to on or off so that it defines a complete state, typically used for a default global state

ovoid setAllToInherit()
set all the modes to inherit, typically used to signify nodes which inherit all of their modes for the global state

ovoid merge(const StateSet& rhs)
merge this stateset with stateset rhs, this overrides the rhs if OVERRIDE is specified, otherwise rhs takes precedence

otypedef std::map<StateAttribute::GLMode,StateAttribute::GLModeValue> ModeList
a container to map GLModes to their respective GLModeValues

ovoid setMode(const StateAttribute::GLMode mode, const StateAttribute::GLModeValue value)
set this StateSet to contain specified GLMode and value

ovoid setModeToInherit(const StateAttribute::GLMode mode)
set this StateSet to inherit specified GLMode type from parents. has the effect of deleting any GlMode of specified type from StateSet.

oconst StateAttribute::GLModeValue getMode(const StateAttribute::GLMode mode) const
get specified GLModeValue for specified GLMode. returns INHERIT if no GLModeValue is contained within StateSet.

oinline ModeList& getModeList()
return the list of all GLModes contained in this StateSet

oinline const ModeList& getModeList() const
return the const list of all GLModes contained in this const StateSet

otypedef std::pair<ref_ptr<StateAttribute>,StateAttribute::OverrideValue> RefAttributePair
simple pairing between an attribute and its override flag

otypedef std::map<StateAttribute::Type,RefAttributePair> AttributeList
a container to map StateAttribyte::Types to their respective RefAttributePair

ovoid setAttribute(StateAttribute* attribute, const StateAttribute::OverrideValue value=StateAttribute::OFF)
set this StateSet to contain specified attribute and override flag

ovoid setAttributeAndModes(StateAttribute* attribute, const StateAttribute::GLModeValue value=StateAttribute::ON)
set this StateSet to contain specified attribute and set the associated GLMode's to specified value

ovoid setAttributeToInherit(const StateAttribute::Type type)
set this StateSet to inherit specified attribute type from parents. has the effect of deleting any state attributes of specified type from StateSet.

oStateAttribute* getAttribute(const StateAttribute::Type type)
get specified StateAttribute for specified type. returns NULL if no type is contained within StateSet.

oconst StateAttribute* getAttribute(const StateAttribute::Type type) const
get specified const StateAttribute for specified type. returns NULL if no type is contained within const StateSet.

oconst RefAttributePair* getAttributePair(const StateAttribute::Type type) const
get specified RefAttributePair for specified type. returns NULL if no type is contained within StateSet.

oinline AttributeList& getAttributeList()
return the list of all StateAttributes contained in this StateSet

oinline const AttributeList& getAttributeList() const
return the const list of all StateAttributes contained in this const StateSet

oenum RenderingHint

o DEFAULT_BIN

o OPAQUE_BIN

o TRANSPARENT_BIN

ovoid setRenderingHint(const int hint)
set the RenderingHint of the StateSet. RenderingHint is used by osgUtil::Renderer to determine which draw bin to drop associated osg::Drawables in. For opaque objects OPAQUE_BIN would typical used, which TRANSPARENT_BIN should be used for objects which need to be depth sorted.

oinline const int getRenderingHint() const
get the RenderingHint of the StateSet

oenum RenderBinMode

o INHERIT_RENDERBIN_DETAILS

o USE_RENDERBIN_DETAILS

o OVERRIDE_RENDERBIN_DETAILS

o ENCLOSE_RENDERBIN_DETAILS

ovoid setRenderBinDetails(const int binNum, const std::string& binName, const RenderBinMode mode=USE_RENDERBIN_DETAILS)
set the render bin details

ovoid setRendingBinToInherit()
set the render bin details to inherit

oinline const RenderBinMode getRenderBinMode() const
get the render bin mode

oinline const bool useRenderBinDetails() const
get whether the render bin details are set and should be used

oinline const int getBinNumber() const
get the render bin number

oinline const std::string& getBinName() const
get the render bin name

ovoid compile(State& state) const
call compile on all StateAttributes contained within this StateSet

ovirtual ~StateSet()

oStateSet& operator = (const StateSet&)

oModeList _modeList

oAttributeList _attributeList

oint _renderingHint

oRenderBinMode _binMode

oint _binNum

ostd::string _binName


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



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