SoLevelOfDetail — level-of-detail switching group node
Contents
Action Behavior
SoGLRenderAction,SoRayPickAction,SoCallbackAction
Only the child with the appropriate level of detail is traversed.
SoGetBoundingBoxAction
The box that encloses all children is computed. (This is the box that is needed to compute the
projected size.)
others
All implemented as for SoGroup.
Description
The children of this node typically represent the same object or objects at varying levels of detail,
from highest detail to lowest. The size of the objects when projected into the viewport is used to
determine which version to use (i.e., which child to traverse).
The size is computed as the area of the screen rectangle enclosing the projection of the 3D bounding box
that encloses all of the children. When rendering, this size is compared to the values in the screenArea
field. If the size is greater than the first value, child 0 is traversed. If it is smaller than the
first, but greater than the second, child 1 is traversed, and so on. If there are fewer children than are
required by this rule, the last child is traversed. The screenArea field contains just 0 by default, so
the first child is always traversed.
The size calculation takes the current complexity into account. If the complexity is 0 or is of type
BOUNDING_BOX, the last child is always traversed. If the complexity is less than .5, the computed size is
scaled down appropriately to use (possibly) a less detailed representation. If the complexity is greater
than .5, the size is scaled up. At complexity 1, the first child is always used.
Note that the SoLOD node is similar to SoLevelOfDetail, except the switching between levels in the SoLOD
node is based on distance from the camera, which is faster than using screen area.
Fields
SoMFFloatscreenArea
Areas to use for comparison
File Format/Defaults
LevelOfDetail{screenArea0}Inherits From
SoBase > SoFieldContainer > SoNode > SoGroup > SoLevelOfDetail
Methods
SoLevelOfDetail()
Creates a level-of-detail node with default settings.
staticSoTypegetClassTypeId()
Returns type identifier for this class.
Name
SoLevelOfDetail — level-of-detail switching group node
See Also
SoLOD,SoComplexity,SoSwitch,SoGroupSoLevelOfDetail(3IV)()
Synopsis
#include<Inventor/nodes/SoLevelOfDetail.h>
Fields from class SoLevelOfDetail:
SoMFFloatscreenArea
Methods from class SoLevelOfDetail:
SoLevelOfDetail()staticSoTypegetClassTypeId()
Methods from class SoGroup:
voidaddChild(SoNode*child)voidinsertChild(SoNode*child,intnewChildIndex)SoNode*getChild(intindex)constintfindChild(constSoNode*child)constintgetNumChildren()constvoidremoveChild(intindex)voidremoveChild(SoNode*child)voidremoveAllChildren()voidreplaceChild(intindex,SoNode*newChild)voidreplaceChild(SoNode*oldChild,SoNode*newChild)
Methods from class SoNode:
voidsetOverride(SbBoolstate)SbBoolisOverride()constSoNode*copy(SbBoolcopyConnections=FALSE)constvirtualSbBoolaffectsState()conststaticSoNode*getByName(constSbName&name)staticintgetByName(constSbName&name,SoNodeList&list)
Methods from class SoFieldContainer:
voidsetToDefaults()SbBoolhasDefaultValues()constSbBoolfieldsAreEqual(constSoFieldContainer*fc)constvoidcopyFieldValues(constSoFieldContainer*fc,SbBoolcopyConnections=FALSE)SbBoolset(constchar*fieldDataString)voidget(SbString&fieldDataString)virtualintgetFields(SoFieldList&resultList)constvirtualSoField*getField(constSbName&fieldName)constSbBoolgetFieldName(constSoField*field,SbName&fieldName)constSbBoolisNotifyEnabled()constSbBoolenableNotify(SbBoolflag)
Methods from class SoBase:
voidref()voidunref()constvoidunrefNoDelete()constvoidtouch()virtualSoTypegetTypeId()constSbBoolisOfType(SoTypetype)constvirtualvoidsetName(constSbName&name)virtualSbNamegetName()const