SoHandleEventAction Class |
Allows nodes in a graph to receive input events.
Namespace: OIV.Inventor.Actions
The SoHandleEventAction type exposes the following members.
Name | Description | |
---|---|---|
SoHandleEventAction | Constructor takes viewport region to use; this is needed to perform a pick operation when requested. |
Name | Description | |
---|---|---|
Apply(SoNode) | Initiates an action on the graph defined by a node. | |
Apply(SoPath) | Initiates an action on the graph defined by a path. | |
Apply(SoPathList) | Calls Apply(pathList, false). (Inherited from SoAction.) | |
Apply(SoPathList, Boolean) | Initiates an action on the graph defined by a list of paths. | |
ClearApplyResult | When applied, an action may reference nodes or create objects (e.g. | |
EnableElement | ||
EnableElements | (Overrides SoActionEnableElements.) | |
EnableRadiusForTriangles | Enable pick radius for triangle-based shapes. | |
Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |
ForwardTraversal(SoNode) | Traverse a node that is not part of the current scenegraph. | |
ForwardTraversal(SoPath) | Traverse a path that is not part of the current scenegraph. | |
GetContinueActionInBranchFlag | This function indicates if the action must stop in the current branch. | |
GetCurPath | Returns the path accumulated during traversal, i.e., the chain of nodes from the root of the traversed graph to the current node being traversed. | |
GetDistribMode | Returns the distribution mode of this action across a cluster (ScaleViz-Cluster only). | |
GetEvent | Returns the event being handled. | |
GetGrabber | Returns the node that is currently grabbing events, or NULL if there is none. | |
GetHashCode |
Overrides GetHashCode().
(Inherited from SoNetBase.) | |
GetNodeAppliedTo | Returns the node the action is being applied to. | |
GetOriginalPathListAppliedTo | Returns the original path list the action is being applied to. | |
GetPathAppliedTo | Returns the path the action is being applied to. | |
GetPathCode | Returns path code based on where current node (the node at the end of the current path) lies with respect to the path(s) the action is being applied to. | |
GetPathListAppliedTo | Returns the path list the action is being applied to. | |
GetPickedPoint | Returns the frontmost object hit (as an OIV.Inventor.SoPickedPoint) by performing a pick based on the mouse location specified in the event for which the action is being applied. | |
GetPickedPointList | Returns a list of objects intersected by a picking operation, sorted from nearest to farthest. | |
GetPickRadius | Returns the radius (in pixels) around the viewport-space point through which the ray passes when doing ray picking. | |
GetPickRoot | Returns the root node used for initiating a pick action for those nodes that want to know what is under the cursor. | |
GetPipeId | Gets pipe identifier in the range [1..N] associated to this render action while running a ScaleViz Multipipe configuration. | |
GetSceneManager | Return the OIV.Inventor.SoSceneManager associated with this action. | |
GetState | Gets the state from the action. | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
GetViewportRegion | Returns current viewport region to use for action. | |
GetWhatAppliedTo | Returns code indicating what action is being applied to. | |
HasTerminated | Returns true if the traversal has reached a termination condition. | |
InvalidateState | Invalidates the current traversal state in the action, forcing it to be recreated when the action is next applied. | |
IsBeingApplied | Returns true if this action is currently being applied. | |
IsHandled | Returns whether any node has yet handled the event. | |
IsLastPathListAppliedTo | Returns true if the current list is the last one from the original. | |
IsUsingAlternateRep | Returns true if current action is using alternate representations. | |
PostDelayedTraversal | Method called by SoMultiPassManager after delayed pass traversals. | |
PreDelayedTraversal | Method called by SoMultiPassManager before delayed pass traversals. | |
ReleaseGrabber | Releases the grab. | |
ResetContinueActionInBranchFlag | This function resets the continue action flag. | |
SetEvent | Sets the event being handled. | |
SetGrabber | Initiates grabbing of future events. | |
SetHandled | Sets whether any node has yet handled the event. | |
SetPickedPoint | Calls SetPickedPoint((OIV.Inventor.SoPickedPoint ^)nullptr). | |
SetPickedPoint(SoPickedPoint) | Set the OIV.Inventor.SoPickedPoint object that will be returned by getPickedPoint. | |
SetPickRadius | Sets the radius (in pixels) around the viewport-space point through which the ray passes when doing ray picking. | |
SetPickRoot | Sets the root node used for initiating a pick action for those nodes that want to know what is under the cursor. | |
SetPipeId | Sets pipe identifier in the range [1..N] associated to this render action while running a ScaleViz Multipipe configuration. | |
SetSceneManager | Set the scene manager associated with this action (if any ). | |
SetUpState | Creates state if it is NULL or it is no longer valid because new elements have been enabled since it was created. | |
SetViewportRegion | Sets current viewport region to use for action. | |
StopActionInBranch | This function stops the action in the current Scene Graph branch. | |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
Traverse | Does traversal of a graph rooted by a node. | |
UseAlternateRep | Tell the action to use alternate representations during traversal when available. |
This class is used to allow nodes in a scene graph to handle input events. It is usually invoked from a component derived from OIV.Inventor.Win.SoWinRenderArea when the component receives a window system event. OIV.Inventor.SoSceneManager automatically creates a handle event action and provides a convenience method processEvent() to pass events to its managed scene graph. The Open Inventor viewer classes use this method to pass events to the scene graph in selection mode.
A node can get the event currently being handled by calling OIV.Inventor.Actions.SoHandleEventAction.GetEvent().
Manipulator, dragger and selection nodes respond to and process events. Most group nodes just pass the event to their children, while most other nodes simply ignore the action entirely. The OIV.Inventor.Nodes.SoEventCallback node invokes a callback / delegate method when traversed by a handle event action processing a specific type of event. This is the primary mechanism for handling event input in Open Inventor. 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. Draggers use this mechanism to ensure that they see the "finish" (e.g. mouse button up) event for their interaction.
Picking
A node can conveniently find out what, if any, geometry is under the cursor by calling the OIV.Inventor.Actions.SoHandleEventAction.GetPickedPoint() method. Applications can do this in the callback function assigned to an OIV.Inventor.Nodes.SoEventCallback node. The first time this method is called during a handle event traversal, the handle event action will automatically apply its internal OIV.Inventor.Actions.SoRayPickAction to the scene graph returned by OIV.Inventor.Actions.SoHandleEventAction.GetPickRoot(). The result is stored in case other nodes make the same query during the same traversal. The stored result can be cleared by calling OIV.Inventor.Actions.SoHandleEventAction.ClearApplyResult().
Some, but not all, options can be modified on the internal pick action (see for example OIV.Inventor.Actions.SoHandleEventAction.SetPickRadius(System.Single)). Note that the internal pick action does not compute texture coordinates or normal vector for the picked point. Thus, OIV.Inventor.Actions.SoHandleEventAction.GetPickedPoint().getNormal() returns (0,0,0) and OIV.Inventor.Actions.SoHandleEventAction.GetPickedPoint().getTextureCoords() returns (0,0,0,0).
If a node needs to apply the pick action itself, for example to set different options, it can get the appropriate root node by calling OIV.Inventor.Actions.SoHandleEventAction.GetPickRoot().
To use GPU picking on compatible shapes, it is mandatory to set the pick radius to 0, see OIV.Inventor.Actions.SoHandleEventAction.SetPickRadius(System.Single). Compatible shapes are described in the OIV.Inventor.Actions.SoRayPickAction section Picking Algorithms.