VTK
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 =========================================================================*/
41 #ifndef vtkLegendBoxActor_h
42 #define vtkLegendBoxActor_h
43 
44 #include "vtkRenderingAnnotationModule.h" // For export macro
45 #include "vtkActor2D.h"
46 
47 class vtkActor;
48 class vtkDoubleArray;
49 class vtkImageData;
50 class vtkPolyData;
52 class vtkPolyDataMapper;
53 class vtkPlaneSource;
54 class vtkTextMapper;
55 class vtkTextProperty;
56 class vtkTexturedActor2D;
57 class vtkTransform;
59 class vtkProperty2D;
60 
61 class VTKRENDERINGANNOTATION_EXPORT vtkLegendBoxActor : public vtkActor2D
62 {
63 public:
65  void PrintSelf(ostream& os, vtkIndent indent);
66 
72 
76  void SetNumberOfEntries(int num);
78  {return this->NumberOfEntries;}
79 
81 
91  void SetEntry(int i, vtkPolyData *symbol, const char* string, double color[3]);
92  void SetEntry(int i, vtkImageData *symbol, const char* string, double color[3]);
93  void SetEntry(int i, vtkPolyData *symbol, vtkImageData *icon,
94  const char* string, double color[3]);
96 
97  void SetEntrySymbol (int i, vtkPolyData *symbol);
98  void SetEntryIcon (int i, vtkImageData *icon);
99  void SetEntryString (int i, const char* string);
100  void SetEntryColor (int i, double color[3]);
101  void SetEntryColor (int i, double r, double g, double b);
102 
105  const char* GetEntryString(int i);
106  double* GetEntryColor(int i);
107 
109 
113  vtkGetObjectMacro(EntryTextProperty,vtkTextProperty);
115 
117 
121  vtkSetMacro(Border, int);
122  vtkGetMacro(Border, int);
123  vtkBooleanMacro(Border, int);
125 
127 
135  vtkSetMacro(LockBorder, int);
136  vtkGetMacro(LockBorder, int);
137  vtkBooleanMacro(LockBorder, int);
139 
141 
146  vtkGetMacro(Box, int);
149 
153  vtkProperty2D* GetBoxProperty() { return this->BoxActor->GetProperty(); };
154 
156 
160  vtkSetClampMacro(Padding, int, 0, 50);
161  vtkGetMacro(Padding, int);
163 
165 
170  vtkSetMacro(ScalarVisibility,int);
171  vtkGetMacro(ScalarVisibility,int);
172  vtkBooleanMacro(ScalarVisibility,int);
174 
176 
179  vtkSetMacro(UseBackground, int);
180  vtkGetMacro(UseBackground, int);
181  vtkBooleanMacro(UseBackground, int);
183 
185 
189  vtkSetVector3Macro(BackgroundColor, double);
190  vtkGetVector3Macro(BackgroundColor, double);
192 
194 
198  vtkSetClampMacro(BackgroundOpacity, double, 0.0, 1.0);
199  vtkGetMacro(BackgroundOpacity, double);
201 
206  void ShallowCopy(vtkProp *prop);
207 
216 
218 
225  int RenderOverlay(vtkViewport* viewport);
227 
232 
233 protected:
236 
238 
240 
241  int Border;
242  int Box;
243  int Padding;
246  double BoxOpacity;
247 
248  // Internal actors, mappers, data to represent the legend
250  int Size; //allocation size
254 
260 
267 
275 
276  // Background plane.
279  double BackgroundColor[3];
281 
282  // May use texture.
285 
286  // Used to control whether the stuff is recomputed
288  int CachedSize[2];
290 
291 private:
292  vtkLegendBoxActor(const vtkLegendBoxActor&) VTK_DELETE_FUNCTION;
293  void operator=(const vtkLegendBoxActor&) VTK_DELETE_FUNCTION;
294 };
295 
296 
297 #endif
298 
a actor that draws 2D data
Definition: vtkActor2D.h:46
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:52
dynamic, self-adjusting array of double
topologically and geometrically regular array of data
Definition: vtkImageData.h:46
a simple class to control print indentation
Definition: vtkIndent.h:40
draw symbols with text
void ShallowCopy(vtkProp *prop)
Shallow copy of this scaled text actor.
void SetNumberOfEntries(int num)
Specify the number of entries in the legend box.
vtkPolyData * BoxPolyData
vtkTexturedActor2D ** IconActor
vtkTexturedActor2D * BackgroundActor
vtkTimeStamp BuildTime
vtkProperty2D * GetBoxProperty()
Get the box vtkProperty2D.
virtual void ReleaseGraphicsResources(vtkWindow *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
vtkImageData ** IconImage
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
vtkTextProperty * EntryTextProperty
vtkTransformPolyDataFilter ** SymbolTransform
vtkPlaneSource * Background
void SetEntry(int i, vtkImageData *symbol, const char *string, double color[3])
vtkImageData * GetEntryIcon(int i)
void SetEntry(int i, vtkPolyData *symbol, vtkImageData *icon, const char *string, double color[3])
vtkPlaneSource ** Icon
vtkTransform ** IconTransform
vtkPolyDataMapper2D * BorderMapper
int RenderOpaqueGeometry(vtkViewport *viewport)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
vtkActor2D * BorderActor
vtkPolyData createTexturedPlane()
void SetEntryColor(int i, double color[3])
vtkDoubleArray * Colors
vtkPolyData * GetEntrySymbol(int i)
vtkPolyDataMapper2D * BackgroundMapper
static vtkLegendBoxActor * New()
Instantiate object with a rectangle in normaled view coordinates of (0.2,0.85, 0.8,...
void SetEntrySymbol(int i, vtkPolyData *symbol)
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.
const char * GetEntryString(int i)
void InitializeEntries()
vtkPolyDataMapper2D ** IconMapper
vtkTransformPolyDataFilter ** IconTransformFilter
vtkPolyData * BorderPolyData
vtkTransform ** Transform
void SetEntryColor(int i, double r, double g, double b)
vtkPolyDataMapper2D ** SymbolMapper
vtkPolyDataMapper2D * BoxMapper
vtkPolyData ** Symbol
double * GetEntryColor(int i)
void SetEntryString(int i, const char *string)
int RenderOverlay(vtkViewport *viewport)
Support the standard render methods.
vtkActor2D ** SymbolActor
vtkActor2D ** TextActor
virtual int HasTranslucentPolygonalGeometry()
Does this prop have some translucent polygonal geometry?
void SetEntryIcon(int i, vtkImageData *icon)
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:86
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:48
represent surface properties of a 2D image
Definition: vtkProperty2D.h:41
2D text annotation
Definition: vtkTextMapper.h:54
represent text properties.
actor that draws 2D data with texture support
record modification and/or execution time
Definition: vtkTimeStamp.h:36
transform points and associated normals and vectors for polygonal dataset
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:61
abstract specification for Viewports
Definition: vtkViewport.h:48
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
@ Box
Definition: vtkX3D.h:65
@ color
Definition: vtkX3D.h:221
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.