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 "vtkActor2D.h"
44 
45 class vtkActor;
46 class vtkDoubleArray;
47 class vtkImageData;
48 class vtkPolyData;
50 class vtkPolyDataMapper;
51 class vtkPlaneSource;
52 class vtkTextMapper;
53 class vtkTextProperty;
54 class vtkTexturedActor2D;
55 class vtkTransform;
57 class vtkProperty2D;
58 
60 {
61 public:
63  void PrintSelf(ostream& os, vtkIndent indent);
64 
67  static vtkLegendBoxActor *New();
68 
70 
71  void SetNumberOfEntries(int num);
73  {return this->NumberOfEntries;}
75 
77 
85  void SetEntry(int i, vtkPolyData *symbol, const char* string, double color[3]);
86  void SetEntry(int i, vtkImageData *symbol, const char* string, double color[3]);
87  void SetEntry(int i, vtkPolyData *symbol, vtkImageData *icon,
88  const char* string, double color[3]);
90 
91  void SetEntrySymbol (int i, vtkPolyData *symbol);
92  void SetEntryIcon (int i, vtkImageData *icon);
93  void SetEntryString (int i, const char* string);
94  void SetEntryColor (int i, double color[3]);
95  void SetEntryColor (int i, double r, double g, double b);
96 
97  vtkPolyData* GetEntrySymbol(int i);
98  vtkImageData* GetEntryIcon(int i);
99  const char* GetEntryString(int i);
100  double* GetEntryColor(int i);
101 
103 
104  virtual void SetEntryTextProperty(vtkTextProperty *p);
105  vtkGetObjectMacro(EntryTextProperty,vtkTextProperty);
107 
109 
111  vtkSetMacro(Border, int);
112  vtkGetMacro(Border, int);
113  vtkBooleanMacro(Border, int);
115 
117 
123  vtkSetMacro(LockBorder, int);
124  vtkGetMacro(LockBorder, int);
125  vtkBooleanMacro(LockBorder, int);
127 
129 
131  vtkSetMacro(Box, int);
132  vtkGetMacro(Box, int);
133  vtkBooleanMacro(Box, int);
135 
137  vtkProperty2D* GetBoxProperty() { return this->BoxActor->GetProperty(); };
138 
140 
142  vtkSetClampMacro(Padding, int, 0, 50);
143  vtkGetMacro(Padding, int);
145 
147 
150  vtkSetMacro(ScalarVisibility,int);
151  vtkGetMacro(ScalarVisibility,int);
152  vtkBooleanMacro(ScalarVisibility,int);
154 
156 
157  vtkSetMacro(UseBackground, int);
158  vtkGetMacro(UseBackground, int);
159  vtkBooleanMacro(UseBackground, int);
161 
163 
164  vtkSetVector3Macro(BackgroundColor, double);
165  vtkGetVector3Macro(BackgroundColor, double);
167 
169 
170  vtkSetClampMacro(BackgroundOpacity, double, 0.0, 1.0);
171  vtkGetMacro(BackgroundOpacity, double);
173 
176  void ShallowCopy(vtkProp *prop);
177 
178 //BTX
183  virtual void ReleaseGraphicsResources(vtkWindow *);
184 
186 
189  int RenderOpaqueGeometry(vtkViewport* viewport);
191  int RenderOverlay(vtkViewport* viewport);
193 
195 
196  virtual int HasTranslucentPolygonalGeometry();
197 //ETX
199 
200 protected:
203 
204  void InitializeEntries();
205 
206  vtkPolyData createTexturedPlane();
207 
208  int Border;
209  int Box;
210  int Padding;
213  double BoxOpacity;
214 
215  // Internal actors, mappers, data to represent the legend
217  int Size; //allocation size
221 
227 
234 
242 
243  // Background plane.
246  double BackgroundColor[3];
248 
249  // May use texture.
252 
253  // Used to control whether the stuff is recomputed
255  int CachedSize[2];
257 
258 private:
259  vtkLegendBoxActor(const vtkLegendBoxActor&); // Not implemented.
260  void operator=(const vtkLegendBoxActor&); // Not implemented.
261 };
262 
263 
264 #endif
265