SoElement(3) SoElement is the abstract base class for all elements.

SYNOPSIS


#include <Inventor/elements/SoElement.h>

Inherited by SoAccumulatedElement, SoCacheElement, SoCacheHintElement, SoCullElement, SoDepthBufferElement, SoFloatElement, SoGLCacheContextElement, SoGLRenderPassElement, SoGLUpdateAreaElement, SoGLVBOElement, SoInt32Element, SoLazyElement, SoLocalBBoxMatrixElement, SoMultiTextureCoordinateElement, SoMultiTextureEnabledElement, SoMultiTextureImageElement, SoOverrideElement, SoPickRayElement, SoProfilerElement, SoReplacedElement, SoShapeHintsElement, SoShapeStyleElement, SoTextureCombineElement, SoTextureOverrideElement, SoViewportRegionElement, and SoWindowElement.

Public Member Functions


const SoType getTypeId (void) const

int getStackIndex (void) const

virtual void init (SoState *state)

virtual void push (SoState *state)

virtual void pop (SoState *state, const SoElement *prevTopElement)

virtual SbBool matches (const SoElement *element) const =0

virtual SoElement * copyMatchInfo (void) const =0

void setDepth (const int depth)

int getDepth (void) const

virtual void print (FILE *file=stdout) const

virtual ~SoElement ()

Static Public Member Functions


static void initClass (void)

static SoType getClassTypeId (void)

static int getClassStackIndex (void)

static void initElements (void)

static int getNumStackIndices (void)

static SoType getIdFromStackIndex (const int stackIndex)

Protected Member Functions


SoElement (void)

void capture (SoState *const state) const

virtual void captureThis (SoState *state) const

void setTypeId (const SoType typeId)

void setStackIndex (const int index)

SoElement * getNextInStack (void) const

SoElement * getNextFree (void) const

Static Protected Member Functions


static SoElement * getElement (SoState *const state, const int stackIndex)

static const SoElement * getConstElement (SoState *const state, const int stackIndex)

static int createStackIndex (const SoType id)

Protected Attributes


SoType typeId

int stackIndex

int depth

Static Protected Attributes


static int classStackIndex

static SoTypeList * stackToType

Detailed Description

SoElement is the abstract base class for all elements.

This is the base class for all the element classes in Coin.

Constructor & Destructor Documentation

SoElement::~SoElement () [virtual]

The destructor.

SoElement::SoElement (void) [protected]

The constructor. To create element instances, use SoType::createInstance() for the elements type identifier..

Member Function Documentation

void SoElement::initClass (void) [static]

Initialize relevant common data for all instances, like the type system.

Reimplemented in SoLazyElement, SoTextureCoordinateElement, SoProfileCoordinateElement, SoMultiTextureImageElement, SoTextureCombineElement, SoGLLazyElement, SoWindowElement, SoProfilerElement, SoLightElement, SoTextureImageElement, SoCullElement, SoGLMultiTextureImageElement, SoGLVBOElement, SoDiffuseColorElement, SoGLMultiTextureCoordinateElement, SoGLTextureImageElement, SoGeoElement, SoMultiTextureEnabledElement, SoMultiTextureMatrixElement, SoOverrideElement, SoProfileElement, SoAmbientColorElement, SoBBoxModelMatrixElement, SoCacheElement, SoClipPlaneElement, SoCoordinateElement, SoDepthBufferElement, SoEmissiveColorElement, SoGLMultiTextureMatrixElement, SoGLPointSizeElement, SoGLTextureCoordinateElement, SoGLUpdateAreaElement, SoModelMatrixElement, SoNormalElement, SoSpecularColorElement, SoTextureUnitElement, SoAccumulatedElement, SoBumpMapCoordinateElement, SoBumpMapMatrixElement, SoEnvironmentElement, SoFontNameElement, SoInt32Element, SoLightAttenuationElement, SoListenerDopplerElement, SoListenerOrientationElement, SoListenerPositionElement, SoPickRayElement, SoReplacedElement, SoTextureMatrixElement, SoTextureOverrideElement, SoTransparencyElement, SoViewVolumeElement, SoViewingMatrixElement, SoViewportRegionElement, SoGLShadowCullingElement, SoShadowStyleElement, SoAnnoText3CharOrientElement, SoAnnoText3FontSizeHintElement, SoAnnoText3RenderPrintElement, SoComplexityElement, SoComplexityTypeElement, SoCreaseAngleElement, SoDecimationPercentageElement, SoDecimationTypeElement, SoDrawStyleElement, SoFloatElement, SoFocalDistanceElement, SoFontSizeElement, SoGLClipPlaneElement, SoGLColorIndexElement, SoGLCoordinateElement, SoGLDepthBufferElement, SoGLDrawStyleElement, SoGLEnvironmentElement, SoGLLightIdElement, SoGLLinePatternElement, SoGLLineWidthElement, SoGLModelMatrixElement, SoGLNormalElement, SoGLPolygonOffsetElement, SoGLProjectionMatrixElement, SoGLRenderPassElement, SoGLShapeHintsElement, SoGLTexture3EnabledElement, SoGLTextureEnabledElement, SoGLTextureMatrixElement, SoGLViewingMatrixElement, SoGLViewportRegionElement, SoLightModelElement, SoLinePatternElement, SoLineWidthElement, SoListenerGainElement, SoLocalBBoxMatrixElement, SoMaterialBindingElement, SoNormalBindingElement, SoPickStyleElement, SoPointSizeElement, SoPolygonOffsetElement, SoShapeStyleElement, SoShininessElement, SoSoundElement, SoSwitchElement, SoTextOutlineEnabledElement, SoTextureCoordinateBindingElement, SoTextureEnabledElement, SoTextureQualityElement, SoUnitsElement, and SoVertexAttributeBindingElement.

SoType SoElement::getClassTypeId (void) [static]

This static method returns the class type.

Reimplemented in SoTextureCoordinateElement, SoLazyElement, SoProfileCoordinateElement, SoMultiTextureImageElement, SoTextureCombineElement, SoWindowElement, SoGLLazyElement, SoLightElement, SoTextureImageElement, SoProfilerElement, SoCullElement, SoGLMultiTextureImageElement, SoDiffuseColorElement, SoGLMultiTextureCoordinateElement, SoGLTextureImageElement, SoGLVBOElement, SoGeoElement, SoMultiTextureEnabledElement, SoMultiTextureMatrixElement, SoOverrideElement, SoProfileElement, SoAmbientColorElement, SoBBoxModelMatrixElement, SoCacheElement, SoClipPlaneElement, SoCoordinateElement, SoEmissiveColorElement, SoGLMultiTextureMatrixElement, SoGLTextureCoordinateElement, SoGLUpdateAreaElement, SoModelMatrixElement, SoNormalElement, SoSpecularColorElement, SoTextureUnitElement, SoAccumulatedElement, SoBumpMapCoordinateElement, SoBumpMapMatrixElement, SoDepthBufferElement, SoEnvironmentElement, SoFontNameElement, SoGLPointSizeElement, SoInt32Element, SoLightAttenuationElement, SoListenerDopplerElement, SoListenerOrientationElement, SoListenerPositionElement, SoPickRayElement, SoReplacedElement, SoTextureMatrixElement, SoTransparencyElement, SoViewVolumeElement, SoViewingMatrixElement, SoViewportRegionElement, SoGLShadowCullingElement, SoShadowStyleElement, SoAnnoText3CharOrientElement, SoAnnoText3FontSizeHintElement, SoAnnoText3RenderPrintElement, SoComplexityElement, SoComplexityTypeElement, SoCreaseAngleElement, SoDecimationPercentageElement, SoDecimationTypeElement, SoDrawStyleElement, SoFloatElement, SoFocalDistanceElement, SoFontSizeElement, SoGLClipPlaneElement, SoGLColorIndexElement, SoGLCoordinateElement, SoGLDrawStyleElement, SoGLEnvironmentElement, SoGLLightIdElement, SoGLLinePatternElement, SoGLLineWidthElement, SoGLModelMatrixElement, SoGLNormalElement, SoGLPolygonOffsetElement, SoGLProjectionMatrixElement, SoGLRenderPassElement, SoGLShapeHintsElement, SoGLTexture3EnabledElement, SoGLTextureEnabledElement, SoGLTextureMatrixElement, SoGLViewingMatrixElement, SoGLViewportRegionElement, SoLightModelElement, SoLinePatternElement, SoLineWidthElement, SoListenerGainElement, SoLocalBBoxMatrixElement, SoMaterialBindingElement, SoNormalBindingElement, SoPickStyleElement, SoPointSizeElement, SoPolygonOffsetElement, SoShapeStyleElement, SoShininessElement, SoSoundElement, SoSwitchElement, SoTextOutlineEnabledElement, SoTextureCoordinateBindingElement, SoTextureEnabledElement, SoTextureOverrideElement, SoTextureQualityElement, SoUnitsElement, SoVertexAttributeBindingElement, and SoGLDepthBufferElement.

int SoElement::getClassStackIndex (void) [static]

This static method returns the state stack index for the class.

Reimplemented in SoTextureCoordinateElement, SoLazyElement, SoProfileCoordinateElement, SoMultiTextureImageElement, SoTextureCombineElement, SoWindowElement, SoGLLazyElement, SoLightElement, SoTextureImageElement, SoProfilerElement, SoCullElement, SoGLMultiTextureImageElement, SoDiffuseColorElement, SoGLMultiTextureCoordinateElement, SoGLTextureImageElement, SoGLVBOElement, SoGeoElement, SoMultiTextureEnabledElement, SoMultiTextureMatrixElement, SoOverrideElement, SoProfileElement, SoAmbientColorElement, SoBBoxModelMatrixElement, SoCacheElement, SoClipPlaneElement, SoCoordinateElement, SoEmissiveColorElement, SoGLMultiTextureMatrixElement, SoGLTextureCoordinateElement, SoGLUpdateAreaElement, SoModelMatrixElement, SoNormalElement, SoSpecularColorElement, SoTextureUnitElement, SoAccumulatedElement, SoBumpMapCoordinateElement, SoBumpMapMatrixElement, SoDepthBufferElement, SoEnvironmentElement, SoFontNameElement, SoGLPointSizeElement, SoInt32Element, SoLightAttenuationElement, SoListenerDopplerElement, SoListenerOrientationElement, SoListenerPositionElement, SoPickRayElement, SoReplacedElement, SoTextureMatrixElement, SoTransparencyElement, SoViewVolumeElement, SoViewingMatrixElement, SoViewportRegionElement, SoGLShadowCullingElement, SoShadowStyleElement, SoAnnoText3CharOrientElement, SoAnnoText3FontSizeHintElement, SoAnnoText3RenderPrintElement, SoComplexityElement, SoComplexityTypeElement, SoCreaseAngleElement, SoDecimationPercentageElement, SoDecimationTypeElement, SoDrawStyleElement, SoFloatElement, SoFocalDistanceElement, SoFontSizeElement, SoGLClipPlaneElement, SoGLColorIndexElement, SoGLCoordinateElement, SoGLDrawStyleElement, SoGLEnvironmentElement, SoGLLightIdElement, SoGLLinePatternElement, SoGLLineWidthElement, SoGLModelMatrixElement, SoGLNormalElement, SoGLPolygonOffsetElement, SoGLProjectionMatrixElement, SoGLRenderPassElement, SoGLShapeHintsElement, SoGLTexture3EnabledElement, SoGLTextureEnabledElement, SoGLTextureMatrixElement, SoGLViewingMatrixElement, SoGLViewportRegionElement, SoLightModelElement, SoLinePatternElement, SoLineWidthElement, SoListenerGainElement, SoLocalBBoxMatrixElement, SoMaterialBindingElement, SoNormalBindingElement, SoPickStyleElement, SoPointSizeElement, SoPolygonOffsetElement, SoShapeStyleElement, SoShininessElement, SoSoundElement, SoSwitchElement, SoTextOutlineEnabledElement, SoTextureCoordinateBindingElement, SoTextureEnabledElement, SoTextureOverrideElement, SoTextureQualityElement, SoUnitsElement, SoVertexAttributeBindingElement, and SoGLDepthBufferElement.

const SoType SoElement::getTypeId (void) const

Returns the type identification of an object derived from a class inheriting SoElement. This is used for run-time type checking and 'downward' casting.

For a more thorough explanation of the run-time type identification functionality, see the documentation of SoBase::getTypeId().

int SoElement::getStackIndex (void) const

Returns the stack index for an element instance.

void SoElement::init (SoState *state) [virtual]

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 SoLazyElement, SoTextureCombineElement, SoOverrideElement, SoTextureImageElement, SoDepthBufferElement, SoShapeStyleElement, SoTextureCoordinateElement, SoUnitsElement, SoGLVBOElement, SoMaterialBindingElement, SoNormalBindingElement, SoMultiTextureEnabledElement, SoEnvironmentElement, SoPickStyleElement, SoProfileElement, SoTextureOverrideElement, SoVertexAttributeBindingElement, SoDrawStyleElement, SoMultiTextureImageElement, SoProfileCoordinateElement, SoShadowStyleElement, SoComplexityTypeElement, SoGLTextureEnabledElement, SoGLShadowCullingElement, SoGLLazyElement, SoPolygonOffsetElement, SoTextureCoordinateBindingElement, SoWindowElement, SoCullElement, SoLightElement, SoLightModelElement, SoLinePatternElement, SoAccumulatedElement, SoAnnoText3FontSizeHintElement, SoAnnoText3RenderPrintElement, SoGLMultiTextureImageElement, SoGeoElement, SoDiffuseColorElement, SoGLMultiTextureCoordinateElement, SoGLTextureImageElement, SoMultiTextureMatrixElement, SoTextureUnitElement, SoAmbientColorElement, SoBBoxModelMatrixElement, SoCacheElement, SoClipPlaneElement, SoCoordinateElement, SoDecimationTypeElement, SoEmissiveColorElement, SoGLColorIndexElement, SoGLMultiTextureMatrixElement, SoGLPointSizeElement, SoGLTextureCoordinateElement, SoGLUpdateAreaElement, SoModelMatrixElement, SoNormalElement, SoSpecularColorElement, SoBumpMapCoordinateElement, SoBumpMapMatrixElement, SoFontNameElement, SoInt32Element, SoLightAttenuationElement, SoListenerDopplerElement, SoListenerOrientationElement, SoListenerPositionElement, SoPickRayElement, SoReplacedElement, SoTextureMatrixElement, SoTransparencyElement, SoViewVolumeElement, SoViewingMatrixElement, SoViewportRegionElement, SoAnnoText3CharOrientElement, SoComplexityElement, SoCreaseAngleElement, SoDecimationPercentageElement, SoFloatElement, SoFocalDistanceElement, SoFontSizeElement, SoGLClipPlaneElement, SoGLDrawStyleElement, SoGLEnvironmentElement, SoGLLightIdElement, SoGLLinePatternElement, SoGLLineWidthElement, SoGLModelMatrixElement, SoGLNormalElement, SoGLPolygonOffsetElement, SoGLRenderPassElement, SoGLShapeHintsElement, SoGLTexture3EnabledElement, SoGLTextureMatrixElement, SoGLViewingMatrixElement, SoGLViewportRegionElement, SoLineWidthElement, SoListenerGainElement, SoLocalBBoxMatrixElement, SoPointSizeElement, SoShininessElement, SoSoundElement, SoSwitchElement, SoTextOutlineEnabledElement, SoTextureEnabledElement, SoTextureQualityElement, and SoGLDepthBufferElement.

void SoElement::push (SoState *state) [virtual]

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 SoLazyElement, SoMultiTextureImageElement, SoTextureCombineElement, SoOverrideElement, SoShapeStyleElement, SoDepthBufferElement, SoMultiTextureEnabledElement, SoSoundElement, SoGLVBOElement, SoGLShadowCullingElement, SoProfileElement, SoTextureOverrideElement, SoGLTextureEnabledElement, SoWindowElement, SoGLLazyElement, SoCullElement, SoLightElement, SoAccumulatedElement, SoGLMultiTextureImageElement, SoBBoxModelMatrixElement, SoCacheElement, SoGLMultiTextureCoordinateElement, SoGLPointSizeElement, SoGLTextureImageElement, SoMultiTextureMatrixElement, SoClipPlaneElement, SoGLMultiTextureMatrixElement, SoGLTextureCoordinateElement, SoGLUpdateAreaElement, SoModelMatrixElement, SoBumpMapMatrixElement, SoGLDrawStyleElement, SoGLLightIdElement, SoGLLinePatternElement, SoGLLineWidthElement, SoGLModelMatrixElement, SoGLShapeHintsElement, SoGLTexture3EnabledElement, SoGLViewingMatrixElement, SoLocalBBoxMatrixElement, SoTextOutlineEnabledElement, SoTextureMatrixElement, SoGLPolygonOffsetElement, SoGLViewportRegionElement, and SoGLDepthBufferElement.

void SoElement::pop (SoState *state, const SoElement *prevTopElement) [virtual]

This method is callled 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 SoDepthBufferElement, SoShapeStyleElement, SoSoundElement, SoGLVBOElement, SoGLShadowCullingElement, SoGLTextureEnabledElement, SoWindowElement, SoGLLazyElement, SoGLMultiTextureImageElement, SoGLMultiTextureCoordinateElement, SoGLTextureImageElement, SoCacheElement, SoGLMultiTextureMatrixElement, SoGLPointSizeElement, SoGLTextureCoordinateElement, SoGLUpdateAreaElement, SoGLDrawStyleElement, SoGLLightIdElement, SoGLLinePatternElement, SoGLLineWidthElement, SoGLModelMatrixElement, SoGLShapeHintsElement, SoGLTexture3EnabledElement, SoGLViewingMatrixElement, SoGLViewportRegionElement, SoTextOutlineEnabledElement, SoGLClipPlaneElement, SoGLEnvironmentElement, SoGLPolygonOffsetElement, SoGLTextureMatrixElement, SoGLProjectionMatrixElement, and SoGLDepthBufferElement.

SbBool SoElement::matches (const SoElement *element) const [pure virtual]

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, SoMultiTextureImageElement, SoTextureCombineElement, SoOverrideElement, SoDepthBufferElement, SoShapeStyleElement, SoLocalBBoxMatrixElement, SoMultiTextureEnabledElement, SoGLVBOElement, SoCullElement, SoCacheElement, SoWindowElement, SoFontNameElement, SoLightAttenuationElement, SoGLUpdateAreaElement, SoTextureOverrideElement, SoProfilerElement, SoModelMatrixElement, SoInt32Element, SoPickRayElement, SoFloatElement, SoReplacedElement, SoViewportRegionElement, SoAccumulatedElement, and SoGLRenderPassElement.

SoElement * SoElement::copyMatchInfo (void) const [pure virtual]

This function creates a copy of the element that contains enough information to enable the matches() function to work.

Used to help with scenegraph traversal caching operations.

Implemented in SoLazyElement, SoMultiTextureImageElement, SoTextureCombineElement, SoOverrideElement, SoDepthBufferElement, SoShapeStyleElement, SoLocalBBoxMatrixElement, SoMultiTextureEnabledElement, SoGLVBOElement, SoCullElement, SoCacheElement, SoWindowElement, SoAccumulatedElement, SoFontNameElement, SoLightAttenuationElement, SoGLUpdateAreaElement, SoTextureOverrideElement, SoProfilerElement, SoInt32Element, SoPickRayElement, SoReplacedElement, SoFloatElement, SoViewportRegionElement, and SoGLRenderPassElement.

void SoElement::initElements (void) [static]

This function initializes all the built-in Coin element classes.

int SoElement::getNumStackIndices (void) [static]

Returns the number of allocated element stack index slots.

SoType SoElement::getIdFromStackIndex (const intstackIndex) [static]

Returns the SoType identifier for the element class with element state stack index stackIndex.

void SoElement::setDepth (const intdepth)

Sets the depth value of the element instance in the state stack.

int SoElement::getDepth (void) const

Returns the state stack depth value of the element instance.

void SoElement::print (FILE *file = stdout) const [virtual]

This function is for printing element information, and is used mostly for debugging purposes.

Reimplemented in SoOverrideElement, SoEnvironmentElement, SoSoundElement, SoCoordinateElement, SoTextureOverrideElement, SoFontNameElement, SoLightAttenuationElement, SoListenerDopplerElement, SoViewportRegionElement, SoListenerOrientationElement, SoListenerPositionElement, SoReplacedElement, SoInt32Element, and SoFloatElement.

SoElement * SoElement::getElement (SoState *conststate, const intstackIndex) [inline], [static], [protected]

This method returns the top instance (in the state stack) of the element class with stack index stackIndex.

The retuned instance is writable. To make this instance, some lazy evaluation may have to be perfomed, so use getConstElement() instead if the instance shouldn't be modified.

If no instance is available and can not be made, NULL is returned.

See also:

const SoElement * SoElement::getConstElement(SoState * const state, const int stackIndex)

void const SoElement * SoElement::getConstElement (SoState *conststate, const intstackIndex) [inline], [static], [protected]

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.

See also:

SoElement * SoElement::getElement(SoState * const state, const int stackIndex)

void SoElement::capture (SoState *conststate) const [inline], [protected]

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.

void SoElement::captureThis (SoState *state) const [protected], [virtual]

Adds the element to the cache.

Reimplemented in SoAccumulatedElement.

void SoElement::setTypeId (const SoTypetypeId) [protected]

Sets the type identifier of an instance.

Note that this is fundamentally different from the SoNode run-time type system.

void SoElement::setStackIndex (const intstackIndex) [protected]

Sets the stack index in an instance. Used in constructors of derived elements.

int SoElement::createStackIndex (const SoTypetypeId) [static], [protected]

Returns the value of a new available stack index.

SoElement * SoElement::getNextInStack (void) const [protected]

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.

SoElement * SoElement::getNextFree (void) const [protected]

Returns the next free element, ie the next element up in the stack.

Member Data Documentation

int SoElement::classStackIndex [static], [protected]

This is the static state stack index for the class.

SoType SoElement::typeId [protected]

The element's unique SoType type identification.

int SoElement::stackIndex [protected]

The index in the state stack for this particular element instance.

SoTypeList * SoElement::stackToType [static], [protected]

Provides mapping from state stack indices to element types.

int SoElement::depth [protected]

The depth of the element instance in the state stack.

Author

Generated automatically by Doxygen for Coin from the source code.