00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00051 #ifndef __vtkLabeledDataMapper_h
00052 #define __vtkLabeledDataMapper_h
00053
00054 #include "vtkMapper2D.h"
00055
00056 class vtkDataObject;
00057 class vtkDataSet;
00058 class vtkTextMapper;
00059 class vtkTextProperty;
00060 class vtkTransform;
00061
00062 #define VTK_LABEL_IDS 0
00063 #define VTK_LABEL_SCALARS 1
00064 #define VTK_LABEL_VECTORS 2
00065 #define VTK_LABEL_NORMALS 3
00066 #define VTK_LABEL_TCOORDS 4
00067 #define VTK_LABEL_TENSORS 5
00068 #define VTK_LABEL_FIELD_DATA 6
00069
00070 class VTK_RENDERING_EXPORT vtkLabeledDataMapper : public vtkMapper2D
00071 {
00072 public:
00075 static vtkLabeledDataMapper *New();
00076
00077 vtkTypeRevisionMacro(vtkLabeledDataMapper,vtkMapper2D);
00078 void PrintSelf(ostream& os, vtkIndent indent);
00079
00081
00089 vtkSetStringMacro(LabelFormat);
00090 vtkGetStringMacro(LabelFormat);
00092
00094
00099 vtkSetMacro(LabeledComponent,int);
00100 vtkGetMacro(LabeledComponent,int);
00102
00104
00107 void SetFieldDataArray(int arrayIndex);
00108 vtkGetMacro(FieldDataArray,int);
00110
00112
00115 void SetFieldDataName(const char *arrayName);
00116 vtkGetStringMacro(FieldDataName);
00118
00121 virtual void SetInput(vtkDataObject*);
00122
00125 vtkDataSet *GetInput();
00126
00128
00132 vtkSetMacro(LabelMode, int);
00133 vtkGetMacro(LabelMode, int);
00134 void SetLabelModeToLabelIds() {this->SetLabelMode(VTK_LABEL_IDS);};
00135 void SetLabelModeToLabelScalars() {this->SetLabelMode(VTK_LABEL_SCALARS);};
00136 void SetLabelModeToLabelVectors() {this->SetLabelMode(VTK_LABEL_VECTORS);};
00137 void SetLabelModeToLabelNormals() {this->SetLabelMode(VTK_LABEL_NORMALS);};
00138 void SetLabelModeToLabelTCoords() {this->SetLabelMode(VTK_LABEL_TCOORDS);};
00139 void SetLabelModeToLabelTensors() {this->SetLabelMode(VTK_LABEL_TENSORS);};
00140 void SetLabelModeToLabelFieldData()
00141 {this->SetLabelMode(VTK_LABEL_FIELD_DATA);};
00143
00145
00146 virtual void SetLabelTextProperty(vtkTextProperty *p);
00147 vtkGetObjectMacro(LabelTextProperty,vtkTextProperty);
00149
00151
00152 void RenderOpaqueGeometry(vtkViewport* viewport, vtkActor2D* actor);
00153 void RenderOverlay(vtkViewport* viewport, vtkActor2D* actor);
00155
00157 virtual void ReleaseGraphicsResources(vtkWindow *);
00158
00160
00161 vtkGetObjectMacro(Transform, vtkTransform);
00162 void SetTransform(vtkTransform* t);
00164
00165 protected:
00166 vtkLabeledDataMapper();
00167 ~vtkLabeledDataMapper();
00168
00169 vtkDataSet *Input;
00170 vtkTextProperty *LabelTextProperty;
00171
00172 char *LabelFormat;
00173 int LabelMode;
00174 int LabeledComponent;
00175 int FieldDataArray;
00176 char *FieldDataName;
00177
00178 vtkTimeStamp BuildTime;
00179
00180 int NumberOfLabels;
00181 int NumberOfLabelsAllocated;
00182 vtkTextMapper **TextMappers;
00183 double* LabelPositions;
00184 vtkTransform *Transform;
00185
00186 virtual int FillInputPortInformation(int, vtkInformation*);
00187
00188 void AllocateLables(int numLables);
00189 void BuildLabels();
00190 void BuildLabelsInternal(vtkDataSet*);
00191 private:
00192 vtkLabeledDataMapper(const vtkLabeledDataMapper&);
00193 void operator=(const vtkLabeledDataMapper&);
00194 };
00195
00196 #endif
00197