Coin  4.0.3
Coin3D core library
Loading...
Searching...
No Matches
SoReplacedElement Class Reference

The SoReplacedElement class is an abstract element superclass. More...

#include <Inventor/elements/SoReplacedElement.h>

Inheritance diagram for SoReplacedElement:
SoElement SoAmbientColorElement SoBumpMapCoordinateElement SoBumpMapElement SoCoordinateElement SoDiffuseColorElement SoEmissiveColorElement SoEnvironmentElement SoFontNameElement SoGLColorIndexElement SoGLShaderProgramElement SoGeoElement SoLightAttenuationElement SoListenerDopplerElement SoListenerOrientationElement SoListenerPositionElement SoNormalElement SoPolygonOffsetElement SoProfileCoordinateElement SoProjectionMatrixElement SoShininessElement SoSoundElement SoSpecularColorElement SoTransparencyElement SoViewVolumeElement SoViewingMatrixElement

Public Member Functions

virtual SoElementcopyMatchInfo () const
 
SbUniqueId getNodeId () const
 
virtual void init (SoState *state)
 
virtual SbBool matches (const SoElement *element) const
 
virtual void print (FILE *file) const
 
- Public Member Functions inherited from SoElement
virtual ~SoElement ()
 
int getDepth (void) const
 
int getStackIndex (void) const
 
const SoType getTypeId (void) const
 
virtual void pop (SoState *state, const SoElement *prevTopElement)
 
virtual void push (SoState *state)
 
void setDepth (const int depth)
 

Static Public Member Functions

static int getClassStackIndex (void)
 
static SoType getClassTypeId (void)
 
static void initClass (void)
 
- Static Public Member Functions inherited from SoElement
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

virtual ~SoReplacedElement ()
 
- Protected Member Functions inherited from SoElement
 SoElement (void)
 
void capture (SoState *const state) const
 
virtual void captureThis (SoState *state) const
 
SoElementgetNextFree (void) const
 
SoElementgetNextInStack (void) const
 
void setStackIndex (const int index)
 
void setTypeId (const SoType typeId)
 

Static Protected Member Functions

static SoElementgetElement (SoState *const state, const int stackIndex, SoNode *const node)
 
- Static Protected Member Functions inherited from SoElement
static int createStackIndex (const SoType id)
 
static const SoElementgetConstElement (SoState *const state, const int stackIndex)
 
static SoElementgetElement (SoState *const state, const int stackIndex)
 

Protected Attributes

SbUniqueId nodeId
 
- Protected Attributes inherited from SoElement
int depth
 
int stackIndex
 
SoType typeId
 

Additional Inherited Members

- Static Protected Attributes inherited from SoElement
static int classStackIndex
 
static SoTypeListstackToType
 

Detailed Description

The SoReplacedElement class is an abstract element superclass.

This is the superclass of all elements where the new element data replaces the old data, and where the data the element stores is not just a simple float or integer value.

Apart from this conceptual difference from its superclass, the SoReplacedElement class also overloads the default getElement() method to include a node reference. This reference is used to fetch the unique node identification number of the node that last changed the element.

The identifier values of nodes in the scene graph is updated upon any kind of change to a node, so this technique plays an important role in the construction, validation and destruction of internal scene graph caches.

See also
SoAccumulatedElement

Constructor & Destructor Documentation

◆ ~SoReplacedElement()

SoReplacedElement::~SoReplacedElement ( void )
protectedvirtual

Destructor.

Member Function Documentation

◆ copyMatchInfo()

SoElement * SoReplacedElement::copyMatchInfo ( void ) const
virtual

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.

Implements SoElement.

Reimplemented in SoGLShaderProgramElement, SoFontNameElement, and SoLightAttenuationElement.

◆ getClassStackIndex()

int SoReplacedElement::getClassStackIndex ( void )
static

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

◆ getClassTypeId()

SoType SoReplacedElement::getClassTypeId ( void )
static

This static method returns the SoType object associated with objects of this class.

◆ getElement()

SoElement * SoReplacedElement::getElement ( SoState *const state,
const int stackIndex,
SoNode *const node )
staticprotected

This function overloads SoElement::getElement() with an extra node parameter, to let us set the SoReplacedElement::nodeId in the element instance before returning.

SoReplacedElement subclasses should use this method to get writable instances.

The identifier values of nodes in the scene graph is updated upon any kind of change to a node, so this technique plays an important role in the construction, validation and destruction of internal scene graph caches.

See also
SoElement::getElement()

◆ getNodeId()

SbUniqueId SoReplacedElement::getNodeId ( void ) const

Returns the node identifier for the node that previously updated the SoReplacedElement.

◆ init()

◆ initClass()

void SoReplacedElement::initClass ( void )
static

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

◆ matches()

SbBool SoReplacedElement::matches ( const SoElement * element) const
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.

Implements SoElement.

Reimplemented in SoFontNameElement, SoGLShaderProgramElement, and SoLightAttenuationElement.

◆ print()

void SoReplacedElement::print ( FILE * file) const
virtual

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

Reimplemented from SoElement.

Reimplemented in SoCoordinateElement, SoEnvironmentElement, SoFontNameElement, SoLightAttenuationElement, SoListenerDopplerElement, SoListenerOrientationElement, SoListenerPositionElement, and SoSoundElement.

Member Data Documentation

◆ nodeId

uint32_t SoReplacedElement::nodeId
protected

This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.


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