Abstract base class for simplifying scene graphs. More...
#include <Inventor/actions/SoSimplifyAction.h>
Public Member Functions | |
virtual SoType | getTypeId () const |
Returns the type identifier for this specific instance. | |
SoSimplifyAction (SoSimplifier *_simplifier) | |
Constructor. | |
~SoSimplifyAction () | |
Destructor. | |
void | setSimplificationLevels (int num, const float levels[]) |
Sets number of levels of detail to produce and what percentage to produce at each level. | |
const float * | getSimplificationLevels () const |
Gets percentages to produce at each level of detail. | |
int | getNumSimplificationLevels () const |
Gets number of levels of detail to produce. | |
void | setRanges (int num, const float newRanges[]) |
Sets the ranges that will be used in the LevelOfSimplification node to decide which level of detail to display. | |
const float * | getRanges () const |
Gets the ranges that will be used in the LevelOfSimplification node to decide which level of detail to display. | |
int | getNumRanges () const |
Gets the number of ranges that will be used in the LevelOfSimplification node to decide which level of detail to display. | |
void | setSizeFactor (float size) |
Sets the scale factor to use to decide what values of ranges to use in the LevelOfSimplification node. | |
float | getSizeFactor () const |
Gets the scale factor to use to decide what values of ranges to use in the LevelOfSimplification node. | |
void | setInlineLOD (SbBool i) |
Sets inlineLOD flag. | |
SbBool | isInlineLOD () const |
Gets inlineLOD flag. | |
void | setUrlName (const SbString name) |
Sets the name used when creating Inline files for each simplified child. | |
SbString | getUrlName () const |
Gets the name used when creating Inline files for each simplified child. | |
void | setVerbosity (SbBool v) |
Sets verbosity flag. | |
SbBool | isVerbose () const |
Gets verbosity 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. | |
int | getMinTriangles () const |
Gets the minimum number of triangles for a simplified child. | |
void | setRenderCulling (SbBool r) |
Sets render culling flag. | |
int | isRenderCulling () const |
Gets render culling flag. | |
Public Member Functions inherited from SoAction | |
virtual | ~SoAction () |
Destructor. | |
virtual void | apply (SoNode *node) |
Initiates an action on the graph defined by a node. | |
virtual void | apply (SoPath *path) |
Initiates an action on the graph defined by a path. | |
virtual void | apply (const SoPathList &pathList, SbBool obeysRules=FALSE) |
Initiates an action on the graph defined by a list of paths. | |
virtual void | clearApplyResult () |
When applied, an action may reference nodes or create objects (e.g. | |
virtual void | invalidateState () |
Invalidates the current traversal state in the action, forcing it to be recreated when the action is next applied. | |
void | stopActionInBranch () |
This function stops the action in the current Scene Graph branch. | |
SbBool | getContinueActionInBranchFlag () const |
This function indicates if the action must stop in the current branch. | |
void | resetContinueActionInBranchFlag () |
This function resets the continue action flag. | |
void | useAlternateRep (const SbBool enable) |
Tell the action to use alternate representations during traversal when available. | |
SbBool | isUsingAlternateRep () const |
Returns TRUE if current action is using alternate representations. | |
void | setSceneManager (SoSceneManager *mgr) |
Set the scene manager associated with this action (if any ). | |
SoSceneManager * | getSceneManager () const |
Return the SoSceneManager associated with this action. | |
virtual void | forwardTraversal (SoNode *node) |
Traverse a node that is not part of the current scenegraph. | |
virtual void | forwardTraversal (SoPath *path) |
Traverse a path that is not part of the current scenegraph. | |
DistribMode | getDistribMode () const |
Returns the distribution mode of this action across a cluster (ScaleViz-Cluster only). | |
AppliedCode | getWhatAppliedTo () const |
Returns code indicating what action is being applied to. | |
SoNode * | getNodeAppliedTo () const |
Returns the node the action is being applied to. | |
SoPath * | getPathAppliedTo () const |
Returns the path the action is being applied to. | |
const SoPathList * | getPathListAppliedTo () const |
Returns the path list the action is being applied to. | |
const SoPathList * | getOriginalPathListAppliedTo () const |
Returns the original path list the action is being applied to. | |
SbBool | isLastPathListAppliedTo () const |
Returns TRUE if the current list is the last one from the original. | |
PathCode | getPathCode (int &numIndices, const int *&indices) |
Returns path code based on where current node (the node at the end of the current path) lies with respect to the path(s) the action is being applied to. | |
PathCode | getPathCodeMI (int &numIndices, const int *&indices, const int *&instanceIndices) |
Extender API: available to programmers who wish to extend the toolkit | |
void | traverse (SoNode *node) |
Does traversal of a graph rooted by a node. | |
SbBool | hasTerminated () const |
Returns TRUE if the traversal has reached a termination condition. | |
const SoPath * | getCurPath () |
Returns the path accumulated during traversal, i.e., the chain of nodes from the root of the traversed graph to the current node being traversed. | |
SoState * | getState () const |
Gets the state from the action. | |
virtual void | setUpState () |
Creates state if it is NULL or it is no longer valid because new elements have been enabled since it was created. | |
void | setPipeId (int id) |
Sets pipe identifier in the range [1..N] associated to this render action while running a ScaleViz Multipipe configuration. | |
int | getPipeId () const |
Gets pipe identifier in the range [1..N] associated to this render action while running a ScaleViz Multipipe configuration. | |
bool | isBeingApplied () |
Returns TRUE if this action is currently being applied. | |
virtual bool | preDelayedTraversal () |
Method called by SoMultiPassManager before delayed pass traversals. | |
virtual void | postDelayedTraversal () |
Method called by SoMultiPassManager after delayed pass traversals. | |
Public Member Functions inherited from SoTypedObject | |
SbBool | isOfType (const SoType &type) const |
Returns TRUE if this object is of the type specified in type or is derived from that type. | |
template<typename TypedObjectClass > | |
SbBool | isOfType () const |
Returns TRUE if this object is of the type of class TypedObjectClass or is derived from that class. | |
Static Public Member Functions | |
static SoType | getClassTypeId () |
Returns the type identifier for this class. | |
Static Public Member Functions inherited from SoAction | |
static SoType | getClassTypeId () |
Returns the type identifier for this class. | |
static void | nullAction (SoAction *, SoNode *) |
Null action method that can be stored in lookup table when desired. | |
Static Public Member Functions inherited from SoTypedObject | |
static SoType | getClassTypeId () |
Returns the type identifier for this class. | |
Additional Inherited Members | |
Public Types inherited from SoAction | |
enum | DistribMode { LOCAL_ONLY , CLUSTER_ONLY , ALL } |
This is used to define the way an action is distributed across a cluster. More... | |
enum | AppliedCode { NODE , PATH , PATH_LIST } |
This enum is used to determine what the action is being applied to. More... | |
enum | PathCode { NO_PATH , IN_PATH , BELOW_PATH , OFF_PATH } |
This enum may be used during traversal of nodes to indicate where the node is with respect to the path being traversed. More... | |
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:
SoAction, SoLevelOfSimplification, SoGlobalSimplifyAction, SoShapeSimplifyAction, SoReorganizeAction
Definition at line 84 of file SoSimplifyAction.h.
SoSimplifyAction::SoSimplifyAction | ( | SoSimplifier * | _simplifier | ) |
Constructor.
The algorithm used for simplifying is defined by the SoSimplifier class that is passed in the constructor.
SoSimplifyAction::~SoSimplifyAction | ( | ) |
Destructor.
|
static |
Returns the type identifier for this class.
int SoSimplifyAction::getMinTriangles | ( | ) | const |
Gets the minimum number of triangles for a simplified child.
int SoSimplifyAction::getNumRanges | ( | ) | const |
Gets the number of ranges that will be used in the LevelOfSimplification node to decide which level of detail to display.
int SoSimplifyAction::getNumSimplificationLevels | ( | ) | const |
Gets number of levels of detail to produce.
const float * SoSimplifyAction::getRanges | ( | ) | const |
Gets the ranges that will be used in the LevelOfSimplification node to decide which level of detail to display.
const float * SoSimplifyAction::getSimplificationLevels | ( | ) | const |
Gets percentages to produce at each level of detail.
float SoSimplifyAction::getSizeFactor | ( | ) | const |
Gets the scale factor to use to decide what values of ranges to use in the LevelOfSimplification node.
|
virtual |
Returns the type identifier for this specific instance.
Implements SoTypedObject.
Reimplemented in SoGlobalSimplifyAction, SoReorganizeAction, and SoShapeSimplifyAction.
SbString SoSimplifyAction::getUrlName | ( | ) | const |
Gets the name used when creating Inline files for each simplified child.
SbBool SoSimplifyAction::isInlineLOD | ( | ) | const |
Gets inlineLOD flag.
If true, each simplified child is written into a separate file using SoWWWInline nodes.
int SoSimplifyAction::isRenderCulling | ( | ) | const |
Gets render culling flag.
If true, the "renderCulling" field will be set to ON for the Separators that hold each simplified level.
SbBool SoSimplifyAction::isVerbose | ( | ) | const |
Gets verbosity flag.
If true, the simplify action prints out messages at each stage of the simplification.
void SoSimplifyAction::setInlineLOD | ( | SbBool | i | ) |
Sets inlineLOD flag.
If true, each simplified child is written into a separate file using SoWWWInline nodes.
void SoSimplifyAction::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 SoSimplifyAction::setRanges | ( | int | num, |
const 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.
void SoSimplifyAction::setRenderCulling | ( | SbBool | r | ) |
Sets render culling flag.
If true, the "renderCulling" field will be set to ON for the Separators that hold each simplified level.
void SoSimplifyAction::setSimplificationLevels | ( | int | num, |
const 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.
void SoSimplifyAction::setSizeFactor | ( | float | size | ) |
Sets the scale factor to use to decide what values of ranges to use in the LevelOfSimplification node.
void SoSimplifyAction::setUrlName | ( | const SbString | name | ) |
Sets the name used when creating Inline files for each simplified child.
void SoSimplifyAction::setVerbosity | ( | SbBool | v | ) |
Sets verbosity flag.
If true, the simplify action prints out messages at each stage of the simplification.