1SoHandleEventAction(3IV)() SoHandleEventAction(3IV)()
2
3
4
6 SoHandleEventAction — allows nodes in a graph to receive input events
7
9 SoAction > SoHandleEventAction
10
12 #include <Inventor/actions/SoHandleEventAction.h>
13
14 Methods from class SoHandleEventAction:
15
16 SoHandleEventAction(const SbViewportRegion
17 &viewportRegion)
18 void setViewportRegion(const SbViewportRegion
19 &newRegion)
20 const SbViewportRegion & getViewportRegion() const
21 void setEvent(const SoEvent *ev)
22 const SoEvent * getEvent() const
23 void setHandled()
24 SbBool isHandled() const
25 void setGrabber(SoNode *node)
26 void releaseGrabber()
27 SoNode * getGrabber() const
28 void setPickRoot(SoNode *node)
29 SoNode * getPickRoot() const
30 void setPickRadius(float radiusInPixels)
31 const SoPickedPoint * getPickedPoint()
32 const SoPickedPointList & getPickedPointList()
33
34 Methods from class SoAction:
35
36 virtual void apply(SoNode *node)
37 virtual void apply(SoPath *path)
38 virtual void apply(const SoPathList &pathList, SbBool obeysRules =
39 FALSE)
40 static SoType getClassTypeId()
41 virtual SoType getTypeId()
42 virtual SbBool isOfType(SoType type)
43 virtual void invalidateState()
44
45
47 This class is used to allow nodes in a scene graph to handle input
48 events. It is usually invoked from a component derived from SoXtRender‐
49 Area when the component receives a window system event.
50
51 Manipulator, dragger and selection nodes respond to and process events.
52 Most other group nodes just pass the event to their children, while
53 most other nodes simply ignore the action entirely. Once a node has
54 indicated to the action that it has handled the event, traversal stops.
55
56 A node that handles an event can also grab future events. Once it has
57 done so, all events will be sent directly to that node, with no traver‐
58 sal taking place, until the node releases the grab.
59
61 SoHandleEventAction(const SbViewportRegion
62 &viewportRegion)
63 Constructor takes viewport region to use; this is needed to perform
64 a pick operation when requested.
65
66 void setViewportRegion(const SbViewportRegion
67 &newRegion)
68 const SbViewportRegion & getViewportRegion() const
69 Sets/returns current viewport region to use for action.
70
71 void setEvent(const SoEvent *ev)
72 const SoEvent * getEvent() const
73 Sets/returns the event being handled.
74
75 void setHandled()
76 SbBool isHandled() const
77 Sets/returns whether any node has yet handled the event.
78
79 void setGrabber(SoNode *node)
80 Initiates grabbing of future events. All events will be sent to the
81 given node until the grab is released.
82
83 void releaseGrabber()
84 Releases the grab.
85
86 SoNode * getGrabber() const
87 Returns the node that is currently grabbing events, or NULL if there
88 is none.
89
90 void setPickRoot(SoNode *node)
91 SoNode * getPickRoot() const
92 Sets/returns the root node used for initiating a pick action for
93 those nodes that want to know what is under the cursor.
94
95 void setPickRadius(float radiusInPixels)
96 Set the radius (in pixels) around the viewport-space point through
97 which the ray passes when doing ray picking. Ray picking is per‐
98 formed when getPickedPoint() is called. The pick radius set here is
99 used when testing the ray against lines and points.
100
101 const SoPickedPoint * getPickedPoint()
102 Returns the frontmost object hit (as an SoPickedPoint) by performing
103 a pick based on the mouse location specified in the event for which
104 the action is being applied. The first time this is called for a
105 particular event, a SoRayPickAction is applied to find this object;
106 subsequent calls for the same event return the same information. The
107 storage for the picked point remains valid as long as the action is
108 not re-applied or deleted.
109
110 const SoPickedPointList & getPickedPointList()
111 Returns a list of objects intersected by a picking operation, sorted
112 from nearest to farthest.
113
114
116 SoEvent, SoPickedPoint, SoRayPickAction
117
118
119
120
121 SoHandleEventAction(3IV)()