.TH "SoHandleEventAction" 3 "Thu May 29 2014" "Version 4.0.0a" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME SoHandleEventAction \- .PP The \fBSoHandleEventAction\fP class distributes user events to the scene\&. .PP 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\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBSoAction\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "virtual \fBSoType\fP \fBgetTypeId\fP (void) const " .br .ti -1c .RI "\fBSoHandleEventAction\fP (const \fBSbViewportRegion\fP &viewportregion)" .br .ti -1c .RI "virtual \fB~SoHandleEventAction\fP (void)" .br .ti -1c .RI "void \fBsetViewportRegion\fP (const \fBSbViewportRegion\fP &newregion)" .br .ti -1c .RI "const \fBSbViewportRegion\fP & \fBgetViewportRegion\fP (void) const " .br .ti -1c .RI "void \fBsetEvent\fP (const \fBSoEvent\fP *ev)" .br .ti -1c .RI "const \fBSoEvent\fP * \fBgetEvent\fP (void) const " .br .ti -1c .RI "void \fBsetHandled\fP (void)" .br .ti -1c .RI "SbBool \fBisHandled\fP (void) const " .br .ti -1c .RI "void \fBsetGrabber\fP (\fBSoNode\fP *node)" .br .ti -1c .RI "void \fBreleaseGrabber\fP (void)" .br .ti -1c .RI "\fBSoNode\fP * \fBgetGrabber\fP (void) const " .br .ti -1c .RI "void \fBsetPickRoot\fP (\fBSoNode\fP *node)" .br .ti -1c .RI "\fBSoNode\fP * \fBgetPickRoot\fP (void) const " .br .ti -1c .RI "void \fBsetPickRadius\fP (const float radiusinpixels)" .br .ti -1c .RI "const \fBSoPickedPoint\fP * \fBgetPickedPoint\fP (void)" .br .ti -1c .RI "const \fBSoPickedPointList\fP & \fBgetPickedPointList\fP (void)" .br .in -1c .SS "Static Public Member Functions" .in +1c .ti -1c .RI "static \fBSoType\fP \fBgetClassTypeId\fP (void)" .br .ti -1c .RI "static void \fBaddMethod\fP (const \fBSoType\fP type, SoActionMethod method)" .br .ti -1c .RI "static void \fBenableElement\fP (const \fBSoType\fP type, const int stackindex)" .br .ti -1c .RI "static void \fBinitClass\fP (void)" .br .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "virtual const .br \fBSoEnabledElementsList\fP & \fBgetEnabledElements\fP (void) const " .br .ti -1c .RI "virtual void \fBbeginTraversal\fP (\fBSoNode\fP *node)" .br .in -1c .SS "Static Protected Member Functions" .in +1c .ti -1c .RI "static \fBSoEnabledElementsList\fP * \fBgetClassEnabledElements\fP (void)" .br .ti -1c .RI "static \fBSoActionMethodList\fP * \fBgetClassActionMethods\fP (void)" .br .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP The \fBSoHandleEventAction\fP class distributes user events to the scene\&. .PP 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\&. \fBSoHandleEventAction\fP also provides the functionality for tracking the object currently under the cursor, and functionality for 'grabbing' the event focus\&. .PP \fBSee also:\fP .RS 4 \fBSoEvent\fP .RE .PP .SH "Constructor & Destructor Documentation" .PP .SS "SoHandleEventAction::SoHandleEventAction (const \fBSbViewportRegion\fP &viewportregion)" Constructor\&. .PP \fBSoHandleEventAction\fP needs a \fIviewportregion\fP to pass on to the raypick action instance it uses for being able to track objects under the mouse cursor\&. .SS "SoHandleEventAction::~SoHandleEventAction (void)\fC [virtual]\fP" Destructor\&. .SH "Member Function Documentation" .PP .SS "\fBSoType\fP SoHandleEventAction::getTypeId (void) const\fC [virtual]\fP" Returns the type identification of an action derived from a class inheriting \fBSoAction\fP\&. This is used for run-time type checking and 'downward' casting\&. .PP Usage example: .PP .PP .nf void bar(SoAction * action) { if (action->getTypeId() == SoGLRenderAction::getClassTypeId()) { // safe downward cast, know the type SoGLRenderAction * glrender = (SoGLRenderAction *)action; } return; // ignore if not renderaction } .fi .PP .PP For application programmers wanting to extend the library with new actions: this method needs to be overridden in \fIall\fP subclasses\&. This is typically done as part of setting up the full type system for extension classes, which is usually accomplished by using the pre-defined macros available through Inventor/nodes/SoSubAction\&.h: SO_ACTION_SOURCE, SO_ACTION_INIT_CLASS and SO_ACTION_CONSTRUCTOR\&. .PP For more information on writing Coin extensions, see the \fBSoAction\fP class documentation\&. .PP Returns the actual type id of an object derived from a class inheriting \fBSoAction\fP\&. Needs to be overridden in \fIall\fP subclasses\&. .PP Implements \fBSoAction\fP\&. .SS "void SoHandleEventAction::addMethod (const \fBSoType\fPtype, SoActionMethodmethod)\fC [static]\fP" \fIThis API member is considered internal to the library, as it is not likely to be of interest to the application programmer\&.\fP .SS "void SoHandleEventAction::enableElement (const \fBSoType\fPtype, const intstackindex)\fC [static]\fP" \fIThis API member is considered internal to the library, as it is not likely to be of interest to the application programmer\&.\fP .SS "const \fBSoEnabledElementsList\fP & SoHandleEventAction::getEnabledElements (void) const\fC [protected]\fP, \fC [virtual]\fP" Returns a list of the elements used by action instances of this class upon traversal operations\&. .PP Reimplemented from \fBSoAction\fP\&. .SS "void SoHandleEventAction::setViewportRegion (const \fBSbViewportRegion\fP &newregion)" Set a new viewport region, replacing the one passed in the constructor\&. .SS "const \fBSbViewportRegion\fP & SoHandleEventAction::getViewportRegion (void) const" Returns the viewport region this action instance is using\&. .PP Advanced Usage: .PP You can also get the viewport region by accessing it through its element on the traversal state\&. You do that the following way: .PP .PP .nf #include SoState * state = action->getState(); SbViewportRegion vp = SoViewportRegionElement::get(state); .fi .PP .PP 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: .PP .PP .nf #include SoState * state = action->getState(); SbViewVolume vv = SoViewVolumeElement::get(state); .fi .PP .PP 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 \fBSoState::isElementEnabled()\fP and \fBSoElement::getClassStackIndex()\fP\&. .SS "void SoHandleEventAction::setEvent (const \fBSoEvent\fP *ev)" Set the event to distribute to the nodes of the scene\&. .SS "const \fBSoEvent\fP * SoHandleEventAction::getEvent (void) const" Returns the event this action is handling\&. .SS "void SoHandleEventAction::setHandled (void)" Marks the action instance as handled, hence terminates the action\&. .PP 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 \fCFALSE\fP after traversal if no nodes wanted the event\&. .PP \fBSee also:\fP .RS 4 \fBisHandled()\fP .RE .PP .SS "SbBool SoHandleEventAction::isHandled (void) const" Returns whether or not the event has been handled by a node during scene graph traversal\&. .PP \fBSee also:\fP .RS 4 \fBsetHandled()\fP .RE .PP .SS "void SoHandleEventAction::setGrabber (\fBSoNode\fP *node)" Set a \fInode\fP pointer which will get all future events handled by this action until \fBreleaseGrabber()\fP is called\&. .PP Note that since later \fBSoHandleEventAction\fP invokations are just applied directly on the grabber node, using \fBSoHandleEventAction\fP methods like \fBgetCurPath()\fP will return bogus data\&. .SS "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\&. .PP \fBSee also:\fP .RS 4 \fBsetGrabber()\fP .RE .PP .SS "\fBSoNode\fP * SoHandleEventAction::getGrabber (void) const" Returns the grabber node, or \fCNULL\fP if no grabber is active\&. .SS "void SoHandleEventAction::setPickRoot (\fBSoNode\fP *node)" Sets the root \fInode\fP that is used for the pick action tracking the cursor\&. .SS "\fBSoNode\fP * SoHandleEventAction::getPickRoot (void) const" Returns the root node that is used by nodes that is tracking the cursor\&. .SS "void SoHandleEventAction::setPickRadius (const floatradiusinpixels)" Sets the pick radius for cursor tracking\&. .SS "const \fBSoPickedPoint\fP * SoHandleEventAction::getPickedPoint (void)" Returns the \fBSoPickedPoint\fP information for the intersection point below the cursor\&. .SS "const \fBSoPickedPointList\fP & SoHandleEventAction::getPickedPointList (void)" Returns a list of all intersection points below the mouse cursor\&. .SS "void SoHandleEventAction::beginTraversal (\fBSoNode\fP *node)\fC [protected]\fP, \fC [virtual]\fP" This virtual method is called from \fBSoAction::apply()\fP, and is the entry point for the actual scenegraph traversal\&. .PP It can be overridden to initialize the action at traversal start, for specific initializations in the action subclasses inheriting \fBSoAction\fP\&. .PP Default method just calls \fBtraverse()\fP, which any overridden implementation of the method must do too (or call \fBSoAction::beginTraversal()\fP) to trigger the scenegraph traversal\&. .PP Reimplemented from \fBSoAction\fP\&. .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.