00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 
00031 
00032 
00033 
00034 
00035 
00036 
00037 
00038 
00068 #ifndef __vtkLegendBoxActor_h
00069 #define __vtkLegendBoxActor_h
00070 
00071 #include "vtkActor2D.h"
00072 #include "vtkTextMapper.h"
00073 
00074 class vtkActor;
00075 class vtkPolyData;
00076 class vtkPolyDataMapper;
00077 class vtkPolyDataMapper2D;
00078 class vtkTransformPolyDataFilter;
00079 class vtkTransform;
00080 
00081 class VTK_EXPORT vtkLegendBoxActor : public vtkActor2D
00082 {
00083 public:
00084   vtkTypeMacro(vtkLegendBoxActor,vtkActor2D);
00085   void PrintSelf(ostream& os, vtkIndent indent);
00086 
00089   static vtkLegendBoxActor *New();
00090 
00092   void SetNumberOfEntries(int num);
00093   int GetNumberOfEntries()
00094     {return this->NumberOfEntries;}
00095 
00104   void SetEntry(int i, vtkPolyData *symbol, const char* string, float color[3]);
00105   void SetEntrySymbol(int i, vtkPolyData *symbol);
00106   void SetEntryString(int i, const char* string);
00107   void SetEntryColor(int i, float color[3]);
00108   void SetEntryColor(int i, float r, float g, float b);
00109   vtkPolyData *GetEntrySymbol(int i);
00110   const char* GetEntryString(int i);
00111   float *GetEntryColor(int i);
00112 
00114   vtkSetMacro(Bold, int);
00115   vtkGetMacro(Bold, int);
00116   vtkBooleanMacro(Bold, int);
00117 
00119   vtkSetMacro(Italic, int);
00120   vtkGetMacro(Italic, int);
00121   vtkBooleanMacro(Italic, int);
00122 
00125   vtkSetMacro(Shadow, int);
00126   vtkGetMacro(Shadow, int);
00127   vtkBooleanMacro(Shadow, int);
00128 
00132   vtkSetMacro(FontFamily, int);
00133   vtkGetMacro(FontFamily, int);
00134   void SetFontFamilyToArial() {this->SetFontFamily(VTK_ARIAL);};
00135   void SetFontFamilyToCourier() {this->SetFontFamily(VTK_COURIER);};
00136   void SetFontFamilyToTimes() {this->SetFontFamily(VTK_TIMES);};
00137 
00140   vtkSetMacro(Border, int);
00141   vtkGetMacro(Border, int);
00142   vtkBooleanMacro(Border, int);
00143 
00150   vtkSetMacro(LockBorder, int);
00151   vtkGetMacro(LockBorder, int);
00152   vtkBooleanMacro(LockBorder, int);
00153 
00156   vtkSetClampMacro(Padding, int, 0, 50);
00157   vtkGetMacro(Padding, int);
00158 
00162   vtkSetMacro(ScalarVisibility,int);
00163   vtkGetMacro(ScalarVisibility,int);
00164   vtkBooleanMacro(ScalarVisibility,int);
00165 
00168   void ShallowCopy(vtkProp *prop);
00169 
00170 
00175   virtual void ReleaseGraphicsResources(vtkWindow *);
00176 
00180   int RenderOpaqueGeometry(vtkViewport* viewport);
00181   int RenderTranslucentGeometry(vtkViewport* ) {return 0;};
00182   int RenderOverlay(vtkViewport* viewport);
00183 
00184 
00185 protected:
00186   vtkLegendBoxActor();
00187   ~vtkLegendBoxActor();
00188   vtkLegendBoxActor(const vtkLegendBoxActor&) {};
00189   void operator=(const vtkLegendBoxActor&) {};
00190 
00191   void InitializeEntries();
00192 
00193   int   Bold;
00194   int   Italic;
00195   int   Shadow;
00196   int   FontFamily;
00197   int   Border;
00198   int   Padding;
00199   int   LockBorder;
00200   int   ScalarVisibility;
00201 
00202   
00203   int                        NumberOfEntries;
00204   int                        Size; 
00205   vtkFloatArray              *Colors;
00206   vtkTextMapper              **TextMapper;
00207   vtkActor2D                 **TextActor;
00208   vtkPolyData                **Symbol;
00209   vtkTransform               **Transform;
00210   vtkTransformPolyDataFilter **SymbolTransform;
00211   vtkPolyDataMapper2D        **SymbolMapper;
00212   vtkActor2D                 **SymbolActor;
00213   vtkPolyData                *BorderPolyData;
00214   vtkPolyDataMapper2D        *BorderMapper;
00215   vtkActor2D                 *BorderActor;
00216 
00217   
00218   int           LegendEntriesVisible;
00219   int           CachedSize[2];
00220   vtkTimeStamp  BuildTime;
00221 
00222 };
00223 
00224 
00225 #endif
00226