SOHANDLEEVENTACTION(3iv)
β¨ NAME β¨
okay bestie, so SoHandleEventAction β it's the whole vibe of letting nodes in a scene graph receive input events π
(this is from the SoHandleEventAction(3IV) manual page, just so we're clear about who we're stanning)
πΈ INHERITS FROM πΈ
SoAction > SoHandleEventAction
it's giving "child of SoAction, main character energy, but still respects the family tree" π«Ά
π SYNOPSIS π
#include <Inventor/actions/SoHandleEventAction.h>
Methods from class SoHandleEventAction:
SoHandleEventAction(const SbViewportRegion
&viewportRegion)
void setViewportRegion(const SbViewportRegion
&newRegion)
const SbViewportRegion & getViewportRegion() const
void setEvent(const SoEvent *ev)
const SoEvent * getEvent() const
void setHandled()
SbBool isHandled() const
void setGrabber(SoNode *node)
void releaseGrabber()
SoNode * getGrabber() const
void setPickRoot(SoNode *node)
SoNode * getPickRoot() const
void setPickRadius(float radiusInPixels)
const SoPickedPoint * getPickedPoint()
const SoPickedPointList & getPickedPointList()
Methods from class 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 π¦
so basically this class is THE plug π β it lets nodes in a scene graph handle input events. it's usually invoked from a component derived from SoXtRenderArea when that component receives a window system event. periodt.
manipulator, dragger and selection nodes? they respond to and process events, they're the ones actually doing the work π most other group nodes just pass the event along to their children (very "not my problem, go ask my kids"), while most other nodes simply ignore the action entirely. rude but valid π
once a node has indicated to the action that it has handled the event, traversal stops. that's it. done. no more scrolling. β
and here's the spicy part: a node that handles an event can also grab future events. once it's done that, ALL events get sent directly to that node, with no traversal taking place, until the node releases the grab. it's giving "I'm holding the aux cord and nobody else is touching it" π₯
π METHODS π
SoHandleEventAction(const SbViewportRegion &viewportRegion)
SoHandleEventAction(const SbViewportRegion
&viewportRegion)
constructor bestie π it takes the viewport region to use; this is needed to perform a pick operation when requested. no region, no picking, that's the deal.
setViewportRegion(), getViewportRegion()
void setViewportRegion(const SbViewportRegion
&newRegion)
const SbViewportRegion & getViewportRegion() const
sets / returns the current viewport region to use for the action. getter-setters, iconic, we love a matched pair π«Ά
setEvent(), getEvent()
void setEvent(const SoEvent *ev)
const SoEvent * getEvent() const
sets / returns the event being handled. literally just the event, in and out, no cap β¨
setHandled(), isHandled()
void setHandled()
SbBool isHandled() const
sets / returns whether any node has yet handled the event. the SbBool is the vibe check: has anyone claimed this yet or are we all just standing here π
setGrabber()
void setGrabber(SoNode *node)
initiates grabbing of future events π₯ all events will be sent to the given node until the grab is released. yep, ALL of them. the node is now the main character.
releaseGrabber()
void releaseGrabber()
releases the grab. handing the aux cord back, so generous of you π
getGrabber()
SoNode * getGrabber() const
returns the node that is currently grabbing events, or NULL if there is none. NULL = nobody's holding it, everybody's free, go wild π
setPickRoot(), getPickRoot()
void setPickRoot(SoNode *node)
SoNode * getPickRoot() const
sets / returns the root node used for initiating a pick action for those nodes that want to know what is under the cursor. it's the "who's under the cursor" starting point, bestie π
setPickRadius()
void setPickRadius(float radiusInPixels)
set the radius (in pixels) around the viewport-space point through which the ray passes when doing ray picking π― ray picking is performed when getPickedPoint() is called. the pick radius set here is used when testing the ray against lines and points.
getPickedPoint()
const SoPickedPoint * getPickedPoint()
returns the frontmost object hit (as an SoPickedPoint) by performing a pick based on the mouse location specified in the event for which the action is being applied. the first time this is called for a particular event, a SoRayPickAction is applied to find this object; subsequent calls for the same event return the same information. it caches, it's efficient, it ate π
heads up fr fr: the storage for the picked point remains valid only as long as the action is not re-applied or deleted. don't go keeping that pointer around like it's gonna live forever π
getPickedPointList()
const SoPickedPointList & getPickedPointList()
returns a list of objects intersected by a picking operation, sorted from nearest to farthest π closest first, farthest last, organised queen behavior β
π SEE ALSO π
SoEventSoPickedPointSoRayPickAction
okay that's the whole page, we made it π that footer stamp said SoHandleEventAction(3IV)() β that's the version tag at the bottom, and there's no date on it, so we're just gonna say this manual page is timeless, as it should be. go handle some events, bestie, you're gonna slay πβ¨π¦πΈ
π¦ where this page comes from
- debian bookworm: inventor-doc 2.1.5-10+dfsg-2 Β· LGPL-2.0-or-later
- debian trixie: inventor-doc 2.1.6+ds-2 Β· LGPL-2.0-or-later
- ubuntu jammy: inventor-doc 2.1.5-10-24
- ubuntu noble: inventor-doc 2.1.5-10+dfsg-2.1build2 Β· LGPL-2.0-or-later
- ubuntu questing: inventor-doc 2.1.6+ds-2
- ubuntu resolute: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- ubuntu stonking: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms