SoOverrideElement(3)
π 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=0x00000001COLOR_INDEX=0x00000002COMPLEXITY=0x00000004COMPLEXITY_TYPE=0x00000008CREASE_ANGLE=0x00000010DIFFUSE_COLOR=0x00000020DRAW_STYLE=0x00000040EMISSIVE_COLOR=0x00000080FONT_NAME=0x00000100FONT_SIZE=0x00000200LIGHT_MODEL=0x00000400LINE_PATTERN=0x00000800LINE_WIDTH=0x00001000MATERIAL_BINDING=0x00002000POINT_SIZE=0x00004000PICK_STYLE=0x00008000SHAPE_HINTS=0x00010000SHININESS=0x00020000SPECULAR_COLOR=0x00040000POLYGON_OFFSET=0x00080000TRANSPARENCY=0x00100000TRANSPARENCY_TYPE=0x00200000NORMAL_VECTOR=0x00400000NORMAL_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) constint getStackIndex (void) constvirtual void pop (SoState *state, const SoElement *prevTopElement)void setDepth (const int depth)int getDepth (void) constvirtual ~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) constvirtual void captureThis (SoState *state) constvoid setTypeId (const SoType typeId)void setStackIndex (const int index)SoElement * getNextInStack (void) constSoElement * 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 typeIdint stackIndexint depth
π Static Protected Attributes inherited from SoElement π
static int classStackIndexstatic 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 theSoPackedColororSoVertexPropertynode is used to specify diffuse color and transparency β it only works with theSoMaterialnode. 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 theSoTypeobject 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 theSoTypeobject. 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 forflagsis0. (that's a real number, bestie, write it down π)- reimplemented from
SoElement.
- reimplemented from
void SoOverrideElement::push (SoState * state) [virtual]β upstream literally just saysFIXME: write doc.π so that's all the tea there is.- reimplemented from
SoElement.
- reimplemented from
SbBool SoOverrideElement::matches (const SoElement * element) const [virtual]β yep, you guessed it:FIXME: write doc.π- implements
SoElement.
- implements
SoElement * SoOverrideElement::copyMatchInfo (void ) const [virtual]β alsoFIXME: write doc.no cap.- implements
SoElement.
- implements
π 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 calledCOIN_SEPARATE_DIFFUSE_TRANSPARENCY_OVERRIDEto1.
please note: separate override will not work for thePackedColororSoVertexPropertynodes. 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().
- see also:
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().
- see also:
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.
- reimplemented from
π 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
- 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