coin_elements(3)
πΈ NAME πΈ
coin_elements β Element Classes π
okay bestie, welcome to Coin lore 101, sit down, get comfy π«Ά
So. The element classes in Coin are literally the containers of state information during action traversals of scene graphs. β¨
That's it. That's the whole vibe of this page. The element classes = the lil holders, the carriers, the keepers of the state while actions go traversal-ing through scene graphs. They're holding the state so nobody else has to, and honestly? iconic behavior π
fr fr, if you're new here: scene graphs get walked (that's the "traversal" part), actions are what do the walking, and the element classes are the ones keeping track of all the state while that's happening. main character energy, no cap π
more of this page is coming, so don't go anywhere β this was just the name drop, the rest is gonna eat π
β¨ SYNOPSIS β¨
π Classes π
class SoGLCacheContextElementβ okay so this class handles the OpenGL cache for a context, periodt. It's the cache manager for your GL context, bestie. β¨class SoGLClipPlaneElementβ this one is yet to be documented, so it's giving mystery for now π. πclass SoGLColorIndexElementβ sets the current OpenGL color, no cap. π¨class SoGLCoordinateElementβ yet to be documented, bestie β we're in the dark for now π. π¦class SoGLDepthBufferElementβ controls the OpenGL depth buffer, lowkey important. πclass SoGLDrawStyleElementβ updates the current draw style in OpenGL, slay. πclass SoGLEnvironmentElementβ is for setting GL fog etc., iconic. π₯class SoGLLazyElementβ is meant to optimize GL rendering, highkey doing the most. πclass SoGLLightIdElementβ yet to be documented, so it's a mystery for now π. πΈclass SoGLLinePatternElementβ changes the line stipple pattern of the OpenGL render state, periodt. β¨class SoGLLineWidthElementβ changes the line width setting of the OpenGL render state, bestie. πclass SoGLModelMatrixElementβ yet to be documented β no tea yet, just vibes π«. π§class SoGLMultiTextureCoordinateElementβ stores the current gltexture coordinates for several units, fr fr. πclass SoGLMultiTextureEnabledElementβ is an element which controls whether texturing is enabled or not, no cap. πclass SoGLMultiTextureMatrixElementβ is used to update the OpenGL texture matrix, periodt. β¨class SoGLMultiTextureImageElementβ is used to control the current GL texture for texture units, slay. πclass SoGLNormalElementβ yet to be documented, bestie β it's giving mystery π. π¦class SoGLPointSizeElementβ changes the point size setting of the OpenGL render state, lowkey. π₯class SoGLPolygonOffsetElementβ yet to be documented, so we're waiting on the docs π. πclass SoGLProjectionMatrixElementβ yet to be documented β no cap, it's a mystery π«. πΈclass SoGLRenderPassElementβ yet to be documented, bestie β we're in the dark π. β¨class SoGLShapeHintsElementβ yet to be documented, so it's a mystery for now π. πclass SoGLUpdateAreaElementβ yet to be documented β no tea yet, just vibes π«. π§class SoGLVBOElementβ is used to store VBO state, lowkey. πclass SoGLViewingMatrixElementβ is used to store the current viewing matrix, highkey. πclass SoGLViewportRegionElementβ yet to be documented, bestie β it's giving mystery π. β¨class SoGLDisplayListβ stores and manages OpenGL display lists, iconic. πclass SoGLVertexAttributeElementβ yet to be documented, so we're waiting on the docs π. π¦class SoAccumulatedElementβ is an abstract class for storing accumulated state, periodt. π₯class SoAmbientColorElementβ yet to be documented β no cap, it's a mystery π«. πclass SoAnnoText3CharOrientElementβ yet to be documented, bestie β we're in the dark π. πΈclass SoAnnoText3FontSizeHintElementβ yet to be documented, so it's a mystery for now π. β¨class SoAnnoText3RenderPrintElementβ yet to be documented β no tea yet, just vibes π«. πclass SoBBoxModelMatrixElementβ keeps track of the current model matrix during a scene graph traversal. It is used by amongst others theSoGetBoundingBoxActionclass, no cap. π§class SoBumpMapElementβ yet to be documented, bestie β it's giving mystery π. πclass SoBumpMapCoordinateElementβ yet to be documented, so we're waiting on the docs π. πclass SoBumpMapMatrixElementβ is used to manage the bump map matrix stack, slay. β¨class SoCacheElementβ stores and manages the open caches, bestie. πclass SoCacheHintElementβ yet to be documented β no cap, it's a mystery π«. π¦class SoClipPlaneElementβ is used to manage the clip plane stack, periodt. π₯class SoComplexityElementβ contains the current shape complexity for a graph traverser, fr fr. πclass SoComplexityTypeElementβ yet to be documented, bestie β we're in the dark π. πΈclass SoCoordinateElementβ yet to be documented, so it's a mystery for now π. β¨class SoCreaseAngleElementβ stores the crease angle during a scene graph traversal, lowkey. πclass SoCullElementβ is used internally for render and pick culling, highkey. π§class SoDecimationPercentageElementβ yet to be documented β no tea yet, just vibes π«. πclass SoDecimationTypeElementβ yet to be documented, bestie β it's giving mystery π. πclass SoDepthBufferElementβ controls the depth buffer settings, periodt. β¨class SoDiffuseColorElementβ yet to be documented, so we're waiting on the docs π. πclass SoDrawStyleElementβ yet to be documented β no cap, it's a mystery π«. π¦class SoElementβ is the abstract base class for all elements, iconic. πclass SoEmissiveColorElementβ yet to be documented, bestie β we're in the dark π. πclass SoEnvironmentElementβ yet to be documented, so it's a mystery for now π. πΈclass SoFloatElementβ is an abstract base class for elements that consists of a single float value, bestie. β¨class SoFocalDistanceElementβ yet to be documented β no tea yet, just vibes π«. πclass SoFontNameElementβ yet to be documented, bestie β it's giving mystery π. π§class SoFontSizeElementβ yet to be documented, so we're waiting on the docs π. πclass SoInt32Elementβ is the base class for elements that simply store a 32-bit integer, no cap. πclass SoLazyElementβ is used to handle material and shape properties, slay. β¨class SoLightAttenuationElementβ yet to be documented β no cap, it's a mystery π«. πclass SoLightElementβ manages the currently active light sources, periodt. π¦class SoLightModelElementβ yet to be documented, bestie β we're in the dark π. π₯class SoLinePatternElementβ defines the line stipple pattern, fr fr. πclass SoLineWidthElementβ changes the line width setting of the render state, lowkey. πΈclass SoLocalBBoxMatrixElementβ yet to be documented, so it's a mystery for now π. β¨class SoMaterialBindingElementβ yet to be documented β no tea yet, just vibes π«. πclass SoVertexAttributeBindingElementβ yet to be documented, bestie β it's giving mystery π. π§class SoMultiTextureCoordinateElementβ yet to be documented, so we're waiting on the docs π. πclass SoMultiTextureEnabledElementβ is an element which stores whether texturing is enabled or not, no cap. πclass SoMultiTextureMatrixElementβ is used to manage the texture matrix stack for texture units > 0, periodt. β¨class SoMultiTextureImageElementβ yet to be documented β no cap, it's a mystery π«. πclass SoModelMatrixElementβ is used to manage the current transformation, highkey. π¦class SoNormalBindingElementβ is yet to be documented, bestie β we're in the dark π. π₯class SoNormalElementβ is yet to be documented, so it's a mystery for now π. πclass SoOverrideElementβ maintains a list of overridable elements and a list over which elements should be overridden, bestie. πΈclass SoPickRayElementβ yet to be documented β no tea yet, just vibes π«. β¨class SoPickStyleElementβ is yet to be documented, bestie β it's giving mystery π. πclass SoPointSizeElementβ changes the point size setting of the render state, periodt. π§class SoPolygonOffsetElementβ yet to be documented, so we're waiting on the docs π. πclass SoProfileCoordinateElementβ yet to be documented β no cap, it's a mystery π«. πclass SoProfileElementβ yet to be documented, bestie β we're in the dark π. β¨class SoProjectionMatrixElementβ yet to be documented, so it's a mystery for now π. πclass SoReplacedElementβ is an abstract element superclass, iconic. π¦class SoShapeHintsElementβ yet to be documented β no tea yet, just vibes π«. π₯class SoShapeStyleElementβ yet to be documented, bestie β it's giving mystery π. πclass SoShininessElementβ yet to be documented, so we're waiting on the docs π. πΈclass SoSpecularColorElementβ is yet to be documented β no cap, it's a mystery π«. β¨class SoSwitchElementβ yet to be documented, bestie β we're in the dark π. πclass SoTextOutlineEnabledElementβ yet to be documented, so it's a mystery for now π. π§class SoTextureCombineElementβ yet to be documented β no tea yet, just vibes π«. πclass SoTextureCoordinateBindingElementβ yet to be documented, bestie β it's giving mystery π. πclass SoTextureOverrideElementβ makes it possible to override texture elements, no cap. β¨class SoTextureUnitElementβ yet to be documented, so we're waiting on the docs π. πclass SoTextureQualityElementβ is yet to be documented β no cap, it's a mystery π«. π¦class SoTransparencyElementβ yet to be documented, bestie β we're in the dark π. π₯class SoUnitsElementβ yet to be documented, so it's a mystery for now π. πclass SoViewVolumeElementβ yet to be documented β no tea yet, just vibes π«. πΈclass SoViewingMatrixElementβ stores the world-to-camera transformation, slay. β¨class SoViewportRegionElementβ yet to be documented, bestie β it's giving mystery π. πclass SoWindowElementβ is used to store current window attributes, fr fr. π§class SoListenerPositionElementβ holds the position of the current listener, lowkey. πclass SoListenerOrientationElementβ holds the orientation of the current listener, highkey. πclass SoListenerGainElementSoListenerGainElementβ this one is the lil keeper of theSoListenergain while a scene graph is being traversed π§SoListenerDopplerElementβ holds the Doppler velocity and the factor of whichever listener is current right now πSoSoundElementβ exists so audio rendering can be optimized and so inactiveSoVRMLSoundnodes can get turned off π€SoVertexAttributeElementβ bestieβ¦ this class is yet to be documented πSoShadowStyleElementβ also yet to be documented, no cap πSoGLShadowCullingElementβ yet to be documented too πSoGeoElementβ you guessed it: yet to be documented πΈSoProfilerTopEngineβ yet to be documented, unfortunately πSoNodeVisualizeβ yet to be documented, periodt β¨
β¨ Detailed Description β¨
Okay so, the element classes in Coin are literally the containers of state information during action traversals of scene graphs. That's the whole job description π«Ά
One element usually corresponds to one single item of information β or sometimes it's a lil group of related information values. The way elements work is like a stack: things get pushed and popped as the action traverses in and out of SoSeparator nodes, and whenever the action needs to know a value, it just peeks at the top of the stack. That's it, that's the vibe π
Elements are internal implementation details of how nodes and actions work, so they're not something you need to stress about before you start writing your own extension nodes. Writing extension elements is even further removed from plain Open Inventor usage β but it's fully possible for the experienced Open Inventor developer πͺ
The Element Classes
Elements are mostly internal to Coin, unless you're out here creating new extension nodes on top of Coin. In that case? Yeah, you'll probably need to know about them π
Elements are part of the design for scene graph traversal in Coin. It goes like this: any traversal action instantiates and keeps a single SoState instance for the whole traversal. That SoState instance uses SoElement objects as its "memory units" to keep track of the current state of any feature of the scene graph nodes π§
As an example, think about the SoPointSize node. When the SoPointSize node gets traversed by, say, a SoGLRenderAction, it will itself push a SoPointSizeElement onto the SoGLRenderAction's SoState stack. Later, when a SoPointSet node shows up in the scene graph, it'll ask the SoState for the current point size value by reading off the value of its SoPointSizeElement π
SoSeparator nodes will push and pop elements on and off the state stack, so anything that changes state below a SoSeparator node will not influence anything above that SoSeparator. Scoping, bestie π
For more on the theoretical underpinnings of this traversal design, you should consider reading available literature on the so-called "Visitor pattern". We recommend "Design Patterns", by Gamma, Helm, Johnson, Vlissides (aka the "Gang Of Four"). Fun fact: this book actually uses the Inventor API traversal mechanism as the case study for explaining the Visitor pattern π
For extending the Coin library with your own classes, we strongly recommend you make yourself acquainted with the excellent The Inventor Toolmaker book (ISBN 0-201-62493-1), which describes the tasks involved in detail. This book was written by the original SGI Inventor designers and explains many of the underlying design ideas, plus it's packed with hands-on examples on how to extend the Coin toolkit in ways that stay true to the fundamental design ideas. (The Inventor Toolmaker is also available at SGI's online library, at no cost. See Download The Inventor Toolmaker.) Reading the source code of the built-in classes in Coin should also prove very helpful π
The following is a complete example on how to extend Coin with your own traversal elements. First up: the class declaration of the new element (i.e. the header include file):
// [texturefilenameelement.h]
#ifndef TEXTUREFILENAMEELEMENT_H
#define TEXTUREFILENAMEELEMENT_H
#include <Inventor/elements/SoReplacedElement.h>
#include <Inventor/SbString.h>
class TextureFilenameElement : public SoReplacedElement {
typedef SoReplacedElement inherited;
SO_ELEMENT_HEADER(TextureFilenameElement);
public:
static void initClass(void);
virtual void init(SoState * state);
static void set(SoState * const state, SoNode * const node,
const SbString & filename);
static const SbString & get(SoState * const state);
static const TextureFilenameElement * getInstance(SoState * state);
protected:
virtual ~TextureFilenameElement();
virtual void setElt(const SbString & filename);
private:
SbString filename;
};
#endif // !TEXTUREFILENAMEELEMENT_H
And here's the implementation of the element:
// [texturefilenameelement.cpp]
//
// The purpose of the code in this file is to demonstrate how you can
// make your own elements for scene graph traversals.
//
// Code by Peder Blekken <pederb@sim.no>. Copyright (C)
// Kongsberg Oil & Gas Technologies.
#include "texturefilenameelement.h"
SO_ELEMENT_SOURCE(TextureFilenameElement);
void
TextureFilenameElement::initClass(void)
{
SO_ELEMENT_INIT_CLASS(TextureFilenameElement, inherited);
}
void
TextureFilenameElement::init(SoState * state)
{
this->filename = "<none>";
}
TextureFilenameElement::~TextureFilenameElement()
{
}
void
TextureFilenameElement::set(SoState * const state, SoNode * const node,
const SbString & filename)
{
TextureFilenameElement * elem = (TextureFilenameElement *)
SoReplacedElement::getElement(state, classStackIndex, node);
elem->setElt(filename);
}
const SbString &
TextureFilenameElement::get(SoState * const state)
{
return TextureFilenameElement::getInstance(state)->filename;
}
void
TextureFilenameElement::setElt(const SbString & filename)
{
this->filename = filename;
}
const TextureFilenameElement *
TextureFilenameElement::getInstance(SoState * state)
{
return (const TextureFilenameElement *)
SoElement::getConstElement(state, classStackIndex);
}
And a small, standalone test application putting the new element to use π
// [lstextures.cpp]
//
// The purpose of this file is to make a small wrapper "tool" around
// the TextureFilenameElement extension element, just for showing
// example code on how to make use of a user-defined custom element.
//
// The code goes like this:
//
// We initialize the element, enable it for the SoCallbackAction, read
// a scene graph file, set callbacks on SoTexture2 and all shape nodes
// and applies the SoCallbackAction. The callbacks will then print out
// the texture filename information from the TextureFilenameElement
// each time an interesting node is hit.
//
//
// Code by Peder Blekken <pederb@sim.no>. Cleaned up, integrated in
// Coin distribution and commented by Morten Eriksen
// <mortene@sim.no>. Copyright (C) Kongsberg Oil & Gas Technologies.
#include <Inventor/SoDB.h>
#include <Inventor/SoInput.h>
#include <Inventor/actions/SoCallbackAction.h>
#include <Inventor/nodes/SoSeparator.h>
#include <Inventor/nodes/SoTexture2.h>
#include <Inventor/nodes/SoShape.h>
#include <Inventor/misc/SoState.h>
#include <cstdio>
#include "texturefilenameelement.h"
SoCallbackAction::Response
pre_tex2_cb(void * data, SoCallbackAction * action, const SoNode * node)
{
const SbString & filename = ((SoTexture2 *)node)->filename.getValue();
TextureFilenameElement::set(action->getState(), (SoNode *)node, filename);
(void)fprintf(stdout, "=> New texture: %s\n",
filename.getLength() == 0 ?
"<inlined>" : filename.getString());
return SoCallbackAction::CONTINUE;
}
SoCallbackAction::Response
pre_shape_cb(void * data, SoCallbackAction * action, const SoNode * node)
{
const SbString & filename =
TextureFilenameElement::get(action->getState());
(void)fprintf(stdout, " Texturemap on %s: %s\n",
node->getTypeId().getName().getString(),
filename.getLength() == 0 ?
"<inlined>" : filename.getString());
return SoCallbackAction::CONTINUE;
}
void
usage(const char * appname)
{
(void)fprintf(stderr, "\n\tUsage: %s <modelfile.iv>\n\n", appname);
(void)fprintf(stderr,
"\tLists all texture filenames in the model file,\n"
"\tand on which shape nodes they are used.\n\n"
"\tThe purpose of this example utility is simply to\n"
"\tshow how to create and use an extension element for\n"
"\tscene graph traversal.\n\n");
}
int
main(int argc, char ** argv)
{
if (argc != 2) {
usage(argv[0]);
exit(1);
}
SoDB::init();
TextureFilenameElement::initClass();
SO_ENABLE(SoCallbackAction, TextureFilenameElement);
SoInput input;
if (!input.openFile(argv[1])) {
(void)fprintf(stderr, "ERROR: couldn't open file \"%s\".\n", argv[1]);
exit(1);
}
SoSeparator * root = SoDB::readAll(&input);
if (root) {
root->ref();
SoCallbackAction cbaction;
cbaction.addPreCallback(SoTexture2::getClassTypeId(), pre_tex2_cb, NULL);
cbaction.addPreCallback(SoShape::getClassTypeId(), pre_shape_cb, NULL);
cbaction.apply(root);
root->unref();
return 0;
}
return 1;
}
π«Ά Author π«Ά
Generated automatically by Doxygen for Coin from the source code.
And that's a wrap on coin_elements(3) bestie!! π This whole page came to you from Coin version 4.0.10, dated Thu Jun 25 2026 00:00:00 β and yeah, it was auto-generated by Doxygen straight from the source code, so if you spotted a typo, blame the robots, not me π€β¨ Go build some elements, you absolute icon ππ
π¦ 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