SoModelMatrixElement Class Reference
[Elements]

Stores the current model matrix. More...

#include <Inventor/elements/SoModelMatrixElement.h>

Inheritance diagram for SoModelMatrixElement:
SoAccumulatedElement SoElement SoTypedObject SoBBoxModelMatrixElement SoModelScaleElement

List of all members.

Classes

struct  Flags

Public Member Functions

virtual void push (SoState *state)
virtual void print (FILE *fp) const

Static Public Member Functions

static SoType getClassTypeId ()
static int getClassStackIndex ()
static void makeIdentity (SoState *state, SoNode *node)
static void set (SoState *state, SoNode *node, const SbMatrix &matrix, SbBool sendToGL=TRUE)
static void mult (SoState *state, SoNode *node, const SbMatrix &matrix)
static void translateBy (SoState *state, SoNode *node, const SbVec3f &translation)
static void rotateBy (SoState *state, SoNode *node, const SbRotation &rotation)
static void scaleBy (SoState *state, SoNode *node, const SbVec3f &scaleFactor)
static SbMatrix pushMatrix (SoState *state)
static void popMatrix (SoState *state, const SbMatrix &m)
static void setCullMatrix (SoState *state, SoNode *node, const SbMatrix &matrix)
static const SbMatrixgetCombinedCullMatrix (SoState *state)
static const SbMatrixget (SoState *state)
static const SbMatrixget (SoState *state, SbBool &isIdent)

Friends

class SoLocalBBoxMatrixElement

Detailed Description

Stores the current model matrix.

This element stores the current model matrix - the cumulative transformation applied to subsequent shapes. Because the matrix is cumulative, this class is derived from SoAccumulatedElement. The set() method replaces the current matrix, while all the others (mult(), translateBy(), etc.) multiply into it. Node id's of the nodes that affect the element are accumulated properly.

This element also stores the current view-volume culling transformation, which is normally the view*projection matrices (set by cameras), but which may be modified by sophisticated culling schemes.

SEE ALSO

SoMatrixTransform, SoRotation, SoRotationXYZ, SoScale, SoTransform, SoTranslation, SoUnits


Member Function Documentation

static const SbMatrix& SoModelMatrixElement::get ( SoState state,
SbBool isIdent 
) [static]

Returns current model matrix from the state, sets given flag to TRUE if matrix is known to be identity.

static const SbMatrix& SoModelMatrixElement::get ( SoState state  )  [static]

Returns current model matrix from the state.

static int SoModelMatrixElement::getClassStackIndex (  )  [static]

Returns the stack id for this element.

Reimplemented from SoAccumulatedElement.

Reimplemented in SoBBoxModelMatrixElement, and SoModelScaleElement.

static SoType SoModelMatrixElement::getClassTypeId (  )  [static]

Returns the type identifier for this class.

Reimplemented from SoAccumulatedElement.

Reimplemented in SoBBoxModelMatrixElement, and SoModelScaleElement.

static const SbMatrix& SoModelMatrixElement::getCombinedCullMatrix ( SoState state  )  [static]

This method gets the model*cullMatrix combined matrix (which is cached by this element).

static void SoModelMatrixElement::makeIdentity ( SoState state,
SoNode node 
) [static]

Sets the model matrix to the identity matrix.

static void SoModelMatrixElement::mult ( SoState state,
SoNode node,
const SbMatrix matrix 
) [static]

Multiplies the given matrix into the model matrix.

static void SoModelMatrixElement::popMatrix ( SoState state,
const SbMatrix m 
) [static]

This method is used by the TransformSeparator node.

WARNING! For proper caching behavior, the matrix returned by pushMatrix() must be used ONLY as a later argument to popMatrix(), and you must NOT modify the matrix between the push and the pop. If you need the matrix for any other reason, you MUST use the get() routine.

virtual void SoModelMatrixElement::print ( FILE *  fp  )  const [virtual]

Prints element (for debugging).

Reimplemented from SoAccumulatedElement.

virtual void SoModelMatrixElement::push ( SoState state  )  [virtual]

Overrides push() method to copy values from next instance in the stack.

Reimplemented from SoAccumulatedElement.

Reimplemented in SoBBoxModelMatrixElement.

static SbMatrix SoModelMatrixElement::pushMatrix ( SoState state  )  [static]

This method is used by the TransformSeparator node.

WARNING! For proper caching behavior, the matrix returned by pushMatrix() must be used ONLY as a later argument to popMatrix(), and you must NOT modify the matrix between the push and the pop. If you need the matrix for any other reason, you MUST use the get() routine.

static void SoModelMatrixElement::rotateBy ( SoState state,
SoNode node,
const SbRotation rotation 
) [static]

This multiplies a matrix that performs the specified transformation into the model matrix.

static void SoModelMatrixElement::scaleBy ( SoState state,
SoNode node,
const SbVec3f scaleFactor 
) [static]

This multiplies a matrix that performs the specified transformation into the model matrix.

static void SoModelMatrixElement::set ( SoState state,
SoNode node,
const SbMatrix matrix,
SbBool  sendToGL = TRUE 
) [static]

Sets the model matrix to the given matrix.

This method will (indirectly) call glLoadMatrix with the new matrix unless the 'sendToGL' parameter is explicitly FALSE.

static void SoModelMatrixElement::setCullMatrix ( SoState state,
SoNode node,
const SbMatrix matrix 
) [static]

Sets the transformation that defines the volume that view-volume culling should be tested against.

static void SoModelMatrixElement::translateBy ( SoState state,
SoNode node,
const SbVec3f translation 
) [static]

This multiplies a matrix that performs the specified transformation into the model matrix.


Friends And Related Function Documentation

friend class SoLocalBBoxMatrixElement [friend]

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

Open Inventor Toolkit reference manual, generated on 15 Mar 2023
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/