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 
00076 #ifndef __vtkLabeledDataMapper_h
00077 #define __vtkLabeledDataMapper_h
00078 
00079 #include "vtkMapper2D.h"
00080 #include "vtkTextMapper.h"
00081 #include "vtkDataSet.h"
00082 
00083 #define VTK_LABEL_IDS        0
00084 #define VTK_LABEL_SCALARS    1
00085 #define VTK_LABEL_VECTORS    2
00086 #define VTK_LABEL_NORMALS    3
00087 #define VTK_LABEL_TCOORDS    4
00088 #define VTK_LABEL_TENSORS    5
00089 #define VTK_LABEL_FIELD_DATA 6
00090 
00091 class VTK_EXPORT vtkLabeledDataMapper : public vtkMapper2D
00092 {
00093 public:
00097   static vtkLabeledDataMapper *New();
00098 
00099   vtkTypeMacro(vtkLabeledDataMapper,vtkMapper2D);
00100   void PrintSelf(ostream& os, vtkIndent indent);
00101   
00103   void RenderOpaqueGeometry(vtkViewport* viewport, vtkActor2D* actor);
00104   void RenderOverlay(vtkViewport* viewport, vtkActor2D* actor);
00105 
00107   vtkSetObjectMacro(Input, vtkDataSet);
00108   vtkGetObjectMacro(Input, vtkDataSet);
00109 
00113   virtual void ReleaseGraphicsResources(vtkWindow *);
00114 
00119   vtkSetMacro(LabelMode, int);
00120   vtkGetMacro(LabelMode, int);
00121   void SetLabelModeToLabelIds() {this->SetLabelMode(VTK_LABEL_IDS);};
00122   void SetLabelModeToLabelScalars() {this->SetLabelMode(VTK_LABEL_SCALARS);};
00123   void SetLabelModeToLabelVectors() {this->SetLabelMode(VTK_LABEL_VECTORS);};
00124   void SetLabelModeToLabelNormals() {this->SetLabelMode(VTK_LABEL_NORMALS);};
00125   void SetLabelModeToLabelTCoords() {this->SetLabelMode(VTK_LABEL_TCOORDS);};
00126   void SetLabelModeToLabelTensors() {this->SetLabelMode(VTK_LABEL_TENSORS);};
00127   void SetLabelModeToLabelFieldData()
00128             {this->SetLabelMode(VTK_LABEL_FIELD_DATA);};
00129 
00133   vtkSetClampMacro(FontSize,int,0,VTK_LARGE_INTEGER);
00134   vtkGetMacro(FontSize,int);
00135 
00137   vtkSetMacro(Bold, int);
00138   vtkGetMacro(Bold, int);
00139   vtkBooleanMacro(Bold, int);
00140 
00142   vtkSetMacro(Italic, int);
00143   vtkGetMacro(Italic, int);
00144   vtkBooleanMacro(Italic, int);
00145 
00148   vtkSetMacro(Shadow, int);
00149   vtkGetMacro(Shadow, int);
00150   vtkBooleanMacro(Shadow, int);
00151 
00155   vtkSetMacro(FontFamily, int);
00156   vtkGetMacro(FontFamily, int);
00157   void SetFontFamilyToArial() {this->SetFontFamily(VTK_ARIAL);};
00158   void SetFontFamilyToCourier() {this->SetFontFamily(VTK_COURIER);};
00159   void SetFontFamilyToTimes() {this->SetFontFamily(VTK_TIMES);};
00160 
00167   vtkSetStringMacro(LabelFormat);
00168   vtkGetStringMacro(LabelFormat);
00169 
00175   vtkSetMacro(LabeledComponent,int);
00176   vtkGetMacro(LabeledComponent,int);
00177 
00180   vtkSetClampMacro(FieldDataArray,int,0,VTK_LARGE_INTEGER);
00181   vtkGetMacro(FieldDataArray,int);
00182 
00183 protected:
00184   vtkLabeledDataMapper();
00185   ~vtkLabeledDataMapper();
00186   vtkLabeledDataMapper(const vtkLabeledDataMapper&) {};
00187   void operator=(const vtkLabeledDataMapper&) {};
00188 
00189   vtkDataSet *Input;
00190   int LabelMode;
00191 
00192   int   FontSize;
00193   int Bold;
00194   int   Italic;
00195   int   Shadow;
00196   int   FontFamily;
00197 
00198   char  *LabelFormat;
00199   int   LabeledComponent;
00200   int   FieldDataArray;
00201 
00202   vtkTimeStamp BuildTime;
00203 
00204 private:
00205   int NumberOfLabels;
00206   int NumberOfLabelsAllocated;
00207   vtkTextMapper **TextMappers;
00208 
00209 };
00210 
00211 #endif
00212