SoElement(3)
π SoElement(3) β Coin π
okay bestie, welcome to the SoElement(3) manual page from Coin. this is part 1, and it's literally the blueprint for every element in the whole element hierarchy. no cap.
β¨ NAME β¨
SoElement β SoElement is the abstract base class for all elements. it's giving main character energy for the entire element family.
πΈ SYNOPSIS πΈ
#include <Inventor/elements/SoElement.h>
Inherited by: SoAccumulatedElement, SoCacheElement, SoCacheHintElement, SoCullElement, SoDepthBufferElement, SoFloatElement, SoGLCacheContextElement, SoGLRenderPassElement, SoGLUpdateAreaElement, SoGLVBOElement, SoInt32Element, SoLazyElement, SoLocalBBoxMatrixElement, SoMultiTextureCoordinateElement, SoMultiTextureEnabledElement, SoMultiTextureImageElement, SoOverrideElement, SoPickRayElement, SoProfilerElement, SoReplacedElement, SoResetMatrixElement, SoShapeHintsElement, SoShapeStyleElement, SoTextureCombineElement, SoTextureOverrideElement, SoViewportRegionElement, and SoWindowElement.
π Public Member Functions π
const SoType getTypeId (void) constint getStackIndex (void) constvirtual void init (SoState *state)virtual void push (SoState *state)virtual void pop (SoState *state, const SoElement *prevTopElement)virtual SbBool matches (const SoElement *element) const =0virtual SoElement * copyMatchInfo (void) const =0void setDepth (const int depth)int getDepth (void) constvirtual void print (FILE *file=stdout) constvirtual ~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) 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)static const SoElement * getConstElement (SoState *const state, const int stackIndex)static int createStackIndex (const SoType id)
π§ Protected Attributes π§
SoType typeIdint stackIndexint depth
π Static Protected Attributes π
static int classStackIndexstatic 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. lowkey the root of the whole element family tree.
π Constructor & Destructor Documentation π
SoElement::~SoElement () [virtual]
The destructor. that's it, she's done.
SoElement::SoElement (void ) [protected]
The constructor. To create element instances, use SoType::createInstance() for the elements type identifier.
β¨ Member Function Documentation β¨
void SoElement::initClass (void ) [static]
Initialize relevant common data for all instances, like the type system. iconic setup energy.
SoType SoElement::getClassTypeId (void ) [static]
This static method returns the SoType object associated with objects of this class.
int SoElement::getClassStackIndex (void ) [static]
This 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. This is used for runtime type checking and "downward" casting.
For a more thorough explanation of the runtime type identification functionality, see the documentation of SoBase::getTypeId().
int SoElement::getStackIndex (void ) const
Returns the stack index for an element instance. iykyk.
void SoElement::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 in SoAccumulatedElement, SoAmbientColorElement, SoAnnoText3CharOrientElement, SoAnnoText3FontSizeHintElement, SoAnnoText3RenderPrintElement, SoBBoxModelMatrixElement, SoBumpMapCoordinateElement, SoBumpMapElement, SoBumpMapMatrixElement, SoCacheElement, SoCacheHintElement, SoClipPlaneElement, SoComplexityElement, SoComplexityTypeElement, SoCoordinateElement, SoCreaseAngleElement, SoCullElement, SoDecimationPercentageElement, SoDecimationTypeElement, SoDepthBufferElement, SoDiffuseColorElement, SoDrawStyleElement, SoEmissiveColorElement, SoEnvironmentElement, SoFloatElement, SoFocalDistanceElement, SoFontNameElement, SoFontSizeElement, SoGeoElement, SoGLCacheContextElement, SoGLClipPlaneElement, SoGLColorIndexElement, SoGLDepthBufferElement, SoGLDrawStyleElement, SoGLEnvironmentElement, SoGLLazyElement, SoGLLightIdElement, SoGLLinePatternElement, SoGLLineWidthElement, SoGLModelMatrixElement, SoGLMultiTextureCoordinateElement, SoGLMultiTextureEnabledElement, SoGLMultiTextureImageElement, SoGLMultiTextureMatrixElement, SoGLNormalElement, SoGLPointSizeElement, SoGLPolygonOffsetElement, SoGLRenderPassElement, SoGLShaderProgramElement, SoGLShadowCullingElement, SoGLShapeHintsElement, SoGLUpdateAreaElement, SoGLVBOElement, SoGLVertexAttributeElement, SoGLViewingMatrixElement, SoGLViewportRegionElement, SoInt32Element, SoLazyElement, SoLightAttenuationElement, SoLightElement, SoLightModelElement, SoLinePatternElement, SoLineWidthElement, SoListenerDopplerElement, SoListenerGainElement, SoListenerOrientationElement, SoListenerPositionElement, SoLocalBBoxMatrixElement, SoMaterialBindingElement, SoModelMatrixElement, SoMultiTextureCoordinateElement, SoMultiTextureEnabledElement, SoMultiTextureImageElement, SoMultiTextureMatrixElement, SoNormalBindingElement, SoNormalElement, SoOverrideElement, SoPickRayElement, SoPickStyleElement, SoPointSizeElement, SoPolygonOffsetElement, SoProfileCoordinateElement, SoProfileElement, SoProjectionMatrixElement, SoReplacedElement, SoResetMatrixElement, SoShadowStyleElement, SoShapeHintsElement, SoShapeStyleElement, SoShininessElement, SoSoundElement, SoSpecularColorElement, SoSwitchElement, SoTextOutlineEnabledElement, SoTextureCombineElement, SoTextureCoordinateBindingElement, SoTextureOverrideElement, SoTextureQualityElement, SoTextureUnitElement, SoTransparencyElement, SoUnitsElement, SoVertexAttributeBindingElement, SoVertexAttributeElement, SoViewingMatrixElement, SoViewportRegionElement, SoViewVolumeElement, and SoWindowElement.
void SoElement::push (SoState * state) [virtual]
This method is called every time a new element is required in one of the stacks. This 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, SoCacheHintElement, SoClipPlaneElement, SoCullElement, SoDepthBufferElement, SoGLDepthBufferElement, SoGLDrawStyleElement, SoGLLazyElement, SoGLLightIdElement, SoGLLinePatternElement, SoGLLineWidthElement, SoGLModelMatrixElement, SoGLMultiTextureCoordinateElement, SoGLMultiTextureEnabledElement, SoGLMultiTextureImageElement, SoGLMultiTextureMatrixElement, SoGLPointSizeElement, SoGLPolygonOffsetElement, SoGLShaderProgramElement, SoGLShadowCullingElement, SoGLShapeHintsElement, SoGLUpdateAreaElement, SoGLVBOElement, SoGLViewingMatrixElement, SoGLViewportRegionElement, SoLazyElement, SoLightElement, SoLocalBBoxMatrixElement, SoModelMatrixElement, SoMultiTextureCoordinateElement, SoMultiTextureEnabledElement, SoMultiTextureImageElement, SoMultiTextureMatrixElement, SoOverrideElement, SoProfileElement, SoShapeHintsElement, SoShapeStyleElement, SoSoundElement, SoTextOutlineEnabledElement, SoTextureCombineElement, SoTextureOverrideElement, SoVertexAttributeElement, and SoWindowElement.
void SoElement::pop (SoState * state, const SoElement * prevTopElement) [virtual]
This method is called 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.
Override this method if you need to copy some state information from the previous top of stack.
Reimplemented in SoCacheElement, SoCacheHintElement, SoDepthBufferElement, SoGLClipPlaneElement, SoGLDepthBufferElement, SoGLDrawStyleElement, SoGLEnvironmentElement, SoGLLazyElement, SoGLLightIdElement, SoGLLinePatternElement, SoGLLineWidthElement, SoGLModelMatrixElement, SoGLMultiTextureCoordinateElement, SoGLMultiTextureEnabledElement, SoGLMultiTextureImageElement, SoGLMultiTextureMatrixElement, SoGLPointSizeElement, SoGLPolygonOffsetElement, SoGLProjectionMatrixElement, SoGLShaderProgramElement, SoGLShadowCullingElement, SoGLShapeHintsElement, SoGLUpdateAreaElement, SoGLVBOElement, SoGLViewingMatrixElement, SoGLViewportRegionElement, SoShapeHintsElement, SoShapeStyleElement, SoSoundElement, SoTextOutlineEnabledElement, and SoWindowElement.
SbBool SoElement::matches (const SoElement * element) const [pure virtual]
This function returns TRUE if 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.
Implemented in SoAccumulatedElement, SoCacheElement, SoCacheHintElement, SoCullElement, SoDepthBufferElement, SoFloatElement, SoFontNameElement, SoGLCacheContextElement, SoGLRenderPassElement, SoGLShaderProgramElement, SoGLUpdateAreaElement, SoGLVBOElement, SoInt32Element, SoLazyElement, SoLightAttenuationElement, SoLocalBBoxMatrixElement, SoModelMatrixElement, SoMultiTextureCoordinateElement, SoMultiTextureEnabledElement, SoMultiTextureImageElement, SoOverrideElement, SoPickRayElement, SoProfilerElement, SoReplacedElement, SoResetMatrixElement, SoShapeHintsElement, SoShapeStyleElement, SoTextureCombineElement, SoTextureOverrideElement, SoViewportRegionElement, and 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.
Used to help with scene graph traversal caching operations.
- Implemented in
SoAccumulatedElement,SoCacheElement,SoCacheHintElement,SoCullElement,SoDepthBufferElement,SoFloatElement,SoFontNameElement,SoGLCacheContextElement,SoGLRenderPassElement,SoGLShaderProgramElement,SoGLUpdateAreaElement,SoGLVBOElement,SoInt32Element,SoLazyElement,SoLightAttenuationElement,SoLocalBBoxMatrixElement,SoMultiTextureCoordinateElement,SoMultiTextureEnabledElement,SoMultiTextureImageElement,SoOverrideElement,SoPickRayElement,SoProfilerElement,SoReplacedElement,SoResetMatrixElement,SoShapeHintsElement,SoShapeStyleElement,SoTextureCombineElement,SoTextureOverrideElement,SoViewportRegionElement, andSoWindowElement. void SoElement::initElements(void)[static] β bestie, this one initializes all the built-in Coin element classes. All of them. Every single one. It's giving setup era. β¨int SoElement::getNumStackIndices(void)[static] β hands you back the number of allocated element stack index slots. That's it, that's the whole vibe. πSoType SoElement::getIdFromStackIndex(const int stackIndex)[static] β you hand it astackIndexand it gives you theSoTypeidentifier for the element class sitting at that element state stack index. Matchmaker behaviour fr fr. π«Άvoid SoElement::setDepth(const int depth)β sets thedepthvalue of the element instance in the state stack. Setting the vibe, literally.int SoElement::getDepth(void) constβ returns the state stackdepthvalue of the element instance. Reading the vibe back. πvoid SoElement::print(FILE * file = stdout) const[virtual] β this function is for printing element information, and it's used mostly for debugging purposes. So like, it's a lil peek behind the curtain, not a main-character API. π
Reimplemented in SoCoordinateElement, SoEnvironmentElement, SoFloatElement, SoFontNameElement, SoInt32Element, SoLightAttenuationElement, SoListenerDopplerElement, SoListenerOrientationElement, SoListenerPositionElement, SoOverrideElement, SoReplacedElement, SoShapeHintsElement, SoSoundElement, SoTextureOverrideElement, and SoViewportRegionElement.
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 indexstackIndex.
Okay so the returned instance is writable. But heads up: to actually make that instance, some lazy evaluation may have to be performed. So if you're not planning to modify it, use getConstElement() instead, bestie. Don't do extra work for no reason. π
If no instance is available and cannot 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 indexstackIndex. The returned element is non-mutable. Frozen. Immovable. Iconic. π§
(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.)
Like. Do NOT. I am begging. Those bugs are "wonderful" in the sarcastic way, not the slay way. π
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. Subclasses ofSoElementshould call it whenever any value in the element is accessed. (Yes, the original says "If should be called" β that's a typo in the source, we are leaving it exactly as the source has it, no cap. π)void SoElement::captureThis(SoState * state) const[protected], [virtual] β adds the element to the cache. That's the whole job. Go off, king. π
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 runtime type system.
Like, genuinely different. Different species. Do not conflate them, I'm serious. π«
void SoElement::setStackIndex(const int stackIndex)[protected] β sets the stack index in an instance. Used in constructors of derived elements. Constructor-time behaviour only, 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 inpush()to get the previous element.
This method has a slightly misleading name, but we didn't change it to stay compatible with the original SGI Inventor API.
Yeah bestie the name is a lil confusing, it is what it is, legacy code has rights. π
SoElement * SoElement::getNextFree(void) const[protected] β returns the next free element, i.e. the next element up in the stack. Opposite direction from the previous one, in case you were keeping track. π
π Member Data Documentation π
int SoElement::classStackIndex[static], [protected] β this is the static state stack index for the class. The class-wide one. The blueprint. π«ΆSoType SoElement::typeId[protected] β the element's uniqueSoTypetype identification. It's their government name. πint SoElement::stackIndex[protected] β the index in the state stack for this particular element instance. Not the class one β the individual one. Per-instance energy. πSoTypeList * SoElement::stackToType[static], [protected] β provides mapping from state stack indices to element types. It's the translator between numbers and types, and it's slaying at it. π₯int SoElement::depth[protected] β the depth of the element instance in the state stack. How deep are we, bestie? This deep. π
π Author π
Generated automatically by Doxygen for Coin from the source code. So like, nobody hand-wrote this, the robot did it, and honestly? It ate. π€β¨
And that's a wrap on SoElement(3), bestie! This one's from Coin version 4.0.10, and the page is dated Thu Jun 25 2026 00:00:00. Go forth and stack those elements responsibly. Periodt. π
π¦πΈ
π¦ 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