Open Inventor Reference
SoHandleEventAction Class Reference

Allows nodes in a graph to receive input events. More...

#include <Inventor/actions/SoHandleEventAction.h>

Inheritance diagram for SoHandleEventAction:
SoAction

List of all members.

Public Member Functions

 SoHandleEventAction (const SbViewportRegion &viewportRegion)
 Constructor takes viewport region to use; this is needed to perform a pick operation when requested.
virtual ~SoHandleEventAction ()
 Destructor.
void setViewportRegion (const SbViewportRegion &newRegion)
 Sets/returns current viewport region to use for action.
const SbViewportRegiongetViewportRegion () const
 Sets/returns current viewport region to use for action.
void setEvent (const SoEvent *ev)
 Sets/returns the event being handled.
const SoEventgetEvent () const
 Sets/returns the event being handled.
void setHandled ()
 Sets/returns whether any node has yet handled the event.
SbBool isHandled () const
 Sets/returns whether any node has yet handled the event.
void setGrabber (SoNode *node)
 Initiates grabbing of future events.
void releaseGrabber ()
 Releases the grab.
SoNodegetGrabber () const
 Returns the node that is currently grabbing events, or NULL if there is none.
void setPickRoot (SoNode *node)
 Sets/returns the root node used for initiating a pick action for those nodes that want to know what is under the cursor.
SoNodegetPickRoot () const
 Sets/returns the root node used for initiating a pick action for those nodes that want to know what is under the cursor.
void setPickRadius (float radiusInPixels)
 Set the radius (in pixels) around the viewport-space point through which the ray passes when doing ray picking.
const SoPickedPointgetPickedPoint ()
 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.
const SoPickedPointListgetPickedPointList ()
 Returns a list of objects intersected by a picking operation, sorted from nearest to farthest.

Static Public Member Functions

static void initClass ()

Protected Member Functions

virtual void beginTraversal (SoNode *node)
 Initiates action on graph.

Detailed Description

This class is used to allow nodes in a scene graph to handle input events. It is usually invoked from a component derived from SoQtRenderArea when the component receives a window system event.

Manipulator, dragger and selection nodes respond to and process events. Most other group nodes just pass the event to their children, while most other nodes simply ignore the action entirely. Once a node has indicated to the action that it has handled the event, traversal stops.

A node that handles an event can also grab future events. Once it has done so, all events will be sent directly to that node, with no traversal taking place, until the node releases the grab.

See Also
SoEvent, SoPickedPoint, SoRayPickAction

Definition at line 94 of file SoHandleEventAction.h.


Constructor & Destructor Documentation

SoHandleEventAction::SoHandleEventAction ( const SbViewportRegion viewportRegion)
virtual SoHandleEventAction::~SoHandleEventAction ( ) [virtual]

Member Function Documentation

virtual void SoHandleEventAction::beginTraversal ( SoNode node) [protected, virtual]

Reimplemented from SoAction.

const SoEvent* SoHandleEventAction::getEvent ( ) const [inline]

Definition at line 116 of file SoHandleEventAction.h.

SoNode* SoHandleEventAction::getGrabber ( ) const [inline]

Definition at line 129 of file SoHandleEventAction.h.

const SoPickedPoint* SoHandleEventAction::getPickedPoint ( )

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. The storage for the picked point remains valid as long as the action is not re-applied or deleted.

const SoPickedPointList& SoHandleEventAction::getPickedPointList ( )
SoNode* SoHandleEventAction::getPickRoot ( ) const [inline]

Definition at line 136 of file SoHandleEventAction.h.

const SbViewportRegion& SoHandleEventAction::getViewportRegion ( ) const [inline]

Definition at line 111 of file SoHandleEventAction.h.

static void SoHandleEventAction::initClass ( ) [static]

Reimplemented from SoAction.

SbBool SoHandleEventAction::isHandled ( ) const [inline]

Definition at line 121 of file SoHandleEventAction.h.

References SoAction::hasTerminated().

void SoHandleEventAction::releaseGrabber ( ) [inline]

Definition at line 127 of file SoHandleEventAction.h.

void SoHandleEventAction::setEvent ( const SoEvent ev) [inline]

Definition at line 114 of file SoHandleEventAction.h.

void SoHandleEventAction::setGrabber ( SoNode node)

All events will be sent to the given node until the grab is released.

void SoHandleEventAction::setHandled ( ) [inline]

Definition at line 119 of file SoHandleEventAction.h.

References SoAction::setTerminated(), and TRUE.

void SoHandleEventAction::setPickRadius ( float  radiusInPixels) [inline]

Ray picking is performed when getPickedPoint() is called. The pick radius set here is used when testing the ray against lines and points.

Definition at line 144 of file SoHandleEventAction.h.

void SoHandleEventAction::setPickRoot ( SoNode node)
void SoHandleEventAction::setViewportRegion ( const SbViewportRegion newRegion)

The documentation for this class was generated from the following file: