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 - occurs when mouse is moved in render window. TimerEvent - occurs when the time between events (e.g., mouse move) is greater than TimerDuration. 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 vtkBalloonWidget's widget events: <pre> vtkWidgetEvent::Move -- start the timer vtkWidgetEvent::TimedOut -- when hovering occurs, vtkWidgetEvent::SelectAction -- activate any callbacks associated with the balloon. </pre>
This widget invokes the following VTK events on itself (which observers can listen for): <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 vtkBalloonWidget, simply invoke its constructor as follows
obj = vtkBalloonWidget
obj
is an instance of the vtkBalloonWidget class.
string = obj.GetClassName ()
- Standard methods for a VTK class.
int = obj.IsA (string name)
- Standard methods for a VTK class.
vtkBalloonWidget = obj.NewInstance ()
- Standard methods for a VTK class.
vtkBalloonWidget = obj.SafeDownCast (vtkObject o)
- Standard methods for a VTK class.
obj.SetEnabled (int )
- The method for activiating and deactiviating this widget. This method
must be overridden because it performs special timer-related operations.
obj.SetRepresentation (vtkBalloonRepresentation r)
- Create the default widget representation if one is not set.
obj.CreateDefaultRepresentation ()
- Create the default widget representation if one is not set.
obj.AddBalloon (vtkProp prop, string str, vtkImageData img)
- Add and remove text and/or an image to be associated with a vtkProp. You
may add one or both of them.
obj.AddBalloon (vtkProp prop, string str)
- Add and remove text and/or an image to be associated with a vtkProp. You
may add one or both of them.
obj.RemoveBalloon (vtkProp prop)
- Add and remove text and/or an image to be associated with a vtkProp. You
may add one or both of them.
string = obj.GetBalloonString (vtkProp prop)
- Methods to retrieve the information associated with each vtkProp (i.e.,
the information that makes up each balloon). A NULL will be returned if
the vtkProp does not exist, or if a string or image have not been
associated with the specified vtkProp.
vtkImageData = obj.GetBalloonImage (vtkProp prop)
- Methods to retrieve the information associated with each vtkProp (i.e.,
the information that makes up each balloon). A NULL will be returned if
the vtkProp does not exist, or if a string or image have not been
associated with the specified vtkProp.
vtkProp = obj.GetCurrentProp ()
- Set/Get the object used to perform pick operations. Since the
vtkBalloonWidget operates on vtkProps, the picker must be a subclass of
vtkAbstractPropPicker. (Note: if not specified, an instance of
vtkPropPicker is used.)
obj.SetPicker (vtkAbstractPropPicker )
- Set/Get the object used to perform pick operations. Since the
vtkBalloonWidget operates on vtkProps, the picker must be a subclass of
vtkAbstractPropPicker. (Note: if not specified, an instance of
vtkPropPicker is used.)
vtkAbstractPropPicker = obj.GetPicker ()
- Set/Get the object used to perform pick operations. Since the
vtkBalloonWidget operates on vtkProps, the picker must be a subclass of
vtkAbstractPropPicker. (Note: if not specified, an instance of
vtkPropPicker is used.)