.TH "SoModelMatrixElement" 3 "Tue Jun 23 2026 23:48:38" "Version 4.0.10" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME SoModelMatrixElement \- The \fBSoModelMatrixElement\fP class is used to manage the current transformation\&. .SH SYNOPSIS .br .PP .PP \fR#include \fP .PP Inherits \fBSoAccumulatedElement\fP\&. .PP Inherited by \fBSoBBoxModelMatrixElement\fP, and \fBSoGLModelMatrixElement\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "virtual void \fBinit\fP (\fBSoState\fP *state)" .br .ti -1c .RI "virtual void \fBpush\fP (\fBSoState\fP *state)" .br .ti -1c .RI "virtual SbBool \fBmatches\fP (const \fBSoElement\fP *element) const" .br .ti -1c .RI "const \fBSbMatrix\fP & \fBgetModelMatrix\fP (void) const" .br .in -1c Public Member Functions inherited from \fBSoElement\fP .in +1c .ti -1c .RI "const \fBSoType\fP \fBgetTypeId\fP (void) const" .br .ti -1c .RI "int \fBgetStackIndex\fP (void) const" .br .ti -1c .RI "virtual void \fBpop\fP (\fBSoState\fP *state, const \fBSoElement\fP *prevTopElement)" .br .ti -1c .RI "void \fBsetDepth\fP (const int \fBdepth\fP)" .br .ti -1c .RI "int \fBgetDepth\fP (void) const" .br .ti -1c .RI "virtual void \fBprint\fP (FILE *file=stdout) const" .br .ti -1c .RI "virtual \fB~SoElement\fP ()" .br .in -1c .SS "Static Public Member Functions" .in +1c .ti -1c .RI "static \fBSoType\fP \fBgetClassTypeId\fP (void)" .br .ti -1c .RI "static int \fBgetClassStackIndex\fP (void)" .br .ti -1c .RI "static void * \fBcreateInstance\fP (void)" .br .ti -1c .RI "static void \fBinitClass\fP (void)" .br .ti -1c .RI "static void \fBmakeIdentity\fP (\fBSoState\fP *const state, \fBSoNode\fP *const node)" .br .ti -1c .RI "static void \fBset\fP (\fBSoState\fP *const state, \fBSoNode\fP *const node, const \fBSbMatrix\fP &matrix)" .br .ti -1c .RI "static void \fBsetCullMatrix\fP (\fBSoState\fP *state, \fBSoNode\fP *node, const \fBSbMatrix\fP &matrix)" .br .ti -1c .RI "static void \fBmult\fP (\fBSoState\fP *const state, \fBSoNode\fP *const node, const \fBSbMatrix\fP &matrix)" .br .ti -1c .RI "static void \fBtranslateBy\fP (\fBSoState\fP *const state, \fBSoNode\fP *const node, const \fBSbVec3f\fP &translation)" .br .ti -1c .RI "static void \fBrotateBy\fP (\fBSoState\fP *const state, \fBSoNode\fP *const node, const \fBSbRotation\fP &rotation)" .br .ti -1c .RI "static void \fBscaleBy\fP (\fBSoState\fP *const state, \fBSoNode\fP *const node, const \fBSbVec3f\fP &scaleFactor)" .br .ti -1c .RI "static \fBSbMatrix\fP \fBpushMatrix\fP (\fBSoState\fP *const state)" .br .ti -1c .RI "static void \fBpopMatrix\fP (\fBSoState\fP *const state, const \fBSbMatrix\fP &matrix)" .br .ti -1c .RI "static const \fBSbMatrix\fP & \fBgetCombinedCullMatrix\fP (\fBSoState\fP *const state)" .br .ti -1c .RI "static const \fBSbMatrix\fP & \fBget\fP (\fBSoState\fP *const state)" .br .ti -1c .RI "static const \fBSbMatrix\fP & \fBget\fP (\fBSoState\fP *const state, SbBool &isIdentity)" .br .in -1c Static Public Member Functions inherited from \fBSoAccumulatedElement\fP .in +1c .ti -1c .RI "static \fBSoType\fP \fBgetClassTypeId\fP (void)" .br .ti -1c .RI "static int \fBgetClassStackIndex\fP (void)" .br .ti -1c .RI "static void \fBinitClass\fP (void)" .br .in -1c Static Public Member Functions inherited from \fBSoElement\fP .in +1c .ti -1c .RI "static void \fBinitClass\fP (void)" .br .ti -1c .RI "static \fBSoType\fP \fBgetClassTypeId\fP (void)" .br .ti -1c .RI "static int \fBgetClassStackIndex\fP (void)" .br .ti -1c .RI "static void \fBinitElements\fP (void)" .br .ti -1c .RI "static int \fBgetNumStackIndices\fP (void)" .br .ti -1c .RI "static \fBSoType\fP \fBgetIdFromStackIndex\fP (const int \fBstackIndex\fP)" .br .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "virtual \fB~SoModelMatrixElement\fP ()" .br .ti -1c .RI "virtual void \fBmakeEltIdentity\fP (void)" .br .ti -1c .RI "virtual void \fBsetElt\fP (const \fBSbMatrix\fP &matrix)" .br .ti -1c .RI "virtual void \fBmultElt\fP (const \fBSbMatrix\fP &matrix)" .br .ti -1c .RI "virtual void \fBtranslateEltBy\fP (const \fBSbVec3f\fP &translation)" .br .ti -1c .RI "virtual void \fBrotateEltBy\fP (const \fBSbRotation\fP &rotation)" .br .ti -1c .RI "virtual void \fBscaleEltBy\fP (const \fBSbVec3f\fP &scaleFactor)" .br .ti -1c .RI "virtual \fBSbMatrix\fP \fBpushMatrixElt\fP (void)" .br .ti -1c .RI "virtual void \fBpopMatrixElt\fP (const \fBSbMatrix\fP &matrix)" .br .in -1c Protected Member Functions inherited from \fBSoAccumulatedElement\fP .in +1c .ti -1c .RI "virtual \fB~SoAccumulatedElement\fP ()" .br .ti -1c .RI "void \fBclearNodeIds\fP (void)" .br .ti -1c .RI "void \fBaddNodeId\fP (const \fBSoNode\fP *const node)" .br .ti -1c .RI "void \fBsetNodeId\fP (const \fBSoNode\fP *const node)" .br .ti -1c .RI "void \fBcopyNodeIds\fP (const \fBSoAccumulatedElement\fP *copyfrom)" .br .ti -1c .RI "virtual \fBSoElement\fP * \fBcopyMatchInfo\fP (void) const" .br .ti -1c .RI "virtual void \fBcaptureThis\fP (\fBSoState\fP *state) const" .br .in -1c Protected Member Functions inherited from \fBSoElement\fP .in +1c .ti -1c .RI "\fBSoElement\fP (void)" .br .ti -1c .RI "void \fBcapture\fP (\fBSoState\fP *const state) const" .br .ti -1c .RI "void \fBsetTypeId\fP (const \fBSoType\fP \fBtypeId\fP)" .br .ti -1c .RI "void \fBsetStackIndex\fP (const int index)" .br .ti -1c .RI "\fBSoElement\fP * \fBgetNextInStack\fP (void) const" .br .ti -1c .RI "\fBSoElement\fP * \fBgetNextFree\fP (void) const" .br .in -1c .SS "Protected Attributes" .in +1c .ti -1c .RI "\fBSbMatrix\fP \fBmodelMatrix\fP" .br .ti -1c .RI "\fBSbMatrix\fP \fBcullMatrix\fP" .br .ti -1c .RI "\fBSbMatrix\fP \fBcombinedMatrix\fP" .br .ti -1c .RI "uint32_t \fBflags\fP" .br .in -1c Protected Attributes inherited from \fBSoAccumulatedElement\fP .in +1c .ti -1c .RI "\fBSbList\fP< SbUniqueId > \fBnodeIds\fP" .br .in -1c Protected Attributes inherited from \fBSoElement\fP .in +1c .ti -1c .RI "\fBSoType\fP \fBtypeId\fP" .br .ti -1c .RI "int \fBstackIndex\fP" .br .ti -1c .RI "int \fBdepth\fP" .br .in -1c .SS "Additional Inherited Members" Static Protected Member Functions inherited from \fBSoElement\fP .in +1c .ti -1c .RI "static \fBSoElement\fP * \fBgetElement\fP (\fBSoState\fP *const state, const int \fBstackIndex\fP)" .br .ti -1c .RI "static const \fBSoElement\fP * \fBgetConstElement\fP (\fBSoState\fP *const state, const int \fBstackIndex\fP)" .br .ti -1c .RI "static int \fBcreateStackIndex\fP (const \fBSoType\fP id)" .br .in -1c Static Protected Attributes inherited from \fBSoElement\fP .in +1c .ti -1c .RI "static int \fBclassStackIndex\fP" .br .ti -1c .RI "static \fBSoTypeList\fP * \fBstackToType\fP" .br .in -1c .SH "Detailed Description" .PP The \fBSoModelMatrixElement\fP class is used to manage the current transformation\&. \fBSoModelMatrixElement\fP contains the object-to-world matrix\&. .PP The world-to-camera transformation is stored in the \fBSoViewingMatrixElement\fP class\&. .PP Note that one thing that can be a little confusing with the API is that \fBSoModelMatrixElement\fP does not contain the same matrix as the OpenGL \fRGL_MODELVIEW\fP matrix\&. .PP \fBSee also\fP .RS 4 \fBSoViewingMatrixElement\fP .RE .PP .SH "Constructor & Destructor Documentation" .PP .SS "SoModelMatrixElement::~SoModelMatrixElement (void )\fR [protected]\fP, \fR [virtual]\fP" Destructor\&. .SH "Member Function Documentation" .PP .SS "\fBSoType\fP SoModelMatrixElement::getClassTypeId (void )\fR [static]\fP" This static method returns the \fBSoType\fP object associated with objects of this class\&. .SS "int SoModelMatrixElement::getClassStackIndex (void )\fR [static]\fP" This static method returns the state stack index for the class\&. .SS "void * SoModelMatrixElement::createInstance (void )\fR [static]\fP" \fIThis API member is considered internal to the library, as it is not likely to be of interest to the application programmer\&.\fP .br .br Creates a new instance of the class type corresponding to the \fBSoType\fP object\&. .SS "void SoModelMatrixElement::initClass (void )\fR [static]\fP" Initialize relevant common data for all instances, like the type system\&. .SS "void SoModelMatrixElement::init (\fBSoState\fP * state)\fR [virtual]\fP" Initializes the element to its default value\&. The default value for modelMatrix is the identity matrix\&. .PP Reimplemented from \fBSoAccumulatedElement\fP\&. .PP Reimplemented in \fBSoBBoxModelMatrixElement\fP, and \fBSoGLModelMatrixElement\fP\&. .SS "void SoModelMatrixElement::push (\fBSoState\fP * state)\fR [virtual]\fP" This method is called every time a new element is required in one of the stacks\&. This happens when a writable element is requested, using \fBSoState::getElement()\fP or indirectly \fBSoElement::getElement()\fP, and the depth of the current element is less than the state depth\&. .PP Override this method if your element needs to copy data from the previous top of stack\&. The \fBpush()\fP method is called on the new element, and the previous element can be found using \fBSoElement::getNextInStack()\fP\&. .PP Reimplemented from \fBSoAccumulatedElement\fP\&. .PP Reimplemented in \fBSoBBoxModelMatrixElement\fP, and \fBSoGLModelMatrixElement\fP\&. .SS "SbBool SoModelMatrixElement::matches (const \fBSoElement\fP * element) const\fR [virtual]\fP" This function returns \fRTRUE\fP is the element matches another element (of the same class), with respect to cache validity\&. .PP If the application programmer's extension element has a \fBmatches()\fP function, it should also have a \fBcopyMatchInfo()\fP function\&. .PP Reimplemented from \fBSoAccumulatedElement\fP\&. .SS "void SoModelMatrixElement::makeIdentity (\fBSoState\fP *const state, \fBSoNode\fP *const node)\fR [static]\fP" Sets the current model matrix to the identity matrix\&. .SS "void SoModelMatrixElement::set (\fBSoState\fP *const state, \fBSoNode\fP *const node, const \fBSbMatrix\fP & matrix)\fR [static]\fP" Sets the current model matrix to \fImatrix\fP\&. .SS "void SoModelMatrixElement::setCullMatrix (\fBSoState\fP * state, \fBSoNode\fP * node, const \fBSbMatrix\fP & matrix)\fR [static]\fP" Sets the current cull matrix\&. .SS "void SoModelMatrixElement::mult (\fBSoState\fP *const state, \fBSoNode\fP *const node, const \fBSbMatrix\fP & matrix)\fR [static]\fP" Multiplies \fImatrix\fP into the model matrix\&. .SS "void SoModelMatrixElement::translateBy (\fBSoState\fP *const state, \fBSoNode\fP *const node, const \fBSbVec3f\fP & translation)\fR [static]\fP" Appends \fItranslation\fP to the model matrix\&. .SS "void SoModelMatrixElement::rotateBy (\fBSoState\fP *const state, \fBSoNode\fP *const node, const \fBSbRotation\fP & rotation)\fR [static]\fP" Appends \fIrotation\fP to the model matrix\&. .SS "void SoModelMatrixElement::scaleBy (\fBSoState\fP *const state, \fBSoNode\fP *const node, const \fBSbVec3f\fP & scaleFactor)\fR [static]\fP" Appends \fIscaleFactor\fP to the model matrix\&. .SS "\fBSbMatrix\fP SoModelMatrixElement::pushMatrix (\fBSoState\fP *const state)\fR [static]\fP" Used by \fBSoTransformSeparator\fP to store and restore model matrix\&. Don't use it for any other reason\&. .SS "void SoModelMatrixElement::popMatrix (\fBSoState\fP *const state, const \fBSbMatrix\fP & matrix)\fR [static]\fP" Used by \fBSoTransformSeparator\fP to store and restore model matrix\&. Don't use it for any other reason\&. .SS "const \fBSbMatrix\fP & SoModelMatrixElement::getCombinedCullMatrix (\fBSoState\fP *const state)\fR [static]\fP" Returns the combined cull and model matrix\&. This matrix is cached\&. .SS "const \fBSbMatrix\fP & SoModelMatrixElement::get (\fBSoState\fP *const state)\fR [static]\fP" Returns the current model matrix\&. .SS "const \fBSbMatrix\fP & SoModelMatrixElement::get (\fBSoState\fP *const state, SbBool & isIdentity)\fR [static]\fP" Returns the current model matrix\&. Sets \fIisIdentity\fP to TRUE if the model matrix is known to be an identity matrix\&. .SS "const \fBSbMatrix\fP & SoModelMatrixElement::getModelMatrix (void ) const" Returns the current model matrix\&. .SS "void SoModelMatrixElement::makeEltIdentity (void )\fR [protected]\fP, \fR [virtual]\fP" virtual method which is called from the static method \fBmakeIdentity()\fP\&. Sets element model matrix to identity\&. .PP Reimplemented in \fBSoBBoxModelMatrixElement\fP, and \fBSoGLModelMatrixElement\fP\&. .SS "void SoModelMatrixElement::setElt (const \fBSbMatrix\fP & matrix)\fR [protected]\fP, \fR [virtual]\fP" virtual method which is called from the static method \fBset()\fP\&. Sets element model matrix to \fImatrix\fP\&. .PP Reimplemented in \fBSoBBoxModelMatrixElement\fP, and \fBSoGLModelMatrixElement\fP\&. .SS "void SoModelMatrixElement::multElt (const \fBSbMatrix\fP & matrix)\fR [protected]\fP, \fR [virtual]\fP" virtual method which is called from the static method \fBmult()\fP\&. Multiplies \fImatrix\fP into element model matrix\&. .PP Reimplemented in \fBSoBBoxModelMatrixElement\fP, and \fBSoGLModelMatrixElement\fP\&. .SS "void SoModelMatrixElement::translateEltBy (const \fBSbVec3f\fP & translation)\fR [protected]\fP, \fR [virtual]\fP" virtual method which is called from the static method \fBtranslateBy()\fP\&. Appends \fItranslation\fP to element model matrix\&. .PP Reimplemented in \fBSoBBoxModelMatrixElement\fP, and \fBSoGLModelMatrixElement\fP\&. .SS "void SoModelMatrixElement::rotateEltBy (const \fBSbRotation\fP & rotation)\fR [protected]\fP, \fR [virtual]\fP" virtual method which is called from the static method \fBrotateBy()\fP\&. Appends \fIrotation\fP to element model matrix\&. .PP Reimplemented in \fBSoBBoxModelMatrixElement\fP, and \fBSoGLModelMatrixElement\fP\&. .SS "void SoModelMatrixElement::scaleEltBy (const \fBSbVec3f\fP & scaleFactor)\fR [protected]\fP, \fR [virtual]\fP" virtual method which is called from the static method \fBscaleBy()\fP\&. Appends \fIscaleFactor\fP to element model matrix\&. .PP Reimplemented in \fBSoBBoxModelMatrixElement\fP, and \fBSoGLModelMatrixElement\fP\&. .SS "\fBSbMatrix\fP SoModelMatrixElement::pushMatrixElt (void )\fR [protected]\fP, \fR [virtual]\fP" virtual method which is called from the static method \fBpushMatrix()\fP\&. Returns current model matrix\&. .PP Reimplemented in \fBSoBBoxModelMatrixElement\fP, and \fBSoGLModelMatrixElement\fP\&. .SS "void SoModelMatrixElement::popMatrixElt (const \fBSbMatrix\fP & matrix)\fR [protected]\fP, \fR [virtual]\fP" virtual method which is called from the static method \fBpopMatrix()\fP\&. Restores model matrix to the matrix returned from \fBpushMatrix()\fP\&. .PP Reimplemented in \fBSoBBoxModelMatrixElement\fP, and \fBSoGLModelMatrixElement\fP\&. .SH "Member Data Documentation" .PP .SS "\fBSbMatrix\fP SoModelMatrixElement::modelMatrix\fR [protected]\fP" FIXME: write doc\&. .SS "\fBSbMatrix\fP SoModelMatrixElement::cullMatrix\fR [protected]\fP" FIXME: write doc\&. .SS "\fBSbMatrix\fP SoModelMatrixElement::combinedMatrix\fR [protected]\fP" FIXME: write doc\&. .SS "uint32_t SoModelMatrixElement::flags\fR [protected]\fP" FIXME: write doc\&. .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.