# SoHandleEventAction Class Reference
[Actions]

`#include <Inventor/actions/SoHandleEventAction.h>`

Inheritance diagram for SoHandleEventAction:

List of all members.

## Detailed Description

The SoHandleEventAction class distributes user events to the scene.

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.

SoHandleEventAction also provides the functionality for tracking the object currently under the cursor, and functionality for "grabbing" the event focus.

See also:
  SoEvent

## Public Member Functions

| SoHandleEventAction (const SbViewportRegion &viewportregion)
virtual | ~SoHandleEventAction ()
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)
const SoPickedPoint * | getPickedPoint (void)
const SoPickedPointList & | getPickedPointList (void)

## Static Public Member Functions

void | initClass (void)

## Protected Member Functions

virtual void | beginTraversal (SoNode *node)

## Constructor & Destructor Documentation

SoHandleEventAction::SoHandleEventAction | ( | const SbViewportRegion & | viewportregion | ) |

| Constructor. SoHandleEventAction needs a viewportregion to pass on to the raypick action instance it uses for being able to track objects under the mouse cursor.

SoHandleEventAction::~SoHandleEventAction | ( |  | ) | `[virtual]`

| Destructor.

## Member Function Documentation

void SoHandleEventAction::initClass | ( | void |  | ) | `[static]`

| Initializes the run-time type system for this class, and sets up the enabled elements and action method list. Reimplemented from SoAction.

void SoHandleEventAction::setViewportRegion | ( | const SbViewportRegion & | newregion | ) |

| Set a new viewport region, replacing the one passed in the constructor.

const SbViewportRegion & SoHandleEventAction::getViewportRegion | ( | void |  | ) | const

| Returns the viewport region this action instance is using.

void SoHandleEventAction::setEvent | ( | const SoEvent * | ev | ) |

| Set the event to distribute to the nodes of the scene.

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.

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.

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. Note that since later SoHandleEventAction invokations are just applied directly on the grabber node, using SoHandleEventAction methods like getCurPath() will return bogus data.

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.

See also:
  setGrabber()

SoNode * SoHandleEventAction::getGrabber | ( | void |  | ) | const

| Returns the grabber node, or `NULL` if no grabber is active.

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.

const SoPickedPoint * SoHandleEventAction::getPickedPoint | ( | void |  | ) |

| Returns the SoPickedPoint information for the intersection point below the cursor.

const SoPickedPointList & SoHandleEventAction::getPickedPointList | ( | void |  | ) |

| Returns a list of all intersection points below the mouse cursor.

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

This virtual method is called from SoAction::apply(), and is the entry point for the actual scenegraph traversal.

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.

Reimplemented from SoAction.

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

- SoHandleEventAction.h
- SoHandleEventAction.cpp