VTK  9.5.2
vtkBalloonRepresentation.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
44
45#ifndef vtkBalloonRepresentation_h
46#define vtkBalloonRepresentation_h
47
48#include "vtkInteractionWidgetsModule.h" // For export macro
50#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
51
52VTK_ABI_NAMESPACE_BEGIN
53class vtkTextMapper;
54class vtkTextActor;
55class vtkTextProperty;
56class vtkPoints;
57class vtkCellArray;
58class vtkPolyData;
60class vtkActor2D;
61class vtkProperty2D;
62class vtkImageData;
63class vtkTexture;
64class vtkPoints;
65class vtkPolyData;
68
69class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkBalloonRepresentation
71{
72public:
77
79
83 void PrintSelf(ostream& os, vtkIndent indent) override;
85
87
90 virtual void SetBalloonImage(vtkImageData* img);
91 vtkGetObjectMacro(BalloonImage, vtkImageData);
93
95
98 vtkGetStringMacro(BalloonText);
99 vtkSetStringMacro(BalloonText);
101
103
109 vtkSetVector2Macro(ImageSize, int);
110 vtkGetVector2Macro(ImageSize, int);
112
114
118 vtkGetObjectMacro(TextProperty, vtkTextProperty);
120
122
127 vtkGetObjectMacro(FrameProperty, vtkProperty2D);
129
131
135 vtkGetObjectMacro(ImageProperty, vtkProperty2D);
137
138 enum
139 {
144 };
145
147
154 vtkSetMacro(BalloonLayout, int);
155 vtkGetMacro(BalloonLayout, int);
165
167
173 vtkSetVector2Macro(Offset, int);
174 vtkGetVector2Macro(Offset, int);
176
178
182 vtkSetClampMacro(Padding, int, 0, 100);
183 vtkGetMacro(Padding, int);
185
187
190 void StartWidgetInteraction(double e[2]) override;
191 void EndWidgetInteraction(double e[2]) override;
192 void BuildRepresentation() override;
193 int ComputeInteractionState(int X, int Y, int modify = 0) override;
195
197
201 int RenderOverlay(vtkViewport* viewport) override;
203
213
214protected:
217
218 // The balloon text and image
221
222 // The layout of the balloon
224
225 // Controlling placement
227 int Offset[2];
228 int ImageSize[2];
229
230 // Represent the text
234
235 // Represent the image
242
243 // The frame
250
251 // Internal variable controlling rendering process
254
255 // Helper methods
256 void AdjustImageSize(double imageSize[2]);
257 void ScaleImage(double imageSize[2], double scale);
258
259private:
261 void operator=(const vtkBalloonRepresentation&) = delete;
262};
263
264VTK_ABI_NAMESPACE_END
265#endif
a actor that draws 2D data
Definition vtkActor2D.h:36
void SetBalloonLayoutToTextRight()
Specify the layout of the image and text within the balloon.
void SetBalloonLayoutToImageLeft()
Specify the layout of the image and text within the balloon.
void SetBalloonLayoutToTextTop()
Specify the layout of the image and text within the balloon.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard VTK methods.
void BuildRepresentation() override
These are methods that satisfy vtkWidgetRepresentation's API.
virtual void SetBalloonImage(vtkImageData *img)
Specify/retrieve the image to display in the balloon.
void SetBalloonLayoutToImageRight()
Specify the layout of the image and text within the balloon.
vtkPolyDataMapper2D * TextureMapper
virtual void SetBalloonLayout(int)
Specify the layout of the image and text within the balloon.
void EndWidgetInteraction(double e[2]) override
These are methods that satisfy vtkWidgetRepresentation's API.
void StartWidgetInteraction(double e[2]) override
These are methods that satisfy vtkWidgetRepresentation's API.
int ComputeInteractionState(int X, int Y, int modify=0) override
These are methods that satisfy vtkWidgetRepresentation's API.
virtual void SetTextProperty(vtkTextProperty *p)
Set/get the text property (relevant only if text is shown).
void SetBalloonLayoutToImageTop()
Specify the layout of the image and text within the balloon.
void SetBalloonLayoutToTextLeft()
Specify the layout of the image and text within the balloon.
void AdjustImageSize(double imageSize[2])
void SetBalloonLayoutToImageBottom()
Specify the layout of the image and text within the balloon.
void SetBalloonLayoutToTextBottom()
Specify the layout of the image and text within the balloon.
InteractionStateType
State is either outside, or inside (on the text portion of the image).
virtual void SetImageProperty(vtkProperty2D *p)
Set/get the image property (relevant only if an image is shown).
~vtkBalloonRepresentation() override
void ScaleImage(double imageSize[2], double scale)
void ReleaseGraphicsResources(vtkWindow *w) override
Methods required by vtkProp superclass.
static vtkBalloonRepresentation * New()
Instantiate the class.
int RenderOverlay(vtkViewport *viewport) override
Methods required by vtkProp superclass.
virtual void SetFrameProperty(vtkProperty2D *p)
Set/get the frame property (relevant only if text is shown).
object to represent cell connectivity
topologically and geometrically regular array of data
a simple class to control print indentation
Definition vtkIndent.h:29
represent and manipulate 3D points
Definition vtkPoints.h:30
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:72
represent surface properties of a 2D image
An actor that displays text.
2D text annotation
represent text properties.
handles properties associated with a texture map
Definition vtkTexture.h:59
actor that draws 2D data with texture support
abstract specification for Viewports
Definition vtkViewport.h:47
window superclass for vtkRenderWindow
Definition vtkWindow.h:26
#define VTK_MARSHALAUTO