SoLevelOfDetail(3)
π SoLevelOfDetail(3) β a Coin era icon π
okay bestie, gather round π«Ά this is the manual page for SoLevelOfDetail, straight out of Coin, sitting pretty in section 3 of the manual. It's a whole class, and yes she's serving, we'll get into all of it. β¨
β¨ NAME β¨
SoLevelOfDetail β the SoLevelOfDetail class is used to choose a child based on projected size. π
Like. She looks at how big things are gonna look on screen and picks accordingly. That's the whole vibe of her. π¦
no cap, that's genuinely the entire NAME section β but bestie, this is only part 1 of 3, so do not go anywhere, there's so much more coming πΈ
β¨ SYNOPSIS β¨
#include <Inventor/nodes/SoLevelOfDetail.h>
Inherits SoGroup.
π Public Member Functions π
virtual SoType getTypeId (void) constβ bestie, this is literally how you ask the node what type it is πSoLevelOfDetail (void)β the no-arg constructor, periodtSoLevelOfDetail (int numchildren)β constructor that takesnumchildren, slayvirtual void doAction (SoAction *action)β does theSoActionthing, iconicvirtual void callback (SoCallbackAction *action)β handlesSoCallbackAction, no capvirtual void GLRender (SoGLRenderAction *action)β GL render time withSoGLRenderActionβ¨virtual void rayPick (SoRayPickAction *action)β ray pick vibes withSoRayPickActionπ₯virtual void getBoundingBox (SoGetBoundingBoxAction *action)β gets the bounding box viaSoGetBoundingBoxActionπ¦virtual void audioRender (SoAudioRenderAction *action)β audio render withSoAudioRenderActionπ§virtual void notify (SoNotList *nl)β notify withSoNotList, bestie
π¦ Public Member Functions inherited from SoGroup π¦
SoGroup (void)β no-arg constructor, inheritedSoGroup (int nchildren)β constructor withnchildren, inheritedvirtual void addChild (SoNode *node)β adds a child node, so iconicvirtual void insertChild (SoNode *child, int newchildindex)β inserts child atnewchildindexπvirtual SoNode * getChild (int index) constβ gets child atindexπvirtual int findChild (const SoNode *node) constβ findsnodein the child list πvirtual int getNumChildren (void) constβ how many children? bestie needs to knowvirtual void removeChild (int childindex)β removes child bychildindexπvirtual void removeChild (SoNode *child)β removeschildnode, byevirtual void removeAllChildren (void)β removes every single child, periodtvirtual void replaceChild (int index, SoNode *newchild)β replaces child atindexwithnewchildβ¨virtual void replaceChild (SoNode *oldchild, SoNode *newchild)β replacesoldchildwithnewchildπvirtual void getMatrix (SoGetMatrixAction *action)β matrix time withSoGetMatrixActionvirtual void handleEvent (SoHandleEventAction *action)β handlesSoHandleEventActionvirtual void pick (SoPickAction *action)β pick withSoPickActionvirtual void search (SoSearchAction *action)β search withSoSearchActionvirtual void write (SoWriteAction *action)β write withSoWriteActionvirtual void getPrimitiveCount (SoGetPrimitiveCountAction *action)β counts primitives withSoGetPrimitiveCountActionvirtual SoChildList * getChildren (void) constβ gets theSoChildListpointervirtual void addWriteReference (SoOutput *out, SbBool isfromfield=FALSE)β adds write reference,isfromfielddefaults toFALSE
πΈ Public Member Functions inherited from SoNode πΈ
void setOverride (const SbBool state)β sets override stateSbBool isOverride (void) constβ is it override? returnsSbBoolvoid setNodeType (const NodeType type)β sets node type totypeNodeType getNodeType (void) constβ gets theNodeTypevirtual SoNode * copy (SbBool copyconnections=FALSE) constβ copy,copyconnectionsdefaults toFALSEvirtual SbBool affectsState (void) constβ does it affect state? returnsSbBoolvirtual void GLRenderBelowPath (SoGLRenderAction *action)β GL render below pathvirtual void GLRenderInPath (SoGLRenderAction *action)β GL render in pathvirtual void GLRenderOffPath (SoGLRenderAction *action)β GL render off pathvirtual void grabEventsSetup (void)β grab events setupvirtual void grabEventsCleanup (void)β grab events cleanupvirtual void startNotify (void)β start notifySbUniqueId getNodeId (void) constβ gets the unique node idvirtual void writeInstance (SoOutput *out)β write instancevirtual SoNode * addToCopyDict (void) constβ adds to copy dictvirtual SoFieldContainer * copyThroughConnection (void) constβ copy through connection
π Public Member Functions inherited from SoFieldContainer π
void setToDefaults (void)β sets everything to defaultsSbBool hasDefaultValues (void) constβ has default values? returnsSbBoolSbBool fieldsAreEqual (const SoFieldContainer *container) constβ checks if fields are equal tocontainervoid copyFieldValues (const SoFieldContainer *container, SbBool copyconnections=FALSE)β copies field values fromcontainer,copyconnectionsdefaults toFALSESbBool set (const char *const fielddata)β sets fromfielddatastringvoid get (SbString &fielddata)β gets intofielddatavirtual int getFields (SoFieldList &l) constβ gets fields into listlvirtual int getAllFields (SoFieldList &l) constβ gets all fields into listlvirtual SoField * getField (const SbName &name) constβ gets field bynamevirtual SoField * getEventIn (const SbName &name) constβ gets event in bynamevirtual SoField * getEventOut (const SbName &name) constβ gets event out bynameSbBool getFieldName (const SoField *const field, SbName &name) constβ gets field name forfieldSbBool enableNotify (const SbBool flag)β enables notify withflagSbBool isNotifyEnabled (void) constβ is notify enabled? returnsSbBoolSbBool set (const char *fielddata, SoInput *input)β sets fromfielddatawithinputvoid get (SbString &fielddata, SoOutput *out)β gets intofielddatawithoutvirtual SbBool validateNewFieldValue (SoField *field, void *newval)β validates new field value forfieldSbBool getIsBuiltIn (void) constβ is it built in? returnsSbBoolvirtual void getFieldsMemorySize (size_t &managed, size_t &unmanaged) constβ gets fields memory size intomanagedandunmanagedvoid setUserData (void *userdata) constβ sets user datavoid * getUserData (void) constβ gets user data pointer
π Public Member Functions inherited from SoBase π
void ref (void) constβ ref it upvoid unref (void) constβ unref itvoid unrefNoDelete (void) constβ unref without deleteint32_t getRefCount (void) constβ gets ref count asint32_tvoid touch (void)β touch itSbBool isOfType (SoType type) constβ ReturnsTRUEif the type of this object is either of the same type or inherited fromtype.virtual SbName getName (void) constβ gets name asSbNamevirtual void setName (const SbName &newname)β sets name tonewnamevoid addAuditor (void *const auditor, const SoNotRec::Type type)β adds auditor withtypevoid removeAuditor (void *const auditor, const SoNotRec::Type type)β removes auditor withtypeconst SoAuditorList & getAuditors (void) constβ gets auditors asSoAuditorListreferenceSbBool shouldWrite (void)β should it write? returnsSbBoolvoid assertAlive (void) constβ asserts alive, bestie
β Static Public Member Functions β
static SoType getClassTypeId (void)β gets the class type idstatic void initClass (void)β Sets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system.
β Static Public Member Functions inherited from SoGroup β
static SoType getClassTypeId (void)β gets the class type id, inheritedstatic void initClass (void)β Sets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system.
β Static Public Member Functions inherited from SoNode β
static uint32_t getCompatibilityTypes (const SoType &nodetype)β gets compatibility types fornodetypestatic SoType getClassTypeId (void)β gets class type idstatic SoNode * getByName (const SbName &name)β gets node bynamestatic int getByName (const SbName &name, SoNodeList &l)β gets nodes bynameinto listlstatic void initClass (void)β Sets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system.static void initClasses (void)β init all the classes, periodtstatic SbUniqueId getNextNodeId (void)β gets next unique node idstatic int getActionMethodIndex (const SoType type)β gets action method index fortypestatic void getBoundingBoxS (SoAction *action, SoNode *node)β static bounding boxstatic void GLRenderS (SoAction *action, SoNode *node)β static GL renderstatic void callbackS (SoAction *action, SoNode *node)β static callbackstatic void getMatrixS (SoAction *action, SoNode *node)β static get matrixstatic void handleEventS (SoAction *action, SoNode *node)β static handle eventstatic void pickS (SoAction *action, SoNode *node)β static pickstatic void rayPickS (SoAction *action, SoNode *node)β static ray pickstatic void searchS (SoAction *action, SoNode *node)β static searchstatic void writeS (SoAction *action, SoNode *node)β static writestatic void audioRenderS (SoAction *action, SoNode *node)β static audio renderstatic void getPrimitiveCountS (SoAction *action, SoNode *node)β static get primitive count
β Static Public Member Functions inherited from SoFieldContainer β
static void initClass (void)β Sets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system.static SoType getClassTypeId (void)β This static method returns theSoTypeobject associated with objects of this class.static void cleanupClass (void)β cleanup classstatic void initCopyDict (void)β init copy dictstatic void addCopy (const SoFieldContainer *orig, const SoFieldContainer *copy)β adds copystatic SoFieldContainer * checkCopy (const SoFieldContainer *orig)β checks copystatic SoFieldContainer * findCopy (const SoFieldContainer *orig, const SbBool copyconnections)β finds copystatic void copyDone (void)β copy done
β Static Public Member Functions inherited from SoBase β
static void initClass (void)β Sets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system.static SoType getClassTypeId (void)β This static method returns theSoTypeobject associated with objects of this class.static void addName (SoBase *const base, const char *const name)β adds namestatic void removeName (SoBase *const base, const char *const name)β removes namestatic void incrementCurrentWriteCounter (void)β increments current write counterstatic void decrementCurrentWriteCounter (void)β decrements current write counterstatic SoBase * getNamedBase (const SbName &name, SoType type)β gets named basestatic int getNamedBases (const SbName &name, SoBaseList &baselist, SoType type)β gets named basesstatic SbBool read (SoInput *input, SoBase *&base, SoType expectedtype)β readsstatic void setInstancePrefix (const SbString &c)β sets instance prefixstatic void setTraceRefs (SbBool trace)β sets trace refsstatic SbBool getTraceRefs (void)β gets trace refsstatic SbBool connectRoute (SoInput *input, const SbName &fromnodename, const SbName &fromfieldname, const SbName &tonodename, const SbName &tofieldname)β connects routestatic SbBool readRoute (SoInput *input)β reads route
π Public Attributes π
SoMFFloat screenAreaβ the screen area attribute, so fetch
π Protected Member Functions π
virtual const SoFieldData * getFieldData (void) constβ gets field datavirtual ~SoLevelOfDetail ()β destructor, bye bestie
π Protected Member Functions inherited from SoGroup π
virtual ~SoGroup ()β destructorvirtual SbBool readInstance (SoInput *in, unsigned short flags)β reads instancevirtual SbBool readChildren (SoInput *in)β reads childrenvirtual void copyContents (const SoFieldContainer *from, SbBool copyconnections)β copies contentsvirtual SoNotRec createNotRec (void)β creates not recvoid setOperation (const SoNotRec::OperationType opType=SoNotRec::UNSPECIFIED, const SoNode *cc=NULL, const SoNode *pc=NULL, const int ci=-1)β sets operation with defaults
π Protected Member Functions inherited from SoNode π
SoNode (void)β constructorvirtual ~SoNode ()β destructor
π Protected Member Functions inherited from SoFieldContainer π
SoFieldContainer (void)β constructorvirtual ~SoFieldContainer ()β destructor
π Protected Member Functions inherited from SoBase π
SoBase (void)β constructorvirtual ~SoBase ()β destructorvirtual void destroy (void)β destroySbBool hasMultipleWriteRefs (void) constβ has multiple write refs?SbBool writeHeader (SoOutput *out, SbBool isgroup, SbBool isengine) constβ writes headervoid writeFooter (SoOutput *out) constβ writes footervirtual const char * getFileFormatName (void) constβ gets file format name
π¦ Static Protected Member Functions π¦
static const SoFieldData ** getFieldDataPtr (void)β gets field data ptr
π¦ Static Protected Member Functions inherited from SoGroup π¦
static const SoFieldData ** getFieldDataPtr (void)β gets field data ptr
π¦ Static Protected Member Functions inherited from SoNode π¦
static const SoFieldData ** getFieldDataPtr (void)β gets field data ptrstatic void setNextActionMethodIndex (int index)β sets next action method indexstatic int getNextActionMethodIndex (void)β gets next action method indexstatic void incNextActionMethodIndex (void)β increments next action method indexstatic void setCompatibilityTypes (const SoType &nodetype, const uint32_t bitmask)β sets compatibility types
π¦ Static Protected Member Functions inherited from SoBase π¦
static uint32_t getCurrentWriteCounter (void)β gets current write counterstatic void staticDataLock (void)β locks static datastatic void staticDataUnlock (void)β unlocks static data
π Additional Inherited Members π
π Public Types inherited from SoNode π
enum NodeType { INVENTOR = 0x0000, VRML1 = 0x0001, VRML2 = 0x0002,
INVENTOR_1 = 0x0004, INVENTOR_2_0 = 0x0008, INVENTOR_2_1 = 0x0010,
INVENTOR_2_5 = 0x0020, INVENTOR_2_6 = 0x0040, COIN_1_0 = 0x0080,
COIN_2_0 = 0x0100, EXTENSION = 0x0200, COIN_2_2 = 0x0400, COIN_2_3 =
0x0800, COIN_2_4 = 0x1000, INVENTOR_5_0 = 0x2000, COIN_2_5 = 0x4000,
COIN_3_0 = 0x8000, INVENTOR_6_0 = 0x10000, COIN_4_0 = 0x20000 }
π Protected Types inherited from SoBase π
enum BaseFlags { IS_ENGINE = 0x01, IS_GROUP = 0x02 }
π Protected Attributes inherited from SoGroup π
SoChildList * childrenβ the children pointer, bestie
π Protected Attributes inherited from SoNode π
SbUniqueId uniqueIdβ the unique id, no cap
π Protected Attributes inherited from SoFieldContainer π
SbBool isBuiltInβ is built in flag
π Static Protected Attributes inherited from SoNode π
static SbUniqueId nextUniqueId = 1β next unique id starts at1static int nextActionMethodIndex = 0β next action method index starts at0
β¨ Detailed Description β¨
Okay bestie, gather round, because SoLevelOfDetail is that girl. π
The SoLevelOfDetail class is used to choose a child based on projected size. That's the whole vibe. That's the assignment. π
A level-of-detail mechanism is typically used by application programmers to assist the library in speeding up the rendering. Think of it as you doing the library a solid so it can go faster. π€
The way a level-of-detail mechanism works is basically like this:
Several versions of varying complexity of the same geometry / shape is provided by the application programmer in sorted order from "most complex" to "least complex" (where "complex" in this context should be taken to mean more or less detailed in the number of polygons / shapes used for rendering it). So you line them up, most extra first, chillest last. No shuffling. π
The runtime rendering system then, upon scene graph traversal, will on-the-fly calculate either the distance from the camera to the 3D-model in question, or the number of pixels in the screen projection of the 3D-model. This value is then used to decide which version of the model to actually render: as the model is moved farther away from the camera, a less detailed version of the model is used. And vice versa, as the model moves closer to the camera, more and more detailed versions of it are rendered. Far away = low effort. Close up = full glam. It's giving adaptive. π¦
This is under many different circumstances a very effective way to let the application programmer assist to profoundly optimize the rendering of her 3D-scene. Lowkey a glow-up for your frame rate. π₯
There is of course a trade-off with the level-of-detail technique: more versions of the same 3D model means the scene graph will use up more application memory resources. Also, generating the set of less and less detailed versions of a 3D model from the original is often not a trivial task to do properly. The process is often assisted by software like what Kongsberg Oil & Gas Technologies offers in their Rational Reducer package (http://www.rational-reducer.com). So yeah, you're trading memory and homework for speed. Nothing is free, bestie. π
The SoLevelOfDetail node implements the "projected size" variety level-of-detail technique (as opposed to the "object distance" technique, as done by the SoLOD node). The node works by comparing the current projected size of the smallest rectangle covering the bounding box of its child geometry. Along with this set of models of the same shape, a specification of when to switch between them is also provided.
Example scene graph layout:
LevelOfDetail {
screenArea [ 2000, 500, 50 ]
DEF version-0 Separator {
# most complex / detailed / heavy version of subgraph
}
DEF version-1 Separator {
# less complex version of subgraph
}
DEF version-2 Separator {
# even less complex version of subgraph
}
DEF version-3 Separator {
# simplest / "lightest" version of subgraph
}
}
The way the above sub-scene graph would work would be the following: if the rectangular area around the model's projected bounding box covers more than 2000 pixels (meaning it will be up pretty close to the camera), the most complex version of the model (version-0) would be traversed (and rendered, of course). If the projected area would be between 500 and 2000 pixels, the version-1 model would be used. Ditto if the projected area was between 50 and 500 pixels, the version-2 version of the model would be used. Finally, if the projected bounding box area would be less than 50 square pixels, the presumably least detailed version of the model would be used. Sliding scale of slay, basically. π
(A common "trick" is to let the last of the SoLevelOfDetail node's children be just an empty subgraph, so no geometry will be rendered at all if the model is sufficiently far away. This will of course have a positive effect on the total rendering time for the complete scene graph.) Empty child = free real estate. π
Note that the SoLevelOfDetail::screenArea vector will be influenced by preceding SoComplexity nodes in the following way: if SoComplexity::value is set from 0.0 up to 0.5, lower detail levels than normal will be selected for traversal. If SoComplexity::value is above 0.5, higher level details than normal will be used. An SoComplexity::value equal to 1.0 will cause the first child of SoLevelOfDetail to always be used. So your SoComplexity node is out here influencing decisions upstream. Main character energy fr fr. π
As mentioned above, there is one other level-of-detail node in the Coin library: SoLOD. The difference between that one and this is just that instead of projected bounding box area, SoLOD uses the distance between the camera and the object to find out when to switch between the different model versions. Using SoLOD is faster, since figuring out the projected bounding box area needs a certain amount of calculations. But using SoLevelOfDetail is often "better", in the sense that it's really a model's size and visibility in the viewport that determines whether we could switch to a less complex version without losing enough detail that it gives a noticeable visual degradation. Iykyk. π
π FILE FORMAT/DEFAULTS π
LevelOfDetail {
screenArea 0
}
π See also π
SoLOD
π Constructor & Destructor Documentation π
SoLevelOfDetail::SoLevelOfDetail (void )
Default constructor. Does exactly what it says on the tin, no notes. β¨
SoLevelOfDetail::SoLevelOfDetail (int numchildren)
Constructor.
The argument should be the approximate number of children which is expected to be inserted below this node. The number need not be exact, as it is only used as a hint for better memory resource allocation. So like, a vibe estimate is fine, bestie, it's not graded. π
SoLevelOfDetail::~SoLevelOfDetail () [protected], [virtual]
Destructor. Cleanup era. π§Ή
π«Ά Member Function Documentation π«Ά
SoType SoLevelOfDetail::getClassTypeId (void ) [static]
This static method returns the SoType object associated with objects of this class. π«
SoType SoLevelOfDetail::getTypeId (void ) const [virtual]
Returns the type identification of an object derived from a class inheriting SoBase. This is used for runtime type checking and "downward" casting.
Reimplemented from SoGroup.
const SoFieldData ** SoLevelOfDetail::getFieldDataPtr (void ) [static], [protected]
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.
Returns the SoFieldData class which holds information about fields in this node.
Not for you, bestie β this one's library business. Move along, nothing to see. π
const SoFieldData * SoLevelOfDetail::getFieldData (void ) const [protected], [virtual]
Returns a pointer to the class-wide field data storage object for this instance. If no fields are present, returns NULL.
Reimplemented from SoGroup.
void SoLevelOfDetail::doAction (SoAction * action) [virtual]
This function performs the typical operation of a node for any action. The generalist. The multitasker. π
Reimplemented from SoGroup.
void SoLevelOfDetail::callback (SoCallbackAction * action) [virtual]
Action method for SoCallbackAction.
Simply updates the state according to how the node behaves for the render action, so the application programmer can use the SoCallbackAction for extracting information about the scene graph.
Reimplemented from SoGroup.
void SoLevelOfDetail::GLRender (SoGLRenderAction * action) [virtual]
Action method for the SoGLRenderAction.
This is called during rendering traversals. Nodes influencing the rendering state in any way or want to throw geometry primitives at OpenGL override this method. Throwing primitives at OpenGL, iconic behavior honestly. π₯
Reimplemented from SoGroup.
void SoLevelOfDetail::rayPick (SoRayPickAction * action) [virtual]
Action method for SoRayPickAction.
Checks the ray specification of the action and tests for intersection with the data of the node.
Nodes influencing relevant state variables for how picking is done also override this method.
Reimplemented from SoNode.
void SoLevelOfDetail::getBoundingBox (SoGetBoundingBoxAction * action) [virtual]
Action method for the SoGetBoundingBoxAction.
Calculates bounding box and center coordinates for node and modifies the values of the action to encompass the bounding box for this node and to shift the center point for the scene more towards the one for this node.
Nodes influencing how geometry nodes calculate their bounding box also override this method to change the relevant state variables.
Reimplemented from SoGroup.
void SoLevelOfDetail::audioRender (SoAudioRenderAction * action) [virtual]
Action method for SoAudioRenderAction.
Does common processing for SoAudioRenderAction action instances.
Reimplemented from SoGroup.
void SoLevelOfDetail::notify (SoNotList * l) [virtual]
Notifies all auditors for this instance when changes are made. Gossip travels fast in this scene graph. π£
Reimplemented from SoNode.
π Member Data Documentation π
SoMFFloat SoLevelOfDetail::screenArea
The screen area limits for the children. See usage example in main class documentation of SoLevelOfDetail for an explanation of how this vector should be set up correctly.
By default this vector just contains a single value 0.0f.
πΈ Author πΈ
Generated automatically by Doxygen for Coin from the source code.
And that's a wrap, bestie! This whole page is from Coin version 4.0.10, dated Thu Jun 25 2026 00:00:00 β and it's the SoLevelOfDetail(3) page, so if you forget which manpage you were reading, it literally says it right there in the corner. π Go forth and level-of-detail 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