51#ifndef _SO_OVERRIDE_ELEMENT
52#define _SO_OVERRIDE_ELEMENT
54#include <Inventor/elements/SoSubElement.h>
55#include <Inventor/STL/bitset>
61#define SO_GET_OVERRIDE(flag) \
62 const SoOverrideElement *elt; \
63 elt = SoElement::getConstElement<SoOverrideElement>(state); \
64 return (elt->m_flags.test(flag));
69#define SO_SET_OVERRIDE(flag) \
70 SoOverrideElement *elt; \
71 elt = SoElement::getElement<SoOverrideElement>(state); \
73 elt->m_flags.set(flag); \
75 elt->m_flags.reset(flag);
112 { SO_GET_OVERRIDE(AMBIENT_COLOR); }
118 { SO_GET_OVERRIDE(COLOR_INDEX); }
124 { SO_GET_OVERRIDE(COMPLEXITY); }
130 { SO_GET_OVERRIDE(COMPLEXITY_TYPE); }
136 { SO_GET_OVERRIDE(CREASE_ANGLE); }
142 { SO_GET_OVERRIDE(NEIGHBOR_TOLERANCE); }
148 { SO_GET_OVERRIDE(DIFFUSE_COLOR); }
154 { SO_GET_OVERRIDE(DRAW_STYLE); }
160 { SO_GET_OVERRIDE(EMISSIVE_COLOR); }
166 { SO_GET_OVERRIDE(FONT_NAME); }
172 { SO_GET_OVERRIDE(FONT_SIZE); }
178 { SO_GET_OVERRIDE(FONT_RENDERSTYLE); }
184 { SO_GET_OVERRIDE(LIGHT_MODEL); }
190 { SO_GET_OVERRIDE(LINE_PATTERN); }
196 { SO_GET_OVERRIDE(LINE_WIDTH); }
202 { SO_GET_OVERRIDE(MATERIAL_BINDING); }
208 { SO_GET_OVERRIDE(POINT_SIZE); }
214 { SO_GET_OVERRIDE(PICK_STYLE); }
220 { SO_GET_OVERRIDE(SHAPE_HINTS); }
226 { SO_GET_OVERRIDE(SHININESS); }
233 SO_GET_OVERRIDE(SPECULAR_FACTOR);
241 SO_GET_OVERRIDE(ROUGHNESS);
249 SO_GET_OVERRIDE(METALLIC);
256 { SO_GET_OVERRIDE(SPECULAR_COLOR); }
262 { SO_GET_OVERRIDE(TRANSPARENCY); }
268 { SO_GET_OVERRIDE(TRANSPARENCY_TYPE); }
274 { SO_GET_OVERRIDE(ENVIRONMENT); }
280 { SO_GET_OVERRIDE(POLYGON_OFFSET); }
286 { SO_GET_OVERRIDE(PATTERN_OFFSET); }
292 { SO_GET_OVERRIDE(FULL_SCENE_ANTIALIASING); }
298 { SO_GET_OVERRIDE(DEPTH_BUFFER_RANGE); }
304 { SO_GET_OVERRIDE(DEPTH_BUFFER_FUNCTION); }
310 { SO_GET_OVERRIDE(BBOX_TYPE); }
321 { SO_SET_OVERRIDE(AMBIENT_COLOR); }
327 { SO_SET_OVERRIDE(COLOR_INDEX); }
333 { SO_SET_OVERRIDE(COMPLEXITY); }
339 { SO_SET_OVERRIDE(COMPLEXITY_TYPE); }
345 { SO_SET_OVERRIDE(CREASE_ANGLE); }
351 { SO_SET_OVERRIDE(NEIGHBOR_TOLERANCE); }
362 { SO_SET_OVERRIDE(DRAW_STYLE); }
368 { SO_SET_OVERRIDE(EMISSIVE_COLOR); }
374 { SO_SET_OVERRIDE(FONT_NAME); }
380 { SO_SET_OVERRIDE(FONT_SIZE); }
386 { SO_SET_OVERRIDE(FONT_RENDERSTYLE); }
392 { SO_SET_OVERRIDE(LIGHT_MODEL); }
398 { SO_SET_OVERRIDE(LINE_PATTERN); }
404 { SO_SET_OVERRIDE(LINE_WIDTH); }
415 { SO_SET_OVERRIDE(PICK_STYLE); }
421 { SO_SET_OVERRIDE(POINT_SIZE); }
427 { SO_SET_OVERRIDE(SHAPE_HINTS); }
433 { SO_SET_OVERRIDE(SHININESS); }
440 SO_SET_OVERRIDE(SPECULAR_FACTOR);
448 SO_SET_OVERRIDE(ROUGHNESS);
456 SO_SET_OVERRIDE(METALLIC);
463 { SO_SET_OVERRIDE(SPECULAR_COLOR); }
474 { SO_SET_OVERRIDE(TRANSPARENCY_TYPE); }
480 { SO_SET_OVERRIDE(ENVIRONMENT); }
486 { SO_SET_OVERRIDE(POLYGON_OFFSET); }
492 { SO_SET_OVERRIDE(PATTERN_OFFSET); }
498 { SO_SET_OVERRIDE(FULL_SCENE_ANTIALIASING); }
504 { SO_SET_OVERRIDE(DEPTH_BUFFER_RANGE); }
510 { SO_SET_OVERRIDE(DEPTH_BUFFER_FUNCTION); }
516 { SO_SET_OVERRIDE(BBOX_TYPE); }
526 virtual void init(
SoState *state);
534 virtual SoElement* copyMatchInfo()
const;
537 enum Defined_Override_Bit {
565 FULL_SCENE_ANTIALIASING,
569 DEPTH_BUFFER_FUNCTION,
572 TEXTPRP_ANTIALIASING_FACTOR,
573 TEXTPRP_ALIGNEMENT_H,
574 TEXTPRP_ALIGNEMENT_V,
575 TEXTPRP_BACKFRAMELINE,
578 TEXTPRP_TEXTUREQUALITY,
582 TEXTPRP_STYLECOLORS_USE_CURRENT_MATERIAL,
583 TEXTPRP_CHARACTER_SPACING,
587 typedef std::bitset<LAST_OVERRIDE_BIT> BitSetType;
590 static void initClass();
591 static void exitClass();
594 static void setOverrideFlag(
SoState* state,
SoNode* SO_UNUSED_PARAM(node), Defined_Override_Bit flag,
bool override)
596 SO_SET_OVERRIDE(flag);
602 bool compareWithMask(
const SoOverrideElement& in,
const BitSetType* testBitMask = NULL )
const;
609 explicit BitSetGetter(
SoState* state )
614 virtual ~BitSetGetter()
619 inline bool testBit(
int i )
const
621 return m_BufferedFlags.test(i);
625 BitSetGetter & operator=(
const BitSetGetter & ) {
return *
this; }
626 const BitSetType& m_BufferedFlags;
634 explicit BitSetSetter(
SoState* state )
639 virtual ~BitSetSetter()
644 inline void setBit(
size_t i,
bool value )
646 m_BufferedFlags.set(i, value);
650 BitSetSetter & operator=(
const BitSetSetter & );
651 BitSetType& m_BufferedFlags;
655 static void resetOverrideFlag(
SoState* state);
659 void pFlag(FILE *,
int)
const;
Abstract base class for all state elements.
Abstract base class for all database nodes.
Stores a flag for each type of element which can be overridden.
static SbBool getMaterialBindingOverride(SoState *state)
Returns TRUE if SoMaterialBindingElement is overridden.
static SbBool getPatternOverride(SoState *state)
Returns TRUE if SoPatternElement is overriden.
static SbBool getShininessOverride(SoState *state)
Returns TRUE if SoShininessElement is overridden.
static SbBool getSpecularFactorOverride(SoState *state)
Returns TRUE if SoPhysicalMaterial::specular is overridden.
static void setLinePatternOverride(SoState *state, SoNode *, SbBool override)
Set override flag for SoLinePatternElement.
static void setFullSceneAntialiasingOverride(SoState *state, SoNode *, SbBool override)
Set override flag for SoFullSceneAntialiasingElement.
static void setShininessOverride(SoState *state, SoNode *, SbBool override)
Set override flag for SoShininessElement.
static void setComplexityTypeOverride(SoState *state, SoNode *, SbBool override)
Set override flag for SoComplexityTypeElement.
static void setPatternOverride(SoState *state, SoNode *, SbBool override)
Set override flag for SoPatternElement.
static void setLightModelOverride(SoState *state, SoNode *, SbBool override)
Set override flag for SoLightModelElement.
static SbBool getDrawStyleOverride(SoState *state)
Returns TRUE if SoDrawStyleElement is overridden.
static SbBool getTransparencyTypeOverride(SoState *state)
Returns TRUE if SoTransparencyTypeElement is overridden.
static SbBool getMetallicOverride(SoState *state)
Returns TRUE if SoPhysicalMaterial::metallic is overridden.
static void setMaterialBindingOverride(SoState *state, SoNode *, SbBool override)
Set override flag for SoMaterialBindingElement.
static void setColorIndexOverride(SoState *state, SoNode *, SbBool override)
Set override flag for SoColorIndexElement.
static void setTransparencyOverride(SoState *state, SoNode *, SbBool override)
Set override flag for SoTransparencyElement.
static SbBool getComplexityOverride(SoState *state)
Returns TRUE if SoComplexityElement is overridden.
static void setDiffuseColorOverride(SoState *state, SoNode *, SbBool override)
Set override flag for SoDiffuseColorElement.
static SbBool getNeighborToleranceOverride(SoState *state)
Returns TRUE if SoNeighborToleranceElement is overridden.
static SbBool getTransparencyOverride(SoState *state)
Returns TRUE if SoTransparencyElement is overridden.
static SbBool getFontSizeOverride(SoState *state)
Returns TRUE if SoFontSizeElement is overridden.
static void setLineWidthOverride(SoState *state, SoNode *, SbBool override)
Set override flag for SoLineWidthElement.
static SbBool getComplexityTypeOverride(SoState *state)
Returns TRUE if SoComplexityTypeElement is overridden.
static void setAmbientColorOverride(SoState *state, SoNode *, SbBool override)
Set override flag for SoAmbientColorElement.
static SbBool getLinePatternOverride(SoState *state)
Returns TRUE if SoLinePatternElement is overridden.
static SbBool getRoughnessOverride(SoState *state)
Returns TRUE if SoPhysicalMaterial::roughness is overridden.
static SbBool getLightModelOverride(SoState *state)
Returns TRUE if SoLightModelElement is overridden.
static void setSpecularFactorOverride(SoState *state, SoNode *, SbBool override)
Set override flag for SoPhysicalMaterial::specular.
static SbBool getCreaseAngleOverride(SoState *state)
Returns TRUE if SoCreaseAngleElement is overridden.
static void setComplexityOverride(SoState *state, SoNode *, SbBool override)
Set override flag for SoComplexityElement.
static SbBool getDepthBufferRangeOverride(SoState *state)
Returns TRUE if SoDepthBuffer::range is overridden.
static SbBool getPolygonOffsetOverride(SoState *state)
Returns TRUE if SoPolygonOffsetElement is overridden.
static void setEnvironmentOverride(SoState *state, SoNode *, SbBool override)
Set override flag for SoEnvironmentElement.
static void setSpecularColorOverride(SoState *state, SoNode *, SbBool override)
Set override flag for SoSpecularColorElement.
static SbBool getPointSizeOverride(SoState *state)
Returns TRUE if SoPointSizeElement is overridden.
virtual void push(SoState *state)
Overrides push() method to copy values from next instance in the stack, and set up cache dependencies...
static void setNeighborToleranceOverride(SoState *state, SoNode *, SbBool override)
Set override flag for SoNeighborToleranceElement.
static void setFontNameOverride(SoState *state, SoNode *, SbBool override)
Set override flag for SoFontNameElement.
static void setEmissiveColorOverride(SoState *state, SoNode *, SbBool override)
Set override flag for SoEmissiveColorElement.
static void setFontRenderStyleOverride(SoState *state, SoNode *, SbBool override)
Set override flag for SoFontRenderStyleElement.
static SbBool getSpecularColorOverride(SoState *state)
Returns TRUE if SoSpecularColorElement is overridden.
static void setMetallicOverride(SoState *state, SoNode *, SbBool override)
Set override flag for SoPhysicalMaterial::metallic.
static void setFontSizeOverride(SoState *state, SoNode *, SbBool override)
Set override flag for SoFontSizeElement.
static SbBool getPickStyleOverride(SoState *state)
Returns TRUE if SoPickStyleElement is overridden.
static SbBool getDepthBufferFunctionOverride(SoState *state)
Returns TRUE if SoDepthBuffer::function is overridden.
static SbBool getEmissiveColorOverride(SoState *state)
Returns TRUE if SoEmissiveColorElement is overridden.
static SbBool getFontRenderStyleOverride(SoState *state)
Returns TRUE if SoFontRenderStyleElement is overridden.
static void setDepthBufferRangeOverride(SoState *state, SoNode *, SbBool override)
Set override flag for SoDepthBuffer::range.
static void setRoughnessOverride(SoState *state, SoNode *, SbBool override)
Set override flag for SoPhysicalMaterial::roughness.
static SbBool getColorIndexOverride(SoState *state)
Returns TRUE if SoColorIndexElement is overridden.
static SbBool getBBoxTypeOverride(SoState *state)
Returns TRUE if SoComplexityType::bboxType is overridden.
static SbBool getFontNameOverride(SoState *state)
Returns TRUE if SoFontNameElement is overridden.
static SbBool getEnvironmentOverride(SoState *state)
Returns TRUE if SoEnvironmentElement is overridden.
static SbBool getShapeHintsOverride(SoState *state)
Returns TRUE if SoShapeHintsElement is overridden.
static void setCreaseAngleOverride(SoState *state, SoNode *, SbBool override)
Set override flag for SoCreaseAngleElement.
static void setPickStyleOverride(SoState *state, SoNode *, SbBool override)
Set override flag for SoPickStyleElement.
static void setPolygonOffsetOverride(SoState *state, SoNode *, SbBool override)
Set override flag for SoPolygonOffsetElement.
static void setDepthBufferFunctionOverride(SoState *state, SoNode *, SbBool override)
Set override flag for SoDepthBuffer::function.
static void setPointSizeOverride(SoState *state, SoNode *, SbBool override)
Set override flag for SoPointSizeElement.
static SbBool getFullSceneAntialiasingOverride(SoState *state)
Returns TRUE if SoFullSceneAntialiasingElement is overridden.
static SbBool getAmbientColorOverride(SoState *state)
Returns TRUE if SoAmbientColorElement is overridden.
static SbBool getLineWidthOverride(SoState *state)
Returns TRUE if SoLineWidthElement is overridden.
virtual void print(FILE *fp) const
Prints element (for debugging).
static SbBool getDiffuseColorOverride(SoState *state)
Returns TRUE if SoDiffuseColorElement is overridden.
static void setShapeHintsOverride(SoState *state, SoNode *, SbBool override)
Set override flag for SoShapeHintsElement.
static void setDrawStyleOverride(SoState *state, SoNode *, SbBool override)
Set override flag for SoDrawStyleElement.
static void setBBoxTypeOverride(SoState *state, SoNode *, SbBool override)
Set override flag for SoComplexity::bboxType.
static void setTransparencyTypeOverride(SoState *state, SoNode *, SbBool override)
Set override flag for SoTransparencyTypeElement.