VTK  9.6.20260502
vtkLegendBoxEntryInternal.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
11
12#ifndef vtkLegendBoxEntryInternal_h
13#define vtkLegendBoxEntryInternal_h
14
15#include "vtkNew.h"
16#include "vtkSmartPointer.h"
17
18VTK_ABI_NAMESPACE_BEGIN
19class vtkActor2D;
20class vtkImageData;
21class vtkPlaneSource;
22class vtkPolyData;
24class vtkProperty2D;
25class vtkTextMapper;
26class vtkTextProperty;
28class vtkTransform;
30class vtkViewport;
31class vtkWindow;
32
34{
35public:
38
40
44 bool SetText(const char* text);
45 const char* GetText();
47
49
56
61 bool HasSymbol();
62
64
71
76 bool HasIcon();
77
79
83 bool SetColor(double color[3]);
84 double* GetColor();
86
88
95
99 void SetTextPosition(double X, double Y);
100
105 void UpdateIconTransform(int width, int height, double posX, double posY);
106
111 void UpdateSymbolTransform(int width, int height, double posX, double posY);
112
117 void UpdateProperties(bool visibility, vtkProperty2D* prop);
118
123
128
132 double* GetIconBounds();
133
135
138 void SetFontSize(int size);
139 int SetConstrainedFontSize(vtkViewport* viewport, int size[2]);
140 void GetSize(vtkViewport* viewport, int size[2]);
142
143private:
149 void UpdateTransform(
150 vtkTransform* tranform, double posX, double posY, double bounds[6], int width, int height);
151
155 double GetScale(double bounds[6], int width, int height);
156
157 vtkNew<vtkTextMapper> TextMapper;
158 vtkNew<vtkActor2D> TextActor;
159
161 vtkNew<vtkTransform> Transform;
162 vtkNew<vtkTransformFilter> SymbolTransform;
163 vtkNew<vtkPolyDataMapper2D> SymbolMapper;
164 vtkNew<vtkActor2D> SymbolActor;
165
168 vtkNew<vtkTransform> IconTransform;
169 vtkNew<vtkTransformFilter> IconTransformFilter;
172
173 double Color[3] = { -1, -1, -1 };
174};
175
176VTK_ABI_NAMESPACE_END
177
178#endif
a actor that draws 2D data
Definition vtkActor2D.h:145
topologically and geometrically regular array of data
bool SetSymbol(vtkPolyData *)
Set / Get the entry symbol.
double * GetColor()
Set / Get the entry color.
void UpdateSymbolTransform(int width, int height, double posX, double posY)
Update the symbol transform (scale and position).
bool SetColor(double color[3])
Set / Get the entry color.
void SetFontSize(int size)
Forwarded to internal text mapper.
vtkImageData * GetIcon()
Set / Get the entry icon.
void SetTextPosition(double X, double Y)
Set the text position.
int RenderOverlay(vtkViewport *)
Forward usual rendering methods to internal actors.
int SetConstrainedFontSize(vtkViewport *viewport, int size[2])
Forwarded to internal text mapper.
void UpdateIconTransform(int width, int height, double posX, double posY)
Update the icon transform (scale and position).
bool SetIcon(vtkImageData *)
Set / Get the entry icon.
bool SetText(const char *text)
Set / Get the entry text.
bool HasIcon()
Returns true if the entry has an icon set (i.e.
void GetSize(vtkViewport *viewport, int size[2])
Forwarded to internal text mapper.
vtkPolyData * GetSymbol()
Set / Get the entry symbol.
double * GetSymbolBounds()
Get the entry symbol bounds.
int RenderOpaqueGeometry(vtkViewport *)
Forward usual rendering methods to internal actors.
void UpdateProperties(bool visibility, vtkProperty2D *prop)
Update internal actors properties.
void ReleaseGraphicsResources(vtkWindow *win)
Forward usual rendering methods to internal actors.
const char * GetText()
Set / Get the entry text.
bool HasSymbol()
Returns true if the entry has a symbol set (i.e.
void CopyTextProperty(vtkTextProperty *prop)
Copy given property into internal TextActor property.
double * GetIconBounds()
Get the entry symbol bounds.
Allocate and hold a VTK object.
Definition vtkNew.h:168
create an array of quadrilaterals located in a plane
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
represent surface properties of a 2D image
Hold a reference to a vtkObjectBase instance.
2D text annotation
represent text properties.
actor that draws 2D data with texture support
transform points and associated normals and vectors
describes linear transformations via a 4x4 matrix
abstract specification for Viewports
Definition vtkViewport.h:66
window superclass for vtkRenderWindow
Definition vtkWindow.h:61