Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

dox/Hybrid/vtkLegendBoxActor.h

Go to the documentation of this file.
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkLegendBoxActor.h,v $ 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00037 #ifndef __vtkLegendBoxActor_h 00038 #define __vtkLegendBoxActor_h 00039 00040 #include "vtkActor2D.h" 00041 00042 class vtkActor; 00043 class vtkDoubleArray; 00044 class vtkPolyData; 00045 class vtkPolyDataMapper2D; 00046 class vtkPolyDataMapper; 00047 class vtkTextMapper; 00048 class vtkTextProperty; 00049 class vtkTransform; 00050 class vtkTransformPolyDataFilter; 00051 class vtkProperty2D; 00052 00053 class VTK_HYBRID_EXPORT vtkLegendBoxActor : public vtkActor2D 00054 { 00055 public: 00056 vtkTypeRevisionMacro(vtkLegendBoxActor,vtkActor2D); 00057 void PrintSelf(ostream& os, vtkIndent indent); 00058 00061 static vtkLegendBoxActor *New(); 00062 00064 00065 void SetNumberOfEntries(int num); 00066 int GetNumberOfEntries() 00067 {return this->NumberOfEntries;} 00069 00071 00079 void SetEntry(int i, vtkPolyData *symbol, const char* string, double color[3]); 00080 void SetEntrySymbol(int i, vtkPolyData *symbol); 00081 void SetEntryString(int i, const char* string); 00082 void SetEntryColor(int i, double color[3]); 00083 void SetEntryColor(int i, double r, double g, double b); 00084 vtkPolyData *GetEntrySymbol(int i); 00085 const char* GetEntryString(int i); 00086 double *GetEntryColor(int i); 00088 00090 00091 virtual void SetEntryTextProperty(vtkTextProperty *p); 00092 vtkGetObjectMacro(EntryTextProperty,vtkTextProperty); 00094 00096 00098 vtkSetMacro(Border, int); 00099 vtkGetMacro(Border, int); 00100 vtkBooleanMacro(Border, int); 00102 00104 00110 vtkSetMacro(LockBorder, int); 00111 vtkGetMacro(LockBorder, int); 00112 vtkBooleanMacro(LockBorder, int); 00114 00116 00118 vtkSetMacro(Box, int); 00119 vtkGetMacro(Box, int); 00120 vtkBooleanMacro(Box, int); 00122 00124 vtkProperty2D* GetBoxProperty() { return this->BoxActor->GetProperty(); }; 00125 00127 00129 vtkSetClampMacro(Padding, int, 0, 50); 00130 vtkGetMacro(Padding, int); 00132 00134 00137 vtkSetMacro(ScalarVisibility,int); 00138 vtkGetMacro(ScalarVisibility,int); 00139 vtkBooleanMacro(ScalarVisibility,int); 00141 00144 void ShallowCopy(vtkProp *prop); 00145 00146 //BTX 00151 virtual void ReleaseGraphicsResources(vtkWindow *); 00152 00154 00157 int RenderOpaqueGeometry(vtkViewport* viewport); 00158 int RenderTranslucentGeometry(vtkViewport* ) {return 0;}; 00159 int RenderOverlay(vtkViewport* viewport); 00161 //ETX 00162 00163 protected: 00164 vtkLegendBoxActor(); 00165 ~vtkLegendBoxActor(); 00166 00167 void InitializeEntries(); 00168 00169 00170 int Border; 00171 int Box; 00172 int Padding; 00173 int LockBorder; 00174 int ScalarVisibility; 00175 double BoxOpacity; 00176 00177 // Internal actors, mappers, data to represent the legend 00178 int NumberOfEntries; 00179 int Size; //allocation size 00180 vtkDoubleArray *Colors; 00181 vtkTextMapper **TextMapper; 00182 vtkActor2D **TextActor; 00183 vtkPolyData **Symbol; 00184 vtkTransform **Transform; 00185 vtkTransformPolyDataFilter **SymbolTransform; 00186 vtkPolyDataMapper2D **SymbolMapper; 00187 vtkActor2D **SymbolActor; 00188 vtkPolyData *BorderPolyData; 00189 vtkPolyDataMapper2D *BorderMapper; 00190 vtkActor2D *BorderActor; 00191 vtkPolyData *BoxPolyData; 00192 vtkPolyDataMapper2D *BoxMapper; 00193 vtkActor2D *BoxActor; 00194 vtkTextProperty *EntryTextProperty; 00195 00196 // Used to control whether the stuff is recomputed 00197 int LegendEntriesVisible; 00198 int CachedSize[2]; 00199 vtkTimeStamp BuildTime; 00200 00201 private: 00202 vtkLegendBoxActor(const vtkLegendBoxActor&); // Not implemented. 00203 void operator=(const vtkLegendBoxActor&); // Not implemented. 00204 }; 00205 00206 00207 #endif 00208