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(StateAttribute::GLMode mode, StateAttribute::GLModeValue value)
set this StateSet to contain specified GLMode and value
[more]void setModeToInherit(StateAttribute::GLMode mode)
set this StateSet to inherit specified GLMode type from parents.
[more]StateAttribute::GLModeValue getMode(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, StateAttribute::OverrideValue value=StateAttribute::OFF)
set this StateSet to contain specified attribute and override flag
[more]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
[more]void setAttributeToInherit(StateAttribute::Type type)
set this StateSet to inherit specified attribute type from parents.
[more]StateAttribute* getAttribute(StateAttribute::Type type)
get specified StateAttribute for specified type.
[more]const StateAttribute* getAttribute(StateAttribute::Type type) const
get specified const StateAttribute for specified type.
[more]const RefAttributePair* getAttributePair(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, StateAttribute::GLMode mode, StateAttribute::GLModeValue value)
set this StateSet to contain specified GLMode and value
[more]void setTextureModeToInherit(unsigned int unit, StateAttribute::GLMode mode)
set this StateSet to inherit specified GLMode type from parents.
[more]StateAttribute::GLModeValue getTextureMode(unsigned int unit, 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, StateAttribute::OverrideValue value=StateAttribute::OFF)
set this StateSet to contain specified attribute and override flag
[more]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
[more]void setTextureAttributeToInherit(unsigned int unit, StateAttribute::Type type)
set this StateSet to inherit specified attribute type from parents.
[more]StateAttribute* getTextureAttribute(unsigned int unit, StateAttribute::Type type)
get specified Texture related StateAttribute for specified type.
[more]const StateAttribute* getTextureAttribute(unsigned int unit, StateAttribute::Type type) const
get specified Texture related const StateAttribute for specified type.
[more]const RefAttributePair* getTextureAttributePair(unsigned int unit, 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, StateAttribute::GLModeValue value)
[more]void setAssociatedTextureModes(unsigned int unit, const StateAttribute* attribute, StateAttribute::GLModeValue value)
[more]void setRenderingHint(int hint)
set the RenderingHint of the StateSet.
[more]inline int getRenderingHint() const
get the RenderingHint of the StateSet
[more]void setRenderBinDetails(int binNum, const std::string& binName, RenderBinMode mode=USE_RENDERBIN_DETAILS)
set the render bin details
[more]void setRenderBinToInherit()
set the render bin details to inherit
[more]inline RenderBinMode getRenderBinMode() const
get the render bin mode
[more]inline bool useRenderBinDetails() const
get whether the render bin details are set and should be used
[more]inline 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]typedef std::vector<ModeList> TextureModeList
[more]typedef std::vector<AttributeList> TextureAttributeList
[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, StateAttribute::GLMode mode, StateAttribute::GLModeValue value)
[more]void setModeToInherit(ModeList& modeList, StateAttribute::GLMode mode)
[more]StateAttribute::GLModeValue getMode(const ModeList& modeList, StateAttribute::GLMode mode) const
[more]void setAssociatedModes(ModeList& modeList, const StateAttribute* attribute, 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(DataVariance dv)
oinline 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

ostatic void setDeleteHandler(DeleteHandler* handler)
ostatic DeleteHandler* getDeleteHandler()
oinline void ref() const
oinline void unref_nodelete() const
oinline int referenceCount() const
oinline void unref() 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(StateAttribute::GLMode mode, StateAttribute::GLModeValue value)
set this StateSet to contain specified GLMode and value

ovoid setModeToInherit(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.

oStateAttribute::GLModeValue getMode(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, StateAttribute::OverrideValue value=StateAttribute::OFF)
set this StateSet to contain specified attribute and override flag

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

ovoid setAttributeToInherit(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(StateAttribute::Type type)
get specified StateAttribute for specified type. returns NULL if no type is contained within StateSet.

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

oconst RefAttributePair* getAttributePair(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

otypedef std::vector<ModeList> TextureModeList

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

ovoid setTextureModeToInherit(unsigned int unit, 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.

oStateAttribute::GLModeValue getTextureMode(unsigned int unit, 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

otypedef std::vector<AttributeList> TextureAttributeList

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

ovoid 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

ovoid setTextureAttributeToInherit(unsigned int unit, 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, 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, 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, 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, StateAttribute::GLModeValue value)

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

oenum RenderingHint

o DEFAULT_BIN

o OPAQUE_BIN

o TRANSPARENT_BIN

ovoid setRenderingHint(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 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(int binNum, const std::string& binName, RenderBinMode mode=USE_RENDERBIN_DETAILS)
set the render bin details

ovoid setRenderBinToInherit()
set the render bin details to inherit

oinline RenderBinMode getRenderBinMode() const
get the render bin mode

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

oinline 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, StateAttribute::GLMode mode, StateAttribute::GLModeValue value)

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

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

ovoid setAssociatedModes(ModeList& modeList, const StateAttribute* attribute, 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++.