SoElement(3)

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

✨ SoElement(3) β€” the manual that ate and left no crumbs ✨

okay so welcome to the SoElement(3) page, bestie. This is the Library Functions Manual entry for the abstract base class that runs the whole element situation. We're doing part 1, so buckle up. πŸŽ€

πŸ’– NAME πŸ’–

SoElement β€” SoElement is the abstract base class for all elements. periodt.

🌸 SYNOPSIS 🌸

#include <Inventor/elements/SoElement.h>

Inherited by: SoAccumulatedElement, SoCacheElement, , SoCullElement, SoDepthBufferElement, SoFloatElement, , SoGLRenderPassElement, SoGLUpdateAreaElement, SoGLVBOElement, SoInt32Element, SoLazyElement, SoLocalBBoxMatrixElement, , SoMultiTextureEnabledElement, SoMultiTextureImageElement, SoOverrideElement, SoPickRayElement, SoProfilerElement, SoReplacedElement, , and SoShapeStyleElement.

🫢 Public Member Functions

  • const SoType getTypeId (void) const
  • int getStackIndex (void) const
  • virtual void init (SoState *state)
  • virtual void push (SoState *state)
  • virtual void pop (SoState *state, const SoElement *prevTopElement)
  • virtual SbBool matches (const SoElement *element) const =0
  • virtual SoElement * copyMatchInfo (void) const =0
  • void setDepth (const int depth)
  • int getDepth (void) const
  • virtual void print (FILE *file=stdout) const
  • virtual ~SoElement ()

🌟 Static Public Member Functions

  • 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

  • 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)
  • static const SoElement * getConstElement (SoState *const state, const int stackIndex)
  • static int createStackIndex (const SoType id)

πŸ“ Protected Attributes

  • SoType typeId
  • int stackIndex
  • int depth

🌈 Static Protected Attributes

  • static int classStackIndex
  • static SoTypeList * stackToType

πŸ‘‘ Detailed Description πŸ‘‘

SoElement is the abstract base class for all elements.

This is the base class for all the element classes in Coin. main character energy. πŸ’…


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

SoElement::~SoElement () [virtual]

The destructor. 😭

SoElement::SoElement (void ) [protected]

