VTK  9.2.6
vtkLegendBoxActor.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkLegendBoxActor.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=========================================================================*/
37
38#ifndef vtkLegendBoxActor_h
39#define vtkLegendBoxActor_h
40
41#include "vtkActor2D.h"
42#include "vtkRenderingAnnotationModule.h" // For export macro
43
44class vtkActor;
45class vtkDoubleArray;
46class vtkImageData;
47class vtkPolyData;
50class vtkPlaneSource;
51class vtkTextMapper;
52class vtkTextProperty;
54class vtkTransform;
56class vtkProperty2D;
57
58class VTKRENDERINGANNOTATION_EXPORT vtkLegendBoxActor : public vtkActor2D
59{
60public:
62 void PrintSelf(ostream& os, vtkIndent indent) override;
63
69
73 void SetNumberOfEntries(int num);
74 int GetNumberOfEntries() { return this->NumberOfEntries; }
75
77
87 void SetEntry(int i, vtkPolyData* symbol, const char* string, double color[3]);
88 void SetEntry(int i, vtkImageData* symbol, const char* string, double color[3]);
90 int i, vtkPolyData* symbol, vtkImageData* icon, const char* string, double color[3]);
92
93 void SetEntrySymbol(int i, vtkPolyData* symbol);
94 void SetEntryIcon(int i, vtkImageData* icon);
95 void SetEntryString(int i, const char* string);
96 void SetEntryColor(int i, double color[3]);
97 void SetEntryColor(int i, double r, double g, double b);
98
101 const char* GetEntryString(int i);
102 double* GetEntryColor(int i) VTK_SIZEHINT(3);
103
105
111
113
117 vtkSetMacro(Border, vtkTypeBool);
118 vtkGetMacro(Border, vtkTypeBool);
119 vtkBooleanMacro(Border, vtkTypeBool);
121
123
131 vtkSetMacro(LockBorder, vtkTypeBool);
132 vtkGetMacro(LockBorder, vtkTypeBool);
133 vtkBooleanMacro(LockBorder, vtkTypeBool);
135
137
141 vtkSetMacro(Box, vtkTypeBool);
142 vtkGetMacro(Box, vtkTypeBool);
143 vtkBooleanMacro(Box, vtkTypeBool);
145
149 vtkProperty2D* GetBoxProperty() { return this->BoxActor->GetProperty(); }
150
152
156 vtkSetClampMacro(Padding, int, 0, 50);
157 vtkGetMacro(Padding, int);
159
161
168 vtkBooleanMacro(ScalarVisibility, vtkTypeBool);
170
172
177 vtkBooleanMacro(UseBackground, vtkTypeBool);
179
181
185 vtkSetVector3Macro(BackgroundColor, double);
186 vtkGetVector3Macro(BackgroundColor, double);
188
190
194 vtkSetClampMacro(BackgroundOpacity, double, 0.0, 1.0);
195 vtkGetMacro(BackgroundOpacity, double);
197
202 void ShallowCopy(vtkProp* prop) override;
203
212
214
219 int RenderOpaqueGeometry(vtkViewport* viewport) override;
221 int RenderOverlay(vtkViewport* viewport) override;
223
228
229protected:
232
234
236
243
244 // Internal actors, mappers, data to represent the legend
246 int Size; // allocation size
250
256
263
271
272 // Background plane.
277
278 // May use texture.
281
282 // Used to control whether the stuff is recomputed
286
287private:
288 vtkLegendBoxActor(const vtkLegendBoxActor&) = delete;
289 void operator=(const vtkLegendBoxActor&) = delete;
290};
291
292#endif
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:46
dynamic, self-adjusting array of double
topologically and geometrically regular array of data
a simple class to control print indentation
Definition vtkIndent.h:34
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 ** IconActor
vtkTexturedActor2D * BackgroundActor
vtkTypeBool HasTranslucentPolygonalGeometry() override
Does this prop have some translucent polygonal geometry?
vtkImageData ** IconImage
vtkTextProperty * EntryTextProperty
vtkTransformPolyDataFilter ** SymbolTransform
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.
vtkPlaneSource ** Icon
vtkTransform ** IconTransform
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])
vtkDoubleArray * Colors
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
vtkTextMapper ** TextMapper
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()
vtkPolyDataMapper2D ** IconMapper
vtkTransformPolyDataFilter ** IconTransformFilter
vtkPolyData * BorderPolyData
vtkTransform ** Transform
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 ** SymbolMapper
vtkPolyDataMapper2D * BoxMapper
vtkPolyData ** Symbol
void SetEntryString(int i, const char *string)
vtkPolyData * GetEntrySymbol(int i)
vtkActor2D ** SymbolActor
vtkActor2D ** TextActor
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.
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:85
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 for polygonal dataset
describes linear transformations via a 4x4 matrix
abstract specification for Viewports
Definition vtkViewport.h:50
window superclass for vtkRenderWindow
Definition vtkWindow.h:39
int vtkTypeBool
Definition vtkABI.h:69
#define VTK_SIZEHINT(...)