Class SoSimplifyAction
- java.lang.Object
- 
- com.openinventor.inventor.Inventor
- 
- com.openinventor.inventor.actions.SoAction
- 
- com.openinventor.inventor.actions.SoSimplifyAction
 
 
 
- 
- Direct Known Subclasses:
- SoGlobalSimplifyAction,- SoReorganizeAction,- SoShapeSimplifyAction
 
 public class SoSimplifyAction extends SoAction Abstract base class for simplifying scene graphs. This class is the base class of the simplify actions that produce versions of a scene graph with fewer triangles. The simplify actions can generate either several simplified levels of the original geometry, grouped by a LevelOfSimplification node, or just one reduced level of detail. If a single level is computed, the action creates a single IndexedTriangleFaceSet.Each simplified sub-levels can be stored in regular separators or in WWWInline nodes. In this case, the urlName defines the full url to use for each WWWInline. For instance if urlName = "dir/file", the action will generate "dir/file_1.wrl","dir/file_2.wrl", and so on. When a simplify action generates Level of Simplification nodes, the range field of each Level of Simplification node can be given globally in the range field of the simplify action. If the simplify action range field is not set, the simplify action computes it automatically for each LevelOfSimplification node. In this case, the sizeFactor field can be used to customize the range computation. A minimum number of triangles can be set to stop the simplification when the object becomes too small. Specifying 0.0 for the last level inserts an empty node in the scene graph. This allows you to avoid rendering an object that is too small or too far from the viewer. Available simplification actions are: - SoGlobalSimplifyAction
 Traverses the scene graph and collects all the triangles into a single shape which is then simplified.
- SoShapeSimplifyAction
 Traverses the scene graph and simplifies each shape independently.
- SoReorganizeAction
 Reorganizes the scene graph by grouping shapes with common properties, then combines those shapes in a single shape and runs the simplifier on it.
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class com.openinventor.inventor.actions.SoActionSoAction.AppliedCodes, SoAction.DistribModes, SoAction.PathCodes, SoAction.PathIndices
 - 
Nested classes/interfaces inherited from class com.openinventor.inventor.InventorInventor.ConstructorCommand
 
- 
 - 
Field Summary- 
Fields inherited from class com.openinventor.inventor.InventorVERBOSE_LEVEL, ZeroHandle
 
- 
 - 
Constructor SummaryConstructors Constructor Description SoSimplifyAction(SoSimplifier _simplifier)Constructor.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidenableElement(java.lang.Class<? extends Inventor> t, int stkIndex)java.nio.FloatBuffergetDirectRanges()Gets the ranges that will be used in the LevelOfSimplification node to decide which level of detail to display.java.nio.FloatBuffergetDirectSimplificationLevels()Gets percentages to produce at each level of detail.intgetMinTriangles()Gets the minimum number of triangles for a simplified child.intgetNumRanges()Gets the number of ranges that will be used in the LevelOfSimplification node to decide which level of detail to display.intgetNumSimplificationLevels()Gets number of levels of detail to produce.float[]getRanges()Gets the ranges that will be used in the LevelOfSimplification node to decide which level of detail to display.float[]getSimplificationLevels()Gets percentages to produce at each level of detail.floatgetSizeFactor()Gets the scale factor to use to decide what values of ranges to use in the LevelOfSimplification node.java.lang.StringgetUrlName()Gets the name used when creating Inline files for each simplified child.booleanisInlineLOD()Gets inlineLOD flag.intisRenderCulling()Gets render culling flag.booleanisVerbose()Gets verbosity flag.voidsetInlineLOD(boolean i)Sets inlineLOD flag.voidsetMinTriangles(int mt)Sets the minimum number of triangles for a simplified child; if a given percentage would create a simplified version that went below this minimum, no simplified chld is produced for this level.voidsetRanges(float[] newRanges)Sets the ranges that will be used in the LevelOfSimplification node to decide which level of detail to display.voidsetRenderCulling(boolean r)Sets render culling flag.voidsetSimplificationLevels(float[] levels)Sets number of levels of detail to produce and what percentage to produce at each level.voidsetSizeFactor(float size)Sets the scale factor to use to decide what values of ranges to use in the LevelOfSimplification node.voidsetUrlName(java.lang.String name)Sets the name used when creating Inline files for each simplified child.voidsetVerbosity(boolean v)Sets verbosity flag.- 
Methods 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, useAlternateRep
 - 
Methods inherited from class com.openinventor.inventor.Inventordispose, getNativeResourceHandle
 
- 
 
- 
- 
- 
Constructor Detail- 
SoSimplifyActionpublic SoSimplifyAction(SoSimplifier _simplifier) Constructor. The algorithm used for simplifying is defined by theSoSimplifierclass that is passed in the constructor.
 
- 
 - 
Method Detail- 
setRangespublic void setRanges(float[] newRanges) Sets the ranges that will be used in the LevelOfSimplification node to decide which level of detail to display. This is optional; if not given, the size factor will be used to generate range values.
 - 
setUrlNamepublic void setUrlName(java.lang.String name) Sets the name used when creating Inline files for each simplified child.
 - 
getDirectRangespublic java.nio.FloatBuffer getDirectRanges() Gets the ranges that will be used in the LevelOfSimplification node to decide which level of detail to display.
 - 
enableElementpublic static void enableElement(java.lang.Class<? extends Inventor> t, int stkIndex) 
 - 
setSimplificationLevelspublic void setSimplificationLevels(float[] levels) Sets number of levels of detail to produce and what percentage to produce at each level. An example array would be [1.0, 0.3, 0.1], which would generate a LevelOfSimplification node with the original geometry and then two simplified children, one with 30% of the triangles and the other with 10% of the triangles in the original.
 - 
getDirectSimplificationLevelspublic java.nio.FloatBuffer getDirectSimplificationLevels() Gets percentages to produce at each level of detail.
 - 
getNumSimplificationLevelspublic int getNumSimplificationLevels() Gets number of levels of detail to produce.
 - 
getSimplificationLevelspublic float[] getSimplificationLevels() Gets percentages to produce at each level of detail.
 - 
isVerbosepublic boolean isVerbose() Gets verbosity flag. If true, the simplify action prints out messages at each stage of the simplification.
 - 
setInlineLODpublic void setInlineLOD(boolean i) Sets inlineLOD flag. If true, each simplified child is written into a separate file usingSoWWWInlinenodes.
 - 
setMinTrianglespublic void setMinTriangles(int mt) Sets the minimum number of triangles for a simplified child; if a given percentage would create a simplified version that went below this minimum, no simplified chld is produced for this level.
 - 
getUrlNamepublic java.lang.String getUrlName() Gets the name used when creating Inline files for each simplified child.
 - 
setVerbositypublic void setVerbosity(boolean v) Sets verbosity flag. If true, the simplify action prints out messages at each stage of the simplification.
 - 
isInlineLODpublic boolean isInlineLOD() Gets inlineLOD flag. If true, each simplified child is written into a separate file usingSoWWWInlinenodes.
 - 
getSizeFactorpublic float getSizeFactor() Gets the scale factor to use to decide what values of ranges to use in the LevelOfSimplification node.
 - 
getNumRangespublic int getNumRanges() Gets the number of ranges that will be used in the LevelOfSimplification node to decide which level of detail to display.
 - 
isRenderCullingpublic int isRenderCulling() Gets render culling flag. If true, the "renderCulling" field will be set to ON for the Separators that hold each simplified level.
 - 
getRangespublic float[] getRanges() Gets the ranges that will be used in the LevelOfSimplification node to decide which level of detail to display.
 - 
getMinTrianglespublic int getMinTriangles() Gets the minimum number of triangles for a simplified child.
 - 
setSizeFactorpublic void setSizeFactor(float size) Sets the scale factor to use to decide what values of ranges to use in the LevelOfSimplification node.
 - 
setRenderCullingpublic void setRenderCulling(boolean r) Sets render culling flag. If true, the "renderCulling" field will be set to ON for the Separators that hold each simplified level.
 
- 
 
-