SoGetMatrixAction(3)
β¨ SoGetMatrixAction(3) β¨
okay so bestie, this page comes straight out of the Library Functions Manual, and it's all about SoGetMatrixAction. buckle up, it's giving transformation-matrix realness π
πΈ NAME πΈ
SoGetMatrixAction β the action class for accumulating the transformation matrix of a subgraph. no cap.
π¦ SYNOPSIS π¦
#include <Inventor/actions/SoGetMatrixAction.h>
Inherits SoAction. it's literally in the family tree, iykyk π
π Public Member Functions π
virtual SoType getTypeId (void) constβ the type-checking baddieSoGetMatrixAction (const SbViewportRegion ®ion)β constructor, say hivirtual ~SoGetMatrixAction ()β destructor, bye bestievoid setViewportRegion (const SbViewportRegion ®ion)β sets the viewport regionconst SbViewportRegion & getViewportRegion (void) constβ gets the viewport region backSbMatrix & getMatrix (void)β the accumulated transformation matrixSbMatrix & getInverse (void)β the inverse of that matrixSbMatrix & getTextureMatrix (void)β the accumulated texture matrixSbMatrix & getTextureInverse (void)β the inverse of the texture matrix
π«Ά Public Member Functions inherited from SoAction π«Ά
virtual ~SoAction ()virtual SbBool isOfType (SoType type) constvirtual void apply (SoNode *root)virtual void apply (SoPath *path)virtual void apply (const SoPathList &pathlist, SbBool obeysrules=0)void apply (SoAction *beingApplied)virtual void invalidateState (void)AppliedCode getWhatAppliedTo (void) constSoNode * getNodeAppliedTo (void) constSoPath * getPathAppliedTo (void) constconst SoPathList * getPathListAppliedTo (void) constconst SoPathList * getOriginalPathListAppliedTo (void) constSbBool isLastPathListAppliedTo (void) constPathCode getPathCode (int &numindices, const int *&indices)void traverse (SoNode *const node)SbBool hasTerminated (void) constconst SoPath * getCurPath (void)SoState * getState (void) constPathCode getCurPathCode (void) constvirtual SoNode * getCurPathTail (void)void usePathCode (int &numindices, const int *&indices)void pushCurPath (const int childindex, SoNode *node=NULL)void popCurPath (const PathCode prevpathcode)void pushCurPath (void)void popPushCurPath (const int childindex, SoNode *node=NULL)void popCurPath (void)void switchToPathTraversal (SoPath *path)void switchToNodeTraversal (SoNode *node)
β Static Public Member Functions β
static SoType getClassTypeId (void)static void addMethod (const SoType type, SoActionMethod method)static void enableElement (const SoType type, const int stackindex)static void initClass (void)
π Static Public Member Functions inherited from SoAction π
static void initClass (void)static void initClasses (void)static SoType getClassTypeId (void)static void nullAction (SoAction *action, SoNode *node)
π Protected Member Functions π
virtual const SoEnabledElementsList & getEnabledElements (void) constvirtual void beginTraversal (SoNode *node)
π§ Protected Member Functions inherited from SoAction π§
SoAction (void)virtual void endTraversal (SoNode *node)void setTerminated (const SbBool flag)virtual SbBool shouldCompactPathList (void) const
π Static Protected Member Functions π
static SoEnabledElementsList * getClassEnabledElements (void)static SoActionMethodList * getClassActionMethods (void)
πΈ Static Protected Member Functions inherited from SoAction πΈ
static SoEnabledElementsList * getClassEnabledElements (void)static SoActionMethodList * getClassActionMethods (void)
π«Ά Additional Inherited Members π«Ά
π Public Types inherited from SoAction π
enum AppliedCode { NODE = 0, PATH = 1, PATH_LIST = 2 }
enum PathCode { NO_PATH = 0, IN_PATH = 1, BELOW_PATH = 2, OFF_PATH = 3 }
π Protected Attributes inherited from SoAction π
SoState * state
SoActionMethodList * traversalMethods
π₯ Detailed Description π₯
okay so SoGetMatrixAction is an action for accumulating the transformation matrix of a subgraph. it's literally the glow-up tool for coordinate systems β¨
This action makes it easy to calculate and convert to and from the global coordinate system of your scene and local coordinates of parts in a hierarchical model. so useful, we're obsessed.
As opposed to most other action types, the SoGetMatrixAction does not traverse children of the node it is applied to β just the node itself. When applied to paths, it stops at the last node and does not continue further with the children of the tail node. it's giving "boundaries", and we respect that π
Typical usage when querying for world space position, orientation and/or scaling would be as follows:
// First get hold of an SoPath through the scenegraph down to the
// node ("mynode") you want to query about its current world space
// transformation(s).
SoSearchAction * searchaction = new SoSearchAction;
searchaction->setNode(mynode);
searchaction->apply(myscenegraphroot);
SoPath * path = searchaction->getPath();
assert(path != NULL);
// Then apply the SoGetMatrixAction to get the full transformation
// matrix from world space.
const SbViewportRegion vpr = myviewer->getViewportRegion();
SoGetMatrixAction * getmatrixaction = new SoGetMatrixAction(vpr);
getmatrixaction->apply(path);
SbMatrix transformation = getmatrixaction->getMatrix();
// And if you want to access the individual transformation
// components of the matrix:
SbVec3f translation;
SbRotation rotation;
SbVec3f scalevector;
SbRotation scaleorientation;
transformation.getTransform(translation, rotation, scalevector, scaleorientation);
π Constructor & Destructor Documentation π
πΈ SoGetMatrixAction::SoGetMatrixAction (const SbViewportRegion & region) πΈ
Constructor. hi bestie π
The region viewport specification is not used by this action, and is passed along in case it is needed by any nodes. so it's like, just holding it for a friend.
References SoGetMatrixAction().
Referenced by addMethod(), and SoGetMatrixAction().
π¦ SoGetMatrixAction::~SoGetMatrixAction () [virtual] π¦
Destructor. and that's the end of the era π
π Member Function Documentation π
β SoType SoGetMatrixAction::getTypeId (void ) const [virtual] β
Returns the type identification of an action derived from a class inheriting SoAction. This is used for run-time type checking and "downward" casting. so basically it's the vibe check for your object types β¨
Usage example:
void bar(SoAction * action)
{
if (action->getTypeId() == SoGLRenderAction::getClassTypeId()) {
// safe downward cast, know the type
SoGLRenderAction * glrender = (SoGLRenderAction *)action;
}
return; // ignore if not renderaction
}
For application programmers wanting to extend the library with new actions: this method needs to be overridden in all subclasses. This is typically done as part of setting up the full type system for extension classes, which is usually accomplished by using the pre-defined macros available through Inventor/nodes/SoSubAction.h: SO_ACTION_SOURCE, SO_ACTION_INIT_CLASS and SO_ACTION_CONSTRUCTOR. slay, macros.
For more information on writing Coin extensions, see the SoAction class documentation.
Returns the actual type id of an object derived from a class inheriting SoAction. Needs to be overridden in all subclasses.
Implements SoAction.
π
void SoGetMatrixAction::addMethod (const SoType type, SoActionMethod method) [static] π
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer. so like, not your business bestie, but we're telling you anyway π«Ά
References SoAction::SoAction(), and SoGetMatrixAction().
π void SoGetMatrixAction::enableElement (const SoType type, const int stackindex) [static] π
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer. same energy, it's giving backstage pass only π
π§ const SoEnabledElementsList & SoGetMatrixAction::getEnabledElements (void ) const [protected], [virtual] π§
Returns a list of the elements used by action instances of this class upon traversal operations.
Reimplemented from SoAction.
π void SoGetMatrixAction::setViewportRegion (const SbViewportRegion & region) π
Set the viewport region. simple as that, no cap.
See also: SoGetMatrixAction::SoGetMatrixAction()
π¦ const SbViewportRegion & SoGetMatrixAction::getViewportRegion (void ) const π¦
Returns the viewport region for the action instance. it's giving "here's the region back" β¨
π₯ SbMatrix & SoGetMatrixAction::getMatrix (void ) π₯
Returns the accumulated transformation matrix. the main character, honestly π
Note: don't modify the returned matrix. This should only be done if you are implementing your own transformation type node extensions. This advice is also valid for the other matrix access methods documented below. so like, hands off, fr fr.
Referenced by SoTransform::combineLeft(), SoVRMLTransform::combineLeft(), SoTransform::combineRight(), SoVRMLTransform::combineRight(), SoAntiSquish::getMatrix(), SoGeoLocation::getMatrix(), SoGeoSeparator::getMatrix(), SoMatrixTransform::getMatrix(), SoResetTransform::getMatrix(), SoRotation::getMatrix(), SoRotationXYZ::getMatrix(), SoScale::getMatrix(), SoSurroundScale::getMatrix(), SoTransform::getMatrix(), SoTranslation::getMatrix(), SoUnits::getMatrix(), SoVRMLTransform::getMatrix(), and SoDragger::getPartToLocalMatrix().
π SbMatrix & SoGetMatrixAction::getInverse (void ) π
Returns the inverse of the accumulated transformation matrix. the uno reverse card of matrices π
Referenced by SoAntiSquish::getMatrix(), SoGeoLocation::getMatrix(), SoGeoSeparator::getMatrix(), SoMatrixTransform::getMatrix(), SoResetTransform::getMatrix(), SoRotation::getMatrix(), SoRotationXYZ::getMatrix(), SoScale::getMatrix(), SoSurroundScale::getMatrix(), SoTransform::getMatrix(), SoTranslation::getMatrix(), SoUnits::getMatrix(), SoVRMLTransform::getMatrix(), and SoDragger::getPartToLocalMatrix().
πΈ SbMatrix & SoGetMatrixAction::getTextureMatrix (void ) πΈ
Returns the accumulated texture matrix. for when the texture wants to transform too, periodt.
Referenced by SoTexture2Transform::getMatrix(), SoTexture3Transform::getMatrix(), and SoVRMLTextureTransform::getMatrix().
β SbMatrix & SoGetMatrixAction::getTextureInverse (void ) β
Returns the inverse of the accumulated texture matrix. texture but make it inverse β¨
Referenced by SoTexture2Transform::getMatrix(), SoTexture3Transform::getMatrix(), and SoVRMLTextureTransform::getMatrix().
π«Ά void SoGetMatrixAction::beginTraversal (SoNode * node) [protected], [virtual] π«Ά
This virtual method is called from SoAction::apply(), and is the entry point for the actual scenegraph traversal. it's giving "the doors open, let's go" πͺ
It can be overridden to initialize the action at traversal start, for specific initializations in the action subclasses inheriting SoAction.
Default method just calls traverse(), which any overridden implementation of the method must do too (or call SoAction::beginTraversal()) to trigger the scenegraph traversal. don't skip that step bestie, or nothing happens π
Reimplemented from SoAction.
References SoAction::state, SoAction::traversalMethods, and SoAction::traverse().
π Author π
Generated automatically by Doxygen for Coin from the source code. the bots wrote it, we just made it cute π
and that's the whole page, bestie π«Ά this was Coin, Version 2.5.0, page SoGetMatrixAction(3) β thanks for reading, ily, go accumulate some matrices β¨ππ
π¦ where this page comes from
- fedora 43: Coin2-devel 2.5.0-52.fc43 Β· GPL-2.0-only
- fedora 43: Coin2-devel 2.5.0-52.fc43 Β· GPL-2.0-only
- fedora 44: Coin2-devel 2.5.0-54.fc44 Β· GPL-2.0-only
- fedora 44: Coin2-devel 2.5.0-54.fc44 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms