class SG_EXPORT osg::StateSet

Encapsulates OpenGL state modes and attributes.

Inheritance:


Public Methods

[more] StateSet()
[more] StateSet(const StateSet&, const CopyOp& copyop=CopyOp::SHALLOW_COPY)
[more]virtual Object* cloneType() const
[more]virtual Object* clone(const CopyOp& copyop) const
[more]virtual bool isSameKindAs(const Object* obj) const
[more]virtual const char* libraryName() 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 setTextureMode(unsigned int unit, const StateAttribute::GLMode mode, const StateAttribute::GLModeValue value)
set this StateSet to contain specified GLMode and value
[more]void setTextureModeToInherit(unsigned int unit, const StateAttribute::GLMode mode)
set this StateSet to inherit specified GLMode type from parents.
[more]const StateAttribute::GLModeValue getTextureMode(unsigned int unit, const StateAttribute::GLMode mode) const
get specified GLModeValue for specified GLMode.
[more]inline TextureModeList& getTextureModeList()
return the list of all Texture related GLModes contained in this StateSet
[more]inline const TextureModeList& getTextureModeList() const
return the const list of all Texture related GLModes contained in this const StateSet
[more]void setTextureAttribute(unsigned int unit, StateAttribute* attribute, const StateAttribute::OverrideValue value=StateAttribute::OFF)
set this StateSet to contain specified attribute and override flag
[more]void setTextureAttributeAndModes(unsigned int unit, 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 setTextureAttributeToInherit(unsigned int unit, const StateAttribute::Type type)
set this StateSet to inherit specified attribute type from parents.
[more]StateAttribute* getTextureAttribute(unsigned int unit, const StateAttribute::Type type)
get specified Texture related StateAttribute for specified type.
[more]const StateAttribute* getTextureAttribute(unsigned int unit, const StateAttribute::Type type) const
get specified Texture related const StateAttribute for specified type.
[more]const RefAttributePair* getTextureAttributePair(unsigned int unit, const StateAttribute::Type type) const
get specified Texture related RefAttributePair for specified type.
[more]inline TextureAttributeList& getTextureAttributeList()
return the list of all Texture related StateAttributes contained in this StateSet
[more]inline const TextureAttributeList& getTextureAttributeList() const
return the const list of all Texture related StateAttributes contained in this const StateSet
[more]void setAssociatedModes(const StateAttribute* attribute, const StateAttribute::GLModeValue value)
[more]void setAssociatedTextureModes(unsigned int unit, const StateAttribute* attribute, const StateAttribute::GLModeValue value)
[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]TextureModeList _textureModeList
[more]TextureAttributeList _textureAttributeList
[more]int _renderingHint
[more]RenderBinMode _binMode
[more]int _binNum
[more]std::string _binName

Protected Methods

[more]virtual ~StateSet()
[more]StateSet& operator = (const StateSet&)
[more]inline ModeList& getOrCreateTextureModeList(unsigned int unit)
[more]inline AttributeList& getOrCreateTextureAttributeList(unsigned int unit)
[more]int compareModes(const ModeList& lhs, const ModeList& rhs)
[more]int compareAttributePtrs(const AttributeList& lhs, const AttributeList& rhs)
[more]int compareAttributeContents(const AttributeList& lhs, const AttributeList& rhs)
[more]void setMode(ModeList& modeList, const StateAttribute::GLMode mode, const StateAttribute::GLModeValue value)
[more]void setModeToInherit(ModeList& modeList, const StateAttribute::GLMode mode)
[more]const StateAttribute::GLModeValue getMode(const ModeList& modeList, const StateAttribute::GLMode mode) const
[more]void setAssociatedModes(ModeList& modeList, const StateAttribute* attribute, const StateAttribute::GLModeValue value)
[more]void setAttribute(AttributeList& attributeList, StateAttribute* attribute, const StateAttribute::OverrideValue value=StateAttribute::OFF)
[more]StateAttribute* getAttribute(AttributeList& attributeList, const StateAttribute::Type type)
[more]const StateAttribute* getAttribute(const AttributeList& attributeList, const StateAttribute::Type type) const
[more]const RefAttributePair* getAttributePair(const AttributeList& attributeList, const StateAttribute::Type type) const


Inherited from Object:

Public Methods

oinline void setDataVariance(const DataVariance dv)
oinline const DataVariance getDataVariance() const
oinline void setUserData(Referenced* obj)
oinline Referenced* getUserData()
oinline const Referenced* getUserData() const

Public Members

oenum DataVariance

Protected Fields

oDataVariance _dataVariance
oref_ptr<Referenced> _userData


Inherited from Referenced:

Public Methods

oinline void ref() const
oinline void unref() const
oinline void unref_nodelete() 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&, const CopyOp& copyop=CopyOp::SHALLOW_COPY)

