| http://www.sim.no/ http://www.coin3d.org/

- Main Page
- Related Pages
- Modules
- Classes
- Files

- File List
- File Members

SoOverrideElement.h
1 #ifndef COIN_SOOVERRIDEELEMENT_H
2 #define COIN_SOOVERRIDEELEMENT_H
3
4 /**************************************************************************\
5 *
6 * This file is part of the Coin 3D visualization library.
7 * Copyright (C) by Kongsberg Oil & Gas Technologies.
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * ("GPL") version 2 as published by the Free Software Foundation.
12 * See the file LICENSE.GPL at the root directory of this source
13 * distribution for additional information about the GNU GPL.
14 *
15 * For using Coin with software that can not be combined with the GNU
16 * GPL, and for taking advantage of the additional benefits of our
17 * support services, please contact Kongsberg Oil & Gas Technologies
18 * about acquiring a Coin Professional Edition License.
19 *
20 * See http://www.coin3d.org/ for more information.
21 *
22 * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
23 * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
24 *
25 \**************************************************************************/
26
27 #include <Inventor/elements/SoSubElement.h>
28 #include <Inventor/system/inttypes.h>
29
30 class SoType; // lame doxygen "fix"
31
32 class COIN_DLL_API SoOverrideElement : public SoElement {
33 typedef SoElement inherited;
34
35 SO_ELEMENT_HEADER(SoOverrideElement);
36 public:
37 static void initClass(void);
38 protected:
39 virtual ~SoOverrideElement();
40
41 public:
42 enum FlagBits {
43 AMBIENT_COLOR = 0x00000001,
44 COLOR_INDEX = 0x00000002,
45 COMPLEXITY = 0x00000004,
46 COMPLEXITY_TYPE = 0x00000008,
47 CREASE_ANGLE = 0x00000010,
48 DIFFUSE_COLOR = 0x00000020,
49 DRAW_STYLE = 0x00000040,
50 EMISSIVE_COLOR = 0x00000080,
51 FONT_NAME = 0x00000100,
52 FONT_SIZE = 0x00000200,
53 LIGHT_MODEL = 0x00000400,
54 LINE_PATTERN = 0x00000800,
55 LINE_WIDTH = 0x00001000,
56 MATERIAL_BINDING = 0x00002000,
57 POINT_SIZE = 0x00004000,
58 PICK_STYLE = 0x00008000,
59 SHAPE_HINTS = 0x00010000,
60 SHININESS = 0x00020000,
61 SPECULAR_COLOR = 0x00040000,
62 POLYGON_OFFSET = 0x00080000,
63 TRANSPARENCY = 0x00100000,
64 TRANSPARENCY_TYPE = 0x00200000,
65 NORMAL_VECTOR = 0x00400000,
66 NORMAL_BINDING = 0x00800000
67 };
68
69 virtual void init(SoState * state);
70
71 virtual void push(SoState * state);
72
73 virtual SbBool matches(const SoElement * element) const;
74 virtual SoElement * copyMatchInfo(void) const;
75
76 static uint32_t getFlags(SoState * const state) {
77 return (static_cast<const SoOverrideElement*>(getConstElement(state, classStackIndex)))->flags;
78 }
79
80 static SbBool getAmbientColorOverride(SoState * const state);
81 static SbBool getColorIndexOverride(SoState * const state);
82 static SbBool getComplexityOverride(SoState * const state);
83 static SbBool getComplexityTypeOverride(SoState * const state);
84 static SbBool getCreaseAngleOverride(SoState * const state);
85 static SbBool getDiffuseColorOverride(SoState * const state);
86 static SbBool getDrawStyleOverride(SoState * const state);
87 static SbBool getEmissiveColorOverride(SoState * const state);
88 static SbBool getFontNameOverride(SoState * const state);
89 static SbBool getFontSizeOverride(SoState * const state);
90 static SbBool getLightModelOverride(SoState * const state);
91 static SbBool getLinePatternOverride(SoState * const state);
92 static SbBool getLineWidthOverride(SoState * const state);
93 static SbBool getMaterialBindingOverride(SoState * const state);
94 static SbBool getPickStyleOverride(SoState * const state);
95 static SbBool getPointSizeOverride(SoState * const state);
96 static SbBool getPolygonOffsetOverride(SoState * const state);
97 static SbBool getShapeHintsOverride(SoState * const state);
98 static SbBool getShininessOverride(SoState * const state);
99 static SbBool getSpecularColorOverride(SoState * const state);
100 static SbBool getTransparencyOverride(SoState * const state);
101 static SbBool getTransparencyTypeOverride(SoState * const state);
102 static SbBool getNormalVectorOverride(SoState * const state);
103 static SbBool getNormalBindingOverride(SoState * const state);
104
105 static void setAmbientColorOverride(SoState * const state,
106 SoNode * const node,
107 const SbBool override);
108 static void setColorIndexOverride(SoState * const state,
109 SoNode * const node,
110 const SbBool override);
111 static void setComplexityOverride(SoState * const state,
112 SoNode * const node,
113 const SbBool override);
114 static void setComplexityTypeOverride(SoState * const state,
115 SoNode * const node,
116 const SbBool override);
117 static void setCreaseAngleOverride(SoState * const state,
118 SoNode * const node,
119 const SbBool override);
120 static void setDiffuseColorOverride(SoState * const state,
121 SoNode * const node,
122 const SbBool override);
123 static void setDrawStyleOverride(SoState * const state,
124 SoNode * const node,
125 const SbBool override);
126 static void setEmissiveColorOverride(SoState * const state,
127 SoNode * const node,
128 const SbBool override);
129 static void setFontNameOverride(SoState * const state,
130 SoNode * const node,
131 const SbBool override);
132 static void setFontSizeOverride(SoState * const state,
133 SoNode * const node,
134 const SbBool override);
135 static void setLightModelOverride(SoState * const state,
136 SoNode * const node,
137 const SbBool override);
138 static void setLinePatternOverride(SoState * const state,
139 SoNode * const node,
140 const SbBool override);
141 static void setLineWidthOverride(SoState * const state,
142 SoNode * const node,
143 const SbBool override);
144 static void setMaterialBindingOverride(SoState * const state,
145 SoNode * const node,
146 const SbBool override);
147 static void setPickStyleOverride(SoState * const state,
148 SoNode * const node,
149 const SbBool override);
150 static void setPointSizeOverride(SoState * const state,
151 SoNode * const node,
152 const SbBool override);
153 static void setPolygonOffsetOverride(SoState * const state,
154 SoNode * const node,
155 const SbBool override);
156 static void setShapeHintsOverride(SoState * const state,
157 SoNode * const node,
158 const SbBool override);
159 static void setShininessOverride(SoState * const state,
160 SoNode * const node,
161 const SbBool override);
162 static void setSpecularColorOverride(SoState * const state,
163 SoNode * const node,
164 const SbBool override);
165 static void setTransparencyOverride(SoState * const state,
166 SoNode * const node,
167 const SbBool override);
168 static void setTransparencyTypeOverride(SoState * const state,
169 SoNode * const node,
170 const SbBool override);
171 static void setNormalVectorOverride(SoState * const state,
172 SoNode * const node,
173 const SbBool override);
174 static void setNormalBindingOverride(SoState * const state,
175 SoNode * const node,
176 const SbBool override);
177
178 virtual void print(FILE * file) const;
179
180 private:
181
182 uint32_t flags;
183 };
184
185 #endif // !COIN_SOOVERRIDEELEMENT_H

Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.