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=========================================================================*/
77#ifndef vtkBalloonWidget_h
78#define vtkBalloonWidget_h
79
80#include "vtkInteractionWidgetsModule.h" // For export macro
81#include "vtkHoverWidget.h"
82
84class vtkProp;
86class vtkStdString;
87class vtkPropMap;
88class vtkImageData;
89
90
91class VTKINTERACTIONWIDGETS_EXPORT vtkBalloonWidget : public vtkHoverWidget
92{
93public:
98
100
104 void PrintSelf(ostream& os, vtkIndent indent);
106
111 virtual void SetEnabled(int);
112
120
125 {return reinterpret_cast<vtkBalloonRepresentation*>(this->WidgetRep);}
126
131
133
138 void AddBalloon(vtkProp *prop, const char *str, vtkImageData *img);
139 void AddBalloon(vtkProp *prop, const char *str) //for wrapping
140 {this->AddBalloon(prop,str,NULL);}
143
145
151 const char *GetBalloonString(vtkProp *prop);
154
156
160 void UpdateBalloonString(vtkProp *prop, const char *str);
163
169 {return this->CurrentProp;}
170
172
179 vtkGetObjectMacro(Picker,vtkAbstractPropPicker);
181
182protected:
185
186 // This class implements the method called from its superclass.
188 virtual int SubclassHoverAction();
189
190 // Classes for managing balloons
191 vtkPropMap *PropMap; //PIMPL'd map of (vtkProp,vtkStdString)
192
193 // Support for picking
195
196 // Register internal Pickers within PickingManager
197 virtual void RegisterPickers();
198
199 // The vtkProp that is being hovered over (which may be NULL)
201
202private:
203 vtkBalloonWidget(const vtkBalloonWidget&) VTK_DELETE_FUNCTION;
204 void operator=(const vtkBalloonWidget&) VTK_DELETE_FUNCTION;
205};
206
207#endif
abstract API for pickers that can pick an instance of vtkProp
void SetWidgetRepresentation(vtkWidgetRepresentation *r)
vtkWidgetRepresentation * WidgetRep
represent the vtkBalloonWidget
popup text balloons above instance of vtkProp when hovering occurs
void CreateDefaultRepresentation()
Create the default widget representation if one is not set.
const char * GetBalloonString(vtkProp *prop)
Methods to retrieve the information associated with each vtkProp (i.e., the information that makes up...
void RemoveBalloon(vtkProp *prop)
vtkPropMap * PropMap
void SetPicker(vtkAbstractPropPicker *)
Set/Get the object used to perform pick operations.
void UpdateBalloonImage(vtkProp *prop, vtkImageData *image)
void AddBalloon(vtkProp *prop, const char *str)
virtual int SubclassEndHoverAction()
virtual void SetEnabled(int)
The method for activating and deactivating this widget.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual vtkProp * GetCurrentProp()
Return the current vtkProp that is being hovered over.
vtkBalloonRepresentation * GetBalloonRepresentation()
Return the representation as a vtkBalloonRepresentation.
void UpdateBalloonString(vtkProp *prop, const char *str)
Update the balloon string or image.
virtual int SubclassHoverAction()
void SetRepresentation(vtkBalloonRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
vtkImageData * GetBalloonImage(vtkProp *prop)
virtual void RegisterPickers()
Register internal Pickers in the Picking Manager.
static vtkBalloonWidget * New()
Instantiate this class.
void AddBalloon(vtkProp *prop, vtkStdString *str, vtkImageData *img)
Add and remove text and/or an image to be associated with a vtkProp.
vtkAbstractPropPicker * Picker
void AddBalloon(vtkProp *prop, const char *str, vtkImageData *img)
invoke a vtkTimerEvent when hovering
topologically and geometrically regular array of data
Definition: vtkImageData.h:46
a simple class to control print indentation
Definition: vtkIndent.h:40
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:48
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:49
abstract class defines interface between the widget and widget representation classes
@ image
Definition: vtkX3D.h:374