Coin  4.0.3
Coin3D core library
Loading...
Searching...
No Matches
SoOverrideElement.h
1#ifndef COIN_SOOVERRIDEELEMENT_H
2#define COIN_SOOVERRIDEELEMENT_H
3
4/**************************************************************************\
5 * Copyright (c) Kongsberg Oil & Gas Technologies AS
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions are
10 * met:
11 *
12 * Redistributions of source code must retain the above copyright notice,
13 * this list of conditions and the following disclaimer.
14 *
15 * Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 *
19 * Neither the name of the copyright holder nor the names of its
20 * contributors may be used to endorse or promote products derived from
21 * this software without specific prior written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34\**************************************************************************/
35
36#include <Inventor/elements/SoSubElement.h>
37#include <Inventor/system/inttypes.h>
38
39class SoType; // lame doxygen "fix"
40
41class COIN_DLL_API SoOverrideElement : public SoElement {
42 typedef SoElement inherited;
43
44 SO_ELEMENT_HEADER(SoOverrideElement);
45public:
46 static void initClass(void);
47protected:
48 virtual ~SoOverrideElement();
49
50public:
51 enum FlagBits {
52 AMBIENT_COLOR = 0x00000001,
53 COLOR_INDEX = 0x00000002,
54 COMPLEXITY = 0x00000004,
55 COMPLEXITY_TYPE = 0x00000008,
56 CREASE_ANGLE = 0x00000010,
57 DIFFUSE_COLOR = 0x00000020,
58 DRAW_STYLE = 0x00000040,
59 EMISSIVE_COLOR = 0x00000080,
60 FONT_NAME = 0x00000100,
61 FONT_SIZE = 0x00000200,
62 LIGHT_MODEL = 0x00000400,
63 LINE_PATTERN = 0x00000800,
64 LINE_WIDTH = 0x00001000,
65 MATERIAL_BINDING = 0x00002000,
66 POINT_SIZE = 0x00004000,
67 PICK_STYLE = 0x00008000,
68 SHAPE_HINTS = 0x00010000,
69 SHININESS = 0x00020000,
70 SPECULAR_COLOR = 0x00040000,
71 POLYGON_OFFSET = 0x00080000,
72 TRANSPARENCY = 0x00100000,
73 TRANSPARENCY_TYPE = 0x00200000,
74 NORMAL_VECTOR = 0x00400000,
75 NORMAL_BINDING = 0x00800000
76 };
77
78 virtual void init(SoState * state);
79
80 virtual void push(SoState * state);
81
82 virtual SbBool matches(const SoElement * element) const;
83 virtual SoElement * copyMatchInfo(void) const;
84
85 static uint32_t getFlags(SoState * const state) {
86 return (static_cast<const SoOverrideElement*>(getConstElement(state, classStackIndex)))->flags;
87 }
88
89 static SbBool getAmbientColorOverride(SoState * const state);
90 static SbBool getColorIndexOverride(SoState * const state);
91 static SbBool getComplexityOverride(SoState * const state);
92 static SbBool getComplexityTypeOverride(SoState * const state);
93 static SbBool getCreaseAngleOverride(SoState * const state);
94 static SbBool getDiffuseColorOverride(SoState * const state);
95 static SbBool getDrawStyleOverride(SoState * const state);
96 static SbBool getEmissiveColorOverride(SoState * const state);
97 static SbBool getFontNameOverride(SoState * const state);
98 static SbBool getFontSizeOverride(SoState * const state);
99 static SbBool getLightModelOverride(SoState * const state);
100 static SbBool getLinePatternOverride(SoState * const state);
101 static SbBool getLineWidthOverride(SoState * const state);
102 static SbBool getMaterialBindingOverride(SoState * const state);
103 static SbBool getPickStyleOverride(SoState * const state);
104 static SbBool getPointSizeOverride(SoState * const state);
105 static SbBool getPolygonOffsetOverride(SoState * const state);
106 static SbBool getShapeHintsOverride(SoState * const state);
107 static SbBool getShininessOverride(SoState * const state);
108 static SbBool getSpecularColorOverride(SoState * const state);
109 static SbBool getTransparencyOverride(SoState * const state);
110 static SbBool getTransparencyTypeOverride(SoState * const state);
111 static SbBool getNormalVectorOverride(SoState * const state);
112 static SbBool getNormalBindingOverride(SoState * const state);
113
114 static void setAmbientColorOverride(SoState * const state,
115 SoNode * const node,
116 const SbBool override);
117 static void setColorIndexOverride(SoState * const state,
118 SoNode * const node,
119 const SbBool override);
120 static void setComplexityOverride(SoState * const state,
121 SoNode * const node,
122 const SbBool override);
123 static void setComplexityTypeOverride(SoState * const state,
124 SoNode * const node,
125 const SbBool override);
126 static void setCreaseAngleOverride(SoState * const state,
127 SoNode * const node,
128 const SbBool override);
129 static void setDiffuseColorOverride(SoState * const state,
130 SoNode * const node,
131 const SbBool override);
132 static void setDrawStyleOverride(SoState * const state,
133 SoNode * const node,
134 const SbBool override);
135 static void setEmissiveColorOverride(SoState * const state,
136 SoNode * const node,
137 const SbBool override);
138 static void setFontNameOverride(SoState * const state,
139 SoNode * const node,
140 const SbBool override);
141 static void setFontSizeOverride(SoState * const state,
142 SoNode * const node,
143 const SbBool override);
144 static void setLightModelOverride(SoState * const state,
145 SoNode * const node,
146 const SbBool override);
147 static void setLinePatternOverride(SoState * const state,
148 SoNode * const node,
149 const SbBool override);
150 static void setLineWidthOverride(SoState * const state,
151 SoNode * const node,
152 const SbBool override);
153 static void setMaterialBindingOverride(SoState * const state,
154 SoNode * const node,
155 const SbBool override);
156 static void setPickStyleOverride(SoState * const state,
157 SoNode * const node,
158 const SbBool override);
159 static void setPointSizeOverride(SoState * const state,
160 SoNode * const node,
161 const SbBool override);
162 static void setPolygonOffsetOverride(SoState * const state,
163 SoNode * const node,
164 const SbBool override);
165 static void setShapeHintsOverride(SoState * const state,
166 SoNode * const node,
167 const SbBool override);
168 static void setShininessOverride(SoState * const state,
169 SoNode * const node,
170 const SbBool override);
171 static void setSpecularColorOverride(SoState * const state,
172 SoNode * const node,
173 const SbBool override);
174 static void setTransparencyOverride(SoState * const state,
175 SoNode * const node,
176 const SbBool override);
177 static void setTransparencyTypeOverride(SoState * const state,
178 SoNode * const node,
179 const SbBool override);
180 static void setNormalVectorOverride(SoState * const state,
181 SoNode * const node,
182 const SbBool override);
183 static void setNormalBindingOverride(SoState * const state,
184 SoNode * const node,
185 const SbBool override);
186
187 virtual void print(FILE * file) const;
188
189private:
190
191 uint32_t flags;
192};
193
194#endif // !COIN_SOOVERRIDEELEMENT_H
SoElement is the abstract base class for all elements.
Definition SoElement.h:43
virtual SoElement * copyMatchInfo(void) const =0
virtual SbBool matches(const SoElement *element) const =0
Definition SoElement.cpp:609
static void initClass(void)
Definition SoElement.cpp:507
virtual void init(SoState *state)
Definition SoElement.cpp:553
virtual void push(SoState *state)
Definition SoElement.cpp:570
virtual void print(FILE *file=stdout) const
Definition SoElement.cpp:595
static const SoElement * getConstElement(SoState *const state, const int stackIndex)
Definition SoElement.h:123
The SoNode class is the base class for nodes used in scene graphs.
Definition SoNode.h:56
The SoOverrideElement maintains a list of overridable elements and a list over which elements should ...
Definition SoOverrideElement.h:41
FlagBits
Definition SoOverrideElement.h:51
The SoState class manages the Coin scene graph traversal state data.
Definition SoState.h:44
The SoType class is the basis for the runtime type system in Coin.
Definition SoType.h:59