SoReplacedElement(3)
π SoReplacedElement(3) β the Coin manual page, bestie edition
okay so we're in section 3 of the Coin man pages, and today's main character is SoReplacedElement. she's abstract, she's a superclass, she's the blueprint behind a whole little friend group of elements, and honestly? iconic. let's get into it π
β¨ NAME β¨
SoReplacedElement β the SoReplacedElement class is an abstract element superclass.
π¦ SYNOPSIS π¦
#include <Inventor/elements/SoReplacedElement.h>
Inherits SoElement.
Inherited by SoAmbientColorElement, SoBumpMapCoordinateElement, SoBumpMapElement, SoCoordinateElement, SoDiffuseColorElement, SoEmissiveColorElement, SoEnvironmentElement, SoFontNameElement, SoGLColorIndexElement, SoGLShaderProgramElement, SoGeoElement, SoLightAttenuationElement, SoListenerDopplerElement, SoListenerOrientationElement, SoListenerPositionElement, SoNormalElement, SoPolygonOffsetElement, SoProfileCoordinateElement, SoProjectionMatrixElement, SoShininessElement, SoSoundElement, SoSpecularColorElement, SoTransparencyElement, SoViewVolumeElement, and SoViewingMatrixElement. that's the whole squad, no cap π
Public Member Functions
virtual void init(SoState *state)virtual SbBool matches(const SoElement *element) constvirtual SoElement * copyMatchInfo() constSbUniqueId getNodeId() constvirtual void print(FILE *file) const
Public Member Functions inherited from SoElement
const SoType getTypeId(void) constint getStackIndex(void) constvirtual void push(SoState *state)virtual void pop(SoState *state, const SoElement *prevTopElement)void setDepth(const int depth)int getDepth(void) constvirtual ~SoElement()
Static Public Member Functions
static SoType getClassTypeId(void)static int getClassStackIndex(void)static void initClass(void)
Static Public Member Functions inherited from SoElement
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
virtual ~SoReplacedElement()
Protected Member Functions inherited from SoElement
SoElement(void)void capture(SoState *const state) constvirtual void captureThis(SoState *state) constvoid setTypeId(const SoType typeId)void setStackIndex(const int index)SoElement * getNextInStack(void) constSoElement * getNextFree(void) const
Static Protected Member Functions
static SoElement * getElement(SoState *const state, const int stackIndex, SoNode *const node)
Static Protected Member Functions inherited from SoElement
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
SbUniqueId nodeId
Protected Attributes inherited from SoElement
SoType typeIdint stackIndexint depth
Additional Inherited Members π
Static Protected Attributes inherited from SoElement
static int classStackIndexstatic SoTypeList * stackToType
π Detailed Description π
The SoReplacedElement class is an abstract element superclass.
so like, she's the mom friend of all elements where the new element data replaces the old data β and where the data she stores isn't just some lil' simple float or integer value. it's giving "the real stuff", yk? π
Apart from this conceptual difference from her 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. (yes, that's a mouthful, but it's important, bestie.)
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. no cap, this is the whole point of the class.
See also
SoAccumulatedElement
π Constructor & Destructor Documentation π
SoReplacedElement::~SoReplacedElement(void) [protected], [virtual]
Destructor. she's leaving the group chat, bye bestie π«Ά
π₯ Member Function Documentation π₯
SoType SoReplacedElement::getClassTypeId(void) [static]
This static method returns the SoType object associated with objects of this class.
int SoReplacedElement::getClassStackIndex(void) [static]
This static method returns the state stack index for the class.
void SoReplacedElement::initClass(void) [static]
Initialize relevant common data for all instances, like the type system. gotta set up the whole vibe before anyone shows up β¨
void SoReplacedElement::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 from SoElement.
Reimplemented in SoAmbientColorElement, SoBumpMapCoordinateElement, SoBumpMapElement, SoCoordinateElement, SoDiffuseColorElement, SoEmissiveColorElement, SoEnvironmentElement, SoFontNameElement, SoGeoElement, SoGLColorIndexElement, SoGLEnvironmentElement, SoGLNormalElement, SoGLPolygonOffsetElement, SoGLShaderProgramElement, SoGLViewingMatrixElement, SoLightAttenuationElement, SoListenerDopplerElement, SoListenerOrientationElement, SoListenerPositionElement, SoNormalElement, SoPolygonOffsetElement, SoProfileCoordinateElement, SoProjectionMatrixElement, SoShininessElement, SoSoundElement, SoSpecularColorElement, SoTransparencyElement, SoViewingMatrixElement, and SoViewVolumeElement. look at them all showing up π
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.
(yes, the original says "is", not "if" β we keep the lore exactly as written, bestie, we do not edit the ancestors π)
If the application programmer's extension element has a matches() function, it should also have a copyMatchInfo() function. they're a package deal, fr fr.
Implements SoElement.
Reimplemented in SoFontNameElement, SoGLShaderProgramElement, and SoLightAttenuationElement.
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 SoFontNameElement, SoGLShaderProgramElement, and SoLightAttenuationElement.
SbUniqueId SoReplacedElement::getNodeId(void) const
Returns the node identifier for the node that previously updated the SoReplacedElement.
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.
SoElement * SoReplacedElement::getElement(SoState *const state, const int stackIndex, SoNode *const node) [static], [protected]
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. π main character energy only.
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()
π Member Data Documentation π
SbUniqueId 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. so likeβ¦ don't touch it unless you know what you're doing, bestie π«£
πΈ Author πΈ
Generated automatically by Doxygen for Coin from the source code.
π and that's the whole page!! every flag, every function, every inherited member β all present and accounted for. we do not skip sections in this house.
Version 4.0.10 β dated Thu Jun 25 2026 00:00:00 π¦ that's the sign-off, mwah, go forth and cache responsibly β¨ππ
π¦ where this page comes from
- fedora 43: Coin4-devel 4.0.10-1.fc43 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 43: Coin4-devel 4.0.10-1.fc43 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 44: Coin4-devel 4.0.10-1.fc44 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 44: Coin4-devel 4.0.10-1.fc44 Β· BSD-3-Clause AND GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms