Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
SoModelScaleElement Class Reference

Stores the current model scale. More...

#include <Inventor/elements/SoModelScaleElement.h>

+ Inheritance diagram for SoModelScaleElement:

Public Member Functions

const SbVec3f getScaleFactor () const
 Returns the of this element model scale - if the overall SoModelMatrix is diagonazible Not all the SoModelMatrix are diagonalizable because a SoMatrixTransform or a direct set of the SoModelMatrix with a not diagonalizable matrix, so the getScaleFactor can return a vector containing one or more NaN or zeros.
 
- Public Member Functions inherited from SoModelMatrixElement
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 const SbVec3f getScaleFactor (SoState *state)
 Returns current model scale - if the overall SoModelMatrix is diagonazible Not all the SoModelMatrix are diagonalizable because a SoMatrixTransform or a direct set of the SoModelMatrix with a not diagonalizable matrix, so the getScaleFactor can return a vector containing one or more NaN or zeros.
 
- Static Public Member Functions inherited from SoModelMatrixElement
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.
 

Detailed Description

Stores the current model scale.

This is just to redefine the match method to track just the scale portion of the model matrix and to use this element to filter changes not related to scaling. Not all the SoModelMatrix are diagonalizable because a SoMatrixTransform or a direct set of the SoModelMatrix with a not diagonalizable matrix, so the getScaleFactor can return a vector containing one or more NaN or zeros. This element has some limitation related to the way transformation also rigid ones are accumulated. So please use it with attention also because for the moment the SbMatrix::getTransform method does not return any status

This element stores just the scale pportion of 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.

SEE ALSO

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

Definition at line 84 of file SoModelScaleElement.h.

Member Function Documentation

◆ getClassStackIndex()

static int SoModelScaleElement::getClassStackIndex ( )
static

Returns the stack id for this element.


◆ getClassTypeId()

static SoType SoModelScaleElement::getClassTypeId ( )
static

Returns the type identifier for this class.


◆ getScaleFactor() [1/2]

const SbVec3f SoModelScaleElement::getScaleFactor ( ) const

Returns the of this element model scale - if the overall SoModelMatrix is diagonazible Not all the SoModelMatrix are diagonalizable because a SoMatrixTransform or a direct set of the SoModelMatrix with a not diagonalizable matrix, so the getScaleFactor can return a vector containing one or more NaN or zeros.

◆ getScaleFactor() [2/2]

static const SbVec3f SoModelScaleElement::getScaleFactor ( SoState state)
static

Returns current model scale - if the overall SoModelMatrix is diagonazible Not all the SoModelMatrix are diagonalizable because a SoMatrixTransform or a direct set of the SoModelMatrix with a not diagonalizable matrix, so the getScaleFactor can return a vector containing one or more NaN or zeros.


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