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 
71  static vtkLegendBoxActor *New();
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 
103  vtkPolyData* GetEntrySymbol(int i);
104  vtkImageData* GetEntryIcon(int i);
105  const char* GetEntryString(int i);
106  double* GetEntryColor(int i);
107 
109 
112  virtual void SetEntryTextProperty(vtkTextProperty *p);
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 
145  vtkSetMacro(Box, int);
146  vtkGetMacro(Box, int);
147  vtkBooleanMacro(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 
215  virtual void ReleaseGraphicsResources(vtkWindow *);
216 
218 
223  int RenderOpaqueGeometry(vtkViewport* viewport);
225  int RenderOverlay(vtkViewport* viewport);
227 
231  virtual int HasTranslucentPolygonalGeometry();
232 
233 protected:
236 
237  void InitializeEntries();
238 
239  vtkPolyData createTexturedPlane();
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 
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:50
draw symbols with text
vtkPolyData * BorderPolyData
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:51
actor that draws 2D data with texture support
abstract specification for Viewports
Definition: vtkViewport.h:47
vtkProperty2D * GetBoxProperty()
Get the box vtkProperty2D.
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
a actor that draws 2D data
Definition: vtkActor2D.h:45
record modification and/or execution time
Definition: vtkTimeStamp.h:35
vtkPlaneSource ** Icon
transform points and associated normals and vectors for polygonal dataset
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:60
vtkActor2D ** TextActor
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
vtkPlaneSource * Background
virtual int HasTranslucentPolygonalGeometry() override
Does this prop have some translucent polygonal geometry?
2D text annotation
Definition: vtkTextMapper.h:53
dynamic, self-adjusting array of double
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
vtkTextMapper ** TextMapper
vtkPolyDataMapper2D * BackgroundMapper
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkTextProperty * EntryTextProperty
vtkActor2D * BorderActor
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
static vtkActor2D * New()
Creates an actor2D with the following defaults: position (0,0) (coordinate system is viewport); at la...
vtkDoubleArray * Colors
vtkTransform ** Transform
vtkPolyData * BoxPolyData
virtual void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this actor.
represent text properties.
create an array of quadrilaterals located in a plane
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
vtkPolyDataMapper2D * BorderMapper
map vtkPolyData to graphics primitives
vtkTransformPolyDataFilter ** SymbolTransform
vtkImageData ** IconImage
virtual int RenderOverlay(vtkViewport *viewport) override
Support the standard render methods.
virtual void ShallowCopy(vtkProp *prop) override
Shallow copy of this vtkActor2D.
virtual int RenderOpaqueGeometry(vtkViewport *viewport) override
Support the standard render methods.
vtkActor2D ** SymbolActor
vtkTransformPolyDataFilter ** IconTransformFilter
represent surface properties of a 2D image
Definition: vtkProperty2D.h:40
vtkTexturedActor2D * BackgroundActor
vtkPolyDataMapper2D * BoxMapper
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
vtkPolyData ** Symbol
draw vtkPolyData onto the image plane
vtkPolyDataMapper2D ** SymbolMapper
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTimeStamp BuildTime
vtkTransform ** IconTransform
vtkPolyDataMapper2D ** IconMapper
vtkTexturedActor2D ** IconActor