VTK
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vtkBalloonWidget Class Reference

popup text balloons above instance of vtkProp when hovering occurs More...

#include <vtkBalloonWidget.h>

Inheritance diagram for vtkBalloonWidget:
[legend]
Collaboration diagram for vtkBalloonWidget:
[legend]

Public Member Functions

virtual void SetEnabled (int)
 
void CreateDefaultRepresentation ()
 
void SetRepresentation (vtkBalloonRepresentation *r)
 
vtkBalloonRepresentationGetBalloonRepresentation ()
 
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)
 
void UpdateBalloonString (vtkProp *prop, const char *str)
 
void UpdateBalloonImage (vtkProp *prop, vtkImageData *image)
 
virtual vtkPropGetCurrentProp ()
 
void SetPicker (vtkAbstractPropPicker *)
 
virtual vtkAbstractPropPickerGetPicker ()
 
- Public Member Functions inherited from vtkHoverWidget
virtual void SetTimerDuration (int)
 
virtual int GetTimerDuration ()
 
void CreateDefaultRepresentation ()
 
vtkHoverWidgetNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent)
 
- Public Member Functions inherited from vtkAbstractWidget
void Render ()
 
virtual void SetPriority (float)
 
virtual void SetProcessEvents (int)
 
virtual int GetProcessEvents ()
 
virtual void ProcessEventsOn ()
 
virtual void ProcessEventsOff ()
 
vtkWidgetEventTranslatorGetEventTranslator ()
 
void SetParent (vtkAbstractWidget *parent)
 
virtual vtkAbstractWidgetGetParent ()
 
vtkWidgetRepresentationGetRepresentation ()
 
virtual void SetManagesCursor (int)
 
virtual int GetManagesCursor ()
 
virtual void ManagesCursorOn ()
 
virtual void ManagesCursorOff ()
 
vtkAbstractWidgetNewInstance () const
 
- Public Member Functions inherited from vtkInteractorObserver
vtkInteractorObserverNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent)
 
virtual void OnChar ()
 
int GetEnabled ()
 
void EnabledOn ()
 
void EnabledOff ()
 
void On ()
 
void Off ()
 
virtual void SetInteractor (vtkRenderWindowInteractor *iren)
 
virtual vtkRenderWindowInteractorGetInteractor ()
 
virtual float GetPriority ()
 
virtual void PickingManagedOn ()
 
virtual void PickingManagedOff ()
 
virtual void SetPickingManaged (bool)
 
virtual bool GetPickingManaged ()
 
virtual void SetKeyPressActivation (int)
 
virtual int GetKeyPressActivation ()
 
virtual void KeyPressActivationOn ()
 
virtual void KeyPressActivationOff ()
 
virtual void SetKeyPressActivationValue (char)
 
virtual char GetKeyPressActivationValue ()
 
virtual vtkRendererGetDefaultRenderer ()
 
virtual void SetDefaultRenderer (vtkRenderer *)
 
virtual vtkRendererGetCurrentRenderer ()
 
virtual void SetCurrentRenderer (vtkRenderer *)
 
void GrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
 
void ReleaseFocus ()
 
- Public Member Functions inherited from vtkObject
vtkObjectNewInstance () const
 
virtual void DebugOn ()
 
virtual void DebugOff ()
 
bool GetDebug ()
 
void SetDebug (bool debugFlag)
 
virtual void Modified ()
 
virtual unsigned long GetMTime ()
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 
vtkCommandGetCommand (unsigned long tag)
 
void RemoveObserver (vtkCommand *)
 
void RemoveObservers (unsigned long event, vtkCommand *)
 
void RemoveObservers (const char *event, vtkCommand *)
 
int HasObserver (unsigned long event, vtkCommand *)
 
int HasObserver (const char *event, vtkCommand *)
 
void RemoveObserver (unsigned long tag)
 
void RemoveObservers (unsigned long event)
 
void RemoveObservers (const char *event)
 
void RemoveAllObservers ()
 
int HasObserver (unsigned long event)
 
int HasObserver (const char *event)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
int InvokeEvent (unsigned long event, void *callData)
 
int InvokeEvent (const char *event, void *callData)
 
int InvokeEvent (unsigned long event)
 
int InvokeEvent (const char *event)
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 
virtual void Delete ()
 
virtual void FastDelete ()
 
void Print (ostream &os)
 
virtual void Register (vtkObjectBase *o)
 
virtual void UnRegister (vtkObjectBase *o)
 
void SetReferenceCount (int)
 
void PrintRevisions (ostream &)
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 
int GetReferenceCount ()
 

Static Public Member Functions

static vtkBalloonWidgetNew ()
 
- Static Public Member Functions inherited from vtkHoverWidget
static vtkHoverWidgetNew ()
 
static int IsTypeOf (const char *type)
 
static vtkHoverWidgetSafeDownCast (vtkObjectBase *o)
 
- Static Public Member Functions inherited from vtkAbstractWidget
static int IsTypeOf (const char *type)
 
static vtkAbstractWidgetSafeDownCast (vtkObjectBase *o)
 
- Static Public Member Functions inherited from vtkInteractorObserver
static int IsTypeOf (const char *type)
 
static vtkInteractorObserverSafeDownCast (vtkObjectBase *o)
 
static void ComputeDisplayToWorld (vtkRenderer *ren, double x, double y, double z, double worldPt[4])
 
static void ComputeWorldToDisplay (vtkRenderer *ren, double x, double y, double z, double displayPt[3])
 
- Static Public Member Functions inherited from vtkObject
static int IsTypeOf (const char *type)
 
static vtkObjectSafeDownCast (vtkObjectBase *o)
 
static vtkObjectNew ()
 
static void BreakOnError ()
 
static void SetGlobalWarningDisplay (int val)
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 
static int GetGlobalWarningDisplay ()
 
- Static Public Member Functions inherited from vtkObjectBase
static int IsTypeOf (const char *name)
 
static vtkObjectBaseNew ()
 

Protected Member Functions

 vtkBalloonWidget ()
 
 ~vtkBalloonWidget ()
 
virtual int SubclassEndHoverAction ()
 
virtual int SubclassHoverAction ()
 
virtual void RegisterPickers ()
 
- Protected Member Functions inherited from vtkHoverWidget
 vtkHoverWidget ()
 
 ~vtkHoverWidget ()
 
virtual int SubclassSelectAction ()
 
- Protected Member Functions inherited from vtkAbstractWidget
 vtkAbstractWidget ()
 
 ~vtkAbstractWidget ()
 
void SetWidgetRepresentation (vtkWidgetRepresentation *r)
 
virtual void SetCursor (int vtkNotUsed(state))
 
- Protected Member Functions inherited from vtkInteractorObserver
 vtkInteractorObserver ()
 
 ~vtkInteractorObserver ()
 
void UnRegisterPickers ()
 
virtual void PickersModified ()
 
vtkPickingManagerGetPickingManager ()
 
int RequestCursorShape (int requestedShape)
 
virtual void StartInteraction ()
 
virtual void EndInteraction ()
 
void ComputeDisplayToWorld (double x, double y, double z, double worldPt[4])
 
void ComputeWorldToDisplay (double x, double y, double z, double displayPt[3])
 
vtkAssemblyPathGetAssemblyPath (double X, double Y, double Z, vtkAbstractPropPicker *picker)
 
- Protected Member Functions inherited from vtkObject
 vtkObject ()
 
virtual ~vtkObject ()
 
virtual void RegisterInternal (vtkObjectBase *, int check)
 
virtual void UnRegisterInternal (vtkObjectBase *, int check)
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
 
void InternalReleaseFocus ()
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void CollectRevisions (ostream &)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Protected Attributes

vtkPropMap * PropMap
 
vtkAbstractPropPickerPicker
 
vtkPropCurrentProp
 
- Protected Attributes inherited from vtkHoverWidget
int WidgetState
 
int TimerId
 
int TimerDuration
 
- Protected Attributes inherited from vtkAbstractWidget
vtkWidgetRepresentationWidgetRep
 
int ManagesCursor
 
vtkWidgetEventTranslatorEventTranslator
 
vtkWidgetCallbackMapperCallbackMapper
 
vtkAbstractWidgetParent
 
void * CallData
 
int ProcessEvents
 
- Protected Attributes inherited from vtkInteractorObserver
int Enabled
 
vtkCallbackCommandEventCallbackCommand
 
vtkCallbackCommandKeyPressCallbackCommand
 
float Priority
 
bool PickingManaged
 
int KeyPressActivation
 
char KeyPressActivationValue
 
vtkRenderWindowInteractorInteractor
 
vtkRendererCurrentRenderer
 
vtkRendererDefaultRenderer
 
unsigned long CharObserverTag
 
unsigned long DeleteObserverTag
 
vtkObserverMediatorObserverMediator
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
vtkAtomicInt32 ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 
typedef vtkHoverWidget Superclass
 
static int IsTypeOf (const char *type)
 
static vtkBalloonWidgetSafeDownCast (vtkObjectBase *o)
 
virtual int IsA (const char *type)
 
vtkBalloonWidgetNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent)
 
virtual vtkObjectBaseNewInstanceInternal () const
 

Additional Inherited Members

- Public Types inherited from vtkHoverWidget
typedef vtkAbstractWidget Superclass
 
- Public Types inherited from vtkAbstractWidget
typedef vtkInteractorObserver Superclass
 
- Public Types inherited from vtkInteractorObserver
typedef vtkObject Superclass
 
- Public Types inherited from vtkObject
typedef vtkObjectBase Superclass
 
- Protected Types inherited from vtkHoverWidget
enum  { Start =0, Timing, TimedOut }
 
- Static Protected Member Functions inherited from vtkHoverWidget
static void MoveAction (vtkAbstractWidget *)
 
static void HoverAction (vtkAbstractWidget *)
 
static void SelectAction (vtkAbstractWidget *)
 
- Static Protected Member Functions inherited from vtkAbstractWidget
static void ProcessEventsHandler (vtkObject *object, unsigned long event, void *clientdata, void *calldata)
 
- Static Protected Member Functions inherited from vtkInteractorObserver
static void ProcessEvents (vtkObject *object, unsigned long event, void *clientdata, void *calldata)
 

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 activated (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 occurred and the
                                   mouse begins moving again).
  vtkCommand::WidgetActivateEvent (when the balloon is selected with a
                                   keypress).
See also
vtkAbstractWidget
Examples:
vtkBalloonWidget (Examples)
Tests:
vtkBalloonWidget (Tests)

Definition at line 90 of file vtkBalloonWidget.h.

Member Typedef Documentation

Standard methods for a VTK class.

Definition at line 98 of file vtkBalloonWidget.h.

Constructor & Destructor Documentation

vtkBalloonWidget::vtkBalloonWidget ( )
protected
vtkBalloonWidget::~vtkBalloonWidget ( )
protected

Member Function Documentation

static vtkBalloonWidget* vtkBalloonWidget::New ( )
static

Instantiate this class.

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

Standard methods for a VTK class.

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

Standard methods for a VTK class.

Reimplemented from vtkHoverWidget.

static vtkBalloonWidget* vtkBalloonWidget::SafeDownCast ( vtkObjectBase o)
static

Standard methods for a VTK class.

virtual vtkObjectBase* vtkBalloonWidget::NewInstanceInternal ( ) const
protectedvirtual

Standard methods for a VTK class.

Reimplemented from vtkHoverWidget.

vtkBalloonWidget* vtkBalloonWidget::NewInstance ( ) const

Standard methods for a VTK class.

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

Standard methods for a VTK class.

Reimplemented from vtkAbstractWidget.

virtual void vtkBalloonWidget::SetEnabled ( int  )
virtual

The method for activating and deactivating 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 111 of file vtkBalloonWidget.h.

vtkBalloonRepresentation* vtkBalloonWidget::GetBalloonRepresentation ( )
inline

Return the representation as a vtkBalloonRepresentation.

Definition at line 117 of file vtkBalloonWidget.h.

void vtkBalloonWidget::CreateDefaultRepresentation ( )
virtual

Create the default widget representation if one is not set.

Implements vtkAbstractWidget.

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

void vtkBalloonWidget::UpdateBalloonString ( vtkProp prop,
const char *  str 
)

Update the balloon string or image. If the specified prop does not exist, then nothing is added not changed.

void vtkBalloonWidget::UpdateBalloonImage ( vtkProp prop,
vtkImageData image 
)

Update the balloon string or image. If the specified prop does not exist, then nothing is added not changed.

virtual vtkProp* vtkBalloonWidget::GetCurrentProp ( )
inlinevirtual

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 153 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 ( )
protectedvirtual

Reimplemented from vtkHoverWidget.

virtual int vtkBalloonWidget::SubclassHoverAction ( )
protectedvirtual

Reimplemented from vtkHoverWidget.

virtual void vtkBalloonWidget::RegisterPickers ( )
protectedvirtual

Register internal Pickers in the Picking Manager. Must be reimplemented by concrete widgets to register their pickers.

Reimplemented from vtkInteractorObserver.

Member Data Documentation

vtkPropMap* vtkBalloonWidget::PropMap
protected

Definition at line 175 of file vtkBalloonWidget.h.

vtkAbstractPropPicker* vtkBalloonWidget::Picker
protected

Definition at line 178 of file vtkBalloonWidget.h.

vtkProp* vtkBalloonWidget::CurrentProp
protected

Definition at line 184 of file vtkBalloonWidget.h.


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