The constructor. To create element instances, use SoType::createInstance() for the elements type identifier.. (two periods, we're not fixing it.)


πŸ”₯ Member Function Documentation πŸ”₯

void SoElement::initClass (void ) [static]

This one sets up all the relevant common data for every instance, like the type system. iconic. ✨

SoType SoElement::getClassTypeId (void ) [static]

Static bestie that hands you back the class type. πŸ’…

int SoElement::getClassStackIndex (void ) [static]

Static method, returns the state stack index for the class. periodt.

const SoType SoElement::getTypeId (void ) const

Returns the type identification of an object derived from a class inheriting SoElement. It's giving run-time type checking and "downward" casting energy. πŸ¦‹

For a more thorough explanation of the run-time type identification functionality, see the documentation of SoBase::getTypeId().

int SoElement::getStackIndex (void ) const

Returns the stack index for an element instance. no cap. πŸ’…

void SoElement::init (SoState * state) [virtual]

This function initializes the element type in the given SoState. It gets called for the first element of each enabled element type in SoState objects. lowkey important. ✨

Reimplemented in:

  • SoAccumulatedElement
  • SoAmbientColorElement
  • SoAnnoText3CharOrientElement
  • SoAnnoText3FontSizeHintElement
  • SoAnnoText3RenderPrintElement
  • SoBBoxModelMatrixElement
  • SoBumpMapCoordinateElement
  • SoBumpMapMatrixElement
  • SoCacheElement
  • SoClipPlaneElement
  • SoComplexityElement
  • SoComplexityTypeElement
  • SoCoordinateElement
  • SoCreaseAngleElement
  • SoCullElement
  • SoDecimationPercentageElement
  • SoDecimationTypeElement
  • SoDepthBufferElement
  • SoDiffuseColorElement
  • SoDrawStyleElement
  • SoEmissiveColorElement
  • SoEnvironmentElement
  • SoFloatElement
  • SoFocalDistanceElement
  • SoFontNameElement
  • SoFontSizeElement
  • SoGeoElement
  • SoGLClipPlaneElement
  • SoGLColorIndexElement
  • SoGLDepthBufferElement
  • SoGLDrawStyleElement
  • SoGLEnvironmentElement
  • SoGLLazyElement
  • SoGLLightIdElement
  • SoGLLinePatternElement
  • SoGLLineWidthElement
  • SoGLModelMatrixElement
  • SoGLMultiTextureCoordinateElement
  • SoGLMultiTextureImageElement
  • SoGLMultiTextureMatrixElement
  • SoGLNormalElement
  • SoGLPointSizeElement
  • SoGLPolygonOffsetElement
  • SoGLRenderPassElement
  • SoGLShadowCullingElement
  • SoGLShapeHintsElement
  • SoGLTexture3EnabledElement
  • SoGLTextureCoordinateElement
  • SoGLTextureEnabledElement
  • SoGLTextureImageElement
  • SoGLTextureMatrixElement
  • SoGLUpdateAreaElement
  • SoGLVBOElement
  • SoGLViewingMatrixElement
  • SoGLViewportRegionElement
  • SoInt32Element
  • SoLazyElement
  • SoLightAttenuationElement
  • SoLightElement
  • SoLightModelElement
  • SoLinePatternElement
  • SoLineWidthElement
  • SoListenerDopplerElement
  • SoListenerGainElement
  • SoListenerOrientationElement
  • SoListenerPositionElement
  • SoLocalBBoxMatrixElement
  • SoMaterialBindingElement
  • SoModelMatrixElement
  • SoMultiTextureEnabledElement
  • SoMultiTextureImageElement
  • SoMultiTextureMatrixElement
  • SoNormalBindingElement
  • SoNormalElement
  • SoOverrideElement
  • SoPickRayElement
  • SoPickStyleElement
  • SoPointSizeElement
  • SoPolygonOffsetElement
  • SoProfileCoordinateElement
  • SoProfileElement
  • SoReplacedElement
  • SoShadowStyleElement
  • SoShapeStyleElement
  • SoShininessElement
  • SoSoundElement
  • SoSpecularColorElement
  • SoSwitchElement
  • SoTextOutlineEnabledElement
  • SoTextureCombineElement
  • SoTextureCoordinateBindingElement
  • SoTextureCoordinateElement
  • SoTextureEnabledElement
  • SoTextureImageElement
  • SoTextureMatrixElement
  • SoTextureOverrideElement
  • SoTextureQualityElement
  • SoTextureUnitElement
  • SoTransparencyElement
  • SoUnitsElement
  • SoVertexAttributeBindingElement
  • SoViewingMatrixElement
  • SoViewportRegionElement
  • SoViewVolumeElement
  • SoWindowElement

void SoElement::push (SoState * state) [virtual]

Called every single time a new element is required in one of the stacks. That happens when a writable element is requested, using SoState::getElement() or indirectly SoElement::getElement(), and the depth of the current element is less than the state depth. πŸ’€

Override this method if your element needs to copy data from the previous top of stack. The push() method is called on the new element, and the previous element can be found using SoElement::getNextInStack().

Reimplemented in:

  • SoAccumulatedElement
  • SoBBoxModelMatrixElement
  • SoBumpMapMatrixElement
  • SoCacheElement
  • SoClipPlaneElement
  • SoCullElement
  • SoDepthBufferElement
  • SoGLDepthBufferElement
  • SoGLDrawStyleElement
  • SoGLLazyElement
  • SoGLLightIdElement
  • SoGLLinePatternElement
  • SoGLLineWidthElement
  • SoGLModelMatrixElement
  • SoGLMultiTextureCoordinateElement
  • SoGLMultiTextureImageElement
  • SoGLMultiTextureMatrixElement
  • SoGLPointSizeElement
  • SoGLPolygonOffsetElement
  • SoGLShadowCullingElement
  • SoGLShapeHintsElement
  • SoGLTexture3EnabledElement
  • SoGLTextureCoordinateElement
  • SoGLTextureEnabledElement
  • SoGLTextureImageElement
  • SoGLUpdateAreaElement
  • SoGLVBOElement
  • SoGLViewingMatrixElement
  • SoGLViewportRegionElement
  • SoLazyElement
  • SoLightElement
  • SoLocalBBoxMatrixElement
  • SoModelMatrixElement
  • SoMultiTextureEnabledElement
  • SoMultiTextureImageElement
  • SoMultiTextureMatrixElement
  • SoOverrideElement
  • SoProfileElement
  • SoShapeStyleElement
  • SoSoundElement
  • SoTextOutlineEnabledElement
  • SoTextureCombineElement
  • SoTextureMatrixElement
  • SoTextureOverrideElement
  • SoWindowElement

void SoElement::pop (SoState * state, const SoElement * prevTopElement) [virtual]

This method is callled when the state is popped, and the depth of the element is bigger than the current state depth. pop() is called on the new top of stack, and a pointer to the previous top of stack is passed in prevTopElement. (yes, "callled" is literally in the original, we keep it.) 😭

Override this method if you need to copy some state information from the previous top of stack.

Reimplemented in:

  • SoCacheElement
  • SoDepthBufferElement
  • SoGLClipPlaneElement
  • SoGLDepthBufferElement
  • SoGLDrawStyleElement
  • SoGLEnvironmentElement
  • SoGLLazyElement
  • SoGLLightIdElement
  • SoGLLinePatternElement
  • SoGLLineWidthElement
  • SoGLModelMatrixElement
  • SoGLMultiTextureCoordinateElement
  • SoGLMultiTextureImageElement
  • SoGLMultiTextureMatrixElement
  • SoGLPointSizeElement
  • SoGLPolygonOffsetElement
  • SoGLProjectionMatrixElement
  • SoGLShadowCullingElement
  • SoGLShapeHintsElement
  • SoGLTexture3EnabledElement
  • SoGLTextureCoordinateElement
  • SoGLTextureEnabledElement
  • SoGLTextureImageElement
  • SoGLTextureMatrixElement
  • SoGLUpdateAreaElement
  • SoGLVBOElement
  • SoGLViewingMatrixElement
  • SoGLViewportRegionElement
  • SoShapeStyleElement
  • SoSoundElement
  • SoTextOutlineEnabledElement
  • SoWindowElement

SbBool SoElement::matches (const SoElement * element) const [pure virtual]

This function returns TRUE is the element matches another element (of the same class), with respect to cache validity. (typo "is" stays, bestie.) 🫢

If the application programmer's extension element has a matches() function, it should also have a copyMatchInfo() function.

Implemented in:

  • SoAccumulatedElement
  • SoCacheElement
  • SoCullElement
  • SoDepthBufferElement
  • SoFloatElement
  • SoFontNameElement
  • SoGLRenderPassElement
  • SoGLUpdateAreaElement
  • SoGLVBOElement
  • SoInt32Element
  • SoLazyElement
  • SoLightAttenuationElement
  • SoLocalBBoxMatrixElement
  • SoModelMatrixElement
  • SoMultiTextureEnabledElement
  • SoMultiTextureImageElement
  • SoOverrideElement
  • SoPickRayElement
  • SoProfilerElement
  • SoReplacedElement
  • SoShapeStyleElement
  • SoTextureCombineElement
  • SoTextureOverrideElement
  • SoViewportRegionElement
  • SoWindowElement

virtual SoElement * SoElement::copyMatchInfo (void ) const [pure virtual]

This function creates a copy of the element that contains enough information to enable the matches() function to work. it's giving clone energy. ✨

Used to help with scenegraph traversal caching operations.

Implemented in:

  • SoAccumulatedElement
  • SoCacheElement
  • SoCullElement
  • SoDepthBufferElement
  • SoFloatElement
  • SoFontNameElement
  • SoGLRenderPassElement
  • SoGLUpdateAreaElement
  • SoGLVBOElement
  • SoInt32Element
  • SoLazyElement
  • SoLightAttenuationElement
  • SoLocalBBoxMatrixElement
  • SoMultiTextureEnabledElement
  • SoMultiTextureImageElement
  • SoOverrideElement
  • SoPickRayElement
  • SoProfilerElement
  • SoReplacedElement
  • SoShapeStyleElement
  • SoTextureCombineElement
  • SoTextureOverrideElement
  • SoViewportRegionElement
  • SoWindowElement

void SoElement::initElements (void ) [static]

This function initializes all the built-in Coin element classes. all of them. every single one. πŸ‘‘

int SoElement::getNumStackIndices (void ) [static]

Returns the number of allocated element stack index slots. πŸ’…

SoType SoElement::getIdFromStackIndex (const int stackIndex) [static]

Returns the SoType identifier for the element class with element state stack index stackIndex. iykyk. 🌸

void SoElement::setDepth (const int depth) 🌊

Sets the depth value of the element instance in the state stack. That's it, that's the whole job. depth goes in, depth gets set. πŸ’…

int SoElement::getDepth (void ) const πŸ“

Returns the state stack depth value of the element instance. You give it nothing, it gives you the depth. iconic exchange honestly. ✨

void SoElement::print (FILE * file = stdout) const [virtual] πŸ–¨οΈ

This function is for printing element information, and it's used mostly for debugging purposes. It defaults to stdout if you don't hand it a file, bestie.

Reimplemented in SoCoordinateElement, SoEnvironmentElement, SoFloatElement, SoFontNameElement, SoInt32Element, SoLightAttenuationElement, SoListenerDopplerElement, SoListenerOrientationElement, SoListenerPositionElement, SoOverrideElement, SoReplacedElement, SoSoundElement, SoTextureOverrideElement, and SoViewportRegionElement. That's a whole squad of overrides, no cap. πŸŽ€

SoElement * SoElement::getElement (SoState *const state, const int stackIndex) [inline], [static], [protected] πŸ”

This method returns the top instance (in the state stack) of the element class with stack index stackIndex.

The returned instance is writable. To make this instance, some lazy evaluation may have to be performed, so use getConstElement() instead if the instance shouldn't be modified. Respect the vibe of const, fr fr.

If no instance is available and can not be made, NULL is returned. 😭

See also

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

const SoElement * SoElement::getConstElement (SoState *const state, const int stackIndex) [inline], [static], [protected] πŸ”’

This method returns a reference to the top element of the class with stack index stackIndex. The returned element is non-mutable.

(Don't try to be clever and cast away the constness β€” if the returned instance is modified, strange, hard to find and generally wonderful bugs will most likely start to happen.)

Not me warning you in advance. The bugs are described as "wonderful" and honestly that's the most sarcastic thing in this whole manpage. πŸ™ˆ

If no instance can be returned, NULL is returned.

See also

  • SoElement * SoElement::getElement(SoState * const state, const int stackIndex)

void SoElement::capture (SoState *const state) const [inline], [protected] πŸ“Έ

This function does whatever is necessary in the state for caching purposes. It should be called by subclasses of SoElement whenever any value in the element is accessed. Capture the moment, bestie. ✨

void SoElement::captureThis (SoState * state) const [protected], [virtual] 🧺

Adds the element to the cache. Simple as that.

Reimplemented in SoAccumulatedElement.

void SoElement::setTypeId (const SoType typeId) [protected] 🏷️

Sets the type identifier of an instance.

Note that this is fundamentally different from the SoNode run-time type system. Like, don't mix these two up, they are not the same thing, periodt.

void SoElement::setStackIndex (const int stackIndex) [protected] πŸ“š

Sets the stack index in an instance. Used in constructors of derived elements. Constructor business, iykyk.

int SoElement::createStackIndex (const SoType typeId) [static], [protected] πŸ†•

Returns the value of a new available stack index. Fresh index just dropped. πŸ’…

SoElement * SoElement::getNextInStack (void ) const [protected] ⬇️

Returns the next element down in the stack. Should be used in push() to get the previous element.

This method has a slightly misleading name, but it wasn't changed, to stay compatible with the original SGI Inventor API. Legacy naming rights, we respect them. 🫢

SoElement * SoElement::getNextFree (void ) const [protected] ⬆️

Returns the next free element, ie the next element up in the stack. Opposite direction from getNextInStack, don't get it twisted. 🌈


πŸ’Ύ Member Data Documentation πŸ’Ύ

  • int SoElement::classStackIndex [static], [protected] β€” This is the static state stack index for the class.
  • SoType SoElement::typeId [protected] β€” The element's unique SoType type identification. One of a kind, main character energy. πŸ‘‘
  • int SoElement::stackIndex [protected] β€” The index in the state stack for this particular element instance.
  • SoTypeList * SoElement::stackToType [static], [protected] β€” Provides mapping from state stack indices to element types. The whole glow-up map, basically.
  • int SoElement::depth [protected] β€” The depth of the element instance in the state stack.

✍️ Author ✍️

Generated automatically by Doxygen for Coin from the source code. Not a human, just a robot doing its little robot thing. πŸ€–πŸŒΈ


And that's the whole page, bestie β€” this is from Coin, Version 3.1.3, and the page is SoElement(3). Go forth and stack those elements responsibly. πŸ’–πŸ¦‹βœ¨

πŸ“¦ where this page comes from