.TH "SoGLViewingMatrixElement" 3 "Tue Jun 23 2026 23:48:38" "Version 4.0.10" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME SoGLViewingMatrixElement \- The \fBSoGLViewingMatrixElement\fP class is used to store the current viewing matrix\&. .SH SYNOPSIS .br .PP .PP \fR#include \fP .PP Inherits \fBSoViewingMatrixElement\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 void \fBpop\fP (\fBSoState\fP *state, const \fBSoElement\fP *prevTopElement)" .br .in -1c Public Member Functions inherited from \fBSoReplacedElement\fP .in +1c .ti -1c .RI "virtual SbBool \fBmatches\fP (const \fBSoElement\fP *element) const" .br .ti -1c .RI "virtual \fBSoElement\fP * \fBcopyMatchInfo\fP () const" .br .ti -1c .RI "SbUniqueId \fBgetNodeId\fP () const" .br .ti -1c .RI "virtual void \fBprint\fP (FILE *file) 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 "void \fBsetDepth\fP (const int \fBdepth\fP)" .br .ti -1c .RI "int \fBgetDepth\fP (void) 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 SbUniqueId \fBgetNodeId\fP (\fBSoState\fP *const state)" .br .ti -1c .RI "static \fBSbMatrix\fP \fBgetResetMatrix\fP (\fBSoState\fP *state)" .br .in -1c Static Public Member Functions inherited from \fBSoViewingMatrixElement\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 * \fBcreateInstance\fP (void)" .br .ti -1c .RI "static void \fBinitClass\fP (void)" .br .ti -1c .RI "static void \fBset\fP (\fBSoState\fP *const state, \fBSoNode\fP *const node, const \fBSbMatrix\fP &ViewingMatrix)" .br .RI "FIXME: write doc\&. " .ti -1c .RI "static const \fBSbMatrix\fP & \fBget\fP (\fBSoState\fP *const state)" .br .RI "FIXME: write doc\&. " .in -1c Static Public Member Functions inherited from \fBSoReplacedElement\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~SoGLViewingMatrixElement\fP ()" .br .ti -1c .RI "virtual void \fBsetElt\fP (const \fBSbMatrix\fP &matrix)" .br .in -1c Protected Member Functions inherited from \fBSoViewingMatrixElement\fP .in +1c .ti -1c .RI "virtual \fB~SoViewingMatrixElement\fP ()" .br .in -1c Protected Member Functions inherited from \fBSoReplacedElement\fP .in +1c .ti -1c .RI "virtual \fB~SoReplacedElement\fP ()" .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 "virtual void \fBcaptureThis\fP (\fBSoState\fP *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 "Additional Inherited Members" Static Protected Member Functions inherited from \fBSoReplacedElement\fP .in +1c .ti -1c .RI "static \fBSoElement\fP * \fBgetElement\fP (\fBSoState\fP *const state, const int \fBstackIndex\fP, \fBSoNode\fP *const node)" .br .in -1c 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 Protected Attributes inherited from \fBSoViewingMatrixElement\fP .in +1c .ti -1c .RI "\fBSbMatrix\fP \fBviewingMatrix\fP" .br .in -1c Protected Attributes inherited from \fBSoReplacedElement\fP .in +1c .ti -1c .RI "SbUniqueId \fBnodeId\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 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 \fBSoGLViewingMatrixElement\fP class is used to store the current viewing matrix\&. The viewing matrix contains the inverse camera coordinate system matrix\&. The camera coordinate system is built from the field values in the current \fBSoCamera\fP (currently either \fBSoPerspectiveCamera\fP or \fBSoOrthographicCamera\fP) and any transformations prior to the camera in the scene graph\&. .SH "Constructor & Destructor Documentation" .PP .SS "SoGLViewingMatrixElement::~SoGLViewingMatrixElement (void )\fR [protected]\fP, \fR [virtual]\fP" Destructor\&. .SH "Member Function Documentation" .PP .SS "\fBSoType\fP SoGLViewingMatrixElement::getClassTypeId (void )\fR [static]\fP" This static method returns the \fBSoType\fP object associated with objects of this class\&. .SS "int SoGLViewingMatrixElement::getClassStackIndex (void )\fR [static]\fP" This static method returns the state stack index for the class\&. .SS "void * SoGLViewingMatrixElement::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 SoGLViewingMatrixElement::initClass (void )\fR [static]\fP" Initialize relevant common data for all instances, like the type system\&. .SS "void SoGLViewingMatrixElement::init (\fBSoState\fP * state)\fR [virtual]\fP" Initializes the element to its default value\&. The default value is the identity matrix\&. .PP Reimplemented from \fBSoViewingMatrixElement\fP\&. .SS "void SoGLViewingMatrixElement::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 \fBSoElement\fP\&. .SS "void SoGLViewingMatrixElement::pop (\fBSoState\fP * state, const \fBSoElement\fP * prevTopElement)\fR [virtual]\fP" This method is called when the state is popped, and the depth of the element is bigger than the current state depth\&. \fBpop()\fP is called on the new top of stack, and a pointer to the previous top of stack is passed in \fIprevTopElement\fP\&. .PP Override this method if you need to copy some state information from the previous top of stack\&. .PP Reimplemented from \fBSoElement\fP\&. .SS "SbUniqueId SoGLViewingMatrixElement::getNodeId (\fBSoState\fP *const state)\fR [static]\fP" Returns the node id of the current camera node\&. This is used by \fBSoGLModelMatrixElement\fP to detect a change in the viewing matrix inside an \fBSoTransformSeparator\fP node\&. .SS "\fBSbMatrix\fP SoGLViewingMatrixElement::getResetMatrix (\fBSoState\fP * state)\fR [static]\fP" Returns the matrix that should be used by \fBSoGLModelMatrixElement\fP when the transformation should be reset during traversal (typically when encountering an \fBSoResetTransform\fP node)\&. It is not sufficient to simply load the viewing matrix, since the transformations that were applied before the camera needs to be accounted for\&. .PP This function is an extension for Coin, and it is not available in the original SGI Open Inventor v2\&.1 API\&. .br .PP \fBSince\fP .RS 4 Coin 2\&.0 .RE .PP .SS "void SoGLViewingMatrixElement::setElt (const \fBSbMatrix\fP & matrix)\fR [protected]\fP, \fR [virtual]\fP" Sets the current viewing matrix\&. .PP Reimplemented from \fBSoViewingMatrixElement\fP\&. .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.