Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
SoModelMatrixElement Class Reference

Stores the current model matrix. More...

#include <Inventor/elements/SoModelMatrixElement.h>

+ Inheritance diagram for SoModelMatrixElement:

Public Member Functions

virtual void push (SoState *state)
 Overrides push() method to copy values from next instance in the stack.
 
virtual void print (FILE *fp) const
 Prints element (for debugging).
 
- Public Member Functions inherited from SoElement
virtual void pop (SoState *state, const SoElement *prevTopElement)
 Pops element.
 
virtual SoType getTypeId () const
 Returns type identifier for element instance.
 
- 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 int getClassStackIndex ()
 Returns the stack id for this element.
 
static void makeIdentity (SoState *state, SoNode *node)
 Sets the model matrix to the identity matrix.
 
static void set (SoState *state, SoNode *node, const SbMatrix &matrix, SbBool sendToGL=TRUE)
 Sets the model matrix to the given matrix.
 
static void mult (SoState *state, SoNode *node, const SbMatrix &matrix)
 Multiplies the given matrix into the model matrix.
 
static void translateBy (SoState *state, SoNode *node, const SbVec3f &translation)
 This multiplies a matrix that performs the specified transformation into the model matrix.
 
static void rotateBy (SoState *state, SoNode *node, const SbRotation &rotation)
 This multiplies a matrix that performs the specified transformation into the model matrix.
 
static void scaleBy (SoState *state, SoNode *node, const SbVec3f &scaleFactor)
 This multiplies a matrix that performs the specified transformation into the model matrix.
 
static SbMatrix pushMatrix (SoState *state)
 This method is used by the TransformSeparator node.
 
static void popMatrix (SoState *state, const SbMatrix &m)
 This method is used by the TransformSeparator node.
 
static void setCullMatrix (SoState *state, SoNode *node, const SbMatrix &matrix)
 Sets the transformation that defines the volume that view-volume culling should be tested against.
 
static const SbMatrixgetCombinedCullMatrix (SoState *state)
 This method gets the model*cullMatrix combined matrix (which is cached by this element).
 
static const SbMatrixget (SoState *state)
 Returns current model matrix from the state.
 
static const SbMatrixget (SoState *state, SbBool &isIdent)
 Returns current model matrix from the state, sets given flag to TRUE if matrix is known to be identity.
 
- Static Public Member Functions inherited from SoAccumulatedElement
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
static int getClassStackIndex ()
 Returns the stack id for this element.
 
- Static Public Member Functions inherited from SoElement
static SoType getClassTypeId ()
 Returns type identifier for SoElement class.
 
- Static Public Member Functions inherited from SoTypedObject
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 

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

Definition at line 80 of file SoModelMatrixElement.h.

Member Function Documentation

◆ get() [1/2]

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

Returns current model matrix from the state.

◆ get() [2/2]

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.

◆ getClassStackIndex()

static int SoModelMatrixElement::getClassStackIndex ( )
static

Returns the stack id for this element.


◆ getClassTypeId()

static SoType SoModelMatrixElement::getClassTypeId ( )
static

Returns the type identifier for this class.


◆ getCombinedCullMatrix()

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

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

◆ makeIdentity()

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

Sets the model matrix to the identity matrix.

◆ mult()

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

Multiplies the given matrix into the model matrix.

◆ popMatrix()

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.

◆ print()

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

Prints element (for debugging).

Reimplemented from SoAccumulatedElement.

◆ push()

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.

◆ pushMatrix()

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.

◆ rotateBy()

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.

◆ scaleBy()

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.

◆ set()

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.

◆ setCullMatrix()

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.

◆ translateBy()

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 Symbol Documentation

◆ SoLocalBBoxMatrixElement

friend class SoLocalBBoxMatrixElement
friend

Definition at line 277 of file SoModelMatrixElement.h.


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