vtkBalloonWidget Class Reference

#include <vtkBalloonWidget.h>

Inheritance diagram for vtkBalloonWidget:

Inheritance graph
[legend]
Collaboration diagram for vtkBalloonWidget:

Collaboration graph
[legend]

List of all members.


Detailed Description

popup text balloons above instance of vtkProp when hovering occurs

The vtkBalloonWidget is used to popup text and/or an image when the mouse hovers over an instance of vtkProp. The widget keeps track of (vtkProp,vtkBalloon) pairs (where the internal vtkBalloon class is defined by a pair of vtkStdString and vtkImageData), and when the mouse stops moving for a user-specified period of time over the vtkProp, then the vtkBalloon is drawn nearby the vtkProp. Note that an instance of vtkBalloonRepresentation is used to draw the balloon.

To use this widget, specify an instance of vtkBalloonWidget and a representation (e.g., vtkBalloonRepresentation). Then list all instances of vtkProp, a text string, and/or an instance of vtkImageData to be associated with each vtkProp. (Note that you can specify both text and an image, or just one or the other.) You may also wish to specify the hover delay (i.e., set in the superclass vtkHoverWidget).

Event Bindings:
By default, the widget observes the following VTK events (i.e., it watches the vtkRenderWindowInteractor for these events):
   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).
 
Event Bindings:
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:
   vtkWidgetEvent::Move -- start the timer
   vtkWidgetEvent::TimedOut -- when hovering occurs,
   vtkWidgetEvent::SelectAction -- activate any callbacks associated 
                                   with the balloon.
 
Event Bindings:
This widget invokes the following VTK events on itself (which observers can listen for):
   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).
 
See also:
vtkAbstractWidget
Tests:
vtkBalloonWidget (Tests)

Definition at line 86 of file vtkBalloonWidget.h.

typedef vtkHoverWidget Superclass
static int IsTypeOf (const char *type)
static vtkBalloonWidgetSafeDownCast (vtkObject *o)
virtual const char * GetClassName ()
virtual int IsA (const char *type)
void PrintSelf (ostream &os, vtkIndent indent)

Public Member Functions

virtual void SetEnabled (int)
void CreateDefaultRepresentation ()
void SetRepresentation (vtkBalloonRepresentation *r)
void AddBalloon (vtkProp *prop, vtkStdString *str, vtkImageData *img)
void AddBalloon (vtkProp *prop, const char *str, vtkImageData *img)
void AddBalloon (vtkProp *prop, const char *str)
void RemoveBalloon (vtkProp *prop)
const char * GetBalloonString (vtkProp *prop)
vtkImageDataGetBalloonImage (vtkProp *prop)
virtual vtkPropGetCurrentProp ()
void SetPicker (vtkAbstractPropPicker *)
virtual vtkAbstractPropPickerGetPicker ()

Static Public Member Functions

static vtkBalloonWidgetNew ()

Protected Member Functions

 vtkBalloonWidget ()
 ~vtkBalloonWidget ()
virtual int SubclassEndHoverAction ()
virtual int SubclassHoverAction ()

Protected Attributes

vtkPropMap * PropMap
vtkAbstractPropPickerPicker
vtkPropCurrentProp

Member Typedef Documentation

Standard methods for a VTK class.

Reimplemented from vtkHoverWidget.

Definition at line 94 of file vtkBalloonWidget.h.


Constructor & Destructor Documentation

vtkBalloonWidget::vtkBalloonWidget (  )  [protected]

vtkBalloonWidget::~vtkBalloonWidget (  )  [protected]


Member Function Documentation

static vtkBalloonWidget* vtkBalloonWidget::New (  )  [static]

Instantiate this class.

Reimplemented from vtkHoverWidget.

virtual const char* vtkBalloonWidget::GetClassName (  )  [virtual]

Standard methods for a VTK class.

Reimplemented from vtkHoverWidget.

static int vtkBalloonWidget::IsTypeOf ( const char *  type  )  [static]

Standard methods for a VTK class.

Reimplemented from vtkHoverWidget.

virtual int vtkBalloonWidget::IsA ( const char *  type  )  [virtual]

Standard methods for a VTK class.

Reimplemented from vtkHoverWidget.

static vtkBalloonWidget* vtkBalloonWidget::SafeDownCast ( vtkObject o  )  [static]

Standard methods for a VTK class.

Reimplemented from vtkHoverWidget.

void vtkBalloonWidget::PrintSelf ( ostream &  os,
vtkIndent  indent 
) [virtual]

Standard methods for a VTK class.

Reimplemented from vtkHoverWidget.

virtual void vtkBalloonWidget::SetEnabled ( int   )  [virtual]

The method for activiating and deactiviating this widget. This method must be overridden because it performs special timer-related operations.

Reimplemented from vtkHoverWidget.

void vtkBalloonWidget::SetRepresentation ( vtkBalloonRepresentation r  )  [inline]

Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene. Note that the representation is a subclass of vtkProp so it can be added to the renderer independent of the widget.

Definition at line 107 of file vtkBalloonWidget.h.

void vtkBalloonWidget::CreateDefaultRepresentation (  )  [virtual]

Create the default widget representation if one is not set.

Reimplemented from vtkHoverWidget.

void vtkBalloonWidget::AddBalloon ( vtkProp prop,
vtkStdString 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.

void vtkBalloonWidget::AddBalloon ( vtkProp prop,
const char *  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.

void vtkBalloonWidget::AddBalloon ( vtkProp prop,
const char *  str 
) [inline]

Add and remove text and/or an image to be associated with a vtkProp. You may add one or both of them.

Definition at line 119 of file vtkBalloonWidget.h.

void vtkBalloonWidget::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.

const char* vtkBalloonWidget::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* vtkBalloonWidget::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.

virtual vtkProp* vtkBalloonWidget::GetCurrentProp (  )  [inline, virtual]

Return the current vtkProp that is being hovered over. Note that the value may be NULL (if hovering over nothing or the mouse is moving).

Definition at line 136 of file vtkBalloonWidget.h.

void vtkBalloonWidget::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.)

virtual vtkAbstractPropPicker* vtkBalloonWidget::GetPicker (  )  [virtual]

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.)

virtual int vtkBalloonWidget::SubclassEndHoverAction (  )  [protected, virtual]

Reimplemented from vtkHoverWidget.

virtual int vtkBalloonWidget::SubclassHoverAction (  )  [protected, virtual]

Reimplemented from vtkHoverWidget.


Member Data Documentation

vtkPropMap* vtkBalloonWidget::PropMap [protected]

Definition at line 158 of file vtkBalloonWidget.h.

Definition at line 161 of file vtkBalloonWidget.h.

Definition at line 164 of file vtkBalloonWidget.h.


The documentation for this class was generated from the following file:

Generated on Sat Dec 27 13:17:23 2008 for VTK by  doxygen 1.5.6