VTK  9.2.6
vtkBalloonRepresentation.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkBalloonRepresentation.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=========================================================================*/
53
54#ifndef vtkBalloonRepresentation_h
55#define vtkBalloonRepresentation_h
56
57#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
58#include "vtkInteractionWidgetsModule.h" // For export macro
60
61class vtkTextMapper;
62class vtkTextActor;
63class vtkTextProperty;
64class vtkPoints;
65class vtkCellArray;
66class vtkPolyData;
68class vtkActor2D;
69class vtkProperty2D;
70class vtkImageData;
71class vtkTexture;
72class vtkPoints;
73class vtkPolyData;
76
77class VTKINTERACTIONWIDGETS_EXPORT vtkBalloonRepresentation : public vtkWidgetRepresentation
78{
79public:
84
86
90 void PrintSelf(ostream& os, vtkIndent indent) override;
92
94
97 virtual void SetBalloonImage(vtkImageData* img);
98 vtkGetObjectMacro(BalloonImage, vtkImageData);
100
102
105 vtkGetStringMacro(BalloonText);
106 vtkSetStringMacro(BalloonText);
108
110
116 vtkSetVector2Macro(ImageSize, int);
117 vtkGetVector2Macro(ImageSize, int);
119
121
125 vtkGetObjectMacro(TextProperty, vtkTextProperty);
127
129
134 vtkGetObjectMacro(FrameProperty, vtkProperty2D);
136
138
142 vtkGetObjectMacro(ImageProperty, vtkProperty2D);
144
145 enum
146 {
151 };
152
154
161 vtkSetMacro(BalloonLayout, int);
162 vtkGetMacro(BalloonLayout, int);
172
174
180 vtkSetVector2Macro(Offset, int);
181 vtkGetVector2Macro(Offset, int);
183
185
189 vtkSetClampMacro(Padding, int, 0, 100);
190 vtkGetMacro(Padding, int);
192
194
197 void StartWidgetInteraction(double e[2]) override;
198 void EndWidgetInteraction(double e[2]) override;
199 void BuildRepresentation() override;
200 int ComputeInteractionState(int X, int Y, int modify = 0) override;
202
204
208 int RenderOverlay(vtkViewport* viewport) override;
210
220#if !defined(VTK_LEGACY_REMOVE)
221 VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
223#endif
224
225protected:
228
229 // The balloon text and image
232
233 // The layout of the balloon
235
236 // Controlling placement
238 int Offset[2];
239 int ImageSize[2];
240
241 // Represent the text
245
246 // Represent the image
253
254 // The frame
261
262 // Internal variable controlling rendering process
265
266 // Helper methods
267 void AdjustImageSize(double imageSize[2]);
268 void ScaleImage(double imageSize[2], double scale);
269
270private:
272 void operator=(const vtkBalloonRepresentation&) = delete;
273};
274
275#endif
a actor that draws 2D data
Definition vtkActor2D.h:40
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).
InteractionStateType _InteractionState
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:34
represent and manipulate 3D points
Definition vtkPoints.h:34
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:85
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:66
actor that draws 2D data with texture support
abstract specification for Viewports
Definition vtkViewport.h:50
window superclass for vtkRenderWindow
Definition vtkWindow.h:39
#define VTK_DEPRECATED_IN_9_2_0(reason)