Open Inventor Release 2024.1.1
 
Loading...
Searching...
No Matches
SoGetMatrixAction Class Reference

Computes transformation matrix for a subgraph. More...

#include <Inventor/actions/SoGetMatrixAction.h>

+ Inheritance diagram for SoGetMatrixAction:

Public Member Functions

virtual SoType getTypeId () const
 Returns the type identifier for this specific instance.
 
 SoGetMatrixAction (const SbViewportRegion &newRegion)
 Constructor.
 
void setViewportRegion (const SbViewportRegion &newRegion)
 Sets current viewport region to use for action.
 
const SbViewportRegiongetViewportRegion () const
 Returns current viewport region to use for action.
 
SbMatrixgetMatrix ()
 Returns cumulative transformation matrix.
 
SbMatrixgetInverse ()
 Returns the inverse of the cumulative transformation matrix.
 
SbMatrixgetTextureMatrix ()
 Returns cumulative texture transformation matrix.
 
SbMatrixgetTextureInverse ()
 Returns the inverse of the cumulative texture transformation matrix.
 
- 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 ).
 
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 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

Computes transformation matrix for a subgraph.

This action computes transformation matrices for a given subgraph. It computes the cumulative transformation matrix and its inverse, along with a cumulative texture transformation matrix and its inverse. The cumulative transformation matrix transforms the coordinates of a shape from the local object coordinate system to the global world coordinate system.

When this action is applied to a node, it computes the matrix for just that node. This is currently the easiest way to get the transformation matrix for an SoTransform node. It's not very useful for most other types of nodes.

The most common scenario is applying this action to a path. In that case it gathers the transformation info for all nodes in the path and those that affect nodes in the path, but it stops when it hits the last node in the path; it does not traverse downwards from it as most other actions (such as rendering) do. This behavior makes the most sense for this action. To get a path to, for example, a specific geometry in the scene graph see SoSearchAction.

Sets: SoViewportRegionElement

EXAMPLE

    // Get cumulative matrix using current viewport on screen
    SoPath* somePath = ...
    SoGetMatrixAction gma( viewer->getViewportRegion() );
    gma.apply( somePath );
    SbMatrix& matrix = gma.getMatrix();
    4x4 matrix class.
    Definition SbMatrix.h:309
    Path that points to a list of hierarchical nodes.
    Definition SoPath.h:187

SEE ALSO

SoGetBoundingBoxAction, SoSearchAction

Definition at line 141 of file SoGetMatrixAction.h.

Constructor & Destructor Documentation

◆ SoGetMatrixAction()

SoGetMatrixAction::SoGetMatrixAction ( const SbViewportRegion newRegion)

Constructor.


Even though the bounding box computation may not involve a window per se, some nodes need the size of the viewport to determine their size in 3D coordinates. For example the size of an SoText2 is a fixed value in device coordinates, but the corresponding size in 3D depends on the current camera.

Usually it is convenient to get the actual viewport region from the viewer as shown in the example above. However if the scene graph does not contain any viewport dependent nodes then any values can be used.

Member Function Documentation

◆ getClassTypeId()

static SoType SoGetMatrixAction::getClassTypeId ( )
static

Returns the type identifier for this class.


◆ getInverse()

SbMatrix & SoGetMatrixAction::getInverse ( )
inline

Returns the inverse of the cumulative transformation matrix.

Warning: the matrix returned by this routine should not be changed (unless you are implementing your own transformation nodes).

Definition at line 185 of file SoGetMatrixAction.h.

◆ getMatrix()

SbMatrix & SoGetMatrixAction::getMatrix ( )
inline

Returns cumulative transformation matrix.

Warning: the matrix returned by this routine should not be changed (unless you are implementing your own transformation nodes).

Definition at line 179 of file SoGetMatrixAction.h.

◆ getTextureInverse()

SbMatrix & SoGetMatrixAction::getTextureInverse ( )
inline

Returns the inverse of the cumulative texture transformation matrix.

Warning: the matrix returned by this routine should not be changed (unless you are implementing your own transformation nodes).

Definition at line 198 of file SoGetMatrixAction.h.

◆ getTextureMatrix()

SbMatrix & SoGetMatrixAction::getTextureMatrix ( )
inline

Returns cumulative texture transformation matrix.

Warning: the matrix returned by this routine should not be changed (unless you are implementing your own transformation nodes).

Definition at line 192 of file SoGetMatrixAction.h.

◆ getTypeId()

virtual SoType SoGetMatrixAction::getTypeId ( ) const
virtual

Returns the type identifier for this specific instance.

Implements SoTypedObject.

◆ getViewportRegion()

const SbViewportRegion & SoGetMatrixAction::getViewportRegion ( ) const
inline

Returns current viewport region to use for action.

Definition at line 172 of file SoGetMatrixAction.h.

◆ setViewportRegion()

void SoGetMatrixAction::setViewportRegion ( const SbViewportRegion newRegion)

Sets current viewport region to use for action.


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