SoHandleEventAction — allows nodes in a graph to receive input events
Contents
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 SoXtRenderArea 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.
Inherits From
SoAction > SoHandleEventAction
Methods
SoHandleEventAction(constSbViewportRegion&viewportRegion)
Constructor takes viewport region to use; this is needed to perform a pick operation when requested.
voidsetViewportRegion(constSbViewportRegion&newRegion)constSbViewportRegion&getViewportRegion()const
Sets/returns current viewport region to use for action.
voidsetEvent(constSoEvent*ev)constSoEvent*getEvent()const
Sets/returns the event being handled.
voidsetHandled()SbBoolisHandled()const
Sets/returns whether any node has yet handled the event.
voidsetGrabber(SoNode*node)
Initiates grabbing of future events. All events will be sent to the given node until the grab is
released.
voidreleaseGrabber()
Releases the grab.
SoNode*getGrabber()const
Returns the node that is currently grabbing events, or NULL if there is none.
voidsetPickRoot(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.
voidsetPickRadius(floatradiusInPixels)
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.
constSoPickedPoint*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. The storage for the picked point remains valid as long as the
action is not re-applied or deleted.
constSoPickedPointList&getPickedPointList()
Returns a list of objects intersected by a picking operation, sorted from nearest to farthest.
Name
SoHandleEventAction — allows nodes in a graph to receive input events
See Also
SoEvent,SoPickedPoint,SoRayPickActionSoHandleEventAction(3IV)()
Synopsis
#include<Inventor/actions/SoHandleEventAction.h>
Methods from class SoHandleEventAction:
SoHandleEventAction(constSbViewportRegion&viewportRegion)voidsetViewportRegion(constSbViewportRegion&newRegion)constSbViewportRegion&getViewportRegion()constvoidsetEvent(constSoEvent*ev)constSoEvent*getEvent()constvoidsetHandled()SbBoolisHandled()constvoidsetGrabber(SoNode*node)voidreleaseGrabber()SoNode*getGrabber()constvoidsetPickRoot(SoNode*node)SoNode*getPickRoot()constvoidsetPickRadius(floatradiusInPixels)constSoPickedPoint*getPickedPoint()constSoPickedPointList&getPickedPointList()
Methods from class SoAction:
virtualvoidapply(SoNode*node)virtualvoidapply(SoPath*path)virtualvoidapply(constSoPathList&pathList,SbBoolobeysRules=FALSE)staticSoTypegetClassTypeId()virtualSoTypegetTypeId()virtualSbBoolisOfType(SoTypetype)virtualvoidinvalidateState()