VTK
vtkBalloonWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkBalloonWidget.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
76 #ifndef __vtkBalloonWidget_h
77 #define __vtkBalloonWidget_h
78 
79 #include "vtkHoverWidget.h"
80 
82 class vtkProp;
84 class vtkStdString;
85 class vtkPropMap;
86 class vtkImageData;
87 
88 
90 {
91 public:
93  static vtkBalloonWidget *New();
94 
96 
98  void PrintSelf(ostream& os, vtkIndent indent);
100 
104  virtual void SetEnabled(int);
105 
107 
111  {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));}
113 
115 
117  {return reinterpret_cast<vtkBalloonRepresentation*>(this->WidgetRep);}
119 
122 
124 
126  void AddBalloon(vtkProp *prop, vtkStdString *str, vtkImageData *img);
127  void AddBalloon(vtkProp *prop, const char *str, vtkImageData *img);
128  void AddBalloon(vtkProp *prop, const char *str) //for wrapping
129  {this->AddBalloon(prop,str,NULL);}
130  void RemoveBalloon(vtkProp *prop);
132 
134 
138  const char *GetBalloonString(vtkProp *prop);
139  vtkImageData *GetBalloonImage(vtkProp *prop);
141 
143 
145  void UpdateBalloonString(vtkProp *prop, const char *str);
146  void UpdateBalloonImage(vtkProp *prop, vtkImageData *image);
148 
150 
153  {return this->CurrentProp;}
155 
157 
161  void SetPicker(vtkAbstractPropPicker*);
162  vtkGetObjectMacro(Picker,vtkAbstractPropPicker);
164 
165 protected:
167  ~vtkBalloonWidget();
168 
169  // This class implements the method called from its superclass.
170  virtual int SubclassEndHoverAction();
171  virtual int SubclassHoverAction();
172 
173  // Classes for managing balloons
174  vtkPropMap *PropMap; //PIMPL'd map of (vtkProp,vtkStdString)
175 
176  // Support for picking
178 
179  // The vtkProp that is being hovered over (which may be NULL)
181 
182 private:
183  vtkBalloonWidget(const vtkBalloonWidget&); //Not implemented
184  void operator=(const vtkBalloonWidget&); //Not implemented
185 };
186 
187 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:49
Wrapper around vtkstd::string to keep symbols short.
Definition: vtkStdString.h:45
vtkBalloonRepresentation * GetBalloonRepresentation()
virtual void SetEnabled(int)
vtkWidgetRepresentation * WidgetRep
void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:37
topologically and geometrically regular array of data
Definition: vtkImageData.h:43
void CreateDefaultRepresentation()
#define VTK_WIDGETS_EXPORT
virtual int SubclassHoverAction()
popup text balloons above instance of vtkProp when hovering occurs
represent the vtkBalloonWidget
virtual int SubclassEndHoverAction()
abstract API for pickers that can pick an instance of vtkProp
vtkAbstractPropPicker * Picker
virtual vtkProp * GetCurrentProp()
invoke a vtkTimerEvent when hovering
void SetWidgetRepresentation(vtkWidgetRepresentation *r)
void AddBalloon(vtkProp *prop, const char *str)
vtkPropMap * PropMap
static vtkHoverWidget * New()
void SetRepresentation(vtkBalloonRepresentation *r)