Section: Visualization Toolkit Widget Classes
.SECTION Event Bindings By default, the widget observes the following VTK events (i.e., it watches the vtkRenderWindowInteractor for these events): <pre> MouseMoveEvent - manages a timer used to determine whether the mouse is hovering. TimerEvent - when the time between events (e.g., mouse move), then a timer event is invoked. KeyPressEvent - when the "Enter" key is pressed after the balloon appears, a callback is activited (e.g., WidgetActivateEvent). </pre>
Note that the event bindings described above can be changed using this class's vtkWidgetEventTranslator. This class translates VTK events into the vtkHoverWidget's widget events: <pre> vtkWidgetEvent::Move -- start (or reset) the timer vtkWidgetEvent::TimedOut -- when enough time is elapsed between defined VTK events the hover event is invoked. vtkWidgetEvent::SelectAction -- activate any callbacks associated with the balloon. </pre>
This widget invokes the following VTK events on itself when the widget determines that it is hovering. Note that observers of this widget can listen for these events and take appropriate action. <pre> vtkCommand::TimerEvent (when hovering is determined to occur) vtkCommand::EndInteractionEvent (after a hover has occured and the mouse begins moving again). vtkCommand::WidgetActivateEvent (when the balloon is selected with a keypress). </pre>
To create an instance of class vtkHoverWidget, simply invoke its constructor as follows
obj = vtkHoverWidget
obj
is an instance of the vtkHoverWidget class.
string = obj.GetClassName ()
- Standard methods for a VTK class.
int = obj.IsA (string name)
- Standard methods for a VTK class.
vtkHoverWidget = obj.NewInstance ()
- Standard methods for a VTK class.
vtkHoverWidget = obj.SafeDownCast (vtkObject o)
- Standard methods for a VTK class.
obj.SetTimerDuration (int )
- Specify the hovering interval (in milliseconds). If after moving the
mouse the pointer stays over a vtkProp for this duration, then a
vtkTimerEvent::TimerEvent is invoked.
int = obj.GetTimerDurationMinValue ()
- Specify the hovering interval (in milliseconds). If after moving the
mouse the pointer stays over a vtkProp for this duration, then a
vtkTimerEvent::TimerEvent is invoked.
int = obj.GetTimerDurationMaxValue ()
- Specify the hovering interval (in milliseconds). If after moving the
mouse the pointer stays over a vtkProp for this duration, then a
vtkTimerEvent::TimerEvent is invoked.
int = obj.GetTimerDuration ()
- Specify the hovering interval (in milliseconds). If after moving the
mouse the pointer stays over a vtkProp for this duration, then a
vtkTimerEvent::TimerEvent is invoked.
obj.SetEnabled (int )
- The method for activiating and deactiviating this widget. This method
must be overridden because it performs special timer-related operations.
obj.CreateDefaultRepresentation ()