VTK  9.1.0
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=========================================================================*/
47#ifndef vtkLegendBoxActor_h
48#define vtkLegendBoxActor_h
49
50#include "vtkActor2D.h"
51#include "vtkRenderingAnnotationModule.h" // For export macro
52
53class vtkActor;
54class vtkDoubleArray;
55class vtkImageData;
56class vtkPolyData;
59class vtkPlaneSource;
60class vtkTextMapper;
61class vtkTextProperty;
63class vtkTransform;
65class vtkProperty2D;
66
67class VTKRENDERINGANNOTATION_EXPORT vtkLegendBoxActor : public vtkActor2D
68{
69public:
71 void PrintSelf(ostream& os, vtkIndent indent) override;
72
78
82 void SetNumberOfEntries(int num);
83 int GetNumberOfEntries() { return this->NumberOfEntries; }
84
86
96 void SetEntry(int i, vtkPolyData* symbol, const char* string, double color[3]);
97 void SetEntry(int i, vtkImageData* symbol, const char* string, double color[3]);
99 int i, vtkPolyData* symbol, vtkImageData* icon, const char* string, double color[3]);
101
102 void SetEntrySymbol(int i, vtkPolyData* symbol);
103 void SetEntryIcon(int i, vtkImageData* icon);
104 void SetEntryString(int i, const char* string);
105 void SetEntryColor(int i, double color[3]);
106 void SetEntryColor(int i, double r, double g, double b);
107
110 const char* GetEntryString(int i);
111 double* GetEntryColor(int i) VTK_SIZEHINT(3);
112
114
118 vtkGetObjectMacro(EntryTextProperty, vtkTextProperty);
120
122
126 vtkSetMacro(Border, vtkTypeBool);
127 vtkGetMacro(Border, vtkTypeBool);
128 vtkBooleanMacro(Border, vtkTypeBool);
130
132
140 vtkSetMacro(LockBorder, vtkTypeBool);
141 vtkGetMacro(LockBorder, vtkTypeBool);
142 vtkBooleanMacro(LockBorder, vtkTypeBool);
144
146
150 vtkSetMacro(Box, vtkTypeBool);
151 vtkGetMacro(Box, vtkTypeBool);
152 vtkBooleanMacro(Box, vtkTypeBool);
154
158 vtkProperty2D* GetBoxProperty() { return this->BoxActor->GetProperty(); }
159
161
165 vtkSetClampMacro(Padding, int, 0, 50);
166 vtkGetMacro(Padding, int);
168
170
175 vtkSetMacro(ScalarVisibility, vtkTypeBool);
176 vtkGetMacro(ScalarVisibility, vtkTypeBool);
177 vtkBooleanMacro(ScalarVisibility, vtkTypeBool);
179
181
184 vtkSetMacro(UseBackground, vtkTypeBool);
185 vtkGetMacro(UseBackground, vtkTypeBool);
186 vtkBooleanMacro(UseBackground, vtkTypeBool);
188
190
194 vtkSetVector3Macro(BackgroundColor, double);
195 vtkGetVector3Macro(BackgroundColor, double);
197
199
203 vtkSetClampMacro(BackgroundOpacity, double, 0.0, 1.0);
204 vtkGetMacro(BackgroundOpacity, double);
206
211 void ShallowCopy(vtkProp* prop) override;
212
221
223
228 int RenderOpaqueGeometry(vtkViewport* viewport) override;
230 int RenderOverlay(vtkViewport* viewport) override;
232
237
238protected:
241
243
245
252
253 // Internal actors, mappers, data to represent the legend
255 int Size; // allocation size
259
265
272
280
281 // Background plane.
284 double BackgroundColor[3];
286
287 // May use texture.
290
291 // Used to control whether the stuff is recomputed
293 int CachedSize[2];
295
296private:
297 vtkLegendBoxActor(const vtkLegendBoxActor&) = delete;
298 void operator=(const vtkLegendBoxActor&) = delete;
299};
300
301#endif
a actor that draws 2D data
Definition: vtkActor2D.h:49
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:55
dynamic, self-adjusting array of double
topologically and geometrically regular array of data
Definition: vtkImageData.h:57
a simple class to control print indentation
Definition: vtkIndent.h:43
draw symbols with text
int RenderOpaqueGeometry(vtkViewport *viewport) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
vtkTypeBool UseBackground
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?
vtkTimeStamp BuildTime
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.
vtkActor2D * BorderActor
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:95
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:57
represent surface properties of a 2D image
Definition: vtkProperty2D.h:47
2D text annotation
Definition: vtkTextMapper.h:57
represent text properties.
actor that draws 2D data with texture support
record modification and/or execution time
Definition: vtkTimeStamp.h:42
transform points and associated normals and vectors for polygonal dataset
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:64
abstract specification for Viewports
Definition: vtkViewport.h:56
window superclass for vtkRenderWindow
Definition: vtkWindow.h:45
@ Box
Definition: vtkX3D.h:71
@ color
Definition: vtkX3D.h:227
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_SIZEHINT(...)