Class SoSimplifyAction
- Direct Known Subclasses:
SoGlobalSimplifyAction
,SoReorganizeAction
,SoShapeSimplifyAction
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.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.openinventor.inventor.actions.SoAction
SoAction.AppliedCodes, SoAction.DistribModes, SoAction.PathCodes, SoAction.PathIndices
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
Field Summary
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
enableElement
(Class<? extends Inventor> t, int stkIndex) Gets the ranges that will be used in the LevelOfSimplification node to decide which level of detail to display.Gets percentages to produce at each level of detail.int
Gets the minimum number of triangles for a simplified child.int
Gets the number of ranges that will be used in the LevelOfSimplification node to decide which level of detail to display.int
Gets number of levels of detail to produce.float[]
Gets the ranges that will be used in the LevelOfSimplification node to decide which level of detail to display.float[]
Gets percentages to produce at each level of detail.float
Gets the scale factor to use to decide what values of ranges to use in the LevelOfSimplification node.Gets the name used when creating Inline files for each simplified child.boolean
Gets inlineLOD flag.int
Gets render culling flag.boolean
Gets verbosity flag.void
setInlineLOD
(boolean i) Sets inlineLOD flag.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.void
setRanges
(float[] newRanges) Sets the ranges that will be used in the LevelOfSimplification node to decide which level of detail to display.void
setRenderCulling
(boolean r) Sets render culling flag.void
setSimplificationLevels
(float[] levels) Sets number of levels of detail to produce and what percentage to produce at each level.void
setSizeFactor
(float size) Sets the scale factor to use to decide what values of ranges to use in the LevelOfSimplification node.void
setUrlName
(String name) Sets the name used when creating Inline files for each simplified child.void
setVerbosity
(boolean v) Sets verbosity flag.Methods inherited from class com.openinventor.inventor.actions.SoAction
apply, 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.Inventor
dispose, getNativeResourceHandle
-
Constructor Details
-
SoSimplifyAction
Constructor. The algorithm used for simplifying is defined by theSoSimplifier
class that is passed in the constructor.
-
-
Method Details
-
setRanges
public 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. -
setUrlName
Sets the name used when creating Inline files for each simplified child. -
getDirectRanges
Gets the ranges that will be used in the LevelOfSimplification node to decide which level of detail to display. -
enableElement
-
setSimplificationLevels
public 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. -
getDirectSimplificationLevels
Gets percentages to produce at each level of detail. -
getNumSimplificationLevels
public int getNumSimplificationLevels()Gets number of levels of detail to produce. -
getSimplificationLevels
public float[] getSimplificationLevels()Gets percentages to produce at each level of detail. -
isVerbose
public boolean isVerbose()Gets verbosity flag. If true, the simplify action prints out messages at each stage of the simplification. -
setInlineLOD
public void setInlineLOD(boolean i) Sets inlineLOD flag. If true, each simplified child is written into a separate file usingSoWWWInline
nodes. -
setMinTriangles
public 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. -
getUrlName
Gets the name used when creating Inline files for each simplified child. -
setVerbosity
public void setVerbosity(boolean v) Sets verbosity flag. If true, the simplify action prints out messages at each stage of the simplification. -
isInlineLOD
public boolean isInlineLOD()Gets inlineLOD flag. If true, each simplified child is written into a separate file usingSoWWWInline
nodes. -
getSizeFactor
public float getSizeFactor()Gets the scale factor to use to decide what values of ranges to use in the LevelOfSimplification node. -
getNumRanges
public int getNumRanges()Gets the number of ranges that will be used in the LevelOfSimplification node to decide which level of detail to display. -
isRenderCulling
public int isRenderCulling()Gets render culling flag. If true, the "renderCulling" field will be set to ON for the Separators that hold each simplified level. -
getRanges
public float[] getRanges()Gets the ranges that will be used in the LevelOfSimplification node to decide which level of detail to display. -
getMinTriangles
public int getMinTriangles()Gets the minimum number of triangles for a simplified child. -
setSizeFactor
public void setSizeFactor(float size) Sets the scale factor to use to decide what values of ranges to use in the LevelOfSimplification node. -
setRenderCulling
public 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.
-