openscenegraph
StateSet
Go to the documentation of this file.
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2008 Robert Osfield
2 *
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version. The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * OpenSceneGraph Public License for more details.
12*/
13
14#ifndef OSG_STATESET
15#define OSG_STATESET 1
16
17#include <osg/Object>
18#include <osg/StateAttribute>
19#include <osg/ref_ptr>
20#include <osg/Uniform>
21
22#include <map>
23#include <vector>
24#include <string>
25
26#ifndef GL_RESCALE_NORMAL
27// allow compilation against GL1.1 headers.
28#define GL_RESCALE_NORMAL 0x803A
29#endif
30
31namespace osg {
32
33// forward declare for the purposes of the UpdateCallback.
34class NodeVisitor;
35
46{
47 public :
48
49
51 StateSet(const StateSet&,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
52
53 virtual Object* cloneType() const { return new StateSet(); }
54 virtual Object* clone(const CopyOp& copyop) const { return new StateSet(*this,copyop); }
55 virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const StateSet*>(obj)!=NULL; }
56 virtual const char* libraryName() const { return "osg"; }
57 virtual const char* className() const { return "StateSet"; }
58
60 int compare(const StateSet& rhs,bool compareAttributeContents=false) const;
61
62 bool operator < (const StateSet& rhs) const { return compare(rhs)<0; }
63 bool operator == (const StateSet& rhs) const { return compare(rhs)==0; }
64 bool operator != (const StateSet& rhs) const { return compare(rhs)!=0; }
65
68 virtual StateSet* asStateSet() { return this; }
69
72 virtual const StateSet* asStateSet() const { return this; }
73
74
76 typedef std::vector<Node*> ParentList;
77
79 inline const ParentList& getParents() const { return _parents; }
80
83 inline ParentList getParents() { return _parents; }
84
85 inline Node* getParent(unsigned int i) { return _parents[i]; }
91 inline const Node* getParent(unsigned int i) const { return _parents[i]; }
92
97 inline unsigned int getNumParents() const { return static_cast<unsigned int>(_parents.size()); }
98
99
101 virtual void computeDataVariance();
102
103
107
109 void clear();
110
116 void merge(const StateSet& rhs);
117
119 typedef std::map<StateAttribute::GLMode,StateAttribute::GLModeValue> ModeList;
120
128
136
148
150 inline void setModeList(ModeList& ml) { _modeList=ml; }
151
153 inline ModeList& getModeList() { return _modeList; }
154
158 inline const ModeList& getModeList() const { return _modeList; }
159
160
161
163 typedef std::pair<ref_ptr<StateAttribute>,StateAttribute::OverrideValue> RefAttributePair;
164
166 typedef std::map<StateAttribute::TypeMemberPair,RefAttributePair> AttributeList;
167
169 void setAttribute(StateAttribute *attribute, StateAttribute::OverrideValue value=StateAttribute::OFF);
170
171 template<class T> void setAttribute(const ref_ptr<T>& attribute, StateAttribute::OverrideValue value=StateAttribute::OFF) { setAttribute(attribute.get(), value); }
172
174 void setAttributeAndModes(StateAttribute *attribute, StateAttribute::GLModeValue value=StateAttribute::ON);
175
176 template<class T> void setAttributeAndModes(const ref_ptr<T>& attribute, StateAttribute::GLModeValue value=StateAttribute::ON) { setAttributeAndModes(attribute.get(), value); }
177
179 void removeAttribute(StateAttribute::Type type, unsigned int member=0);
180
183
184 template<class T> void removeAttribute(const ref_ptr<T>& attribute) { removeAttribute(attribute.get()); }
185
188 StateAttribute* getAttribute(StateAttribute::Type type, unsigned int member = 0);
189
192 const StateAttribute* getAttribute(StateAttribute::Type type, unsigned int member = 0) const;
193
197
200 const RefAttributePair* getAttributePair(StateAttribute::Type type, unsigned int member = 0) const;
201
203 inline void setAttributeList(AttributeList& al) { _attributeList=al; }
204
206 inline AttributeList& getAttributeList() { return _attributeList; }
207
209 inline const AttributeList& getAttributeList() const { return _attributeList; }
210
211
212
213 typedef std::vector<ModeList> TextureModeList;
214
223
225 void removeTextureMode(unsigned int unit,StateAttribute::GLMode mode);
226
230
232 inline void setTextureModeList(TextureModeList& tml) { _textureModeList=tml; }
233
235 inline TextureModeList& getTextureModeList() { return _textureModeList; }
236
238 inline const TextureModeList& getTextureModeList() const { return _textureModeList; }
239
241 inline unsigned int getNumTextureModeLists() const { return static_cast<unsigned int>(_textureModeList.size()); }
242
243 typedef std::vector<AttributeList> TextureAttributeList;
244
246 void setTextureAttribute(unsigned int unit,StateAttribute *attribute, StateAttribute::OverrideValue value=StateAttribute::OFF);
247
248 template<class T> void setTextureAttribute(unsigned int unit, const ref_ptr<T>& attribute, StateAttribute::OverrideValue value=StateAttribute::OFF) { setTextureAttribute( unit, attribute.get(), value); }
249
251 void setTextureAttributeAndModes(unsigned int unit,StateAttribute *attribute, StateAttribute::GLModeValue value=StateAttribute::ON);
252
253 template<class T> void setTextureAttributeAndModes(unsigned int unit, const ref_ptr<T>& attribute, StateAttribute::OverrideValue value=StateAttribute::ON) { setTextureAttributeAndModes( unit, attribute.get(), value); }
254
256 void removeTextureAttribute(unsigned int unit, StateAttribute::Type type);
257
259 void removeTextureAttribute(unsigned int unit, StateAttribute *attribute);
260
261 template<class T> void removeTextureAttribute(unsigned int unit, const ref_ptr<T>& attribute) { removeTextureAttribute(unit, attribute.get()); }
262
266
269 const StateAttribute* getTextureAttribute(unsigned int unit, StateAttribute::Type type) const;
270
274
277 const RefAttributePair* getTextureAttributePair(unsigned int unit, StateAttribute::Type type) const;
278
280 inline void setTextureAttributeList(TextureAttributeList& tal) { _textureAttributeList=tal; }
281
283 inline TextureAttributeList& getTextureAttributeList() { return _textureAttributeList; }
284
286 inline const TextureAttributeList& getTextureAttributeList() const { return _textureAttributeList; }
287
289 inline unsigned int getNumTextureAttributeLists() const { return static_cast<unsigned int>(_textureAttributeList.size()); }
290
291
293 void removeAssociatedModes(const StateAttribute* attribute);
294
295 void setAssociatedTextureModes(unsigned int unit, const StateAttribute* attribute, StateAttribute::GLModeValue value);
296 void removeAssociatedTextureModes(unsigned int unit, const StateAttribute* attribute);
297
298
299
300
302 typedef std::pair<ref_ptr<Uniform>,StateAttribute::OverrideValue> RefUniformPair;
303
305 typedef std::map<std::string,RefUniformPair> UniformList;
306
308 void addUniform(Uniform* uniform, StateAttribute::OverrideValue value=StateAttribute::ON);
309
310 template<class T> void addUniform(const ref_ptr<T>& uniform, StateAttribute::OverrideValue value=StateAttribute::ON) { addUniform( uniform.get(), value); }
311
313 void removeUniform(const std::string& name);
314
316 void removeUniform(Uniform* uniform);
317
318 template<class T> void removeUniform(const ref_ptr<T>& uniform) { removeUniform(uniform.get()); }
319
322 Uniform* getUniform(const std::string& name);
323
325 Uniform* getOrCreateUniform(const std::string& name, Uniform::Type type, unsigned int numElements=1);
326
329 const Uniform* getUniform(const std::string& name) const;
330
333 const RefUniformPair* getUniformPair(const std::string& name) const;
334
336 inline void setUniformList(UniformList& al) { _uniformList=al; }
337
339 inline UniformList& getUniformList() { return _uniformList; }
340
342 inline const UniformList& getUniformList() const { return _uniformList; }
343
344
345 typedef std::pair<std::string, StateAttribute::OverrideValue> DefinePair;
346 typedef std::map<std::string, DefinePair> DefineList;
347
349 void setDefine(const std::string& defineName, StateAttribute::OverrideValue value=StateAttribute::ON);
350
352 void setDefine(const std::string& defineName, const std::string& defineValue, StateAttribute::OverrideValue value=StateAttribute::ON);
353
354 DefinePair* getDefinePair(const std::string& defineName) { DefineList::iterator itr = _defineList.find(defineName); return (itr!=_defineList.end()) ? &(itr->second) : 0; }
355 const DefinePair* getDefinePair(const std::string& defineName) const { DefineList::const_iterator itr = _defineList.find(defineName); return (itr!=_defineList.end()) ? &(itr->second) : 0; }
356
357
359 void removeDefine(const std::string& defineName);
360
361
363 void setDefineList(const DefineList& dl) { _defineList = dl; }
364
366 DefineList& getDefineList() { return _defineList; }
367
369 const DefineList& getDefineList() const { return _defineList; }
370
371
372
374 {
375 DEFAULT_BIN = 0,
376 OPAQUE_BIN = 1,
377 TRANSPARENT_BIN = 2
378 };
379
391 void setRenderingHint(int hint);
392
394 inline int getRenderingHint() const { return _renderingHint; }
395
397 {
398 INHERIT_RENDERBIN_DETAILS =0,
399 USE_RENDERBIN_DETAILS =1,
400 OVERRIDE_RENDERBIN_DETAILS =2,
401 PROTECTED_RENDERBIN_DETAILS =4,
402 OVERRIDE_PROTECTED_RENDERBIN_DETAILS = OVERRIDE_RENDERBIN_DETAILS|PROTECTED_RENDERBIN_DETAILS
403 };
404
406 void setRenderBinDetails(int binNum,const std::string& binName,RenderBinMode mode=USE_RENDERBIN_DETAILS);
407
410
412 inline bool useRenderBinDetails() const { return _binMode!=INHERIT_RENDERBIN_DETAILS; }
413
415 inline void setRenderBinMode(RenderBinMode mode) { _binMode=mode; }
416
418 inline RenderBinMode getRenderBinMode() const { return _binMode; }
419
421 inline void setBinNumber(int num) { _binNum=num; }
422
424 inline int getBinNumber() const { return _binNum; }
425
427 inline void setBinName(const std::string& name) { _binName=name; }
428
430 inline const std::string& getBinName() const { return _binName; }
431
439 inline void setNestRenderBins(bool val) { _nestRenderBins = val; }
440
442 inline bool getNestRenderBins() const { return _nestRenderBins; }
443
444
445 struct OSG_EXPORT Callback : public virtual osg::Callback
446 {
448
449 Callback(const Callback& org,const CopyOp& copyop):
450 osg::Object(org, copyop),
451 osg::Callback(org, copyop) {}
452
454
456 virtual bool run(osg::Object* object, osg::Object* data);
457
459 virtual void operator() (StateSet*, NodeVisitor*) {}
460 };
461
464
465 template<class T> void setUpdateCallback(const ref_ptr<T>& ac) { setUpdateCallback(ac.get()); }
466
468 Callback* getUpdateCallback() { return _updateCallback.get(); }
469
471 const Callback* getUpdateCallback() const { return _updateCallback.get(); }
472
474 bool requiresUpdateTraversal() const { return _updateCallback.valid() || getNumChildrenRequiringUpdateTraversal()!=0; }
475
478 inline unsigned int getNumChildrenRequiringUpdateTraversal() const { return _numChildrenRequiringUpdateTraversal; }
479
482
483
486
487 template<class T> void setEventCallback(const ref_ptr<T>& ec) { setEventCallback(ec.get()); }
488
490 Callback* getEventCallback() { return _eventCallback.get(); }
491
493 const Callback* getEventCallback() const { return _eventCallback.get(); }
494
496 bool requiresEventTraversal() const { return _eventCallback.valid() || getNumChildrenRequiringEventTraversal()!=0; }
497
500 inline unsigned int getNumChildrenRequiringEventTraversal() const { return _numChildrenRequiringEventTraversal; }
501
504
509
511 virtual void setThreadSafeRefUnref(bool threadSafe);
512
514 void compileGLObjects(State& state) const;
515
517 virtual void resizeGLObjectBuffers(unsigned int maxSize);
518
520 virtual void releaseGLObjects(State* state=0) const;
521
522 protected :
523
524
525 virtual ~StateSet();
526
527 StateSet& operator = (const StateSet&) { return *this; }
528
529 void addParent(osg::Node* object);
530 void removeParent(osg::Node* object);
531
533 friend class osg::Node;
534 friend class osg::Drawable;
535 friend class osg::Uniform;
537
540
543
546
547 inline ModeList& getOrCreateTextureModeList(unsigned int unit)
548 {
549 if (unit>=_textureModeList.size()) _textureModeList.resize(unit+1);
550 return _textureModeList[unit];
551 }
552
554 {
555 if (unit>=_textureAttributeList.size()) _textureAttributeList.resize(unit+1);
556 return _textureAttributeList[unit];
557 }
558
559 int compareModes(const ModeList& lhs, const ModeList& rhs);
562
566
567 void setAttribute(AttributeList& attributeList,StateAttribute *attribute, StateAttribute::OverrideValue value=StateAttribute::OFF);
568
569 StateAttribute* getAttribute(AttributeList& attributeList, StateAttribute::Type type, unsigned int member);
570 const StateAttribute* getAttribute(const AttributeList& attributeList, StateAttribute::Type type, unsigned int member) const;
571
572 RefAttributePair* getAttributePair(AttributeList& attributeList, StateAttribute::Type type, unsigned int member);
573 const RefAttributePair* getAttributePair(const AttributeList& attributeList, StateAttribute::Type type, unsigned int member) const;
574
576
579 std::string _binName;
581
585
589
590};
591
593
594}
595
596#endif
Definition Callback:34
Definition CopyOp:41
Definition Drawable:89
Definition NodeVisitor:82
Definition Node:72
Definition Object:61
Definition StateAttribute:77
GLenum GLMode
Definition StateAttribute:81
unsigned int GLModeValue
Definition StateAttribute:85
Type
Definition StateAttribute:124
unsigned int OverrideValue
Definition StateAttribute:89
Definition StateSet:46
TextureAttributeList & getTextureAttributeList()
Definition StateSet:283
virtual bool isSameKindAs(const Object *obj) const
Definition StateSet:55
int compareAttributePtrs(const AttributeList &lhs, const AttributeList &rhs)
UniformList _uniformList
Definition StateSet:544
void setTextureMode(unsigned int unit, StateAttribute::GLMode mode, StateAttribute::GLModeValue value)
bool getNestRenderBins() const
Definition StateSet:442
void setTextureAttributeAndModes(unsigned int unit, const ref_ptr< T > &attribute, StateAttribute::OverrideValue value=StateAttribute::ON)
Definition StateSet:253
virtual const char * className() const
Definition StateSet:57
RefAttributePair * getTextureAttributePair(unsigned int unit, StateAttribute::Type type)
void setMode(ModeList &modeList, StateAttribute::GLMode mode, StateAttribute::GLModeValue value)
void setDefine(const std::string &defineName, StateAttribute::OverrideValue value=StateAttribute::ON)
StateAttribute * getTextureAttribute(unsigned int unit, StateAttribute::Type type)
int _binNum
Definition StateSet:578
bool _nestRenderBins
Definition StateSet:580
const StateAttribute * getTextureAttribute(unsigned int unit, StateAttribute::Type type) const
void removeUniform(const ref_ptr< T > &uniform)
Definition StateSet:318
StateAttribute * getAttribute(AttributeList &attributeList, StateAttribute::Type type, unsigned int member)
std::vector< ModeList > TextureModeList
Definition StateSet:213
void setTextureAttributeAndModes(unsigned int unit, StateAttribute *attribute, StateAttribute::GLModeValue value=StateAttribute::ON)
const std::string & getBinName() const
Definition StateSet:430
bool requiresUpdateTraversal() const
Definition StateSet:474
void setDefine(const std::string &defineName, const std::string &defineValue, StateAttribute::OverrideValue value=StateAttribute::ON)
UniformList & getUniformList()
Definition StateSet:339
void setNumChildrenRequiringUpdateTraversal(unsigned int num)
void setEventCallback(const ref_ptr< T > &ec)
Definition StateSet:487
const ParentList & getParents() const
Definition StateSet:79
void setAssociatedTextureModes(unsigned int unit, const StateAttribute *attribute, StateAttribute::GLModeValue value)
const StateAttribute * getAttribute(const AttributeList &attributeList, StateAttribute::Type type, unsigned int member) const
void setTextureAttributeList(TextureAttributeList &tal)
Definition StateSet:280
void removeDefine(const std::string &defineName)
void removeAttribute(const ref_ptr< T > &attribute)
Definition StateSet:184
const DefinePair * getDefinePair(const std::string &defineName) const
Definition StateSet:355
virtual void releaseGLObjects(State *state=0) const
const StateAttribute * getAttribute(StateAttribute::Type type, unsigned int member=0) const
Callback * getUpdateCallback()
Definition StateSet:468
ModeList _modeList
Definition StateSet:538
std::vector< AttributeList > TextureAttributeList
Definition StateSet:243
void setUpdateCallback(const ref_ptr< T > &ac)
Definition StateSet:465
RenderBinMode
Definition StateSet:397
void setAttributeAndModes(const ref_ptr< T > &attribute, StateAttribute::GLModeValue value=StateAttribute::ON)
Definition StateSet:176
bool useRenderBinDetails() const
Definition StateSet:412
void setAttribute(AttributeList &attributeList, StateAttribute *attribute, StateAttribute::OverrideValue value=StateAttribute::OFF)
void setRenderBinDetails(int binNum, const std::string &binName, RenderBinMode mode=USE_RENDERBIN_DETAILS)
void removeAssociatedModes(const StateAttribute *attribute)
void setModeList(ModeList &ml)
Definition StateSet:150
int getBinNumber() const
Definition StateSet:424
StateSet(const StateSet &, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
void setAttributeList(AttributeList &al)
Definition StateSet:203
AttributeList _attributeList
Definition StateSet:539
DefineList _defineList
Definition StateSet:545
const RefUniformPair * getUniformPair(const std::string &name) const
const UniformList & getUniformList() const
Definition StateSet:342
virtual const StateSet * asStateSet() const
Definition StateSet:72
const TextureAttributeList & getTextureAttributeList() const
Definition StateSet:286
void setAttributeAndModes(StateAttribute *attribute, StateAttribute::GLModeValue value=StateAttribute::ON)
const RefAttributePair * getAttributePair(const AttributeList &attributeList, StateAttribute::Type type, unsigned int member) const
unsigned int getNumTextureModeLists() const
Definition StateSet:241
DefineList & getDefineList()
Definition StateSet:366
std::pair< ref_ptr< Uniform >, StateAttribute::OverrideValue > RefUniformPair
Definition StateSet:302
StateAttribute::GLModeValue getTextureMode(unsigned int unit, StateAttribute::GLMode mode) const
void setAssociatedModes(const StateAttribute *attribute, StateAttribute::GLModeValue value)
std::map< std::string, RefUniformPair > UniformList
Definition StateSet:305
ParentList getParents()
Definition StateSet:83
const RefAttributePair * getAttributePair(StateAttribute::Type type, unsigned int member=0) const
void removeAttribute(StateAttribute::Type type, unsigned int member=0)
ref_ptr< Callback > _eventCallback
Definition StateSet:586
void setNestRenderBins(bool val)
Definition StateSet:439
void runEventCallbacks(osg::NodeVisitor *nv)
const AttributeList & getAttributeList() const
Definition StateSet:209
const Callback * getUpdateCallback() const
Definition StateSet:471
virtual Object * cloneType() const
Definition StateSet:53
StateAttribute::GLModeValue getMode(const ModeList &modeList, StateAttribute::GLMode mode) const
bool requiresEventTraversal() const
Definition StateSet:496
void setUpdateCallback(Callback *ac)
void removeTextureAttribute(unsigned int unit, StateAttribute::Type type)
void setTextureModeList(TextureModeList &tml)
Definition StateSet:232
virtual void setThreadSafeRefUnref(bool threadSafe)
void removeAttribute(StateAttribute *attribute)
Uniform * getUniform(const std::string &name)
TextureModeList & getTextureModeList()
Definition StateSet:235
void setAttribute(StateAttribute *attribute, StateAttribute::OverrideValue value=StateAttribute::OFF)
virtual const char * libraryName() const
Definition StateSet:56
void runUpdateCallbacks(osg::NodeVisitor *nv)
int compare(const StateSet &rhs, bool compareAttributeContents=false) const
const TextureModeList & getTextureModeList() const
Definition StateSet:238
std::map< StateAttribute::TypeMemberPair, RefAttributePair > AttributeList
Definition StateSet:166
RenderingHint
Definition StateSet:374
void setTextureAttribute(unsigned int unit, const ref_ptr< T > &attribute, StateAttribute::OverrideValue value=StateAttribute::OFF)
Definition StateSet:248
void addUniform(Uniform *uniform, StateAttribute::OverrideValue value=StateAttribute::ON)
void setDefineList(const DefineList &dl)
Definition StateSet:363
DefinePair * getDefinePair(const std::string &defineName)
Definition StateSet:354
void removeTextureMode(unsigned int unit, StateAttribute::GLMode mode)
const DefineList & getDefineList() const
Definition StateSet:369
ModeList & getOrCreateTextureModeList(unsigned int unit)
Definition StateSet:547
RenderBinMode _binMode
Definition StateSet:577
void setBinName(const std::string &name)
Definition StateSet:427
Node * getParent(unsigned int i)
Definition StateSet:85
void setUniformList(UniformList &al)
Definition StateSet:336
StateAttribute * getAttribute(StateAttribute::Type type, unsigned int member=0)
void removeTextureAttribute(unsigned int unit, const ref_ptr< T > &attribute)
Definition StateSet:261
virtual void computeDataVariance()
virtual Object * clone(const CopyOp &copyop) const
Definition StateSet:54
void setNumChildrenRequiringEventTraversal(unsigned int num)
void setEventCallback(Callback *ac)
const Node * getParent(unsigned int i) const
Definition StateSet:91
int compareAttributeContents(const AttributeList &lhs, const AttributeList &rhs)
Uniform * getOrCreateUniform(const std::string &name, Uniform::Type type, unsigned int numElements=1)
void setModeToInherit(ModeList &modeList, StateAttribute::GLMode mode)
void setRenderBinMode(RenderBinMode mode)
Definition StateSet:415
virtual ~StateSet()
virtual StateSet * asStateSet()
Definition StateSet:68
int compareModes(const ModeList &lhs, const ModeList &rhs)
void merge(const StateSet &rhs)
const ModeList & getModeList() const
Definition StateSet:158
StateAttribute::GLModeValue getMode(StateAttribute::GLMode mode) const
TextureAttributeList _textureAttributeList
Definition StateSet:542
unsigned int _numChildrenRequiringUpdateTraversal
Definition StateSet:583
RenderBinMode getRenderBinMode() const
Definition StateSet:418
void removeTextureAttribute(unsigned int unit, StateAttribute *attribute)
void removeUniform(const std::string &name)
unsigned int getNumChildrenRequiringEventTraversal() const
Definition StateSet:500
std::vector< Node * > ParentList
Definition StateSet:76
ref_ptr< Callback > _updateCallback
Definition StateSet:582
Callback * getEventCallback()
Definition StateSet:490
int _renderingHint
Definition StateSet:575
void removeAssociatedTextureModes(unsigned int unit, const StateAttribute *attribute)
AttributeList & getOrCreateTextureAttributeList(unsigned int unit)
Definition StateSet:553
void removeMode(StateAttribute::GLMode mode)
virtual void resizeGLObjectBuffers(unsigned int maxSize)
AttributeList & getAttributeList()
Definition StateSet:206
unsigned int getNumChildrenRequiringUpdateTraversal() const
Definition StateSet:478
void addUniform(const ref_ptr< T > &uniform, StateAttribute::OverrideValue value=StateAttribute::ON)
Definition StateSet:310
std::pair< std::string, StateAttribute::OverrideValue > DefinePair
Definition StateSet:345
void setRenderingHint(int hint)
bool checkValidityOfAssociatedModes(State &state) const
std::map< StateAttribute::GLMode, StateAttribute::GLModeValue > ModeList
Definition StateSet:119
RefAttributePair * getAttributePair(StateAttribute::Type type, unsigned int member=0)
ModeList & getModeList()
Definition StateSet:153
std::string _binName
Definition StateSet:579
void setBinNumber(int num)
Definition StateSet:421
void setMode(StateAttribute::GLMode mode, StateAttribute::GLModeValue value)
unsigned int getNumParents() const
Definition StateSet:97
unsigned int getNumTextureAttributeLists() const
Definition StateSet:289
void removeUniform(Uniform *uniform)
const Callback * getEventCallback() const
Definition StateSet:493
void setGlobalDefaults()
std::pair< ref_ptr< StateAttribute >, StateAttribute::OverrideValue > RefAttributePair
Definition StateSet:163
void setRenderBinToInherit()
ParentList _parents
Definition StateSet:532
void addParent(osg::Node *object)
int getRenderingHint() const
Definition StateSet:394
void removeParent(osg::Node *object)
std::map< std::string, DefinePair > DefineList
Definition StateSet:346
const RefAttributePair * getTextureAttributePair(unsigned int unit, StateAttribute::Type type) const
TextureModeList _textureModeList
Definition StateSet:541
unsigned int _numChildrenRequiringEventTraversal
Definition StateSet:587
void compileGLObjects(State &state) const
RefAttributePair * getAttributePair(AttributeList &attributeList, StateAttribute::Type type, unsigned int member)
const Uniform * getUniform(const std::string &name) const
void setAttribute(const ref_ptr< T > &attribute, StateAttribute::OverrideValue value=StateAttribute::OFF)
Definition StateSet:171
void setTextureAttribute(unsigned int unit, StateAttribute *attribute, StateAttribute::OverrideValue value=StateAttribute::OFF)
Definition State:80
Definition Uniform:414
Type
Definition Uniform:416
Definition ref_ptr:32
T * get() const
Definition ref_ptr:117
author: Julien Valentin 2017 (mp3butcher@hotmail.com)
Definition AlphaFunc:19
OSG_EXPORT bool isTextureMode(StateAttribute::GLMode mode)
#define NULL
Definition osg/Export:55
#define OSG_EXPORT
Definition osg/Export:39
Definition StateSet:446
Callback()
Definition StateSet:447
Callback(const Callback &org, const CopyOp &copyop)
Definition StateSet:449
META_Object(osg, Callback)
virtual bool run(osg::Object *object, osg::Object *data)