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 =========================================================================*/
40 #ifndef vtkLegendBoxActor_h
41 #define vtkLegendBoxActor_h
42 
43 #include "vtkRenderingAnnotationModule.h" // For export macro
44 #include "vtkActor2D.h"
45 
46 class vtkActor;
47 class vtkDoubleArray;
48 class vtkImageData;
49 class vtkPolyData;
51 class vtkPolyDataMapper;
52 class vtkPlaneSource;
53 class vtkTextMapper;
54 class vtkTextProperty;
55 class vtkTexturedActor2D;
56 class vtkTransform;
58 class vtkProperty2D;
59 
61 {
62 public:
64  void PrintSelf(ostream& os, vtkIndent indent);
65 
69 
71 
74  {return this->NumberOfEntries;}
76 
78 
86  void SetEntry(int i, vtkPolyData *symbol, const char* string, double color[3]);
87  void SetEntry(int i, vtkImageData *symbol, const char* string, double color[3]);
88  void SetEntry(int i, vtkPolyData *symbol, vtkImageData *icon,
89  const char* string, double color[3]);
91 
92  void SetEntrySymbol (int i, vtkPolyData *symbol);
93  void SetEntryIcon (int i, vtkImageData *icon);
94  void SetEntryString (int i, const char* string);
95  void SetEntryColor (int i, double color[3]);
96  void SetEntryColor (int i, double r, double g, double b);
97 
100  const char* GetEntryString(int i);
101  double* GetEntryColor(int i);
102 
104 
106  vtkGetObjectMacro(EntryTextProperty,vtkTextProperty);
108 
110 
112  vtkSetMacro(Border, int);
113  vtkGetMacro(Border, int);
114  vtkBooleanMacro(Border, int);
116 
118 
124  vtkSetMacro(LockBorder, int);
125  vtkGetMacro(LockBorder, int);
126  vtkBooleanMacro(LockBorder, int);
128 
130 
136 
138  vtkProperty2D* GetBoxProperty() { return this->BoxActor->GetProperty(); };
139 
141 
143  vtkSetClampMacro(Padding, int, 0, 50);
144  vtkGetMacro(Padding, int);
146 
148 
151  vtkSetMacro(ScalarVisibility,int);
152  vtkGetMacro(ScalarVisibility,int);
153  vtkBooleanMacro(ScalarVisibility,int);
155 
157 
158  vtkSetMacro(UseBackground, int);
159  vtkGetMacro(UseBackground, int);
160  vtkBooleanMacro(UseBackground, int);
162 
164 
165  vtkSetVector3Macro(BackgroundColor, double);
166  vtkGetVector3Macro(BackgroundColor, double);
168 
170 
171  vtkSetClampMacro(BackgroundOpacity, double, 0.0, 1.0);
172  vtkGetMacro(BackgroundOpacity, double);
174 
177  void ShallowCopy(vtkProp *prop);
178 
179 //BTX
185 
187 
192  int RenderOverlay(vtkViewport* viewport);
194 
196 
198 //ETX
200 
201 protected:
204 
206 
208 
209  int Border;
210  int Box;
211  int Padding;
214  double BoxOpacity;
215 
216  // Internal actors, mappers, data to represent the legend
218  int Size; //allocation size
222 
228 
235 
243 
244  // Background plane.
247  double BackgroundColor[3];
249 
250  // May use texture.
253 
254  // Used to control whether the stuff is recomputed
256  int CachedSize[2];
258 
259 private:
260  vtkLegendBoxActor(const vtkLegendBoxActor&); // Not implemented.
261  void operator=(const vtkLegendBoxActor&); // Not implemented.
262 };
263 
264 
265 #endif
266 
vtkPolyDataMapper
map vtkPolyData to graphics primitives
Definition: vtkPolyDataMapper.h:42
vtkLegendBoxActor::GetBoxProperty
vtkProperty2D * GetBoxProperty()
Definition: vtkLegendBoxActor.h:138
vtkRenderingAnnotationModule.h
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
vtkLegendBoxActor::SetEntryString
void SetEntryString(int i, const char *string)
vtkLegendBoxActor::IconActor
vtkTexturedActor2D ** IconActor
Definition: vtkLegendBoxActor.h:233
vtkLegendBoxActor::Symbol
vtkPolyData ** Symbol
Definition: vtkLegendBoxActor.h:223
vtkPolyDataMapper2D
draw vtkPolyData onto the image plane
Definition: vtkPolyDataMapper2D.h:51
vtkLegendBoxActor::LegendEntriesVisible
int LegendEntriesVisible
Definition: vtkLegendBoxActor.h:255
vtkLegendBoxActor::ShallowCopy
void ShallowCopy(vtkProp *prop)
vtkLegendBoxActor::~vtkLegendBoxActor
~vtkLegendBoxActor()
vtkgl::b
GLboolean GLboolean GLboolean b
Definition: vtkgl.h:12312
vtkLegendBoxActor::Icon
vtkPlaneSource ** Icon
Definition: vtkLegendBoxActor.h:229
vtkLegendBoxActor::SymbolMapper
vtkPolyDataMapper2D ** SymbolMapper
Definition: vtkLegendBoxActor.h:226
vtkTexturedActor2D
actor that draws 2D data with texture support
Definition: vtkTexturedActor2D.h:41
vtkLegendBoxActor::SetEntryIcon
void SetEntryIcon(int i, vtkImageData *icon)
vtkSetVector3Macro
#define vtkSetVector3Macro(name, type)
Definition: vtkSetGet.h:287
vtkLegendBoxActor::IconTransform
vtkTransform ** IconTransform
Definition: vtkLegendBoxActor.h:230
vtkLegendBoxActor::IconMapper
vtkPolyDataMapper2D ** IconMapper
Definition: vtkLegendBoxActor.h:232
vtkLegendBoxActor::Padding
int Padding
Definition: vtkLegendBoxActor.h:211
vtkLegendBoxActor::TextActor
vtkActor2D ** TextActor
Definition: vtkLegendBoxActor.h:221
vtkLegendBoxActor
draw symbols with text
Definition: vtkLegendBoxActor.h:61
vtkLegendBoxActor::GetNumberOfEntries
int GetNumberOfEntries()
Definition: vtkLegendBoxActor.h:73
vtkLegendBoxActor::Background
vtkPlaneSource * Background
Definition: vtkLegendBoxActor.h:248
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:35
vtkPlaneSource
create an array of quadrilaterals located in a plane
Definition: vtkPlaneSource.h:60
vtkLegendBoxActor::BorderPolyData
vtkPolyData * BorderPolyData
Definition: vtkLegendBoxActor.h:236
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkLegendBoxActor::BoxActor
vtkActor2D * BoxActor
Definition: vtkLegendBoxActor.h:241
vtkLegendBoxActor::SetEntryColor
void SetEntryColor(int i, double r, double g, double b)
vtkLegendBoxActor::RenderTranslucentPolygonalGeometry
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
Definition: vtkLegendBoxActor.h:191
vtkTransform
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:60
vtkLegendBoxActor::SetEntryTextProperty
virtual void SetEntryTextProperty(vtkTextProperty *p)
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
vtkLegendBoxActor::Box
int Box
Definition: vtkLegendBoxActor.h:210
vtkLegendBoxActor::Border
int Border
Definition: vtkLegendBoxActor.h:209
vtkX3D::Box
@ Box
Definition: vtkX3D.h:65
vtkLegendBoxActor::vtkLegendBoxActor
vtkLegendBoxActor()
vtkSetClampMacro
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:143
vtkLegendBoxActor::HasTranslucentPolygonalGeometry
virtual int HasTranslucentPolygonalGeometry()
vtkLegendBoxActor::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkGetVector3Macro
#define vtkGetVector3Macro(name, type)
Definition: vtkSetGet.h:304
vtkTextMapper
2D text annotation
Definition: vtkTextMapper.h:53
vtkLegendBoxActor::BackgroundOpacity
double BackgroundOpacity
Definition: vtkLegendBoxActor.h:246
vtkLegendBoxActor::BorderActor
vtkActor2D * BorderActor
Definition: vtkLegendBoxActor.h:238
vtkLegendBoxActor::GetEntryColor
double * GetEntryColor(int i)
vtkLegendBoxActor::NumberOfEntries
int NumberOfEntries
Definition: vtkLegendBoxActor.h:217
vtkLegendBoxActor::TextMapper
vtkTextMapper ** TextMapper
Definition: vtkLegendBoxActor.h:220
vtkLegendBoxActor::SetEntry
void SetEntry(int i, vtkImageData *symbol, const char *string, double color[3])
vtkLegendBoxActor::SetEntry
void SetEntry(int i, vtkPolyData *symbol, const char *string, double color[3])
vtkLegendBoxActor::BoxPolyData
vtkPolyData * BoxPolyData
Definition: vtkLegendBoxActor.h:239
vtkgl::num
GLuint GLuint num
Definition: vtkgl.h:16907
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:51
vtkLegendBoxActor::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *)
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkLegendBoxActor::IconImage
vtkImageData ** IconImage
Definition: vtkLegendBoxActor.h:234
vtkLegendBoxActor::SetEntryColor
void SetEntryColor(int i, double color[3])
vtkLegendBoxActor::GetEntryIcon
vtkImageData * GetEntryIcon(int i)
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkLegendBoxActor::BorderMapper
vtkPolyDataMapper2D * BorderMapper
Definition: vtkLegendBoxActor.h:237
vtkgl::color
GLuint color
Definition: vtkgl.h:12351
vtkTransformPolyDataFilter
transform points and associated normals and vectors for polygonal dataset
Definition: vtkTransformPolyDataFilter.h:51
vtkLegendBoxActor::BackgroundMapper
vtkPolyDataMapper2D * BackgroundMapper
Definition: vtkLegendBoxActor.h:252
vtkLegendBoxActor::EntryTextProperty
vtkTextProperty * EntryTextProperty
Definition: vtkLegendBoxActor.h:242
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:47
vtkLegendBoxActor::SetNumberOfEntries
void SetNumberOfEntries(int num)
vtkLegendBoxActor::SymbolActor
vtkActor2D ** SymbolActor
Definition: vtkLegendBoxActor.h:227
vtkLegendBoxActor::IconTransformFilter
vtkTransformPolyDataFilter ** IconTransformFilter
Definition: vtkLegendBoxActor.h:231
vtkLegendBoxActor::SetEntrySymbol
void SetEntrySymbol(int i, vtkPolyData *symbol)
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:39
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkLegendBoxActor::Size
int Size
Definition: vtkLegendBoxActor.h:218
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:50
vtkProperty2D
represent surface properties of a 2D image
Definition: vtkProperty2D.h:40
vtkLegendBoxActor::LockBorder
int LockBorder
Definition: vtkLegendBoxActor.h:212
vtkLegendBoxActor::Colors
vtkDoubleArray * Colors
Definition: vtkLegendBoxActor.h:219
vtkgl::r
GLdouble GLdouble GLdouble r
Definition: vtkgl.h:11610
vtkActor2D
a actor that draws 2D data
Definition: vtkActor2D.h:45
vtkLegendBoxActor::Transform
vtkTransform ** Transform
Definition: vtkLegendBoxActor.h:224
vtkActor2D.h
vtkgl::g
GLboolean GLboolean g
Definition: vtkgl.h:12312
vtkLegendBoxActor::RenderOverlay
int RenderOverlay(vtkViewport *viewport)
vtkLegendBoxActor::SetEntry
void SetEntry(int i, vtkPolyData *symbol, vtkImageData *icon, const char *string, double color[3])
vtkLegendBoxActor::New
static vtkLegendBoxActor * New()
vtkLegendBoxActor::ScalarVisibility
int ScalarVisibility
Definition: vtkLegendBoxActor.h:213
vtkLegendBoxActor::SymbolTransform
vtkTransformPolyDataFilter ** SymbolTransform
Definition: vtkLegendBoxActor.h:225
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
vtkLegendBoxActor::BoxMapper
vtkPolyDataMapper2D * BoxMapper
Definition: vtkLegendBoxActor.h:240
vtkgl::p
GLfloat GLfloat p
Definition: vtkgl.h:15717
vtkLegendBoxActor::GetEntryString
const char * GetEntryString(int i)
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:49
vtkLegendBoxActor::RenderOpaqueGeometry
int RenderOpaqueGeometry(vtkViewport *viewport)
vtkLegendBoxActor::BuildTime
vtkTimeStamp BuildTime
Definition: vtkLegendBoxActor.h:257
vtkLegendBoxActor::GetEntrySymbol
vtkPolyData * GetEntrySymbol(int i)
vtkLegendBoxActor::createTexturedPlane
vtkPolyData createTexturedPlane()
vtkLegendBoxActor::UseBackground
int UseBackground
Definition: vtkLegendBoxActor.h:245
vtkLegendBoxActor::BoxOpacity
double BoxOpacity
Definition: vtkLegendBoxActor.h:214
VTKRENDERINGANNOTATION_EXPORT
#define VTKRENDERINGANNOTATION_EXPORT
Definition: vtkRenderingAnnotationModule.h:15
vtkLegendBoxActor::InitializeEntries
void InitializeEntries()
vtkLegendBoxActor::BackgroundActor
vtkTexturedActor2D * BackgroundActor
Definition: vtkLegendBoxActor.h:251