SoOverrideElement(3)

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

πŸ’– SoOverrideElement β€” Coin's override queen πŸ‘‘

okay so bestie, welcome to SoOverrideElement(3), straight outta the Coin 3D scene-graph universe. if you've ever wanted to yell "no, actually, this value wins for everything downstream" at a scene graph, this element is literally your girl. 🫢 it's long, it's thorough, and we're doing it in two parts, so buckle up.


🌸 NAME 🌸

SoOverrideElement β€” she maintains a list of the elements that can be overridden, plus a list of which elements should be overridden rn. two lists, one icon. πŸ’…


✨ SYNOPSIS ✨

#include <Inventor/elements/SoOverrideElement.h>

Inherits SoElement. β€” yes she's got the whole base-class bloodline, we love a legacy girlie πŸ’œ

πŸŽ€ Public Types πŸŽ€

enum FlagBits β€” a full buffet of bit flags, one for every single thing you're allowed to override. collect them all:

  • AMBIENT_COLOR = 0x00000001
  • COLOR_INDEX = 0x00000002
  • COMPLEXITY = 0x00000004
  • COMPLEXITY_TYPE = 0x00000008
  • CREASE_ANGLE = 0x00000010
  • DIFFUSE_COLOR = 0x00000020
  • DRAW_STYLE = 0x00000040
  • EMISSIVE_COLOR = 0x00000080
  • FONT_NAME = 0x00000100
  • FONT_SIZE = 0x00000200
  • LIGHT_MODEL = 0x00000400
  • LINE_PATTERN = 0x00000800
  • LINE_WIDTH = 0x00001000
  • MATERIAL_BINDING = 0x00002000
  • POINT_SIZE = 0x00004000
  • PICK_STYLE = 0x00008000
  • SHAPE_HINTS = 0x00010000
  • SHININESS = 0x00020000
  • SPECULAR_COLOR = 0x00040000
  • POLYGON_OFFSET = 0x00080000
  • TRANSPARENCY = 0x00100000
  • TRANSPARENCY_TYPE = 0x00200000
  • NORMAL_VECTOR = 0x00400000
  • NORMAL_BINDING = 0x00800000

(they're bit flags, so yes, they stack. main character energy on a bitmask. πŸ”₯)

🌈 Public Member Functions 🌈

  • virtual void init (SoState *state)
  • virtual void push (SoState *state) β€” FIXME: write doc.
  • virtual SbBool matches (const SoElement *element) const β€” FIXME: write doc.
  • virtual SoElement * copyMatchInfo (void) const β€” FIXME: write doc.
  • virtual void print (FILE *file) const β€” FIXME: write doc.

🌟 Public Member Functions inherited from SoElement 🌟

  • const SoType getTypeId (void) const
  • int getStackIndex (void) const
  • 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 * createInstance (void)
  • static void initClass (void)
  • static uint32_t getFlags (SoState *const state)

and then the getter girlies β€” one per flag, all asking "is this thing being overridden tho?" πŸ‘€

  • static SbBool getAmbientColorOverride (SoState *const state)
  • static SbBool getColorIndexOverride (SoState *const state)
  • static SbBool getComplexityOverride (SoState *const state)
  • static SbBool getComplexityTypeOverride (SoState *const state)
  • static SbBool getCreaseAngleOverride (SoState *const state)
  • static SbBool getDiffuseColorOverride (SoState *const state)
  • static SbBool getDrawStyleOverride (SoState *const state)
  • static SbBool getEmissiveColorOverride (SoState *const state)
  • static SbBool getFontNameOverride (SoState *const state)
  • static SbBool getFontSizeOverride (SoState *const state)
  • static SbBool getLightModelOverride (SoState *const state)
  • static SbBool getLinePatternOverride (SoState *const state)
  • static SbBool getLineWidthOverride (SoState *const state)
  • static SbBool getMaterialBindingOverride (SoState *const state)
  • static SbBool getPickStyleOverride (SoState *const state)
  • static SbBool getPointSizeOverride (SoState *const state)
  • static SbBool getPolygonOffsetOverride (SoState *const state)
  • static SbBool getShapeHintsOverride (SoState *const state)
  • static SbBool getShininessOverride (SoState *const state)
  • static SbBool getSpecularColorOverride (SoState *const state)
  • static SbBool getTransparencyOverride (SoState *const state)
  • static SbBool getTransparencyTypeOverride (SoState *const state)
  • static SbBool getNormalVectorOverride (SoState *const state)
  • static SbBool getNormalBindingOverride (SoState *const state)

and the setter girlies, because sometimes you gotta make it happen:

  • static void setAmbientColorOverride (SoState *const state, SoNode *const node, const SbBool override)
  • static void setColorIndexOverride (SoState *const state, SoNode *const node, const SbBool override)
  • static void setComplexityOverride (SoState *const state, SoNode *const node, const SbBool override)
  • static void setComplexityTypeOverride (SoState *const state, SoNode *const node, const SbBool override)
  • static void setCreaseAngleOverride (SoState *const state, SoNode *const node, const SbBool override)
  • static void setDiffuseColorOverride (SoState *const state, SoNode *const node, const SbBool override)
  • static void setDrawStyleOverride (SoState *const state, SoNode *const node, const SbBool override)
  • static void setEmissiveColorOverride (SoState *const state, SoNode *const node, const SbBool override)
  • static void setFontNameOverride (SoState *const state, SoNode *const node, const SbBool override)
  • static void setFontSizeOverride (SoState *const state, SoNode *const node, const SbBool override)
  • static void setLightModelOverride (SoState *const state, SoNode *const node, const SbBool override)
  • static void setLinePatternOverride (SoState *const state, SoNode *const node, const SbBool override)
  • static void setLineWidthOverride (SoState *const state, SoNode *const node, const SbBool override)
  • static void setMaterialBindingOverride (SoState *const state, SoNode *const node, const SbBool override) β€” FIXME: write doc.
  • static void setPickStyleOverride (SoState *const state, SoNode *const node, const SbBool override)
  • static void setPointSizeOverride (SoState *const state, SoNode *const node, const SbBool override)
  • static void setPolygonOffsetOverride (SoState *const state, SoNode *const node, const SbBool override)
  • static void setShapeHintsOverride (SoState *const state, SoNode *const node, const SbBool override)
  • static void setShininessOverride (SoState *const state, SoNode *const node, const SbBool override)
  • static void setSpecularColorOverride (SoState *const state, SoNode *const node, const SbBool override)
  • static void setTransparencyOverride (SoState *const state, SoNode *const node, const SbBool override)
  • static void setTransparencyTypeOverride (SoState *const state, SoNode *const node, const SbBool override)
  • static void setNormalVectorOverride (SoState *const state, SoNode *const node, const SbBool override)
  • static void setNormalBindingOverride (SoState *const state, SoNode *const node, const SbBool override)

πŸ¦‹ 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 ~SoOverrideElement ()

🧚 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

πŸ“ Additional Inherited Members πŸ“

⭐ 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 inherited from SoElement πŸŽ€

  • SoType typeId
  • int stackIndex
  • int depth

🌈 Static Protected Attributes inherited from SoElement 🌈

  • static int classStackIndex
  • static SoTypeList * stackToType

πŸ“– Detailed Description πŸ“–

SoOverrideElement maintains a list of overridable elements, plus a list of which elements should be overridden. that's the vibe.

but heads up β€” only certain elements can be overridden. not everything gets a turn. βœ‹

the rest of this class doc is about one very specific, very special case:

a super common ask is "I just wanna override the transparency of the whole scene graph, or of parts of it." and in the original SGI Inventor, that's basically impossible β€” the API was designed so you can override all the fields of a node or none of them. so if you call SoNode::setOverride() on an SoMaterial node, every single material setting on that node overrides every material setting further down the scene graph. there's just no way to override only the transparency settings. tragic, honestly. 😭

but in Coin we added a lil hack to get around this, because it comes up so much: for separate transparency override settings, set the environment variable COIN_SEPARATE_DIFFUSE_TRANSPARENCY_OVERRIDE to "1" and the hack turns on. πŸ”₯

⚠️ important bestie: this will not work when the SoPackedColor or SoVertexProperty node is used to specify diffuse color and transparency β€” it only works with the SoMaterial node. no cap.

here's a complete, standalone example showing exactly how to pull it off:

#include <Inventor/Qt/SoQt.h>
#include <Inventor/Qt/viewers/SoQtExaminerViewer.h>
#include <Inventor/nodes/SoSeparator.h>
#include <Inventor/nodes/SoMaterial.h>

// *************************************************************************

const char * scene = "#Inventor V2.1 asci\n"
"\n"
"Separator {"
"   Cone { }"
"   Translation { translation 1 0 5 }"
""
"   DEF OVERRIDEMATERIAL Material { transparency 0.5 }"
""
"   DEF OBJMATERIAL Material {"
"      diffuseColor 0.5 0 0"
"      transparency 0"
"   }"
"   Sphere { }"
"}"
;

int
main(int argc, char ** argv)
{
  QWidget * window = SoQt::init(argv[0]);

  (void)coin_setenv("COIN_SEPARATE_DIFFUSE_TRANSPARENCY_OVERRIDE", "1", TRUE);

  SoInput * in = new SoInput;
  in->setBuffer(scene, strlen(scene));
  SoSeparator * root = SoDB::readAll(in);
  assert(root);
  delete in;

  root->ref();

  SoMaterial * overridemat = (SoMaterial *)
    SoBase::getNamedBase("OVERRIDEMATERIAL", SoMaterial::getClassTypeId());
  assert(overridemat);

  overridemat->diffuseColor.setIgnored(TRUE);
  overridemat->setOverride(TRUE);

  SoQtExaminerViewer * viewer = new SoQtExaminerViewer(window);
  viewer->setSceneGraph(root);
  viewer->show();

  SoQt::show(window);
  SoQt::mainLoop();

  delete viewer;
  root->unref();

  return 0;
}

πŸ” Member Enumeration Documentation πŸ”

enum SoOverrideElement::FlagBits

FIXME: write doc.


🫧 Constructor & Destructor Documentation 🫧

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

Destructor. she's shutting it down, respectfully. πŸ’…


✨ okay bestie, that's part 1 wrapped β€” part 2 is coming right up, don't go anywhere ✨

πŸ’… Member Function Documentation πŸ’…

okay bestie, this is the big one β€” every single member function on SoOverrideElement lives right here, and I'm not skipping a single one. grab a snack. πŸ“


🌈 the class/type-system girlies

  • SoType SoOverrideElement::getClassTypeId (void ) [static] β€” this static method hands you back the SoType object that's associated with objects of this class. that's the whole job. iconic. ✨
  • int SoOverrideElement::getClassStackIndex (void ) [static] β€” this static method returns the state stack index for the class. yes, that's it. πŸ’œ
  • void * SoOverrideElement::createInstance (void ) [static] β€” heads up, this API member is considered internal to the library, because it's not likely to be of interest to the application programmer. what it does: creates a new instance of the class type corresponding to the SoType object. iykyk. πŸ™ˆ
  • void SoOverrideElement::initClass (void ) [static] β€” initialize all the relevant common data for every instance, like the type system. the group-chat setup message, basically. πŸ“£

πŸ¦‹ the virtual lifecycle ones

  • void SoOverrideElement::init (SoState * state) [virtual] β€” initializes the element to its default value. the default value for flags is 0. (that's a real number, bestie, write it down πŸ“)
    • reimplemented from SoElement.
  • void SoOverrideElement::push (SoState * state) [virtual] β€” upstream literally just says FIXME: write doc. 😭 so that's all the tea there is.
    • reimplemented from SoElement.
  • SbBool SoOverrideElement::matches (const SoElement * element) const [virtual] β€” yep, you guessed it: FIXME: write doc. πŸ’€
    • implements SoElement.
  • SoElement * SoOverrideElement::copyMatchInfo (void ) const [virtual] β€” also FIXME: write doc. no cap.
    • implements SoElement.

πŸ‘‘ the getters (the "is it overridden tho" checkers)

every single one of these is [static] and takes (SoState *const state), and every single one of these has upstream docs that say nothing but FIXME: write doc. i'm just the messenger 🫢

  • SbBool SoOverrideElement::getAmbientColorOverride (SoState *const state) [static] β€” FIXME: write doc.
  • SbBool SoOverrideElement::getColorIndexOverride (SoState *const state) [static] β€” FIXME: write doc.
  • SbBool SoOverrideElement::getComplexityOverride (SoState *const state) [static] β€” FIXME: write doc.
  • SbBool SoOverrideElement::getComplexityTypeOverride (SoState *const state) [static] β€” FIXME: write doc.
  • SbBool SoOverrideElement::getCreaseAngleOverride (SoState *const state) [static] β€” FIXME: write doc.
  • SbBool SoOverrideElement::getDiffuseColorOverride (SoState *const state) [static] β€” FIXME: write doc.
  • SbBool SoOverrideElement::getDrawStyleOverride (SoState *const state) [static] β€” FIXME: write doc.
  • SbBool SoOverrideElement::getEmissiveColorOverride (SoState *const state) [static] β€” FIXME: write doc.
  • SbBool SoOverrideElement::getFontNameOverride (SoState *const state) [static] β€” FIXME: write doc.
  • SbBool SoOverrideElement::getFontSizeOverride (SoState *const state) [static] β€” FIXME: write doc.
  • SbBool SoOverrideElement::getLightModelOverride (SoState *const state) [static] β€” FIXME: write doc.
  • SbBool SoOverrideElement::getLinePatternOverride (SoState *const state) [static] β€” FIXME: write doc.
  • SbBool SoOverrideElement::getLineWidthOverride (SoState *const state) [static] β€” FIXME: write doc.
  • SbBool SoOverrideElement::getMaterialBindingOverride (SoState *const state) [static] β€” FIXME: write doc. (fun fact, this one's a getter with no matching setter in this list β€” she's solo πŸ’…)
  • SbBool SoOverrideElement::getPickStyleOverride (SoState *const state) [static] β€” FIXME: write doc.
  • SbBool SoOverrideElement::getPointSizeOverride (SoState *const state) [static] β€” FIXME: write doc.
  • SbBool SoOverrideElement::getPolygonOffsetOverride (SoState *const state) [static] β€” FIXME: write doc.
  • SbBool SoOverrideElement::getShapeHintsOverride (SoState *const state) [static] β€” FIXME: write doc.
  • SbBool SoOverrideElement::getShininessOverride (SoState *const state) [static] β€” FIXME: write doc.
  • SbBool SoOverrideElement::getSpecularColorOverride (SoState *const state) [static] β€” FIXME: write doc.
  • SbBool SoOverrideElement::getTransparencyOverride (SoState *const state) [static] β€” FIXME: write doc.
  • SbBool SoOverrideElement::getTransparencyTypeOverride (SoState *const state) [static] β€” FIXME: write doc.

πŸ’– the two getters that actually have docs (main character energy)

  • SbBool SoOverrideElement::getNormalVectorOverride (SoState *const state) [static] β€” returns the normal vector override value. ✨
this function is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API.
  • Since: Coin 2.0
  • SbBool SoOverrideElement::getNormalBindingOverride (SoState *const state) [static] β€” returns the normal binding override value. ✨
this function is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API.
  • Since: Coin 2.0

πŸŽ€ the setters

every one of these is [static] and takes (SoState *const state, SoNode *const node, const SbBool override). and yeah β€” most of them are FIXME: write doc. too. the docs team said "we'll get to it" and then went to get boba. πŸ§‹

  • void SoOverrideElement::setAmbientColorOverride (SoState *const state, SoNode *const node, const SbBool override) [static] β€” FIXME: write doc.
  • void SoOverrideElement::setColorIndexOverride (SoState *const state, SoNode *const node, const SbBool override) [static] β€” FIXME: write doc.
  • void SoOverrideElement::setComplexityOverride (SoState *const state, SoNode *const node, const SbBool override) [static] β€” FIXME: write doc.
  • void SoOverrideElement::setComplexityTypeOverride (SoState *const state, SoNode *const node, const SbBool override) [static] β€” FIXME: write doc.
  • void SoOverrideElement::setCreaseAngleOverride (SoState *const state, SoNode *const node, const SbBool override) [static] β€” FIXME: write doc.
  • void SoOverrideElement::setDiffuseColorOverride (SoState *const state, SoNode *const node, const SbBool override) [static] β€” okay bestie this one's the drama. 🎭 you can use it to set the diffuse color override, and it will also set the transparency override. and here's the part where upstream is like "yeah we know": since they feel this is a design flaw, you can override that behaviour by setting an environment value called COIN_SEPARATE_DIFFUSE_TRANSPARENCY_OVERRIDE to 1.
please note: separate override will not work for the PackedColor or SoVertexProperty nodes. fr fr, don't try it.
  • void SoOverrideElement::setDrawStyleOverride (SoState *const state, SoNode *const node, const SbBool override) [static] β€” FIXME: write doc.
  • void SoOverrideElement::setEmissiveColorOverride (SoState *const state, SoNode *const node, const SbBool override) [static] β€” FIXME: write doc.
  • void SoOverrideElement::setFontNameOverride (SoState *const state, SoNode *const node, const SbBool override) [static] β€” FIXME: write doc.
  • void SoOverrideElement::setFontSizeOverride (SoState *const state, SoNode *const node, const SbBool override) [static] β€” FIXME: write doc.
  • void SoOverrideElement::setLightModelOverride (SoState *const state, SoNode *const node, const SbBool override) [static] β€” FIXME: write doc.
  • void SoOverrideElement::setLinePatternOverride (SoState *const state, SoNode *const node, const SbBool override) [static] β€” FIXME: write doc.
  • void SoOverrideElement::setLineWidthOverride (SoState *const state, SoNode *const node, const SbBool override) [static] β€” FIXME: write doc.
  • void SoOverrideElement::setPickStyleOverride (SoState *const state, SoNode *const node, const SbBool override) [static] β€” FIXME: write doc.
  • void SoOverrideElement::setPointSizeOverride (SoState *const state, SoNode *const node, const SbBool override) [static] β€” FIXME: write doc.
  • void SoOverrideElement::setPolygonOffsetOverride (SoState *const state, SoNode *const node, const SbBool override) [static] β€” FIXME: write doc.
  • void SoOverrideElement::setShapeHintsOverride (SoState *const state, SoNode *const node, const SbBool override) [static] β€” FIXME: write doc.
  • void SoOverrideElement::setShininessOverride (SoState *const state, SoNode *const node, const SbBool override) [static] β€” FIXME: write doc.
  • void SoOverrideElement::setSpecularColorOverride (SoState *const state, SoNode *const node, const SbBool override) [static] β€” FIXME: write doc.
  • void SoOverrideElement::setTransparencyOverride (SoState *const state, SoNode *const node, const SbBool override) [static] β€” you can use this to set the transparency override. 🌊
    • see also: setDiffuseColorOverride().
  • void SoOverrideElement::setTransparencyTypeOverride (SoState *const state, SoNode *const node, const SbBool override) [static] β€” you can use this to set the transparency type override. 🌊
    • see also: setDiffuseColorOverride().
  • void SoOverrideElement::setNormalVectorOverride (SoState *const state, SoNode *const node, const SbBool override) [static] β€” you can use this to set the normal vector override. ⭐
this function is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API.
  • Since: Coin 2.0
  • void SoOverrideElement::setNormalBindingOverride (SoState *const state, SoNode *const node, const SbBool override) [static] β€” you can use this to set the normal binding override. ⭐
this function is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API.
  • Since: Coin 2.0

🌸 one last function, she's virtual

  • void SoOverrideElement::print (FILE * file) const [virtual] β€” FIXME: write doc. yep. that's the whole thing. πŸ’€
    • reimplemented from SoElement.

🌈 Author 🌈

Generated automatically by Doxygen for Coin from the source code. πŸ€–πŸ’– (a robot wrote this page and honestly? she ate.)


and that's the whole thing, bestie β€” this page is Coin version 4.0.10, stamped Thu Jun 25 2026 00:00:00, and it's the manpage for SoOverrideElement(3). go forth and override responsibly 🫢✨

πŸ“¦ where this page comes from