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 __vtkPoints_h
00054 #define __vtkPoints_h
00055
00056 #include "vtkAttributeData.h"
00057
00058 class vtkIdList;
00059 class vtkPoints;
00060
00061 class VTK_EXPORT vtkPoints : public vtkAttributeData
00062 {
00063 public:
00064
00065 static vtkPoints *New(int dataType);
00066
00067 static vtkPoints *New();
00068
00069 vtkTypeMacro(vtkPoints,vtkAttributeData);
00070 void PrintSelf(ostream& os, vtkIndent indent);
00071
00073 vtkAttributeData *MakeObject();
00074
00076 int GetNumberOfPoints() { return this->Data->GetNumberOfTuples();};
00077
00079 float *GetPoint(int id) { return this->Data->GetTuple(id);};
00080
00082 void GetPoint(int id, float x[3]) { this->Data->GetTuple(id,x);};
00083 void GetPoint(int id, double x[3]) { this->Data->GetTuple(id,x);};
00084
00088 void SetPoint(int id, const float x[3]) { this->Data->SetTuple(id,x);};
00089 void SetPoint(int id, const double x[3]) { this->Data->SetTuple(id,x);};
00090 void SetPoint(int id, double x, double y, double z);
00091
00094 void InsertPoint(int id, const float x[3]) { this->Data->InsertTuple(id,x);};
00095 void InsertPoint(int id, const double x[3]) {this->Data->InsertTuple(id,x);};
00096 void InsertPoint(int id, double x, double y, double z);
00097
00099 int InsertNextPoint(const float x[3]) {
00100 return this->Data->InsertNextTuple(x);};
00101 int InsertNextPoint(const double x[3]) {
00102 return this->Data->InsertNextTuple(x);};
00103 int InsertNextPoint(double x, double y, double z);
00104
00108 void SetNumberOfPoints(int number);
00109
00111 void GetPoints(vtkIdList *ptId, vtkPoints *fp);
00112
00114 virtual void ComputeBounds();
00115
00117 float *GetBounds();
00118
00120 void GetBounds(float bounds[6]);
00121
00122 #ifndef VTK_REMOVE_LEGACY_CODE
00123
00124 void GetPoints(vtkIdList &ptId, vtkPoints &fp)
00125 {VTK_LEGACY_METHOD(GetPoints,"3.2"); this->GetPoints(&ptId, &fp);}
00126 #endif
00127
00128 protected:
00129 vtkPoints(int dataType=VTK_FLOAT);
00130 ~vtkPoints() {};
00131 vtkPoints(const vtkPoints&) {};
00132 void operator=(const vtkPoints&) {};
00133
00134 float Bounds[6];
00135 vtkTimeStamp ComputeTime;
00136
00137 };
00138
00139 inline void vtkPoints::SetNumberOfPoints(int number)
00140 {
00141 this->Data->SetNumberOfComponents(3);
00142 this->Data->SetNumberOfTuples(number);
00143 }
00144
00145 inline void vtkPoints::SetPoint(int id, double x, double y, double z)
00146 {
00147 double p[3];
00148 p[0] = x;
00149 p[1] = y;
00150 p[2] = z;
00151 this->Data->SetTuple(id,p);
00152 }
00153
00154 inline void vtkPoints::InsertPoint(int id, double x, double y, double z)
00155 {
00156 double p[3];
00157
00158 p[0] = x;
00159 p[1] = y;
00160 p[2] = z;
00161 this->Data->InsertTuple(id,p);
00162 }
00163
00164 inline int vtkPoints::InsertNextPoint(double x, double y, double z)
00165 {
00166 double p[3];
00167
00168 p[0] = x;
00169 p[1] = y;
00170 p[2] = z;
00171 return this->Data->InsertNextTuple(p);
00172 }
00173
00174
00175
00176
00177 #include "vtkIdList.h"
00178
00179 #endif
00180