VTK  9.3.20240424
vtkBalloonWidget.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
81#ifndef vtkBalloonWidget_h
82#define vtkBalloonWidget_h
83
84#include "vtkHoverWidget.h"
85#include "vtkInteractionWidgetsModule.h" // For export macro
86#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
87
88VTK_ABI_NAMESPACE_BEGIN
90class vtkProp;
92class vtkStdString;
93class vtkPropMap;
94class vtkImageData;
95
96class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkBalloonWidget : public vtkHoverWidget
97{
98public:
103
105
109 void PrintSelf(ostream& os, vtkIndent indent) override;
111
116 void SetEnabled(int) override;
117
124 {
126 }
127
132 {
133 return reinterpret_cast<vtkBalloonRepresentation*>(this->WidgetRep);
134 }
135
140
142
147 void AddBalloon(vtkProp* prop, const char* str, vtkImageData* img);
148 void AddBalloon(vtkProp* prop, const char* str) // for wrapping
149 {
150 this->AddBalloon(prop, str, nullptr);
151 }
154
156
162 const char* GetBalloonString(vtkProp* prop);
165
167
171 void UpdateBalloonString(vtkProp* prop, const char* str);
174
179 virtual vtkProp* GetCurrentProp() { return this->CurrentProp; }
180
182
189 vtkGetObjectMacro(Picker, vtkAbstractPropPicker);
191
192 /*
193 * Register internal Pickers within PickingManager
194 */
195 void RegisterPickers() override;
196
197protected:
200
201 // This class implements the method called from its superclass.
203 int SubclassHoverAction() override;
204
205 // Classes for managing balloons
206 vtkPropMap* PropMap; // PIMPL'd map of (vtkProp,vtkStdString)
207
208 // Support for picking
210
211 // The vtkProp that is being hovered over (which may be nullptr)
213
214private:
215 vtkBalloonWidget(const vtkBalloonWidget&) = delete;
216 void operator=(const vtkBalloonWidget&) = delete;
217};
218
219VTK_ABI_NAMESPACE_END
220#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() override
Create the default widget representation if one is not set.
void SetEnabled(int) override
The method for activating and deactivating this widget.
const char * GetBalloonString(vtkProp *prop)
Methods to retrieve the information associated with each vtkProp (i.e., the information that makes up...
~vtkBalloonWidget() override
void RemoveBalloon(vtkProp *prop)
Add and remove text and/or an image to be associated with a vtkProp.
void RegisterPickers() override
Register internal Pickers in the Picking Manager.
void SetPicker(vtkAbstractPropPicker *)
Set/Get the object used to perform pick operations.
void UpdateBalloonImage(vtkProp *prop, vtkImageData *image)
Update the balloon string or image.
void AddBalloon(vtkProp *prop, const char *str)
Add and remove text and/or an image to be associated with a vtkProp.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for a VTK class.
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.
int SubclassHoverAction() override
void SetRepresentation(vtkBalloonRepresentation *r)
Specify an instance of vtkWidgetRepresentation used to represent this widget in the scene.
vtkImageData * GetBalloonImage(vtkProp *prop)
Methods to retrieve the information associated with each vtkProp (i.e., the information that makes up...
int SubclassEndHoverAction() override
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)
Add and remove text and/or an image to be associated with a vtkProp.
invoke a vtkTimerEvent when hovering
topologically and geometrically regular array of data
a simple class to control print indentation
Definition vtkIndent.h:108
abstract superclass for all actors, volumes and annotations
Definition vtkProp.h:66
Wrapper around std::string to keep symbols short.
abstract class defines interface between the widget and widget representation classes
#define VTK_MARSHALAUTO