VTK  9.7.0
vtkLegendBoxActor.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
28
29#ifndef vtkLegendBoxActor_h
30#define vtkLegendBoxActor_h
31
32#include "vtkActor2D.h"
33#include "vtkNew.h" // for vtkNew
34#include "vtkRenderingAnnotationModule.h" // For export macro
35#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
36
37VTK_ABI_NAMESPACE_BEGIN
38class vtkActor;
39class vtkDoubleArray;
40class vtkImageData;
42class vtkPolyData;
45class vtkPlaneSource;
46class vtkTextMapper;
47class vtkTextProperty;
49class vtkTransform;
51class vtkProperty2D;
52
53class VTKRENDERINGANNOTATION_EXPORT VTK_MARSHALAUTO vtkLegendBoxActor : public vtkActor2D
54{
55public:
57 void PrintSelf(ostream& os, vtkIndent indent) override;
58
64
68 void SetNumberOfEntries(int num);
69 int GetNumberOfEntries() { return this->NumberOfEntries; }
70
72
82 void SetEntry(int i, vtkPolyData* symbol, const char* string, double color[3]);
83 void SetEntry(int i, vtkImageData* symbol, const char* string, double color[3]);
85 int i, vtkPolyData* symbol, vtkImageData* icon, const char* string, double color[3]);
87
88 void SetEntrySymbol(int i, vtkPolyData* symbol);
89 void SetEntryIcon(int i, vtkImageData* icon);
90 void SetEntryString(int i, const char* string);
91 void SetEntryColor(int i, double color[3]);
92 void SetEntryColor(int i, double r, double g, double b);
93
96 const char* GetEntryString(int i);
97 double* GetEntryColor(int i) VTK_SIZEHINT(3);
98
104
110
112
116 vtkSetMacro(Border, vtkTypeBool);
117 vtkGetMacro(Border, vtkTypeBool);
118 vtkBooleanMacro(Border, vtkTypeBool);
120
122
130 vtkSetMacro(LockBorder, vtkTypeBool);
131 vtkGetMacro(LockBorder, vtkTypeBool);
132 vtkBooleanMacro(LockBorder, vtkTypeBool);
134
136
140 vtkSetMacro(Box, vtkTypeBool);
141 vtkGetMacro(Box, vtkTypeBool);
142 vtkBooleanMacro(Box, vtkTypeBool);
144
148 vtkProperty2D* GetBoxProperty() { return this->BoxActor->GetProperty(); }
149
151
155 vtkSetClampMacro(Padding, int, 0, 50);
156 vtkGetMacro(Padding, int);
158
160
167 vtkBooleanMacro(ScalarVisibility, vtkTypeBool);
169
171
176 vtkBooleanMacro(UseBackground, vtkTypeBool);
178
180
184 vtkSetVector3Macro(BackgroundColor, double);
185 vtkGetVector3Macro(BackgroundColor, double);
187
189
193 vtkSetClampMacro(BackgroundOpacity, double, 0.0, 1.0);
194 vtkGetMacro(BackgroundOpacity, double);
196
201 void ShallowCopy(vtkProp* prop) override;
202
211
213
218 int RenderOpaqueGeometry(vtkViewport* viewport) override;
220 int RenderOverlay(vtkViewport* viewport) override;
222
227
228protected:
231
233
235
242
244
252
253 // Background plane.
258
259 // May use texture.
262
263 // Used to control whether the stuff is recomputed
267
268private:
269 vtkLegendBoxActor(const vtkLegendBoxActor&) = delete;
270 void operator=(const vtkLegendBoxActor&) = delete;
271
272 std::vector<std::unique_ptr<vtkLegendBoxEntryInternal>> Entries;
273};
274
275VTK_ABI_NAMESPACE_END
276#endif
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:42
dynamic, self-adjusting array of double
topologically and geometrically regular array of data
a simple class to control print indentation
Definition vtkIndent.h:29
int RenderOpaqueGeometry(vtkViewport *viewport) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
void SetNumberOfEntries(int num)
Specify the number of entries in the legend box.
int RenderOverlay(vtkViewport *viewport) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
vtkPolyData * BoxPolyData
vtkTexturedActor2D * BackgroundActor
vtkTypeBool HasTranslucentPolygonalGeometry() override
Does this prop have some translucent polygonal geometry?
vtkTextProperty * EntryTextProperty
int RenderTranslucentPolygonalGeometry(vtkViewport *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
vtkPlaneSource * Background
void SetEntry(int i, vtkImageData *symbol, const char *string, double color[3])
Add an entry to the legend box.
void SetEntry(int i, vtkPolyData *symbol, vtkImageData *icon, const char *string, double color[3])
Add an entry to the legend box.
vtkPolyDataMapper2D * BorderMapper
void ReleaseGraphicsResources(vtkWindow *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
vtkProperty2D * GetBoxProperty()
Get the box vtkProperty2D.
vtkPolyData createTexturedPlane()
void SetEntryColor(int i, double color[3])
void ShallowCopy(vtkProp *prop) override
Shallow copy of this scaled text actor.
double * GetEntryColor(int i)
vtkImageData * GetEntryIcon(int i)
vtkPolyDataMapper2D * BackgroundMapper
void SetEntrySymbol(int i, vtkPolyData *symbol)
vtkTypeBool ScalarVisibility
~vtkLegendBoxActor() override
virtual void SetEntryTextProperty(vtkTextProperty *p)
Set/Get the text property.
void SetEntry(int i, vtkPolyData *symbol, const char *string, double color[3])
Add an entry to the legend box.
void InitializeEntries()
vtkPolyData * BorderPolyData
void SetEntryColor(int i, double r, double g, double b)
static vtkLegendBoxActor * New()
Instantiate object with a rectangle in normaled view coordinates of (0.2,0.85, 0.8,...
vtkPolyDataMapper2D * BoxMapper
void SetEntryString(int i, const char *string)
vtkPolyData * GetEntrySymbol(int i)
const char * GetEntryString(int i)
void SetEntryIcon(int i, vtkImageData *icon)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
A single entry to use inside vtkLegendBoxActor.
create an array of quadrilaterals located in a plane
draw vtkPolyData onto the image plane
map vtkPolyData to graphics primitives
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:72
represent surface properties of a 2D image
2D text annotation
represent text properties.
actor that draws 2D data with texture support
record modification and/or execution time
transform points and associated normals and vectors
describes linear transformations via a 4x4 matrix
abstract specification for Viewports
Definition vtkViewport.h:47
window superclass for vtkRenderWindow
Definition vtkWindow.h:42
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_SIZEHINT(...)
#define VTK_MARSHALAUTO