00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00048 #ifndef __vtkLabeledDataMapper_h
00049 #define __vtkLabeledDataMapper_h
00050
00051 #include "vtkMapper2D.h"
00052
00053 class vtkDataObject;
00054 class vtkDataSet;
00055 class vtkTextMapper;
00056 class vtkTextProperty;
00057 class vtkTransform;
00058
00059 #define VTK_LABEL_IDS 0
00060 #define VTK_LABEL_SCALARS 1
00061 #define VTK_LABEL_VECTORS 2
00062 #define VTK_LABEL_NORMALS 3
00063 #define VTK_LABEL_TCOORDS 4
00064 #define VTK_LABEL_TENSORS 5
00065 #define VTK_LABEL_FIELD_DATA 6
00066
00067 class VTK_RENDERING_EXPORT vtkLabeledDataMapper : public vtkMapper2D
00068 {
00069 public:
00072 static vtkLabeledDataMapper *New();
00073
00074 vtkTypeRevisionMacro(vtkLabeledDataMapper,vtkMapper2D);
00075 void PrintSelf(ostream& os, vtkIndent indent);
00076
00078
00086 vtkSetStringMacro(LabelFormat);
00087 vtkGetStringMacro(LabelFormat);
00089
00091
00096 vtkSetMacro(LabeledComponent,int);
00097 vtkGetMacro(LabeledComponent,int);
00099
00101
00104 void SetFieldDataArray(int arrayIndex);
00105 vtkGetMacro(FieldDataArray,int);
00107
00109
00112 void SetFieldDataName(const char *arrayName);
00113 vtkGetStringMacro(FieldDataName);
00115
00118 virtual void SetInput(vtkDataObject*);
00119
00122 vtkDataSet *GetInput();
00123
00125
00129 vtkSetMacro(LabelMode, int);
00130 vtkGetMacro(LabelMode, int);
00131 void SetLabelModeToLabelIds() {this->SetLabelMode(VTK_LABEL_IDS);};
00132 void SetLabelModeToLabelScalars() {this->SetLabelMode(VTK_LABEL_SCALARS);};
00133 void SetLabelModeToLabelVectors() {this->SetLabelMode(VTK_LABEL_VECTORS);};
00134 void SetLabelModeToLabelNormals() {this->SetLabelMode(VTK_LABEL_NORMALS);};
00135 void SetLabelModeToLabelTCoords() {this->SetLabelMode(VTK_LABEL_TCOORDS);};
00136 void SetLabelModeToLabelTensors() {this->SetLabelMode(VTK_LABEL_TENSORS);};
00137 void SetLabelModeToLabelFieldData()
00138 {this->SetLabelMode(VTK_LABEL_FIELD_DATA);};
00140
00142
00145 virtual void SetLabelTextProperty(vtkTextProperty *p)
00146 { this->SetLabelTextProperty(p, 0); }
00147 virtual vtkTextProperty* GetLabelTextProperty()
00148 { return this->GetLabelTextProperty(0); }
00149 virtual void SetLabelTextProperty(vtkTextProperty *p, int type);
00150 virtual vtkTextProperty* GetLabelTextProperty(int type);
00152
00154
00155 void RenderOpaqueGeometry(vtkViewport* viewport, vtkActor2D* actor);
00156 void RenderOverlay(vtkViewport* viewport, vtkActor2D* actor);
00158
00160 virtual void ReleaseGraphicsResources(vtkWindow *);
00161
00163
00164 vtkGetObjectMacro(Transform, vtkTransform);
00165 void SetTransform(vtkTransform* t);
00167
00168
00170 enum Coordinates
00171 {
00172 WORLD=0,
00173 DISPLAY=1
00174 };
00175
00176
00178
00181 vtkGetMacro(CoordinateSystem,int);
00182 vtkSetClampMacro(CoordinateSystem,int,WORLD,DISPLAY);
00183 void CoordinateSystemWorld() { this->SetCoordinateSystem( vtkLabeledDataMapper::WORLD ); }
00184 void CoordinateSystemDisplay() { this->SetCoordinateSystem( vtkLabeledDataMapper::DISPLAY ); }
00186
00188 virtual unsigned long GetMTime();
00189
00190 protected:
00191 vtkLabeledDataMapper();
00192 ~vtkLabeledDataMapper();
00193
00194 vtkDataSet *Input;
00195
00196 char *LabelFormat;
00197 int LabelMode;
00198 int LabeledComponent;
00199 int FieldDataArray;
00200 char *FieldDataName;
00201 int CoordinateSystem;
00202
00203 vtkTimeStamp BuildTime;
00204
00205 int NumberOfLabels;
00206 int NumberOfLabelsAllocated;
00207 vtkTextMapper **TextMappers;
00208 double* LabelPositions;
00209 vtkTransform *Transform;
00210
00211 virtual int FillInputPortInformation(int, vtkInformation*);
00212
00213 void AllocateLabels(int numLabels);
00214 void BuildLabels();
00215 void BuildLabelsInternal(vtkDataSet*);
00216
00217
00218 class Internals;
00219 Internals* Implementation;
00220
00221
00222 private:
00223 vtkLabeledDataMapper(const vtkLabeledDataMapper&);
00224 void operator=(const vtkLabeledDataMapper&);
00225 };
00226
00227 #endif
00228