StateSet
Go to the documentation of this file.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2008 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#ifndef OSG_STATESET
#define OSG_STATESET 1
#include <osg/Object>
#include <osg/StateAttribute>
#include <osg/ref_ptr>
#include <osg/Uniform>
#include <map>
#include <vector>
#include <string>
#ifndef GL_RESCALE_NORMAL
// allow compilation against GL1.1 headers.
#define GL_RESCALE_NORMAL 0x803A
#endif
namespace osg {
// forward declare for the purposes of the UpdateCallback.
class NodeVisitor;
class OSG_EXPORT StateSet : public Object
{
public :
StateSet();
StateSet(const StateSet&,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
virtual Object* cloneType() const { return new StateSet(); }
virtual Object* clone(const CopyOp& copyop) const { return new StateSet(*this,copyop); }
virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const StateSet*>(obj)!=NULL; }
virtual const char* libraryName() const { return "osg"; }
virtual const char* className() const { return "StateSet"; }
int compare(const StateSet& rhs,bool compareAttributeContents=false) const;
bool operator < (const StateSet& rhs) const { return compare(rhs)<0; }
bool operator == (const StateSet& rhs) const { return compare(rhs)==0; }
bool operator != (const StateSet& rhs) const { return compare(rhs)!=0; }
virtual StateSet* asStateSet() { return this; }
virtual const StateSet* asStateSet() const { return this; }
typedef std::vector<Node*> ParentList;
inline const ParentList& getParents() const { return _parents; }
inline ParentList getParents() { return _parents; }
inline Node* getParent(unsigned int i) { return _parents[i]; }
inline const Node* getParent(unsigned int i) const { return _parents[i]; }
inline unsigned int getNumParents() const { return static_cast<unsigned int>(_parents.size()); }
virtual void computeDataVariance();
void setGlobalDefaults();
void clear();
void merge(const StateSet& rhs);
typedef std::map<StateAttribute::GLMode,StateAttribute::GLModeValue> ModeList;
void setMode(StateAttribute::GLMode mode, StateAttribute::GLModeValue value);
void removeMode(StateAttribute::GLMode mode);
StateAttribute::GLModeValue getMode(StateAttribute::GLMode mode) const;
inline void setModeList(ModeList& ml) { _modeList=ml; }
inline ModeList& getModeList() { return _modeList; }
inline const ModeList& getModeList() const { return _modeList; }
typedef std::pair<ref_ptr<StateAttribute>,StateAttribute::OverrideValue> RefAttributePair;
typedef std::map<StateAttribute::TypeMemberPair,RefAttributePair> AttributeList;
void setAttribute(StateAttribute *attribute, StateAttribute::OverrideValue value=StateAttribute::OFF);
template<class T> void setAttribute(const ref_ptr<T>& attribute, StateAttribute::OverrideValue value=StateAttribute::OFF) { setAttribute(attribute.get(), value); }
void setAttributeAndModes(StateAttribute *attribute, StateAttribute::GLModeValue value=StateAttribute::ON);
template<class T> void setAttributeAndModes(const ref_ptr<T>& attribute, StateAttribute::GLModeValue value=StateAttribute::ON) { setAttributeAndModes(attribute.get(), value); }
void removeAttribute(StateAttribute::Type type, unsigned int member=0);
void removeAttribute(StateAttribute *attribute);
template<class T> void removeAttribute(const ref_ptr<T>& attribute) { removeAttribute(attribute.get()); }
StateAttribute* getAttribute(StateAttribute::Type type, unsigned int member = 0);
const StateAttribute* getAttribute(StateAttribute::Type type, unsigned int member = 0) const;
RefAttributePair* getAttributePair(StateAttribute::Type type, unsigned int member = 0);
const RefAttributePair* getAttributePair(StateAttribute::Type type, unsigned int member = 0) const;
inline void setAttributeList(AttributeList& al) { _attributeList=al; }
inline AttributeList& getAttributeList() { return _attributeList; }
inline const AttributeList& getAttributeList() const { return _attributeList; }
typedef std::vector<ModeList> TextureModeList;
void setTextureMode(unsigned int unit,StateAttribute::GLMode mode, StateAttribute::GLModeValue value);
void removeTextureMode(unsigned int unit,StateAttribute::GLMode mode);
StateAttribute::GLModeValue getTextureMode(unsigned int unit,StateAttribute::GLMode mode) const;
inline void setTextureModeList(TextureModeList& tml) { _textureModeList=tml; }
inline TextureModeList& getTextureModeList() { return _textureModeList; }
inline const TextureModeList& getTextureModeList() const { return _textureModeList; }
inline unsigned int getNumTextureModeLists() const { return static_cast<unsigned int>(_textureModeList.size()); }
typedef std::vector<AttributeList> TextureAttributeList;
void setTextureAttribute(unsigned int unit,StateAttribute *attribute, StateAttribute::OverrideValue value=StateAttribute::OFF);
template<class T> void setTextureAttribute(unsigned int unit, const ref_ptr<T>& attribute, StateAttribute::OverrideValue value=StateAttribute::OFF) { setTextureAttribute( unit, attribute.get(), value); }
void setTextureAttributeAndModes(unsigned int unit,StateAttribute *attribute, StateAttribute::GLModeValue value=StateAttribute::ON);
template<class T> void setTextureAttributeAndModes(unsigned int unit, const ref_ptr<T>& attribute, StateAttribute::OverrideValue value=StateAttribute::ON) { setTextureAttributeAndModes( unit, attribute.get(), value); }
void removeTextureAttribute(unsigned int unit, StateAttribute::Type type);
void removeTextureAttribute(unsigned int unit, StateAttribute *attribute);
template<class T> void removeTextureAttribute(unsigned int unit, const ref_ptr<T>& attribute) { removeTextureAttribute(unit, attribute.get()); }
StateAttribute* getTextureAttribute(unsigned int unit, StateAttribute::Type type);
const StateAttribute* getTextureAttribute(unsigned int unit, StateAttribute::Type type) const;
RefAttributePair* getTextureAttributePair(unsigned int unit, StateAttribute::Type type);
const RefAttributePair* getTextureAttributePair(unsigned int unit, StateAttribute::Type type) const;
inline void setTextureAttributeList(TextureAttributeList& tal) { _textureAttributeList=tal; }
inline TextureAttributeList& getTextureAttributeList() { return _textureAttributeList; }
inline const TextureAttributeList& getTextureAttributeList() const { return _textureAttributeList; }
inline unsigned int getNumTextureAttributeLists() const { return static_cast<unsigned int>(_textureAttributeList.size()); }
void setAssociatedModes(const StateAttribute* attribute, StateAttribute::GLModeValue value);
void removeAssociatedModes(const StateAttribute* attribute);
void setAssociatedTextureModes(unsigned int unit, const StateAttribute* attribute, StateAttribute::GLModeValue value);
void removeAssociatedTextureModes(unsigned int unit, const StateAttribute* attribute);
typedef std::pair<ref_ptr<Uniform>,StateAttribute::OverrideValue> RefUniformPair;
typedef std::map<std::string,RefUniformPair> UniformList;
void addUniform(Uniform* uniform, StateAttribute::OverrideValue value=StateAttribute::ON);
template<class T> void addUniform(const ref_ptr<T>& uniform, StateAttribute::OverrideValue value=StateAttribute::ON) { addUniform( uniform.get(), value); }
void removeUniform(const std::string& name);
void removeUniform(Uniform* uniform);
template<class T> void removeUniform(const ref_ptr<T>& uniform) { removeUniform(uniform.get()); }
Uniform* getUniform(const std::string& name);
Uniform* getOrCreateUniform(const std::string& name, Uniform::Type type, unsigned int numElements=1);
const Uniform* getUniform(const std::string& name) const;
const RefUniformPair* getUniformPair(const std::string& name) const;
inline void setUniformList(UniformList& al) { _uniformList=al; }
inline UniformList& getUniformList() { return _uniformList; }
inline const UniformList& getUniformList() const { return _uniformList; }
typedef std::pair<std::string, StateAttribute::OverrideValue> DefinePair;
typedef std::map<std::string, DefinePair> DefineList;
void setDefine(const std::string& defineName, StateAttribute::OverrideValue value=StateAttribute::ON);
void setDefine(const std::string& defineName, const std::string& defineValue, StateAttribute::OverrideValue value=StateAttribute::ON);
DefinePair* getDefinePair(const std::string& defineName) { DefineList::iterator itr = _defineList.find(defineName); return (itr!=_defineList.end()) ? &(itr->second) : 0; }
const DefinePair* getDefinePair(const std::string& defineName) const { DefineList::const_iterator itr = _defineList.find(defineName); return (itr!=_defineList.end()) ? &(itr->second) : 0; }
void removeDefine(const std::string& defineName);
void setDefineList(const DefineList& dl) { _defineList = dl; }
DefineList& getDefineList() { return _defineList; }
const DefineList& getDefineList() const { return _defineList; }
enum RenderingHint
{
DEFAULT_BIN = 0,
OPAQUE_BIN = 1,
TRANSPARENT_BIN = 2
};
void setRenderingHint(int hint);
inline int getRenderingHint() const { return _renderingHint; }
enum RenderBinMode
{
INHERIT_RENDERBIN_DETAILS =0,
USE_RENDERBIN_DETAILS =1,
OVERRIDE_RENDERBIN_DETAILS =2,
PROTECTED_RENDERBIN_DETAILS =4,
OVERRIDE_PROTECTED_RENDERBIN_DETAILS = OVERRIDE_RENDERBIN_DETAILS|PROTECTED_RENDERBIN_DETAILS
};
void setRenderBinDetails(int binNum,const std::string& binName,RenderBinMode mode=USE_RENDERBIN_DETAILS);
void setRenderBinToInherit();
inline bool useRenderBinDetails() const { return _binMode!=INHERIT_RENDERBIN_DETAILS; }
inline void setRenderBinMode(RenderBinMode mode) { _binMode=mode; }
inline RenderBinMode getRenderBinMode() const { return _binMode; }
inline void setBinNumber(int num) { _binNum=num; }
inline int getBinNumber() const { return _binNum; }
inline void setBinName(const std::string& name) { _binName=name; }
inline const std::string& getBinName() const { return _binName; }
inline void setNestRenderBins(bool val) { _nestRenderBins = val; }
inline bool getNestRenderBins() const { return _nestRenderBins; }
struct OSG_EXPORT Callback : public virtual osg::Callback
{
Callback() {}
Callback(const Callback& org,const CopyOp& copyop):
osg::Object(org, copyop),
osg::Callback(org, copyop) {}
META_Object(osg,Callback);
virtual bool run(osg::Object* object, osg::Object* data);
virtual void operator() (StateSet*, NodeVisitor*) {}
};
void setUpdateCallback(Callback* ac);
template<class T> void setUpdateCallback(const ref_ptr<T>& ac) { setUpdateCallback(ac.get()); }
Callback* getUpdateCallback() { return _updateCallback.get(); }
const Callback* getUpdateCallback() const { return _updateCallback.get(); }
bool requiresUpdateTraversal() const { return _updateCallback.valid() || getNumChildrenRequiringUpdateTraversal()!=0; }
inline unsigned int getNumChildrenRequiringUpdateTraversal() const { return _numChildrenRequiringUpdateTraversal; }
void runUpdateCallbacks(osg::NodeVisitor* nv);
void setEventCallback(Callback* ac);
template<class T> void setEventCallback(const ref_ptr<T>& ec) { setEventCallback(ec.get()); }
Callback* getEventCallback() { return _eventCallback.get(); }
const Callback* getEventCallback() const { return _eventCallback.get(); }
bool requiresEventTraversal() const { return _eventCallback.valid() || getNumChildrenRequiringEventTraversal()!=0; }
inline unsigned int getNumChildrenRequiringEventTraversal() const { return _numChildrenRequiringEventTraversal; }
void runEventCallbacks(osg::NodeVisitor* nv);
bool checkValidityOfAssociatedModes(State& state) const;
virtual void setThreadSafeRefUnref(bool threadSafe);
void compileGLObjects(State& state) const;
virtual void resizeGLObjectBuffers(unsigned int maxSize);
virtual void releaseGLObjects(State* state=0) const;
protected :
virtual ~StateSet();
StateSet& operator = (const StateSet&) { return *this; }
void addParent(osg::Node* object);
void removeParent(osg::Node* object);
ParentList _parents;
friend class osg::Node;
friend class osg::Drawable;
friend class osg::Uniform;
friend class osg::StateAttribute;
ModeList _modeList;
AttributeList _attributeList;
TextureModeList _textureModeList;
TextureAttributeList _textureAttributeList;
UniformList _uniformList;
DefineList _defineList;
inline ModeList& getOrCreateTextureModeList(unsigned int unit)
{
if (unit>=_textureModeList.size()) _textureModeList.resize(unit+1);
return _textureModeList[unit];
}
inline AttributeList& getOrCreateTextureAttributeList(unsigned int unit)
{
if (unit>=_textureAttributeList.size()) _textureAttributeList.resize(unit+1);
return _textureAttributeList[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, StateAttribute::OverrideValue value=StateAttribute::OFF);
StateAttribute* getAttribute(AttributeList& attributeList, StateAttribute::Type type, unsigned int member);
const StateAttribute* getAttribute(const AttributeList& attributeList, StateAttribute::Type type, unsigned int member) const;
RefAttributePair* getAttributePair(AttributeList& attributeList, StateAttribute::Type type, unsigned int member);
const RefAttributePair* getAttributePair(const AttributeList& attributeList, StateAttribute::Type type, unsigned int member) const;
int _renderingHint;
RenderBinMode _binMode;
int _binNum;
std::string _binName;
bool _nestRenderBins;
ref_ptr<Callback> _updateCallback;
unsigned int _numChildrenRequiringUpdateTraversal;
void setNumChildrenRequiringUpdateTraversal(unsigned int num);
ref_ptr<Callback> _eventCallback;
unsigned int _numChildrenRequiringEventTraversal;
void setNumChildrenRequiringEventTraversal(unsigned int num);
};
extern OSG_EXPORT bool isTextureMode(StateAttribute::GLMode mode);
}
#endif
Object
StateAttribute
Uniform
osg::Callback
Definition Callback:34
osg::CopyOp
Definition CopyOp:41
osg::CopyOp::SHALLOW_COPY
@ SHALLOW_COPY
Definition CopyOp:47
osg::Drawable
Definition Drawable:89
osg::NodeVisitor
Definition NodeVisitor:82
osg::Node
Definition Node:72
osg::Object
Definition Object:61
osg::Object::Object
Object()
Definition Object:69
osg::StateAttribute
Definition StateAttribute:77
osg::StateAttribute::GLMode
GLenum GLMode
Definition StateAttribute:81
osg::StateAttribute::OFF
@ OFF
Definition StateAttribute:101
osg::StateAttribute::ON
@ ON
Definition StateAttribute:103
osg::StateAttribute::GLModeValue
unsigned int GLModeValue
Definition StateAttribute:85
osg::StateAttribute::Type
Type
Definition StateAttribute:124
osg::StateAttribute::OverrideValue
unsigned int OverrideValue
Definition StateAttribute:89
osg::StateSet::getTextureAttributeList
TextureAttributeList & getTextureAttributeList()
Definition StateSet:283
osg::StateSet::isSameKindAs
virtual bool isSameKindAs(const Object *obj) const
Definition StateSet:55
osg::StateSet::compareAttributePtrs
int compareAttributePtrs(const AttributeList &lhs, const AttributeList &rhs)
osg::StateSet::_uniformList
UniformList _uniformList
Definition StateSet:544
osg::StateSet::setTextureMode
void setTextureMode(unsigned int unit, StateAttribute::GLMode mode, StateAttribute::GLModeValue value)
osg::StateSet::StateSet
StateSet()
osg::StateSet::getNestRenderBins
bool getNestRenderBins() const
Definition StateSet:442
osg::StateSet::setTextureAttributeAndModes
void setTextureAttributeAndModes(unsigned int unit, const ref_ptr< T > &attribute, StateAttribute::OverrideValue value=StateAttribute::ON)
Definition StateSet:253
osg::StateSet::className
virtual const char * className() const
Definition StateSet:57
osg::StateSet::getTextureAttributePair
RefAttributePair * getTextureAttributePair(unsigned int unit, StateAttribute::Type type)
osg::StateSet::setMode
void setMode(ModeList &modeList, StateAttribute::GLMode mode, StateAttribute::GLModeValue value)
osg::StateSet::StateAttribute
friend class osg::StateAttribute
Definition StateSet:536
osg::StateSet::setDefine
void setDefine(const std::string &defineName, StateAttribute::OverrideValue value=StateAttribute::ON)
osg::StateSet::getTextureAttribute
StateAttribute * getTextureAttribute(unsigned int unit, StateAttribute::Type type)
osg::StateSet::_binNum
int _binNum
Definition StateSet:578
osg::StateSet::_nestRenderBins
bool _nestRenderBins
Definition StateSet:580
osg::StateSet::getTextureAttribute
const StateAttribute * getTextureAttribute(unsigned int unit, StateAttribute::Type type) const
osg::StateSet::removeUniform
void removeUniform(const ref_ptr< T > &uniform)
Definition StateSet:318
osg::StateSet::getAttribute
StateAttribute * getAttribute(AttributeList &attributeList, StateAttribute::Type type, unsigned int member)
osg::StateSet::TextureModeList
std::vector< ModeList > TextureModeList
Definition StateSet:213
osg::StateSet::setTextureAttributeAndModes
void setTextureAttributeAndModes(unsigned int unit, StateAttribute *attribute, StateAttribute::GLModeValue value=StateAttribute::ON)
osg::StateSet::getBinName
const std::string & getBinName() const
Definition StateSet:430
osg::StateSet::requiresUpdateTraversal
bool requiresUpdateTraversal() const
Definition StateSet:474
osg::StateSet::setDefine
void setDefine(const std::string &defineName, const std::string &defineValue, StateAttribute::OverrideValue value=StateAttribute::ON)
osg::StateSet::getUniformList
UniformList & getUniformList()
Definition StateSet:339
osg::StateSet::setNumChildrenRequiringUpdateTraversal
void setNumChildrenRequiringUpdateTraversal(unsigned int num)
osg::StateSet::setEventCallback
void setEventCallback(const ref_ptr< T > &ec)
Definition StateSet:487
osg::StateSet::getParents
const ParentList & getParents() const
Definition StateSet:79
osg::StateSet::setAssociatedTextureModes
void setAssociatedTextureModes(unsigned int unit, const StateAttribute *attribute, StateAttribute::GLModeValue value)
osg::StateSet::getAttribute
const StateAttribute * getAttribute(const AttributeList &attributeList, StateAttribute::Type type, unsigned int member) const
osg::StateSet::setTextureAttributeList
void setTextureAttributeList(TextureAttributeList &tal)
Definition StateSet:280
osg::StateSet::removeDefine
void removeDefine(const std::string &defineName)
osg::StateSet::removeAttribute
void removeAttribute(const ref_ptr< T > &attribute)
Definition StateSet:184
osg::StateSet::getDefinePair
const DefinePair * getDefinePair(const std::string &defineName) const
Definition StateSet:355
osg::StateSet::releaseGLObjects
virtual void releaseGLObjects(State *state=0) const
osg::StateSet::getAttribute
const StateAttribute * getAttribute(StateAttribute::Type type, unsigned int member=0) const
osg::StateSet::getUpdateCallback
Callback * getUpdateCallback()
Definition StateSet:468
osg::StateSet::_modeList
ModeList _modeList
Definition StateSet:538
osg::StateSet::TextureAttributeList
std::vector< AttributeList > TextureAttributeList
Definition StateSet:243
osg::StateSet::setUpdateCallback
void setUpdateCallback(const ref_ptr< T > &ac)
Definition StateSet:465
osg::StateSet::RenderBinMode
RenderBinMode
Definition StateSet:397
osg::StateSet::PROTECTED_RENDERBIN_DETAILS
@ PROTECTED_RENDERBIN_DETAILS
Definition StateSet:401
osg::StateSet::INHERIT_RENDERBIN_DETAILS
@ INHERIT_RENDERBIN_DETAILS
Definition StateSet:398
osg::StateSet::USE_RENDERBIN_DETAILS
@ USE_RENDERBIN_DETAILS
Definition StateSet:399
osg::StateSet::OVERRIDE_PROTECTED_RENDERBIN_DETAILS
@ OVERRIDE_PROTECTED_RENDERBIN_DETAILS
Definition StateSet:402
osg::StateSet::OVERRIDE_RENDERBIN_DETAILS
@ OVERRIDE_RENDERBIN_DETAILS
Definition StateSet:400
osg::StateSet::setAttributeAndModes
void setAttributeAndModes(const ref_ptr< T > &attribute, StateAttribute::GLModeValue value=StateAttribute::ON)
Definition StateSet:176
osg::StateSet::useRenderBinDetails
bool useRenderBinDetails() const
Definition StateSet:412
osg::StateSet::setAttribute
void setAttribute(AttributeList &attributeList, StateAttribute *attribute, StateAttribute::OverrideValue value=StateAttribute::OFF)
osg::StateSet::setRenderBinDetails
void setRenderBinDetails(int binNum, const std::string &binName, RenderBinMode mode=USE_RENDERBIN_DETAILS)
osg::StateSet::removeAssociatedModes
void removeAssociatedModes(const StateAttribute *attribute)
osg::StateSet::setModeList
void setModeList(ModeList &ml)
Definition StateSet:150
osg::StateSet::getBinNumber
int getBinNumber() const
Definition StateSet:424
osg::StateSet::StateSet
StateSet(const StateSet &, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
osg::StateSet::setAttributeList
void setAttributeList(AttributeList &al)
Definition StateSet:203
osg::StateSet::_attributeList
AttributeList _attributeList
Definition StateSet:539
osg::StateSet::_defineList
DefineList _defineList
Definition StateSet:545
osg::StateSet::getUniformPair
const RefUniformPair * getUniformPair(const std::string &name) const
osg::StateSet::getUniformList
const UniformList & getUniformList() const
Definition StateSet:342
osg::StateSet::clear
void clear()
osg::StateSet::asStateSet
virtual const StateSet * asStateSet() const
Definition StateSet:72
osg::StateSet::getTextureAttributeList
const TextureAttributeList & getTextureAttributeList() const
Definition StateSet:286
osg::StateSet::setAttributeAndModes
void setAttributeAndModes(StateAttribute *attribute, StateAttribute::GLModeValue value=StateAttribute::ON)
osg::StateSet::getAttributePair
const RefAttributePair * getAttributePair(const AttributeList &attributeList, StateAttribute::Type type, unsigned int member) const
osg::StateSet::getNumTextureModeLists
unsigned int getNumTextureModeLists() const
Definition StateSet:241
osg::StateSet::getDefineList
DefineList & getDefineList()
Definition StateSet:366
osg::StateSet::RefUniformPair
std::pair< ref_ptr< Uniform >, StateAttribute::OverrideValue > RefUniformPair
Definition StateSet:302
osg::StateSet::getTextureMode
StateAttribute::GLModeValue getTextureMode(unsigned int unit, StateAttribute::GLMode mode) const
osg::StateSet::setAssociatedModes
void setAssociatedModes(const StateAttribute *attribute, StateAttribute::GLModeValue value)
osg::StateSet::UniformList
std::map< std::string, RefUniformPair > UniformList
Definition StateSet:305
osg::StateSet::getParents
ParentList getParents()
Definition StateSet:83
osg::StateSet::getAttributePair
const RefAttributePair * getAttributePair(StateAttribute::Type type, unsigned int member=0) const
osg::StateSet::removeAttribute
void removeAttribute(StateAttribute::Type type, unsigned int member=0)
osg::StateSet::_eventCallback
ref_ptr< Callback > _eventCallback
Definition StateSet:586
osg::StateSet::setNestRenderBins
void setNestRenderBins(bool val)
Definition StateSet:439
osg::StateSet::runEventCallbacks
void runEventCallbacks(osg::NodeVisitor *nv)
osg::StateSet::getAttributeList
const AttributeList & getAttributeList() const
Definition StateSet:209
osg::StateSet::getUpdateCallback
const Callback * getUpdateCallback() const
Definition StateSet:471
osg::StateSet::cloneType
virtual Object * cloneType() const
Definition StateSet:53
osg::StateSet::getMode
StateAttribute::GLModeValue getMode(const ModeList &modeList, StateAttribute::GLMode mode) const
osg::StateSet::requiresEventTraversal
bool requiresEventTraversal() const
Definition StateSet:496
osg::StateSet::setUpdateCallback
void setUpdateCallback(Callback *ac)
osg::StateSet::removeTextureAttribute
void removeTextureAttribute(unsigned int unit, StateAttribute::Type type)
osg::StateSet::setTextureModeList
void setTextureModeList(TextureModeList &tml)
Definition StateSet:232
osg::StateSet::setThreadSafeRefUnref
virtual void setThreadSafeRefUnref(bool threadSafe)
osg::StateSet::removeAttribute
void removeAttribute(StateAttribute *attribute)
osg::StateSet::getUniform
Uniform * getUniform(const std::string &name)
osg::StateSet::getTextureModeList
TextureModeList & getTextureModeList()
Definition StateSet:235
osg::StateSet::setAttribute
void setAttribute(StateAttribute *attribute, StateAttribute::OverrideValue value=StateAttribute::OFF)
osg::StateSet::libraryName
virtual const char * libraryName() const
Definition StateSet:56
osg::StateSet::runUpdateCallbacks
void runUpdateCallbacks(osg::NodeVisitor *nv)
osg::StateSet::compare
int compare(const StateSet &rhs, bool compareAttributeContents=false) const
osg::StateSet::getTextureModeList
const TextureModeList & getTextureModeList() const
Definition StateSet:238
osg::StateSet::AttributeList
std::map< StateAttribute::TypeMemberPair, RefAttributePair > AttributeList
Definition StateSet:166
osg::StateSet::RenderingHint
RenderingHint
Definition StateSet:374
osg::StateSet::TRANSPARENT_BIN
@ TRANSPARENT_BIN
Definition StateSet:377
osg::StateSet::OPAQUE_BIN
@ OPAQUE_BIN
Definition StateSet:376
osg::StateSet::DEFAULT_BIN
@ DEFAULT_BIN
Definition StateSet:375
osg::StateSet::setTextureAttribute
void setTextureAttribute(unsigned int unit, const ref_ptr< T > &attribute, StateAttribute::OverrideValue value=StateAttribute::OFF)
Definition StateSet:248
osg::StateSet::addUniform
void addUniform(Uniform *uniform, StateAttribute::OverrideValue value=StateAttribute::ON)
osg::StateSet::Uniform
friend class osg::Uniform
Definition StateSet:535
osg::StateSet::setDefineList
void setDefineList(const DefineList &dl)
Definition StateSet:363
osg::StateSet::getDefinePair
DefinePair * getDefinePair(const std::string &defineName)
Definition StateSet:354
osg::StateSet::removeTextureMode
void removeTextureMode(unsigned int unit, StateAttribute::GLMode mode)
osg::StateSet::getDefineList
const DefineList & getDefineList() const
Definition StateSet:369
osg::StateSet::getOrCreateTextureModeList
ModeList & getOrCreateTextureModeList(unsigned int unit)
Definition StateSet:547
osg::StateSet::_binMode
RenderBinMode _binMode
Definition StateSet:577
osg::StateSet::setBinName
void setBinName(const std::string &name)
Definition StateSet:427
osg::StateSet::getParent
Node * getParent(unsigned int i)
Definition StateSet:85
osg::StateSet::setUniformList
void setUniformList(UniformList &al)
Definition StateSet:336
osg::StateSet::getAttribute
StateAttribute * getAttribute(StateAttribute::Type type, unsigned int member=0)
osg::StateSet::removeTextureAttribute
void removeTextureAttribute(unsigned int unit, const ref_ptr< T > &attribute)
Definition StateSet:261
osg::StateSet::Node
friend class osg::Node
Definition StateSet:533
osg::StateSet::computeDataVariance
virtual void computeDataVariance()
osg::StateSet::clone
virtual Object * clone(const CopyOp &copyop) const
Definition StateSet:54
osg::StateSet::setNumChildrenRequiringEventTraversal
void setNumChildrenRequiringEventTraversal(unsigned int num)
osg::StateSet::setEventCallback
void setEventCallback(Callback *ac)
osg::StateSet::getParent
const Node * getParent(unsigned int i) const
Definition StateSet:91
osg::StateSet::compareAttributeContents
int compareAttributeContents(const AttributeList &lhs, const AttributeList &rhs)
osg::StateSet::getOrCreateUniform
Uniform * getOrCreateUniform(const std::string &name, Uniform::Type type, unsigned int numElements=1)
osg::StateSet::setModeToInherit
void setModeToInherit(ModeList &modeList, StateAttribute::GLMode mode)
osg::StateSet::setRenderBinMode
void setRenderBinMode(RenderBinMode mode)
Definition StateSet:415
osg::StateSet::~StateSet
virtual ~StateSet()
osg::StateSet::asStateSet
virtual StateSet * asStateSet()
Definition StateSet:68
osg::StateSet::compareModes
int compareModes(const ModeList &lhs, const ModeList &rhs)
osg::StateSet::merge
void merge(const StateSet &rhs)
osg::StateSet::getModeList
const ModeList & getModeList() const
Definition StateSet:158
osg::StateSet::getMode
StateAttribute::GLModeValue getMode(StateAttribute::GLMode mode) const
osg::StateSet::_textureAttributeList
TextureAttributeList _textureAttributeList
Definition StateSet:542
osg::StateSet::_numChildrenRequiringUpdateTraversal
unsigned int _numChildrenRequiringUpdateTraversal
Definition StateSet:583
osg::StateSet::getRenderBinMode
RenderBinMode getRenderBinMode() const
Definition StateSet:418
osg::StateSet::removeTextureAttribute
void removeTextureAttribute(unsigned int unit, StateAttribute *attribute)
osg::StateSet::removeUniform
void removeUniform(const std::string &name)
osg::StateSet::getNumChildrenRequiringEventTraversal
unsigned int getNumChildrenRequiringEventTraversal() const
Definition StateSet:500
osg::StateSet::ParentList
std::vector< Node * > ParentList
Definition StateSet:76
osg::StateSet::_updateCallback
ref_ptr< Callback > _updateCallback
Definition StateSet:582
osg::StateSet::getEventCallback
Callback * getEventCallback()
Definition StateSet:490
osg::StateSet::_renderingHint
int _renderingHint
Definition StateSet:575
osg::StateSet::removeAssociatedTextureModes
void removeAssociatedTextureModes(unsigned int unit, const StateAttribute *attribute)
osg::StateSet::getOrCreateTextureAttributeList
AttributeList & getOrCreateTextureAttributeList(unsigned int unit)
Definition StateSet:553
osg::StateSet::removeMode
void removeMode(StateAttribute::GLMode mode)
osg::StateSet::resizeGLObjectBuffers
virtual void resizeGLObjectBuffers(unsigned int maxSize)
osg::StateSet::getAttributeList
AttributeList & getAttributeList()
Definition StateSet:206
osg::StateSet::getNumChildrenRequiringUpdateTraversal
unsigned int getNumChildrenRequiringUpdateTraversal() const
Definition StateSet:478
osg::StateSet::addUniform
void addUniform(const ref_ptr< T > &uniform, StateAttribute::OverrideValue value=StateAttribute::ON)
Definition StateSet:310
osg::StateSet::DefinePair
std::pair< std::string, StateAttribute::OverrideValue > DefinePair
Definition StateSet:345
osg::StateSet::setRenderingHint
void setRenderingHint(int hint)
osg::StateSet::checkValidityOfAssociatedModes
bool checkValidityOfAssociatedModes(State &state) const
osg::StateSet::ModeList
std::map< StateAttribute::GLMode, StateAttribute::GLModeValue > ModeList
Definition StateSet:119
osg::StateSet::getAttributePair
RefAttributePair * getAttributePair(StateAttribute::Type type, unsigned int member=0)
osg::StateSet::getModeList
ModeList & getModeList()
Definition StateSet:153
osg::StateSet::_binName
std::string _binName
Definition StateSet:579
osg::StateSet::setBinNumber
void setBinNumber(int num)
Definition StateSet:421
osg::StateSet::setMode
void setMode(StateAttribute::GLMode mode, StateAttribute::GLModeValue value)
osg::StateSet::getNumParents
unsigned int getNumParents() const
Definition StateSet:97
osg::StateSet::getNumTextureAttributeLists
unsigned int getNumTextureAttributeLists() const
Definition StateSet:289
osg::StateSet::removeUniform
void removeUniform(Uniform *uniform)
osg::StateSet::getEventCallback
const Callback * getEventCallback() const
Definition StateSet:493
osg::StateSet::setGlobalDefaults
void setGlobalDefaults()
osg::StateSet::RefAttributePair
std::pair< ref_ptr< StateAttribute >, StateAttribute::OverrideValue > RefAttributePair
Definition StateSet:163
osg::StateSet::setRenderBinToInherit
void setRenderBinToInherit()
osg::StateSet::_parents
ParentList _parents
Definition StateSet:532
osg::StateSet::addParent
void addParent(osg::Node *object)
osg::StateSet::getRenderingHint
int getRenderingHint() const
Definition StateSet:394
osg::StateSet::removeParent
void removeParent(osg::Node *object)
osg::StateSet::DefineList
std::map< std::string, DefinePair > DefineList
Definition StateSet:346
osg::StateSet::getTextureAttributePair
const RefAttributePair * getTextureAttributePair(unsigned int unit, StateAttribute::Type type) const
osg::StateSet::_textureModeList
TextureModeList _textureModeList
Definition StateSet:541
osg::StateSet::_numChildrenRequiringEventTraversal
unsigned int _numChildrenRequiringEventTraversal
Definition StateSet:587
osg::StateSet::compileGLObjects
void compileGLObjects(State &state) const
osg::StateSet::getAttributePair
RefAttributePair * getAttributePair(AttributeList &attributeList, StateAttribute::Type type, unsigned int member)
osg::StateSet::getUniform
const Uniform * getUniform(const std::string &name) const
osg::StateSet::setAttribute
void setAttribute(const ref_ptr< T > &attribute, StateAttribute::OverrideValue value=StateAttribute::OFF)
Definition StateSet:171
osg::StateSet::setTextureAttribute
void setTextureAttribute(unsigned int unit, StateAttribute *attribute, StateAttribute::OverrideValue value=StateAttribute::OFF)
osg::State
Definition State:80
osg::Uniform
Definition Uniform:414
osg::Uniform::Type
Type
Definition Uniform:416
osg::ref_ptr
Definition ref_ptr:32
osg::ref_ptr::get
T * get() const
Definition ref_ptr:117
osg
Definition AlphaFunc:19
osg::isTextureMode
OSG_EXPORT bool isTextureMode(StateAttribute::GLMode mode)
NULL
#define NULL
Definition osg/Export:55
OSG_EXPORT
#define OSG_EXPORT
Definition osg/Export:39
ref_ptr
osg::StateSet::Callback
Definition StateSet:446
osg::StateSet::Callback::Callback
Callback()
Definition StateSet:447
osg::StateSet::Callback::Callback
Callback(const Callback &org, const CopyOp &copyop)
Definition StateSet:449
osg::StateSet::Callback::META_Object
META_Object(osg, Callback)
osg::StateSet::Callback::run
virtual bool run(osg::Object *object, osg::Object *data)