coin_elements(3)

πŸ“¦
version 4.0.10 Β· 4 versions
, in fedora 43, fedora 44

🌸 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 the SoGetBoundingBoxAction class, 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 SoListenerGainElement
  • SoListenerGainElement β€” this one is the lil keeper of the SoListener gain 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 inactive SoVRMLSound nodes 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