Open Inventor Release 2024.2.0
 
Loading...
Searching...
No Matches
SoReorganizeAction Class Reference

VSG extension Reorganizes the scene graph by grouping shapes with common properties, then groups these shapes in a single shape and runs the simplifier on it. More...

#include <Inventor/actions/SoReorganizeAction.h>

+ Inheritance diagram for SoReorganizeAction:

Public Member Functions

virtual SoType getTypeId () const
 Returns the type identifier for this specific instance.
 
 SoReorganizeAction (SoSimplifier *_simplifier=NULL)
 Constructor.
 
 ~SoReorganizeAction ()
 Destructor.
 
SoSeparatorgetSimplifiedSceneGraph () const
 Returns result of reorganization as new scene graph.
 
void generateNormals (SbBool g)
 Sets whether normals should be generated during reorganization.
 
SbBool areNormalGenerated () const
 Gets whether normals should be generated during reorganization.
 
void generateTriangleStrips (SbBool g)
 Sets whether triangle strips should be generated.
 
SbBool areTriangleStripGenerated () const
 Gets whether triangle strips should be generated; if false, IndexedFaceSets are generated.
 
void generateTexCoords (SbBool g)
 Sets whether texture coordinates should be generated during reorganization.
 
SbBool areTexCoordsGenerated () const
 Gets whether texture coordinates should be generated during reorganization.
 
void generateVPNodes (SbBool g)
 Sets whether vertex property nodes should be generated during reorganization.
 
SbBool areVPNodesGenerated () const
 Gets whether vertex property nodes should be generated during reorganization.
 
void matchIndexArrays (SbBool g)
 Sets whether to try to match index arrays during reorganization.
 
SbBool areIndexArraysMatched () const
 Gets whether to try to match index arrays during reorganization.
 
SoSimplifiergetSimplifier () const
 Returns the simplifier being used, may be NULL.
 
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 &path_list, SbBool obeys_rules=FALSE)
 Initiates an action on the graph defined by a list of paths.
 
- Public Member Functions inherited from SoSimplifyAction
 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 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 ).
 
SoSceneManagergetSceneManager () 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.
 
SoNodegetNodeAppliedTo () const
 Returns the node the action is being applied to.
 
SoPathgetPathAppliedTo () const
 Returns the path the action is being applied to.
 
const SoPathListgetPathListAppliedTo () const
 Returns the path list the action is being applied to.
 
const SoPathListgetOriginalPathListAppliedTo () 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 SoPathgetCurPath ()
 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.
 
SoStategetState () 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 SoNONUNICODE void startReport (const char *msg)
 Starts a report.
 
static void startReport (const SbString &msg)
 Starts a report.
 
static void finishReport ()
 Ends a report.
 
- Static Public Member Functions inherited from SoSimplifyAction
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...
 

Detailed Description

VSG extension Reorganizes the scene graph by grouping shapes with common properties, then groups these shapes in a single shape and runs the simplifier on it.

This class reorganizes the scene graph by grouping shapes with common properties, then groups these shapes in a single shape and runs the simplifier on it. If a simplifier is not provided, it creates an indexed triangle strip set from this shape.

In order for shapes to be grouped together, they must:

  • Be indexed shapes (e.g., SoIndexedFaceSet)
  • Have the same material properties
  • Have a material binding of PER_VERTEX_INDEXED.

SEE ALSO

SoAction, SoIndexedTriangleStripSet

Definition at line 67 of file SoReorganizeAction.h.

Constructor & Destructor Documentation

◆ SoReorganizeAction()

SoReorganizeAction::SoReorganizeAction ( SoSimplifier _simplifier = NULL)

Constructor.

◆ ~SoReorganizeAction()

SoReorganizeAction::~SoReorganizeAction ( )

Destructor.

Member Function Documentation

◆ apply() [1/3]

virtual void SoReorganizeAction::apply ( const SoPathList path_list,
SbBool  obeys_rules = FALSE 
)
virtual

Initiates an action on the graph defined by a list of paths.

TRUE can be passed for the obeysRules flag if the given path list has the following 4 properties:

  1. All paths have the same head node.
  2. Paths are sorted in traversal order.
  3. If one path ends at node A, no other path continues through A.
  4. No two paths are the same.

These rules will be obeyed by path lists returned by picking and by searches for non-group nodes.

Reimplemented from SoAction.

◆ apply() [2/3]

virtual void SoReorganizeAction::apply ( SoNode node)
virtual

Initiates an action on the graph defined by a node.

Warning: Most actions call ref() on the node before traversing the scene graph, then call unref() after traversal. If the node's reference count was zero (the default), the call to apply() will cause it to be destroyed.

Reimplemented from SoAction.

◆ apply() [3/3]

virtual void SoReorganizeAction::apply ( SoPath path)
virtual

Initiates an action on the graph defined by a path.

Warning: Most actions call ref() on the path before traversing the scene graph, then call unref() after traversal. If the path's reference count was zero (the default), the call to apply() will cause it to be destroyed.

Reimplemented from SoAction.

◆ areIndexArraysMatched()

SbBool SoReorganizeAction::areIndexArraysMatched ( ) const
inline

Gets whether to try to match index arrays during reorganization.

Definition at line 136 of file SoReorganizeAction.h.

◆ areNormalGenerated()

SbBool SoReorganizeAction::areNormalGenerated ( ) const
inline

Gets whether normals should be generated during reorganization.

Definition at line 95 of file SoReorganizeAction.h.

◆ areTexCoordsGenerated()

SbBool SoReorganizeAction::areTexCoordsGenerated ( ) const
inline

Gets whether texture coordinates should be generated during reorganization.

Definition at line 116 of file SoReorganizeAction.h.

◆ areTriangleStripGenerated()

SbBool SoReorganizeAction::areTriangleStripGenerated ( ) const
inline

Gets whether triangle strips should be generated; if false, IndexedFaceSets are generated.

Definition at line 105 of file SoReorganizeAction.h.

◆ areVPNodesGenerated()

SbBool SoReorganizeAction::areVPNodesGenerated ( ) const
inline

Gets whether vertex property nodes should be generated during reorganization.

Definition at line 127 of file SoReorganizeAction.h.

◆ finishReport()

static void SoReorganizeAction::finishReport ( )
static

Ends a report.

"Done" is sent to the console window.

◆ generateNormals()

void SoReorganizeAction::generateNormals ( SbBool  g)
inline

Sets whether normals should be generated during reorganization.


Default is TRUE.

Definition at line 91 of file SoReorganizeAction.h.

◆ generateTexCoords()

void SoReorganizeAction::generateTexCoords ( SbBool  g)
inline

Sets whether texture coordinates should be generated during reorganization.


Default is TRUE.

Definition at line 111 of file SoReorganizeAction.h.

◆ generateTriangleStrips()

void SoReorganizeAction::generateTriangleStrips ( SbBool  g)
inline

Sets whether triangle strips should be generated.


Default is TRUE. If false, IndexedFaceSets are generated.

Definition at line 100 of file SoReorganizeAction.h.

◆ generateVPNodes()

void SoReorganizeAction::generateVPNodes ( SbBool  g)
inline

Sets whether vertex property nodes should be generated during reorganization.


Default is TRUE.

Definition at line 122 of file SoReorganizeAction.h.

◆ getClassTypeId()

static SoType SoReorganizeAction::getClassTypeId ( )
static

Returns the type identifier for this class.


◆ getSimplifiedSceneGraph()

SoSeparator * SoReorganizeAction::getSimplifiedSceneGraph ( ) const
inline

Returns result of reorganization as new scene graph.

Definition at line 86 of file SoReorganizeAction.h.

◆ getSimplifier()

SoSimplifier * SoReorganizeAction::getSimplifier ( ) const
inline

Returns the simplifier being used, may be NULL.

Definition at line 141 of file SoReorganizeAction.h.

◆ getTypeId()

virtual SoType SoReorganizeAction::getTypeId ( ) const
virtual

Returns the type identifier for this specific instance.

Reimplemented from SoSimplifyAction.

◆ matchIndexArrays()

void SoReorganizeAction::matchIndexArrays ( SbBool  g)
inline

Sets whether to try to match index arrays during reorganization.


Default is TRUE.

Definition at line 132 of file SoReorganizeAction.h.

◆ startReport() [1/2]

static SoNONUNICODE void SoReorganizeAction::startReport ( const char *  msg)
static

Starts a report.

The specified message is sent to the console window. Non Unicode: This function should not be used in a Unicode application.

◆ startReport() [2/2]

static void SoReorganizeAction::startReport ( const SbString msg)
static

Starts a report.

The specified message is sent to the console window.


The documentation for this class was generated from the following file: