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. More...
 
virtual void push (SoState *state)
 Pushes/pops element. More...
 
virtual void pop (SoState *state, const SoElement *prevTopElement)
 
virtual void print (FILE *fp) const
 Prints element (for debugging) More...
 
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. More...
 
virtual SoElementcopyMatchInfo () const =0
 Create a copy that we can put in a cache used list and call matches() on later. More...
 
SoType getTypeId () const
 Returns type identifier for element instance. More...
 
int getStackIndex () const
 Returns the stack index for an element instance. More...
 
void setDepth (int dpth)
 Sets stuff in an element instance. More...
 
void setNext (SoElement *nxt)
 
void setNextInStack (SoElement *nxt)
 
void setNextFree (SoElement *nxt)
 
int getDepth () const
 Returns stuff from element instance. More...
 
SoElementgetNext () const
 
virtual ~SoElement ()
 Destructor. More...
 

Static Public Member Functions

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

Protected Member Functions

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

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. More...
 
static const SoElementgetConstElement (SoState *state, int stackIndex)
 Returns a read-only pointer to the top instance in the given element stack. More...
 
static int createStackIndex (SoType id)
 Creates and returns a new stack index. More...
 

Static Protected Attributes

static int classStackIndex
 Stack index for SoElement class. More...
 

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

◆ 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 Function 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: