Open Inventor Reference
SoElement Class Referenceabstract

This is the abstract base class for all state elements. More...

#include <Inventor/elements/SoElement.h>

Inheritance diagram for SoElement:
SoAccumulatedElement SoCacheElement SoFloatElement SoGLCacheContextElement SoGLRenderPassElement SoGLUpdateAreaElement SoGLVBOElement SoInt32Element SoLazyElement SoLocalBBoxMatrixElement SoOverrideElement SoPickRayElement SoReplacedElement SoShapeHintsElement SoShapeStyleElement SoTextureOverrideElement SoViewportRegionElement SoWindowElement

Public Member Functions

virtual void init (SoState *state)
 Initializes element.
 
virtual void push (SoState *state)
 Pushes/pops element.
 
virtual void pop (SoState *state, const SoElement *prevTopElement)
 
virtual void print (FILE *fp) const
 Prints element (for debugging)
 
virtual bool matches (const SoElement *elt) const =0
 Returns TRUE if the element matches another element (of the same class, presumably) with respect to cache validity.
 
virtual SoElementcopyMatchInfo () const =0
 Create a copy that we can put in a cache used list and call matches() on later.
 
SoType getTypeId () const
 Returns type identifier for element instance.
 
int getStackIndex () const
 Returns the stack index for an element instance.
 
void setDepth (int dpth)
 Sets stuff in an element instance.
 
void setNext (SoElement *nxt)
 
void setNextInStack (SoElement *nxt)
 
void setNextFree (SoElement *nxt)
 
int getDepth () const
 Returns stuff from element instance.
 
SoElementgetNext () const
 
virtual ~SoElement ()
 Destructor.
 

Static Public Member Functions

static SoType getClassTypeId ()
 Returns type identifier for SoElement class.
 
static void initElements ()
 Initialize ALL Inventor element classes.
 
static void initClass ()
 Initializes the SoElement class.
 
static int getNumStackIndices ()
 Returns the number of stack indices allocated.
 
static SoType getIdFromStackIndex (int stackIndex)
 Returns the id for the element with the given stack index.
 

Protected Member Functions

 SoElement ()
 Constructor; use typeId.createInstance to create elements.
 
void capture (SoState *state) const
 Does whatever is necessary in state to capture this element for caching purposes.
 
virtual void captureThis (SoState *state) const
 Really captures this element, once it has been determined that a cache is open to capture it.
 
void setTypeId (SoType id)
 Sets typeId in instance.
 
void setStackIndex (int index)
 Sets stackIndex in instance.
 
SoElementgetNextInStack () const
 Returns next instance in specific element stack.
 
SoElementgetNextFree () const
 Returns next free element in a specific element stack.
 

Static Protected Member Functions

static SoElementgetElement (SoState *state, int stackIndex)
 Returns an instance of an element from the stack with the given index in the given state.
 
static const SoElementgetConstElement (SoState *state, int stackIndex)
 Returns a read-only pointer to the top instance in the given element stack.
 
static int createStackIndex (SoType id)
 Creates and returns a new stack index.
 

Static Protected Attributes

static int classStackIndex
 Stack index for SoElement class.
 

Friends

class SoState
 

Detailed Description

This class defines the following features for all of its derived classes:

Type identifiers. Each class of element has a unique (static)
SoType identifier. The correct type id is also stored in each
instance for easy access.

Copying.  Elements are copied into the list of elements used
in an SoCache.  Performing any operation other than matches()
on a copied element is not guaranteed to work (and will not
work for things like Coordinates, if the coordinate they were
pointing to has been deleted).

Stack indices. Since a subclass of an element class needs to
be in the same state stack as the class from which it is
derived, stack indices are inherited.

Capturing. Each time an element's value is accessed, that
element is added to the elements-used list of all currently
open caches.

Definition at line 96 of file SoElement.h.

Constructor & Destructor Documentation

◆ ~SoElement()

virtual SoElement::~SoElement ( )
virtual

◆ SoElement()

SoElement::SoElement ( )
protected

Member Function Documentation

◆ capture()

void SoElement::capture ( SoState state) const
inlineprotected

Should be called by subclasses whenever any value in the element is accessed.

Definition at line 173 of file SoElement.h.

References SoState::isCacheOpen().

Referenced by getConstElement().

◆ captureThis()

virtual void SoElement::captureThis ( SoState state) const
protectedvirtual

Reimplemented in SoAccumulatedElement.

◆ copyMatchInfo()

◆ createStackIndex()

static int SoElement::createStackIndex ( SoType  id)
staticprotected

◆ getClassTypeId()

static SoType SoElement::getClassTypeId ( )
inlinestatic

Definition at line 121 of file SoElement.h.

◆ getConstElement()

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

Description: Returns a read-only pointer to the top instance in the given element stack.

inline to speed up traversal.

Use: protected

