VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 "vtkInteractionWidgetsModule.h" // For export macro
80 #include "vtkHoverWidget.h"
81 
83 class vtkProp;
85 class vtkStdString;
86 class vtkPropMap;
87 class vtkImageData;
88 
89 
91 {
92 public:
94  static vtkBalloonWidget *New();
95 
97 
99  void PrintSelf(ostream& os, vtkIndent indent);
101 
105  virtual void SetEnabled(int);
106 
108 
112  {this->Superclass::SetWidgetRepresentation(reinterpret_cast<vtkWidgetRepresentation*>(r));}
114 
116 
118  {return reinterpret_cast<vtkBalloonRepresentation*>(this->WidgetRep);}
120 
123 
125 
127  void AddBalloon(vtkProp *prop, vtkStdString *str, vtkImageData *img);
128  void AddBalloon(vtkProp *prop, const char *str, vtkImageData *img);
129  void AddBalloon(vtkProp *prop, const char *str) //for wrapping
130  {this->AddBalloon(prop,str,NULL);}
131  void RemoveBalloon(vtkProp *prop);
133 
135 
139  const char *GetBalloonString(vtkProp *prop);
140  vtkImageData *GetBalloonImage(vtkProp *prop);
142 
144 
146  void UpdateBalloonString(vtkProp *prop, const char *str);
147  void UpdateBalloonImage(vtkProp *prop, vtkImageData *image);
149 
151 
154  {return this->CurrentProp;}
156 
158 
162  void SetPicker(vtkAbstractPropPicker*);
165 
166 protected:
168  ~vtkBalloonWidget();
169 
170  // This class implements the method called from its superclass.
171  virtual int SubclassEndHoverAction();
172  virtual int SubclassHoverAction();
173 
174  // Classes for managing balloons
175  vtkPropMap *PropMap; //PIMPL'd map of (vtkProp,vtkStdString)
176 
177  // Support for picking
179 
180  // Register internal Pickers within PickingManager
181  virtual void RegisterPickers();
182 
183  // The vtkProp that is being hovered over (which may be NULL)
185 
186 private:
187  vtkBalloonWidget(const vtkBalloonWidget&); //Not implemented
188  void operator=(const vtkBalloonWidget&); //Not implemented
189 };
190 
191 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:50
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:46
GLenum GLsizei GLenum GLenum const GLvoid * image
Definition: vtkgl.h:11341
vtkBalloonRepresentation * GetBalloonRepresentation()
virtual void SetEnabled(int)
GLdouble GLdouble GLdouble r
Definition: vtkgl.h:11610
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:619
virtual void RegisterPickers()
vtkWidgetRepresentation * WidgetRep
void PrintSelf(ostream &os, vtkIndent indent)
#define VTKINTERACTIONWIDGETS_EXPORT
a simple class to control print indentation
Definition: vtkIndent.h:38
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
void CreateDefaultRepresentation()
virtual int SubclassHoverAction()
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:222
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()
GLint GLvoid * img
Definition: vtkgl.h:11544
void SetRepresentation(vtkBalloonRepresentation *r)