OpendTect  6.3
visnodestate.h
Go to the documentation of this file.
1 #pragma once
2 
3 /*+
4 ________________________________________________________________________
5 
6  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
7  Author: Kristofer Tingdahl
8  Date: Oct 2012
9 ________________________________________________________________________
10 
11 
12 -*/
13 
14 #include "visosg.h"
15 #include "objectset.h"
16 #include "callback.h"
17 
18 namespace osg { class StateSet; class StateAttribute; }
19 
20 namespace visBase
21 {
22 
25 mExpClass(visBase) NodeState : public RefCount::Referenced
26  , public CallBacker
27 {
28 public:
29 
30  void attachStateSet(osg::StateSet*);
31  void detachStateSet(osg::StateSet*);
32  virtual void setPixelDensity(float) {}
33 
34 protected:
35  NodeState();
36  ~NodeState();
37 
38  template <class T> T* addAttribute(T* a) { doAdd(a); return a; }
39  template <class T> void removeAttribute(T* a) {doRemove(a);}
40 
41 private:
42 
43  void doAdd(osg::StateAttribute*);
44  void doRemove(osg::StateAttribute*);
45  virtual void applyAttribute(osg::StateSet*,
46  osg::StateAttribute*);
47 
50 };
51 
52 };
#define mExpClass(module)
Definition: commondefs.h:157
Inherit from this class to be able to send and/or receive CallBacks.
Definition: callback.h:182
ObjectSet< osg::StateAttribute > attributes_
Definition: visnodestate.h:48
void removeAttribute(T *a)
Definition: visnodestate.h:39
Definition: visnodestate.h:25
ObjectSet< osg::StateSet > statesets_
Definition: visnodestate.h:49
Definition: visannot.h:40
Open Scene Graph.
Definition: visannot.h:26
virtual void setPixelDensity(float)
Definition: visnodestate.h:32
T * addAttribute(T *a)
Definition: visnodestate.h:38

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2017