SoHandleEventAction(3)
β¨ SoHandleEventAction(3) β¨
okay bestie, you've landed on the SoHandleEventAction(3) page from the Coin manual (section 3, obviously π
). Grab a snack, this one's a long one, and it's coming to you in two parts. Part 1 starts rn. π«Ά
πΈ NAME πΈ
SoHandleEventAction β the class that distributes user events to the scene. that's the whole vibe. that's the job.
π SYNOPSIS π
#include <Inventor/actions/SoHandleEventAction.h>
Inherits SoAction. yes she's a nepo baby, she comes from a very distinguished family π
π Public Member Functions π
virtual SoType getTypeId (void) const
SoHandleEventAction (const SbViewportRegion &viewportregion)
virtual ~SoHandleEventAction (void)
void setViewportRegion (const SbViewportRegion &newregion)
const SbViewportRegion & getViewportRegion (void) const
void setEvent (const SoEvent *ev)
const SoEvent * getEvent (void) const
void setHandled (void)
SbBool isHandled (void) const
void setGrabber (SoNode *node)
void releaseGrabber (void)
SoNode * getGrabber (void) const
void setPickRoot (SoNode *node)
SoNode * getPickRoot (void) const
void setPickRadius (const float radiusinpixels)
float getPickRadius (void) const
const SoPickedPoint * getPickedPoint (void)
const SoPickedPointList & getPickedPointList (void)
π¦ Public Member Functions inherited from SoAction π¦
virtual ~SoAction (void)
virtual SbBool isOfType (SoType type) const
virtual void apply (SoNode *root)
virtual void apply (SoPath *path)
virtual void apply (const SoPathList &pathlist, SbBool obeysrules=FALSE)
void apply (SoAction *beingApplied)
virtual void invalidateState (void)
AppliedCode getWhatAppliedTo (void) const
SoNode * getNodeAppliedTo (void) const
SoPath * getPathAppliedTo (void) const
const SoPathList * getPathListAppliedTo (void) const
const SoPathList * getOriginalPathListAppliedTo (void) const
SbBool isLastPathListAppliedTo (void) const
PathCode getPathCode (int &numindices, const int *&indices)
void traverse (SoNode *const node)
SbBool hasTerminated (void) const
const SoPath * getCurPath (void)
SoState * getState (void) const
PathCode getCurPathCode (void) const
virtual 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) const
virtual 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 π
The SoHandleEventAction class distributes user events to the scene. no cap, that's literally the description, they said it twice.
This is the action used by the GUI viewer classes to pass interaction events from the window system to the nodes in the scene graph. so likeβ¦ when you click on stuff, this is the girl doing the passing π
SoHandleEventAction also provides the functionality for tracking the object currently under the cursor, and functionality for "grabbing" the event focus. main character energy tbh β everyone wants her attention.
See also SoEvent
π οΈ Constructor & Destructor Documentation π οΈ
SoHandleEventAction::SoHandleEventAction (const SbViewportRegion &viewportregion)
Constructor. she's born β¨
SoHandleEventAction needs a viewportregion to pass on to the ray pick action instance it uses for being able to track objects under the mouse cursor. so yeah, that param is not optional, bestie, she needs it to know where the cursor is π
SoHandleEventAction::~SoHandleEventAction (void ) [virtual]
Destructor. she's leaving, say bye π«Ά
π Member Function Documentation π
SoType SoHandleEventAction::getTypeId (void ) const [virtual]
Returns the type identification of an object derived from a class inheriting SoAction. This is used for runtime type checking and "downward" casting. it's givingβ¦ "who dis" but in a legally binding way π
Implements SoAction.
SoType SoHandleEventAction::getClassTypeId (void ) [static]
This static method returns the SoType object associated with objects of this class.
void SoHandleEventAction::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 for you, babe π
void SoHandleEventAction::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, also not for you π
const SoEnabledElementsList & SoHandleEventAction::getEnabledElements (void ) const [protected], [virtual]
Returns list of enabled elements.
Reimplemented from SoAction.
SoEnabledElementsList * SoHandleEventAction::getClassEnabledElements (void ) [static], [protected]
Returns list of enabled elements for this class. The enabledElements and methods variables are protected in the original OIV API. This is not such a good idea, since exposed static class member variables is a major grievance with regard to Win32 DLLs. This function is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API. so yeah, Coin-only, don't go looking for her in the vintage release π
SoActionMethodList * SoHandleEventAction::getClassActionMethods (void ) [static], [protected]
Returns list of action methods for this class. The enabledElements and methods variables are protected in the original OIV API. This is not such a good idea, since exposed static class member variables is a major grievance with regard to Win32 DLLs. This function is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API. same disclaimer, same drama, different list π«§
void SoHandleEventAction::initClass (void ) [static]
Initializes the runtime type system for this class, and sets up the enabled elements and action method list. it's the "get ready, we're going out" of functions π
void SoHandleEventAction::setViewportRegion (const SbViewportRegion &newregion)
Set a new viewport region, replacing the one passed in the constructor. out with the old, in with the new β¨
const SbViewportRegion & SoHandleEventAction::getViewportRegion (void ) const
Returns the viewport region this action instance is using.
Advanced Usage:
You can also get the viewport region by accessing it through its element on the traversal state. You do that the following way:
#include <Inventor/elements/SoViewportRegionElement.h>
SoState * state = action->getState();
SbViewportRegion vp = SoViewportRegionElement::get(state);
The reason for explaining this is that you can use this generic technique when you need access to state information when you can't seem to find the accessor function you need in the action implementation. You can use it to for instance retrieve the view volume information, for which there are no accessor methods:
#include <Inventor/elements/SoViewVolumeElement.h>
SoState * state = action->getState();
SbViewVolume vv = SoViewVolumeElement::get(state);
When you do this on arbitrary action instances, you need to make sure that the given element is enabled for the action before you try to use it. The relevant functions for this are SoState::isElementEnabled() and SoElement::getClassStackIndex(). iykyk π§
void SoHandleEventAction::setEvent (const SoEvent * ev)
Set the event to distribute to the nodes of the scene. π here ya go, nodes, catch
const SoEvent * SoHandleEventAction::getEvent (void ) const
Returns the event this action is handling.
void SoHandleEventAction::setHandled (void )
Marks the action instance as handled, hence terminates the action. we're done here, wrap it up π
The action is only marked as handled when a node in the graph "grabs" the event this action is carrying, so the handled flag will be FALSE after traversal if no nodes wanted the event. no one claimed it, so it's giving unclaimed π
See also isHandled()
SbBool SoHandleEventAction::isHandled (void ) const
Returns whether or not the event has been handled by a node during scene graph traversal.
See also setHandled()
void SoHandleEventAction::setGrabber (SoNode * node)
Set a node pointer which will get all future events handled by this action until releaseGrabber() is called. she's the chosen one, she gets everything π
Note that since laterSoHandleEventActioninvocations are just applied directly on the grabber node, usingSoHandleEventActionmethods likegetCurPath()will return bogus data. so heads up: don't trust whatgetCurPath()tells you in that situation, it's lying bestie π
void SoHandleEventAction::releaseGrabber (void )
Don't send the events to a "grabber" node anymore, use the default behavior of the action and pass them along to the scene graph again. the grabber era is over, back to normal programming π¦
See also setGrabber()
SoNode * SoHandleEventAction::getGrabber (void ) const
Returns the grabber node, or NULL if no grabber is active. no grabber? NULL. simple as that.
void SoHandleEventAction::setPickRoot (SoNode * node)
Sets the root node that is used for the pick action tracking the cursor.
SoNode * SoHandleEventAction::getPickRoot (void ) const
Returns the root node that is used by nodes that is tracking the cursor.
void SoHandleEventAction::setPickRadius (const float radiusinpixels)
Sets the pick radius for cursor tracking. how far around the cursor are we looking? that's the tea β
float SoHandleEventAction::getPickRadius (void ) const
Gets the pick radius for cursor tracking.
const SoPickedPoint * SoHandleEventAction::getPickedPoint (void )
Returns the SoPickedPoint information for the intersection point below the cursor. what's under the mouse? this function knows π
const SoPickedPointList & SoHandleEventAction::getPickedPointList (void )
Returns a list of all intersection points below the mouse cursor. plural. the whole squad of intersection points π
void SoHandleEventAction::beginTraversal (SoNode * node) [protected], [virtual]
This virtual method is called from SoAction::apply(), and is the entry point for the actual scene graph traversal. the doorway πͺβ¨
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 scene graph traversal. so if you override it, don't forget to actually kick off the traversal, or nothing happens and you'll be sitting there like ποΈπποΈ
Reimplemented from SoAction.
pssst β part 1 done, part 2 is coming, don't go anywhere π
β¨ AUTHOR β¨
okay so who actually wrote this? bestieβ¦ literally nobody π«Ά this whole page was generated automatically by Doxygen for Coin from the source code. not a human, not a group chat, just Doxygen doing its little robot thing and pulling everything straight out of the source code. slay for the machines I guess π β¨
and that's a wrap on SoHandleEventAction(3), bestie!!</purl> π you made it to the very end, iconic behavior π this page came to you courtesy of Coin, version 4.0.10, dated Thu Jun 25 2026 00:00:00 β so if your local copy says something different, blame the timestamps π go forth, handle those events, and remember: the vibe check is always in the source code. no cap π
π¦β¨
π¦ where this page comes from
- fedora 43: Coin4-devel 4.0.10-1.fc43 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 43: Coin4-devel 4.0.10-1.fc43 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 44: Coin4-devel 4.0.10-1.fc44 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 44: Coin4-devel 4.0.10-1.fc44 Β· BSD-3-Clause AND GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms