SOACTION(3iv)

πŸ’– SoAction β€” the abstract base class of literally every action πŸ’–

okay bestie, sit down, hydrate, because this is the mother of all actions. This page lives in manual section 3IV (yes, the Inventor vibes, iykyk) ✨


🌸 NAME 🌸

SoAction β€” abstract base class for all actions πŸŽ€


πŸ¦‹ INHERITS FROM πŸ¦‹

SoAction


✨ SYNOPSIS ✨

#include <Inventor/actions/SoAction.h>

Methods from class SoAction:

virtual             ~SoAction()
virtual void        apply(SoNode *node)
virtual void        apply(SoPath *path)
virtual void        apply(const SoPathList &pathList, SbBool obeysRules =
                         FALSE)
static SoType       getClassTypeId()
virtual SoType      getTypeId()
virtual SbBool      isOfType(SoType type)
virtual void        invalidateState()

πŸ’… DESCRIPTION πŸ’…

SoAction is the abstract base class for all actions, no cap. Classes derived from SoAction define the operations that get applied at each node you bump into while traversing a scene graph 🧚

The function that actually gets called to implement the action for a particular node type? Yeah, that's decided by a lookup table in the global database. Very main character of it tbh πŸ‘‘


🌈 METHODS 🌈

  • virtual ~SoAction() β€” the destructor, periodt.
  • virtual void apply(SoNode *node)
  • virtual void apply(SoPath *path)
  • virtual void apply(const SoPathList &pathList, SbBool obeysRules = FALSE)

Kicks off an action on the graph, and that graph is defined by either a node, a path, or a whole list of paths 🫢

You can pass TRUE for the obeysRules flag if the path list you're handing over has these 4 properties:

  1. All paths have the same head node
  2. Paths are sorted in traversal order
  3. If one path ends at node A, no other path continues through A
  4. No two paths are the same

And bestie, these rules will be obeyed by path lists returned by picking and by searches for non-group nodes. So like, they're not random, they're the real deal πŸ’œ

  • static SoType getClassTypeId() β€” returns the type identifier for this class.
  • virtual SoType getTypeId() β€” returns the type identifier for a specific instance (yes, there's a difference, don't @ me).
  • virtual SbBool isOfType(SoType type) β€” returns TRUE if this instance is of the type specified in type, or is derived from that type. Otherwise it returns FALSE. For example:
actionPtr->isOfType(SoGetMatrixAction::getClassTypeId())

returns TRUE if actionPtr is an instance of SoGetMatrixAction or one of its subclasses 🌟

  • virtual void invalidateState() β€” invalidates the current traversal state in the action, forcing it to be recreated the next time the action is applied. Lowkey this is typically unnecessary in most applications, so don't stress about it πŸ™ˆ

πŸ”₯ SEE ALSO πŸ”₯

SoNode, SoPath, SoPathList, SoCallbackAction, SoGLRenderAction, SoGetBoundingBoxAction, SoGetMatrixAction, SoHandleEventAction, SoPickAction, SoRayPickAction, SoSearchAction, SoWriteAction


go read the friends of this page too, they're all iconic in their own way πŸ’–

okay that's the whole page, you ate it, you understood it, I'm so proud πŸ₯Ή this was SoAction, from the 3IV manual, and the page itself was stamped out with that classic source/version tag and its date β€” consider this your cute lil sign-off, mwah πŸ’‹βœ¨