.TH "SoHandleEventAction" 3 "Fri Sep 6 2024 15:32:06" "Version 4.0.3" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME SoHandleEventAction \- The \fBSoHandleEventAction\fP class distributes user events to the scene\&. .SH SYNOPSIS .br .PP .PP \fR#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 "float \fBgetPickRadius\fP (void) const" .br .ti -1c .RI "const \fBSoPickedPoint\fP * \fBgetPickedPoint\fP (void)" .br .ti -1c .RI "const \fBSoPickedPointList\fP & \fBgetPickedPointList\fP (void)" .br .in -1c Public Member Functions inherited from \fBSoAction\fP .in +1c .ti -1c .RI "virtual \fB~SoAction\fP (void)" .br .ti -1c .RI "virtual SbBool \fBisOfType\fP (\fBSoType\fP type) const" .br .ti -1c .RI "virtual void \fBapply\fP (\fBSoNode\fP *root)" .br .ti -1c .RI "virtual void \fBapply\fP (\fBSoPath\fP *path)" .br .ti -1c .RI "virtual void \fBapply\fP (const \fBSoPathList\fP &pathlist, SbBool obeysrules=FALSE)" .br .ti -1c .RI "void \fBapply\fP (\fBSoAction\fP *beingApplied)" .br .ti -1c .RI "virtual void \fBinvalidateState\fP (void)" .br .ti -1c .RI "\fBAppliedCode\fP \fBgetWhatAppliedTo\fP (void) const" .br .ti -1c .RI "\fBSoNode\fP * \fBgetNodeAppliedTo\fP (void) const" .br .ti -1c .RI "\fBSoPath\fP * \fBgetPathAppliedTo\fP (void) const" .br .ti -1c .RI "const \fBSoPathList\fP * \fBgetPathListAppliedTo\fP (void) const" .br .ti -1c .RI "const \fBSoPathList\fP * \fBgetOriginalPathListAppliedTo\fP (void) const" .br .ti -1c .RI "SbBool \fBisLastPathListAppliedTo\fP (void) const" .br .ti -1c .RI "\fBPathCode\fP \fBgetPathCode\fP (int &numindices, const int *&indices)" .br .ti -1c .RI "void \fBtraverse\fP (\fBSoNode\fP *const node)" .br .ti -1c .RI "SbBool \fBhasTerminated\fP (void) const" .br .ti -1c .RI "const \fBSoPath\fP * \fBgetCurPath\fP (void)" .br .ti -1c .RI "\fBSoState\fP * \fBgetState\fP (void) const" .br .ti -1c .RI "\fBPathCode\fP \fBgetCurPathCode\fP (void) const" .br .ti -1c .RI "virtual \fBSoNode\fP * \fBgetCurPathTail\fP (void)" .br .ti -1c .RI "void \fBusePathCode\fP (int &numindices, const int *&indices)" .br .ti -1c .RI "void \fBpushCurPath\fP (const int childindex, \fBSoNode\fP *node=NULL)" .br .ti -1c .RI "void \fBpopCurPath\fP (const \fBPathCode\fP prevpathcode)" .br .ti -1c .RI "void \fBpushCurPath\fP (void)" .br .ti -1c .RI "void \fBpopPushCurPath\fP (const int childindex, \fBSoNode\fP *node=NULL)" .br .ti -1c .RI "void \fBpopCurPath\fP (void)" .br .ti -1c .RI "void \fBswitchToPathTraversal\fP (\fBSoPath\fP *path)" .br .ti -1c .RI "void \fBswitchToNodeTraversal\fP (\fBSoNode\fP *node)" .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 Static Public Member Functions inherited from \fBSoAction\fP .in +1c .ti -1c .RI "static void \fBinitClass\fP (void)" .br .ti -1c .RI "static void \fBinitClasses\fP (void)" .br .ti -1c .RI "static \fBSoType\fP \fBgetClassTypeId\fP (void)" .br .ti -1c .RI "static void \fBnullAction\fP (\fBSoAction\fP *action, \fBSoNode\fP *node)" .br .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "virtual const \fBSoEnabledElementsList\fP & \fBgetEnabledElements\fP (void) const" .br .ti -1c .RI "virtual void \fBbeginTraversal\fP (\fBSoNode\fP *node)" .br .in -1c Protected Member Functions inherited from \fBSoAction\fP .in +1c .ti -1c .RI "\fBSoAction\fP (void)" .br .ti -1c .RI "virtual void \fBendTraversal\fP (\fBSoNode\fP *node)" .br .ti -1c .RI "void \fBsetTerminated\fP (const SbBool flag)" .br .ti -1c .RI "virtual SbBool \fBshouldCompactPathList\fP (void) const" .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 Static Protected Member Functions inherited from \fBSoAction\fP .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" Public Types inherited from \fBSoAction\fP .in +1c .ti -1c .RI "enum \fBAppliedCode\fP { \fBNODE\fP = 0, \fBPATH\fP = 1, \fBPATH_LIST\fP = 2 }" .br .ti -1c .RI "enum \fBPathCode\fP { \fBNO_PATH\fP = 0, \fBIN_PATH\fP = 1, \fBBELOW_PATH\fP = 2, \fBOFF_PATH\fP = 3 }" .br .in -1c Protected Attributes inherited from \fBSoAction\fP .in +1c .ti -1c .RI "\fBSoState\fP * \fBstate\fP" .br .ti -1c .RI "\fBSoActionMethodList\fP * \fBtraversalMethods\fP" .br .in -1c .SH "Detailed Description" .PP The \fBSoHandleEventAction\fP 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\&. .PP \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 ray pick action instance it uses for being able to track objects under the mouse cursor\&. .SS "SoHandleEventAction::~SoHandleEventAction (void )\fR [virtual]\fP" Destructor\&. .SH "Member Function Documentation" .PP .SS "\fBSoType\fP SoHandleEventAction::getTypeId (void ) const\fR [virtual]\fP" Returns the type identification of an object derived from a class inheriting \fBSoAction\fP\&. This is used for runtime type checking and 'downward' casting\&. .br .PP Implements \fBSoAction\fP\&. .SS "\fBSoType\fP SoHandleEventAction::getClassTypeId (void )\fR [static]\fP" This static method returns the \fBSoType\fP object associated with objects of this class\&. .br .SS "void SoHandleEventAction::addMethod (const \fBSoType\fP type, SoActionMethod method)\fR [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 .br .br .SS "void SoHandleEventAction::enableElement (const \fBSoType\fP type, const int stackindex)\fR [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 .br .br .SS "const \fBSoEnabledElementsList\fP & SoHandleEventAction::getEnabledElements (void ) const\fR [protected]\fP, \fR [virtual]\fP" Returns list of enabled elements\&. .br .PP Reimplemented from \fBSoAction\fP\&. .SS "\fBSoEnabledElementsList\fP * SoHandleEventAction::getClassEnabledElements (void )\fR [static]\fP, \fR [protected]\fP" 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\&. .br .br .SS "\fBSoActionMethodList\fP * SoHandleEventAction::getClassActionMethods (void )\fR [static]\fP, \fR [protected]\fP" 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\&. .br .br .SS "void SoHandleEventAction::initClass (void )\fR [static]\fP" Initializes the runtime type system for this class, and sets up the enabled elements and action method list\&. .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 \fRFALSE\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 invocations 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 \fRNULL\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 float radiusinpixels)" Sets the pick radius for cursor tracking\&. .SS "float SoHandleEventAction::getPickRadius (void ) const" Gets 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)\fR [protected]\fP, \fR [virtual]\fP" This virtual method is called from \fBSoAction::apply()\fP, and is the entry point for the actual scene graph 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 scene graph traversal\&. .PP Reimplemented from \fBSoAction\fP\&. .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.