Class SoLevelOfSimplification
- java.lang.Object
-
- com.openinventor.inventor.Inventor
-
- com.openinventor.inventor.misc.SoBase
-
- com.openinventor.inventor.fields.SoFieldContainer
-
- com.openinventor.inventor.nodes.SoNode
-
- com.openinventor.inventor.nodes.SoGroup
-
- com.openinventor.inventor.nodes.SoLOD
-
- com.openinventor.inventor.nodes.SoLevelOfSimplification
-
- All Implemented Interfaces:
SafeDisposable
public class SoLevelOfSimplification extends SoLOD
Level-of-detail switching node designed for grouping simplified versions of the same shape. This group node is used to group the results of simplifying a shape, such that every child represents the same model but with a different number of primitives. Since it is derived fromSoLOD
, it can behave as a distance-based level-of-detail node; however, it also responds to the decimation percentage element. It records what percentage decimation each child is, and then chooses the appropriate child based on the DecimationPercentage and DecimationType elements.You should specify N percentages for N+1 children. If the DecimationType is HIGHEST or LOWEST, then the LevelOfSimplification node will automatically choose the first or last child, respectively. If the DecimationType is PERCENTAGE, then the node will choose child "i" based on the decimation percentage element value such that:
If the DecimationType is AUTOMATIC, then the child is chosen based on the range value in the usualpercentages[i-1] <= DecimationPercentage < percentages[i] SoLOD
manner, but no child greater than the value of the DecimationPercentage element will be chosen.This node also has a field for recording how many triangles the full detail child contains. This allows this node to answer an
SoGetPrimitiveCountAction
without traversing its children. This is a benefit when some children contain WWWInline , a common occurrence. If the children contain some non-triangle primitives, then the field should be -1 which will force the node to traverse its children duringSoGetPrimitiveCountAction
.File format/default:
LevelOfSimplification {
percentages [] numTriangles -1 center 0 0 0 range [ ] Action behavior:
SoGLRenderAction
,SoRayPickAction
,SoCallbackAction
Only the child with the appropriate level of detail is traversed.SoGetPrimitiveCountAction
A child is chosen in the same way as in GLRender. If thenumTriangles
field is greater than 0, the percentage value for this child is multiplied by thenumTriangles
value and this value is added to the PrimitiveCount without traversing the child. IfnumTriangles
is less than or equal to 0, then the child is traversed to get the count.Other actions
Implemented as for
SoGroup
SoGetPrimitiveCountAction
,SoLOD
, SoOctreeOrdering, SoRenderList, SoValueOrderingSoLevelOfDetail
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.openinventor.inventor.nodes.SoNode
SoNode.RenderModes
-
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
-
Field Summary
Fields Modifier and Type Field Description SoSFInt32
numTriangles
Number of triangles in highest (1.0) case.SoMFFloat
percentages
Percentage decimation for each child.-
Fields inherited from class com.openinventor.inventor.nodes.SoGroup
boundingBoxIgnoring
-
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
-
Constructor Summary
Constructors Constructor Description SoLevelOfSimplification()
Creates level-of-simplification node with default settings.SoLevelOfSimplification(int nChildren)
Constructor that takes approximate number of children.
-
Method Summary
-
Methods inherited from class com.openinventor.inventor.nodes.SoGroup
addChild, findChild, getChild, getNumChildren, insertChild, removeAllChildren, removeChild, removeChild, replaceChild, replaceChild
-
Methods inherited from class com.openinventor.inventor.nodes.SoNode
affectsState, callback, copy, copy, distribute, doAction, getAlternateRep, getBoundingBox, getByName, getMatrix, getPrimitiveCount, getRenderEngineMode, getRenderUnitID, GLRender, GLRenderBelowPath, GLRenderInPath, GLRenderOffPath, grabEventsCleanup, grabEventsSetup, handleEvent, isBoundingBoxIgnoring, isOverride, pick, rayPick, search, setOverride, touch, write
-
Methods inherited from class com.openinventor.inventor.fields.SoFieldContainer
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaults
-
Methods inherited from class com.openinventor.inventor.misc.SoBase
dispose, getName, isDisposable, isSynchronizable, setName, setSynchronizable
-
Methods inherited from class com.openinventor.inventor.Inventor
getNativeResourceHandle
-
-
-
-
Field Detail
-
percentages
public final SoMFFloat percentages
Percentage decimation for each child. Should be numbers between 0.0 and 1.0, with 1.0 representing full detail and 0.0 representing bounding box detail.
-
numTriangles
public final SoSFInt32 numTriangles
Number of triangles in highest (1.0) case. Can be -1 if unknown or if children contain primitives other than triangles.
-
-