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 
68  static vtkLegendBoxActor *New();
69 
71 
72  void SetNumberOfEntries(int num);
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 
98  vtkPolyData* GetEntrySymbol(int i);
99  vtkImageData* GetEntryIcon(int i);
100  const char* GetEntryString(int i);
101  double* GetEntryColor(int i);
102 
104 
105  virtual void SetEntryTextProperty(vtkTextProperty *p);
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 
132  vtkSetMacro(Box, int);
133  vtkGetMacro(Box, int);
134  vtkBooleanMacro(Box, int);
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
184  virtual void ReleaseGraphicsResources(vtkWindow *);
185 
187 
190  int RenderOpaqueGeometry(vtkViewport* viewport);
192  int RenderOverlay(vtkViewport* viewport);
194 
196 
197  virtual int HasTranslucentPolygonalGeometry();
198 //ETX
200 
201 protected:
204 
205  void InitializeEntries();
206 
207  vtkPolyData createTexturedPlane();
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 
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:52
draw symbols with text
vtkPolyData * BorderPolyData
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:50
actor that draws 2D data with texture support
virtual void ReleaseGraphicsResources(vtkWindow *)
abstract specification for Viewports
Definition: vtkViewport.h:46
vtkProperty2D * GetBoxProperty()
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
a actor that draws 2D data
Definition: vtkActor2D.h:44
record modification and/or execution time
Definition: vtkTimeStamp.h:34
vtkPlaneSource ** Icon
transform points and associated normals and vectors for polygonal dataset
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:59
vtkActor2D ** TextActor
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:83
vtkPlaneSource * Background
2D text annotation
Definition: vtkTextMapper.h:52
#define VTKRENDERINGANNOTATION_EXPORT
dynamic, self-adjusting array of double
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
vtkTextMapper ** TextMapper
virtual int HasTranslucentPolygonalGeometry()
virtual int RenderOpaqueGeometry(vtkViewport *viewport)
vtkPolyDataMapper2D * BackgroundMapper
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkTextProperty * EntryTextProperty
vtkActor2D * BorderActor
void PrintSelf(ostream &os, vtkIndent indent)
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
static vtkActor2D * New()
vtkDoubleArray * Colors
vtkTransform ** Transform
vtkPolyData * BoxPolyData
represent text properties.
create an array of quadrilaterals located in a plane
vtkPolyDataMapper2D * BorderMapper
map vtkPolyData to graphics primitives
virtual void ShallowCopy(vtkProp *prop)
vtkTransformPolyDataFilter ** SymbolTransform
vtkImageData ** IconImage
virtual int RenderOverlay(vtkViewport *viewport)
vtkActor2D ** SymbolActor
vtkTransformPolyDataFilter ** IconTransformFilter
represent surface properties of a 2D image
Definition: vtkProperty2D.h:39
vtkTexturedActor2D * BackgroundActor
vtkPolyDataMapper2D * BoxMapper
vtkPolyData ** Symbol
draw vtkPolyData onto the image plane
vtkPolyDataMapper2D ** SymbolMapper
vtkTimeStamp BuildTime
vtkTransform ** IconTransform
vtkPolyDataMapper2D ** IconMapper
vtkTexturedActor2D ** IconActor