Coin
4.0.3
Coin3D core library
|
SoElement is the abstract base class for all elements. More...
#include <Inventor/elements/SoElement.h>
Public Member Functions | |
virtual | ~SoElement () |
virtual SoElement * | copyMatchInfo (void) const =0 |
int | getDepth (void) const |
int | getStackIndex (void) const |
const SoType | getTypeId (void) const |
virtual void | init (SoState *state) |
virtual SbBool | matches (const SoElement *element) const =0 |
virtual void | pop (SoState *state, const SoElement *prevTopElement) |
virtual void | print (FILE *file=stdout) const |
virtual void | push (SoState *state) |
void | setDepth (const int depth) |
Static Public Member Functions | |
static int | getClassStackIndex (void) |
static SoType | getClassTypeId (void) |
static SoType | getIdFromStackIndex (const int stackIndex) |
static int | getNumStackIndices (void) |
static void | initClass (void) |
static void | initElements (void) |
Protected Member Functions | |
SoElement (void) | |
void | capture (SoState *const state) const |
virtual void | captureThis (SoState *state) const |
SoElement * | getNextFree (void) const |
SoElement * | getNextInStack (void) const |
void | setStackIndex (const int index) |
void | setTypeId (const SoType typeId) |
Static Protected Member Functions | |
static int | createStackIndex (const SoType id) |
static const SoElement * | getConstElement (SoState *const state, const int stackIndex) |
static SoElement * | getElement (SoState *const state, const int stackIndex) |
Protected Attributes | |
int | depth |
int | stackIndex |
SoType | typeId |
Static Protected Attributes | |
static int | classStackIndex |
static SoTypeList * | stackToType |
SoElement is the abstract base class for all elements.
This is the base class for all the element classes in Coin.
|
virtual |
The destructor.
|
protected |
The constructor. To create element instances, use SoType::createInstance() for the elements type identifier.
This function does whatever is necessary in the state for caching purposes. If should be called by subclasses of SoElement whenever any value in the element is accessed.
Adds the element to the cache.
Reimplemented in SoAccumulatedElement.
This function creates a copy of the element that contains enough information to enable the matches() function to work.
Used to help with scene graph traversal caching operations.
Implemented in SoGLShaderProgramElement, SoGLUpdateAreaElement, SoPickRayElement, SoReplacedElement, SoTextureOverrideElement, SoViewportRegionElement, SoProfilerElement, SoAccumulatedElement, SoCacheElement, SoCacheHintElement, SoCullElement, SoDepthBufferElement, SoFloatElement, SoFontNameElement, SoGLCacheContextElement, SoGLRenderPassElement, SoGLVBOElement, SoInt32Element, SoLazyElement, SoLightAttenuationElement, SoLocalBBoxMatrixElement, SoMultiTextureCoordinateElement, SoMultiTextureEnabledElement, SoMultiTextureImageElement, SoOverrideElement, SoShapeHintsElement, SoShapeStyleElement, SoTextureCombineElement, SoWindowElement, and SoResetMatrixElement.
Returns the value of a new available stack index.
|
static |
This static method returns the state stack index for the class.
This static method returns the SoType object associated with objects of this class.
|
inlinestaticprotected |
This method returns a reference to the top element of the class with stack index stackIndex. The returned element is non-mutable.
(Don't try to be clever and cast away the constness – if the returned instance is modified, strange, hard to find and generally wonderful bugs will most likely start to happen.)
If no instance can be returned, NULL
is returned.
int SoElement::getDepth | ( | void | ) | const |
Returns the state stack depth value of the element instance.
|
inlinestaticprotected |
This method returns the top instance (in the state stack) of the element class with stack index stackIndex.
The returned instance is writable. To make this instance, some lazy evaluation may have to be performed, so use getConstElement() instead if the instance shouldn't be modified.
If no instance is available and cannot be made, NULL
is returned.
Returns the SoType identifier for the element class with element state stack index stackIndex.
Returns the next free element, i.e. the next element up in the stack.
Returns the next element down in the stack. Should be used in push() to get the previous element.
This method has a slightly misleading name, but we didn't change it to stay compatible with the original SGI Inventor API.
|
static |
Returns the number of allocated element stack index slots.
int SoElement::getStackIndex | ( | void | ) | const |
Returns the stack index for an element instance.
Returns the type identification of an object derived from a class inheriting SoElement. This is used for runtime type checking and "downward" casting.
For a more thorough explanation of the runtime type identification functionality, see the documentation of SoBase::getTypeId().
This function initializes the element type in the given SoState. It is called for the first element of each enabled element type in SoState objects.
Reimplemented in SoGLShadowCullingElement, SoShadowStyleElement, SoAccumulatedElement, SoAmbientColorElement, SoAnnoText3CharOrientElement, SoAnnoText3FontSizeHintElement, SoAnnoText3RenderPrintElement, SoBBoxModelMatrixElement, SoBumpMapCoordinateElement, SoBumpMapElement, SoBumpMapMatrixElement, SoCacheElement, SoCacheHintElement, SoClipPlaneElement, SoComplexityElement, SoComplexityTypeElement, SoCoordinateElement, SoCreaseAngleElement, SoCullElement, SoDecimationPercentageElement, SoDecimationTypeElement, SoDepthBufferElement, SoDiffuseColorElement, SoDrawStyleElement, SoEmissiveColorElement, SoEnvironmentElement, SoFloatElement, SoFocalDistanceElement, SoFontNameElement, SoFontSizeElement, SoGeoElement, SoGLCacheContextElement, SoGLClipPlaneElement, SoGLColorIndexElement, SoGLDepthBufferElement, SoGLDrawStyleElement, SoGLEnvironmentElement, SoGLLazyElement, SoGLLightIdElement, SoGLLinePatternElement, SoGLLineWidthElement, SoGLModelMatrixElement, SoGLMultiTextureCoordinateElement, SoGLMultiTextureEnabledElement, SoGLMultiTextureImageElement, SoGLMultiTextureMatrixElement, SoGLNormalElement, SoGLPointSizeElement, SoGLPolygonOffsetElement, SoGLRenderPassElement, SoGLShaderProgramElement, SoGLShapeHintsElement, SoGLUpdateAreaElement, SoGLVBOElement, SoGLVertexAttributeElement, SoGLViewingMatrixElement, SoGLViewportRegionElement, SoInt32Element, SoLazyElement, SoLightAttenuationElement, SoLightElement, SoLightModelElement, SoLinePatternElement, SoLineWidthElement, SoListenerDopplerElement, SoListenerGainElement, SoListenerOrientationElement, SoListenerPositionElement, SoLocalBBoxMatrixElement, SoMaterialBindingElement, SoModelMatrixElement, SoMultiTextureCoordinateElement, SoMultiTextureEnabledElement, SoMultiTextureImageElement, SoMultiTextureMatrixElement, SoNormalBindingElement, SoNormalElement, SoOverrideElement, SoPickRayElement, SoPickStyleElement, SoPointSizeElement, SoPolygonOffsetElement, SoProfileCoordinateElement, SoProfileElement, SoProjectionMatrixElement, SoReplacedElement, SoShapeHintsElement, SoShapeStyleElement, SoShininessElement, SoSoundElement, SoSpecularColorElement, SoSwitchElement, SoTextOutlineEnabledElement, SoTextureCombineElement, SoTextureCoordinateBindingElement, SoTextureOverrideElement, SoTextureQualityElement, SoTextureUnitElement, SoTransparencyElement, SoUnitsElement, SoVertexAttributeBindingElement, SoVertexAttributeElement, SoViewingMatrixElement, SoViewportRegionElement, SoViewVolumeElement, SoWindowElement, and SoResetMatrixElement.
Initialize relevant common data for all instances, like the type system.
This function initializes all the built-in Coin element classes.
This function returns TRUE
is the element matches another element (of the same class), with respect to cache validity.
If the application programmer's extension element has a matches() function, it should also have a copyMatchInfo() function.
Implemented in SoLazyElement, SoMultiTextureCoordinateElement, SoMultiTextureEnabledElement, SoMultiTextureImageElement, SoTextureCombineElement, SoProfilerElement, SoAccumulatedElement, SoCacheElement, SoCacheHintElement, SoDepthBufferElement, SoFloatElement, SoFontNameElement, SoGLRenderPassElement, SoGLShaderProgramElement, SoGLUpdateAreaElement, SoInt32Element, SoLightAttenuationElement, SoLocalBBoxMatrixElement, SoModelMatrixElement, SoOverrideElement, SoPickRayElement, SoReplacedElement, SoShapeHintsElement, SoShapeStyleElement, SoTextureOverrideElement, SoViewportRegionElement, SoWindowElement, SoResetMatrixElement, SoCullElement, SoGLCacheContextElement, and SoGLVBOElement.
This method is called when the state is popped, and the depth of the element is bigger than the current state depth. pop() is called on the new top of stack, and a pointer to the previous top of stack is passed in prevTopElement.
Override this method if you need to copy some state information from the previous top of stack.
Reimplemented in SoGLShadowCullingElement, SoCacheElement, SoCacheHintElement, SoDepthBufferElement, SoGLClipPlaneElement, SoGLDepthBufferElement, SoGLDrawStyleElement, SoGLEnvironmentElement, SoGLLazyElement, SoGLLightIdElement, SoGLLinePatternElement, SoGLLineWidthElement, SoGLModelMatrixElement, SoGLMultiTextureCoordinateElement, SoGLMultiTextureEnabledElement, SoGLMultiTextureImageElement, SoGLMultiTextureMatrixElement, SoGLPointSizeElement, SoGLPolygonOffsetElement, SoGLProjectionMatrixElement, SoGLShaderProgramElement, SoGLShapeHintsElement, SoGLUpdateAreaElement, SoGLVBOElement, SoGLViewingMatrixElement, SoGLViewportRegionElement, SoShapeHintsElement, SoShapeStyleElement, SoSoundElement, SoTextOutlineEnabledElement, and SoWindowElement.
This function is for printing element information, and is used mostly for debugging purposes.
Reimplemented in SoCoordinateElement, SoEnvironmentElement, SoFloatElement, SoFontNameElement, SoInt32Element, SoLightAttenuationElement, SoListenerDopplerElement, SoListenerOrientationElement, SoListenerPositionElement, SoOverrideElement, SoReplacedElement, SoShapeHintsElement, SoSoundElement, SoViewportRegionElement, and SoTextureOverrideElement.
This method is called every time a new element is required in one of the stacks. This happens when a writable element is requested, using SoState::getElement() or indirectly SoElement::getElement(), and the depth of the current element is less than the state depth.
Override this method if your element needs to copy data from the previous top of stack. The push() method is called on the new element, and the previous element can be found using SoElement::getNextInStack().
Reimplemented in SoGLShaderProgramElement, SoGLShadowCullingElement, SoAccumulatedElement, SoBBoxModelMatrixElement, SoBumpMapMatrixElement, SoCacheElement, SoCacheHintElement, SoClipPlaneElement, SoCullElement, SoDepthBufferElement, SoGLDepthBufferElement, SoGLDrawStyleElement, SoGLLazyElement, SoGLLightIdElement, SoGLLinePatternElement, SoGLLineWidthElement, SoGLModelMatrixElement, SoGLMultiTextureCoordinateElement, SoGLMultiTextureEnabledElement, SoGLMultiTextureImageElement, SoGLMultiTextureMatrixElement, SoGLPointSizeElement, SoGLPolygonOffsetElement, SoGLShapeHintsElement, SoGLUpdateAreaElement, SoGLVBOElement, SoGLViewingMatrixElement, SoGLViewportRegionElement, SoLazyElement, SoLightElement, SoLocalBBoxMatrixElement, SoModelMatrixElement, SoMultiTextureCoordinateElement, SoMultiTextureEnabledElement, SoMultiTextureImageElement, SoMultiTextureMatrixElement, SoOverrideElement, SoProfileElement, SoShapeHintsElement, SoShapeStyleElement, SoSoundElement, SoTextOutlineEnabledElement, SoTextureCombineElement, SoTextureOverrideElement, SoVertexAttributeElement, and SoWindowElement.
Sets the depth value of the element instance in the state stack.
Sets the stack index in an instance. Used in constructors of derived elements.
Sets the type identifier of an instance.
Note that this is fundamentally different from the SoNode runtime type system.
|
staticprotected |
This is the static state stack index for the class.
|
protected |
The depth of the element instance in the state stack.
|
protected |
The index in the state stack for this particular element instance.
|
staticprotected |
Provides mapping from state stack indices to element types.