SoReplacedElement(3)

πŸ“¦ version 2.5.0, in fedora 43, fedora 44

πŸŽ€ NAME πŸŽ€

SoReplacedElement β€” it's the abstract element superclass, bestie. That's the whole name, no notes. (This is the page for SoReplacedElement(3) from the Library Functions Manual, mwah πŸ’–)


✨ SYNOPSIS ✨

#include <Inventor/elements/SoReplacedElement.h>

Inherits SoElement.

Inherited by SoGLColorIndexElement, SoListenerDopplerElement, SoListenerOrientationElement, and SoListenerPositionElement. Not me having a whole little family tree 🫢

🌸 Public Member Functions 🌸

virtual void init (SoState *state)
virtual SbBool matches (const SoElement *element) const
virtual SoElement * copyMatchInfo () const
uint32_t getNodeId () const
virtual void print (FILE *file) const

Public Member Functions inherited from SoElement:

const SoType getTypeId (void) const
int getStackIndex (void) const
virtual void push (SoState *state)
virtual void pop (SoState *state, const SoElement *prevTopElement)
void setDepth (const int depth)
int getDepth (void) const
virtual ~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) 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, 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 🌈

uint32_t nodeId

Protected Attributes inherited from SoElement:

SoType typeId
int stackIndex
int depth

🧚 Additional Inherited Members 🧚

Static Protected Attributes inherited from SoElement:

static int classStackIndex
static SoTypeList * stackToType

πŸ‘‘ Detailed Description πŸ‘‘

SoReplacedElement is the abstract element superclass. Periodt.

It's the superclass of all the 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. Like, it's giving "big girl data storage" energy, not "one lil number" energy, yk?

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. Iconic behaviour honestly.

The identifier values of nodes in the scenegraph 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 scenegraph caches. No cap, this is the load-bearing part πŸ”₯

πŸ‘€ See also

  • SoAccumulatedElement

πŸ’… Constructor & Destructor Documentation πŸ’…

SoReplacedElement::~SoReplacedElement (void ) [protected], [virtual]

Destructor. It destructs. Slay πŸ’€ (it's protected, so bestie, you can't just call it from anywhere, iykyk)


πŸ“ Member Function Documentation πŸ“

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. First one in gets the glow-up ✨

Reimplemented from SoElement.

Reimplemented in SoGLColorIndexElement, SoListenerDopplerElement, SoListenerOrientationElement, and SoListenerPositionElement.

References SoElement::init(), and nodeId.

Referenced by SoListenerDopplerElement::init(), SoListenerOrientationElement::init(), and SoListenerPositionElement::init().

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", we're keeping it, it's part of the charm πŸ™ˆ)

If the application programmer's extension element has a matches() function, it should also have a copyMatchInfo() function. They're a package deal, like us 🫢

Implements SoElement.

References nodeId, and SoElement::SoElement().

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. It's literally handing matches() its homework answers.

Used to help with scenegraph traversal caching operations.

Implements SoElement.

References SoElement::getTypeId(), and nodeId.

uint32_t SoReplacedElement::getNodeId (void ) const

Returns the node identifier for the node that previously updated the SoReplacedElement. Like a little name tag for whoever touched it last 🏷️

References nodeId.

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

This function is for printing element information, and is used mostly for debugging purposes. It's the "wait let me see what's going on in here" function.

Reimplemented from SoElement.

Reimplemented in SoListenerDopplerElement, SoListenerOrientationElement, and SoListenerPositionElement.

References SoType::getName(), SbName::getString(), and SoElement::getTypeId().

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. Extra arg, extra power πŸ’…

SoReplacedElement subclasses should use this method to get writable instances.

The identifier values of nodes in the scenegraph 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 scenegraph caches. (Yes it says it again. It's important. Let it cook.)

πŸ‘€ See also

  • SoElement::getElement()

References SoElement::getElement(), SoNode::getNodeId(), nodeId, and SoElement::stackIndex.


🌸 Member Data Documentation 🌸

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. So like… bestie, don't touch, it's not for you, it's for the library's own business πŸ’…

Referenced by copyMatchInfo(), getElement(), getNodeId(), init(), and matches().


πŸŽ€ Author πŸŽ€

Generated automatically by Doxygen for Coin from the source code. (Not a human, just a lil robot doing its best 🫢)


Okay that's the whole page, you ate that fr fr. Go forth and write your own replaced elements, main character.

This has been SoReplacedElement(3) from the Library Functions Manual, brought to you by Coin, Version 2.5.0 β€” that's the source and the version, bestie, sign-off complete, mwah πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from