Definition at line 234 of file SoElement.h.

References capture(), and SoState::getConstElement().

Referenced by SoFloatElement::get(), SoInt32Element::get(), SoCoordinateElement::getInstance(), and SoNormalElement::getInstance().

◆ getDepth()

int SoElement::getDepth ( ) const
inline

Definition at line 149 of file SoElement.h.

◆ getElement()

static SoElement * SoElement::getElement ( SoState state,
int  stackIndex 
)
inlinestaticprotected

This instance is writeable. This returns NULL if no writable instance can be returned.

Definition at line 162 of file SoElement.h.

References SoState::getElement().

◆ getIdFromStackIndex()

static SoType SoElement::getIdFromStackIndex ( int  stackIndex)
static

◆ getNext()

SoElement * SoElement::getNext ( ) const
inline

Definition at line 150 of file SoElement.h.

◆ getNextFree()

SoElement * SoElement::getNextFree ( ) const
inlineprotected

Definition at line 190 of file SoElement.h.

◆ getNextInStack()

SoElement * SoElement::getNextInStack ( ) const
inlineprotected

Definition at line 187 of file SoElement.h.

Referenced by SoCacheElement::getNextCacheElement().

◆ getNumStackIndices()

static int SoElement::getNumStackIndices ( )
inlinestatic

Definition at line 134 of file SoElement.h.

◆ getStackIndex()

int SoElement::getStackIndex ( ) const
inline

Definition at line 140 of file SoElement.h.

◆ getTypeId()

SoType SoElement::getTypeId ( ) const
inline

Definition at line 124 of file SoElement.h.

◆ init()

virtual void SoElement::init ( SoState state)
virtual

Called for first element of its kind in stack. Default method does nothing.

Reimplemented in SoBBoxModelMatrixElement, SoCacheElement, SoClipPlaneElement, SoComplexityElement, SoComplexityTypeElement, SoCoordinateElement, SoCreaseAngleElement, SoDrawStyleElement, SoFocalDistanceElement, SoFontNameElement, SoFontSizeElement, SoGLCacheContextElement, SoGLDrawStyleElement, SoGLLazyElement, SoGLLightIdElement, SoGLLinePatternElement, SoGLLineWidthElement, SoGLMaterialIndexElement, SoGLModelMatrixElement, SoGLNormalElement, SoGLPointSizeElement, SoGLPolygonOffsetElement, SoGLRenderPassElement, SoGLShapeHintsElement, SoGLTextureCoordinateElement, SoGLTextureEnabledElement, SoGLTextureImageElement, SoGLUpdateAreaElement, SoGLVBOElement, SoGLViewingMatrixElement, SoGLViewportRegionElement, SoLazyElement, SoLightAttenuationElement, SoLinePatternElement, SoLineWidthElement, SoLocalBBoxMatrixElement, SoMaterialBindingElement, SoModelMatrixElement, SoNormalBindingElement, SoNormalElement, SoOverrideElement, SoPickRayElement, SoPickStyleElement, SoPointSizeElement, SoPolygonOffsetElement, SoProfileCoordinateElement, SoProfileElement, SoProjectionMatrixElement, SoReplacedElement, SoShapeHintsElement, SoShapeStyleElement, SoStencilBitsElement, SoSwitchElement, SoTextureCoordinateBindingElement, SoTextureCoordinateElement, SoTextureImageElement, SoTextureMatrixElement, SoTextureQualityElement, SoTextureOverrideElement, SoUnitsElement, SoViewingMatrixElement, SoViewportRegionElement, SoViewVolumeElement, and SoWindowElement.

◆ initClass()

static void SoElement::initClass ( )
static

◆ initElements()

static void SoElement::initElements ( )
static

◆ matches()

◆ pop()

◆ print()

◆ push()

◆ setDepth()

void SoElement::setDepth ( int  dpth)
inline

Definition at line 143 of file SoElement.h.

◆ setNext()

void SoElement::setNext ( SoElement nxt)
inline

Definition at line 144 of file SoElement.h.

◆ setNextFree()

void SoElement::setNextFree ( SoElement nxt)
inline

Definition at line 146 of file SoElement.h.

◆ setNextInStack()

void SoElement::setNextInStack ( SoElement nxt)
inline

Definition at line 145 of file SoElement.h.

◆ setStackIndex()

void SoElement::setStackIndex ( int  index)
inlineprotected

Definition at line 184 of file SoElement.h.

◆ setTypeId()

void SoElement::setTypeId ( SoType  id)
inlineprotected

Definition at line 181 of file SoElement.h.

Friends And Related Symbol Documentation

◆ SoState

friend class SoState
friend

Definition at line 223 of file SoElement.h.

Member Data Documentation

◆ classStackIndex

int SoElement::classStackIndex
staticprotected

Definition at line 193 of file SoElement.h.


The documentation for this class was generated from the following file: