Class SoGlobalSimplifyAction
This class traverses the scene graph and collects all the triangles in a single list. This list is then simplified and the result is stored in a new scene graph.
The SoGlobalSimplifyAction provides two simplification strategies:
 
- SIMPLIFY_GLOBALLY: all the triangles found in the scene graph are collected in a single object. Then this object is simplified.
- SIMPLIFY_BY_SUBGROUP: triangles are collected until a material change or a separator is found.
The default strategy is SIMPLIFY_BY_SUBGROUP.
NOTE: Colors and normal vectors in the existing shapes are not preserved!
Calling generateNormals(true), which is the default, tells Open Inventor to compute per-vertex normal during this action. When disabled (calling generateNormals(false)), objects may appear faceted instead of appearing smooth.
If generateNormals is false, it may be useful to call addShapeHints(true). This tells Open Inventor to add an SoShapeHints node to the result scene graph that will cause normals to be computed during the next render traversal.
 
By default the SoGlobalSimplifyAction collects all the triangles even if they are part of a simple shape (cube, cone, sphere, text3...). Setting the setCatchAllShapesFlag() flag to false tells the action to collect triangles only if they belong to a complex shape.
 
The getSimplifiedSceneGraph() method returns the root of the new scene graph after applying the SoGlobalSimplifyAction.
 
Typically you will pass an instance of SoDecimator to the constructor. Please see SoDecimator for info about which geometry objects can be simplified.
 
- See Also:
- 
Nested Class SummaryNested ClassesNested classes/interfaces inherited from class com.openinventor.inventor.actions.SoActionSoAction.AppliedCodes, SoAction.DistribModes, SoAction.PathCodes, SoAction.PathIndicesNested classes/interfaces inherited from class com.openinventor.inventor.InventorInventor.ConstructorCommand
- 
Field SummaryFields inherited from class com.openinventor.inventor.InventorVERBOSE_LEVEL, ZeroHandle
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddShapeHintsNode(boolean a) Sets whether a shape hints node is added.booleanGets the flag that specifies whether simple shapes are simplified.booleanGets the normal generation flag.static voidenableElement(Class<? extends Inventor> t, int stkIndex) voidgenerateNormals(boolean g) Sets the normal generation flag.Gets the strategy used to determine how to group triangles into the simplified shapes.This returns the new scene graph which contains the simplified result.booleanGets whether a shape hints node will be added.voidsetCatchAllShapesFlag(boolean c) Sets the flag that specifies whether simple shapes are simplified.voidSets the strategy used to determine how to group triangles into the simplified shapes.Methods inherited from class com.openinventor.inventor.actions.SoSimplifyActiongetDirectRanges, getDirectSimplificationLevels, getMinTriangles, getNumRanges, getNumSimplificationLevels, getRanges, getSimplificationLevels, getSizeFactor, getUrlName, isInlineLOD, isRenderCulling, isVerbose, setInlineLOD, setMinTriangles, setRanges, setRenderCulling, setSimplificationLevels, setSizeFactor, setUrlName, setVerbosityMethods inherited from class com.openinventor.inventor.actions.SoActionapply, apply, clearApplyResult, forwardTraversal, forwardTraversal, getContinueActionInBranchFlag, getCurPath, getDistribMode, getNodeAppliedTo, getOriginalPathListAppliedTo, getPathAppliedTo, getPathCode, getPathListAppliedTo, getPipeId, getSceneManager, getState, getWhatAppliedTo, hasTerminated, invalidateState, isBeingApplied, isLastPathListAppliedTo, isUsingAlternateRep, nullAction, postDelayedTraversal, preDelayedTraversal, resetContinueActionInBranchFlag, setPipeId, setSceneManager, setUpState, stopActionInBranch, traverse, useAlternateRepMethods inherited from class com.openinventor.inventor.Inventordispose, getNativeResourceHandle
- 
Constructor Details- 
SoGlobalSimplifyActionConstructor. The algorithm used for simplifying is defined by theSoSimplifierclass that is passed in the constructor.
 
- 
- 
Method Details- 
isShapeHintAddedpublic boolean isShapeHintAdded()Gets whether a shape hints node will be added.
- 
setSimplificationStrategySets the strategy used to determine how to group triangles into the simplified shapes. The choices are SIMPLIFY_GLOBALLY and SIMPLIFY_BY_SUBGROUP. Default is SIMPLIFY_BY_GROUP.
- 
areAllShapesCatchedpublic boolean areAllShapesCatched()Gets the flag that specifies whether simple shapes are simplified.
- 
setCatchAllShapesFlagpublic void setCatchAllShapesFlag(boolean c) 
- 
enableElement
- 
addShapeHintsNodepublic void addShapeHintsNode(boolean a) Sets whether a shape hints node is added. If true, a shapeHints node is added to force smooth normals if they were not generated, and to turn on two-sided lighting. Default is false.
- 
getSimplifiedSceneGraphThis returns the new scene graph which contains the simplified result.
- 
getSimplificationStrategyGets the strategy used to determine how to group triangles into the simplified shapes.
- 
areNormalGeneratedpublic boolean areNormalGenerated()Gets the normal generation flag. If true, per-vertex normals are calculated while simplifying.
- 
generateNormalspublic void generateNormals(boolean g) Sets the normal generation flag. If true, per-vertex normals are calculated while simplifying. Default value is true.
 
-