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
00066 #ifndef __vtkLegendBoxActor_h
00067 #define __vtkLegendBoxActor_h
00068
00069 #include "vtkActor2D.h"
00070 #include "vtkTextMapper.h"
00071
00072 class vtkActor;
00073 class vtkPolyData;
00074 class vtkPolyDataMapper;
00075 class vtkPolyDataMapper2D;
00076 class vtkTransformPolyDataFilter;
00077 class vtkTransform;
00078
00079 class VTK_HYBRID_EXPORT vtkLegendBoxActor : public vtkActor2D
00080 {
00081 public:
00082 vtkTypeMacro(vtkLegendBoxActor,vtkActor2D);
00083 void PrintSelf(ostream& os, vtkIndent indent);
00084
00087 static vtkLegendBoxActor *New();
00088
00090
00091 void SetNumberOfEntries(int num);
00092 int GetNumberOfEntries()
00093 {return this->NumberOfEntries;}
00095
00097
00105 void SetEntry(int i, vtkPolyData *symbol, const char* string, float color[3]);
00106 void SetEntrySymbol(int i, vtkPolyData *symbol);
00107 void SetEntryString(int i, const char* string);
00108 void SetEntryColor(int i, float color[3]);
00109 void SetEntryColor(int i, float r, float g, float b);
00110 vtkPolyData *GetEntrySymbol(int i);
00111 const char* GetEntryString(int i);
00112 float *GetEntryColor(int i);
00114
00116
00117 vtkSetMacro(Bold, int);
00118 vtkGetMacro(Bold, int);
00119 vtkBooleanMacro(Bold, int);
00121
00123
00124 vtkSetMacro(Italic, int);
00125 vtkGetMacro(Italic, int);
00126 vtkBooleanMacro(Italic, int);
00128
00130
00132 vtkSetMacro(Shadow, int);
00133 vtkGetMacro(Shadow, int);
00134 vtkBooleanMacro(Shadow, int);
00136
00138
00141 vtkSetMacro(FontFamily, int);
00142 vtkGetMacro(FontFamily, int);
00143 void SetFontFamilyToArial() {this->SetFontFamily(VTK_ARIAL);};
00144 void SetFontFamilyToCourier() {this->SetFontFamily(VTK_COURIER);};
00145 void SetFontFamilyToTimes() {this->SetFontFamily(VTK_TIMES);};
00147
00149
00151 vtkSetMacro(Border, int);
00152 vtkGetMacro(Border, int);
00153 vtkBooleanMacro(Border, int);
00155
00157
00163 vtkSetMacro(LockBorder, int);
00164 vtkGetMacro(LockBorder, int);
00165 vtkBooleanMacro(LockBorder, int);
00167
00169
00171 vtkSetClampMacro(Padding, int, 0, 50);
00172 vtkGetMacro(Padding, int);
00174
00176
00179 vtkSetMacro(ScalarVisibility,int);
00180 vtkGetMacro(ScalarVisibility,int);
00181 vtkBooleanMacro(ScalarVisibility,int);
00183
00186 void ShallowCopy(vtkProp *prop);
00187
00188
00193 virtual void ReleaseGraphicsResources(vtkWindow *);
00194
00196
00199 int RenderOpaqueGeometry(vtkViewport* viewport);
00200 int RenderTranslucentGeometry(vtkViewport* ) {return 0;};
00201 int RenderOverlay(vtkViewport* viewport);
00203
00204
00205 protected:
00206 vtkLegendBoxActor();
00207 ~vtkLegendBoxActor();
00208
00209 void InitializeEntries();
00210
00211 int Bold;
00212 int Italic;
00213 int Shadow;
00214 int FontFamily;
00215 int Border;
00216 int Padding;
00217 int LockBorder;
00218 int ScalarVisibility;
00219
00220
00221 int NumberOfEntries;
00222 int Size;
00223 vtkFloatArray *Colors;
00224 vtkTextMapper **TextMapper;
00225 vtkActor2D **TextActor;
00226 vtkPolyData **Symbol;
00227 vtkTransform **Transform;
00228 vtkTransformPolyDataFilter **SymbolTransform;
00229 vtkPolyDataMapper2D **SymbolMapper;
00230 vtkActor2D **SymbolActor;
00231 vtkPolyData *BorderPolyData;
00232 vtkPolyDataMapper2D *BorderMapper;
00233 vtkActor2D *BorderActor;
00234
00235
00236 int LegendEntriesVisible;
00237 int CachedSize[2];
00238 vtkTimeStamp BuildTime;
00239
00240 private:
00241 vtkLegendBoxActor(const vtkLegendBoxActor&);
00242 void operator=(const vtkLegendBoxActor&);
00243 };
00244
00245
00246 #endif
00247