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
00039
00053 #ifndef __vtkVectors_h
00054 #define __vtkVectors_h
00055
00056 #include "vtkAttributeData.h"
00057
00058 class vtkIdList;
00059 class vtkVectors;
00060
00061 class VTK_EXPORT vtkVectors : public vtkAttributeData
00062 {
00063 public:
00064 static vtkVectors *New(int dataType);
00065 static vtkVectors *New();
00066
00067 vtkTypeMacro(vtkVectors,vtkAttributeData);
00068 void PrintSelf(ostream& os, vtkIndent indent);
00069
00071 vtkAttributeData *MakeObject()
00072 {return vtkVectors::New(this->GetDataType());};
00073
00075 int GetNumberOfVectors() {return this->Data->GetNumberOfTuples();};
00076
00078 float *GetVector(int id) { return this->Data->GetTuple(id);};
00079
00082 void GetVector(int id, float v[3]) { this->Data->GetTuple(id,v);};
00083 void GetVector(int id, double v[3]) { this->Data->GetTuple(id,v);};
00084
00088 void SetVector(int id, const float v[3]) {this->Data->SetTuple(id,v);};
00089 void SetVector(int id, const double v[3]) {this->Data->SetTuple(id,v);};
00090 void SetVector(int id, double vx, double vy, double vz);
00091
00094 void InsertVector(int id, const float v[3])
00095 {this->Data->InsertTuple(id,v);};
00096 void InsertVector(int id, const double v[3])
00097 {this->Data->InsertTuple(id,v);};
00098 void InsertVector(int id, double vx, double vy, double vz);
00099
00101 int InsertNextVector(const float v[3])
00102 {return this->Data->InsertNextTuple(v);};
00103 int InsertNextVector(const double v[3])
00104 {return this->Data->InsertNextTuple(v);};
00105 int InsertNextVector(double vx, double vy, double vz);
00106
00110 void SetNumberOfVectors(int number);
00111
00113 void ComputeMaxNorm();
00114
00116 double GetMaxNorm();
00117
00119 void GetVectors(vtkIdList *ptId, vtkVectors *fv);
00120
00121 #ifndef VTK_REMOVE_LEGACY_CODE
00122
00123 void GetVectors(vtkIdList& ptId, vtkVectors& fv)
00124 {VTK_LEGACY_METHOD(GetVectors,"3.2"); this->GetVectors(&ptId, &fv);}
00125 #endif
00126
00127
00128 protected:
00129 vtkVectors();
00130 ~vtkVectors() {};
00131 vtkVectors(const vtkVectors&) {};
00132 void operator=(const vtkVectors&) {};
00133
00134 double MaxNorm;
00135 vtkTimeStamp ComputeTime;
00136
00137 };
00138
00139
00140 inline void vtkVectors::SetNumberOfVectors(int number)
00141 {
00142 this->Data->SetNumberOfComponents(3);
00143 this->Data->SetNumberOfTuples(number);
00144 }
00145
00146 inline void vtkVectors::SetVector(int id, double vx, double vy, double vz)
00147 {
00148 double v[3];
00149 v[0] = vx;
00150 v[1] = vy;
00151 v[2] = vz;
00152 this->Data->SetTuple(id,v);
00153 }
00154
00155 inline void vtkVectors::InsertVector(int id, double vx, double vy, double vz)
00156 {
00157 double v[3];
00158
00159 v[0] = vx;
00160 v[1] = vy;
00161 v[2] = vz;
00162 this->Data->InsertTuple(id,v);
00163 }
00164
00165 inline int vtkVectors::InsertNextVector(double vx, double vy, double vz)
00166 {
00167 double v[3];
00168
00169 v[0] = vx;
00170 v[1] = vy;
00171 v[2] = vz;
00172 return this->Data->InsertNextTuple(v);
00173 }
00174
00175
00176
00177
00178 #include "vtkIdList.h"
00179
00180 #endif
00181