ovirtual Object* cloneType() const

ovirtual Object* clone(const CopyOp& copyop) const

ovirtual bool isSameKindAs(const Object* obj) const

ovirtual const char* libraryName() 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

ovoid setTextureMode(unsigned int unit, const StateAttribute::GLMode mode, const StateAttribute::GLModeValue value)
set this StateSet to contain specified GLMode and value

ovoid setTextureModeToInherit(unsigned int unit, 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 getTextureMode(unsigned int unit, const StateAttribute::GLMode mode) const
get specified GLModeValue for specified GLMode. returns INHERIT if no GLModeValue is contained within StateSet.

oinline TextureModeList& getTextureModeList()
return the list of all Texture related GLModes contained in this StateSet

oinline const TextureModeList& getTextureModeList() const
return the const list of all Texture related GLModes contained in this const StateSet

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

ovoid setTextureAttributeAndModes(unsigned int unit, 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 setTextureAttributeToInherit(unsigned int unit, 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* getTextureAttribute(unsigned int unit, const StateAttribute::Type type)
get specified Texture related StateAttribute for specified type. returns NULL if no type is contained within StateSet.

oconst StateAttribute* getTextureAttribute(unsigned int unit, const StateAttribute::Type type) const
get specified Texture related const StateAttribute for specified type. returns NULL if no type is contained within const StateSet.

oconst RefAttributePair* getTextureAttributePair(unsigned int unit, const StateAttribute::Type type) const
get specified Texture related RefAttributePair for specified type. returns NULL if no type is contained within StateSet.

oinline TextureAttributeList& getTextureAttributeList()
return the list of all Texture related StateAttributes contained in this StateSet

oinline const TextureAttributeList& getTextureAttributeList() const
return the const list of all Texture related StateAttributes contained in this const StateSet

ovoid setAssociatedModes(const StateAttribute* attribute, const StateAttribute::GLModeValue value)

ovoid setAssociatedTextureModes(unsigned int unit, const StateAttribute* attribute, const StateAttribute::GLModeValue value)

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

oTextureModeList _textureModeList

oTextureAttributeList _textureAttributeList

oinline ModeList& getOrCreateTextureModeList(unsigned int unit)

oinline AttributeList& getOrCreateTextureAttributeList(unsigned int unit)

oint compareModes(const ModeList& lhs, const ModeList& rhs)

oint compareAttributePtrs(const AttributeList& lhs, const AttributeList& rhs)

oint compareAttributeContents(const AttributeList& lhs, const AttributeList& rhs)

ovoid setMode(ModeList& modeList, const StateAttribute::GLMode mode, const StateAttribute::GLModeValue value)

ovoid setModeToInherit(ModeList& modeList, const StateAttribute::GLMode mode)

oconst StateAttribute::GLModeValue getMode(const ModeList& modeList, const StateAttribute::GLMode mode) const

ovoid setAssociatedModes(ModeList& modeList, const StateAttribute* attribute, const StateAttribute::GLModeValue value)

ovoid setAttribute(AttributeList& attributeList, StateAttribute* attribute, const StateAttribute::OverrideValue value=StateAttribute::OFF)

oStateAttribute* getAttribute(AttributeList& attributeList, const StateAttribute::Type type)

oconst StateAttribute* getAttribute(const AttributeList& attributeList, const StateAttribute::Type type) const

oconst RefAttributePair* getAttributePair(const AttributeList& attributeList, const StateAttribute::Type type) const

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