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
00056 #ifndef __vtkPoints_h
00057 #define __vtkPoints_h
00058
00059 #include "vtkObject.h"
00060 #include "vtkDataArray.h"
00061
00062 class vtkIdList;
00063 class vtkPoints;
00064
00065 class VTK_COMMON_EXPORT vtkPoints : public vtkObject
00066 {
00067 public:
00068
00069 static vtkPoints *New(int dataType);
00070
00071 static vtkPoints *New();
00072
00073 vtkTypeMacro(vtkPoints,vtkObject);
00074 void PrintSelf(ostream& os, vtkIndent indent);
00075
00077 virtual int Allocate(const vtkIdType sz, const vtkIdType ext=1000);
00078
00080 virtual void Initialize();
00081
00083 vtkPoints *MakeObject();
00084
00086
00092 virtual void SetData(vtkDataArray *);
00093 vtkDataArray *GetData() {return this->Data;};
00095
00098 virtual int GetDataType();
00099
00101
00102 virtual void SetDataType(int dataType);
00103 void SetDataTypeToBit() {this->SetDataType(VTK_BIT);};
00104 void SetDataTypeToChar() {this->SetDataType(VTK_CHAR);};
00105 void SetDataTypeToUnsignedChar() {this->SetDataType(VTK_UNSIGNED_CHAR);};
00106 void SetDataTypeToShort() {this->SetDataType(VTK_SHORT);};
00107 void SetDataTypeToUnsignedShort() {this->SetDataType(VTK_UNSIGNED_SHORT);};
00108 void SetDataTypeToInt() {this->SetDataType(VTK_INT);};
00109 void SetDataTypeToUnsignedInt() {this->SetDataType(VTK_UNSIGNED_INT);};
00110 void SetDataTypeToLong() {this->SetDataType(VTK_LONG);};
00111 void SetDataTypeToUnsignedLong() {this->SetDataType(VTK_UNSIGNED_LONG);};
00112 void SetDataTypeToFloat() {this->SetDataType(VTK_FLOAT);};
00113 void SetDataTypeToDouble() {this->SetDataType(VTK_DOUBLE);};
00115
00118 void *GetVoidPointer(const int id) {return this->Data->GetVoidPointer(id);};
00119
00121 virtual void Squeeze() {this->Data->Squeeze();};
00122
00124 virtual void Reset() {this->Data->Reset();};
00125
00127
00130 virtual void DeepCopy(vtkPoints *ad);
00131 virtual void ShallowCopy(vtkPoints *ad);
00133
00140 unsigned long GetActualMemorySize();
00141
00143 vtkIdType GetNumberOfPoints() { return this->Data->GetNumberOfTuples();};
00144
00146 float *GetPoint(vtkIdType id) { return this->Data->GetTuple(id);};
00147
00149
00150 void GetPoint(vtkIdType id, float x[3]) { this->Data->GetTuple(id,x);};
00151 void GetPoint(vtkIdType id, double x[3]) { this->Data->GetTuple(id,x);};
00153
00155
00158 void SetPoint(vtkIdType id, const float x[3]) { this->Data->SetTuple(id,x);};
00159 void SetPoint(vtkIdType id, const double x[3]) { this->Data->SetTuple(id,x);};
00160 void SetPoint(vtkIdType id, double x, double y, double z);
00162
00164
00166 void InsertPoint(vtkIdType id, const float x[3])
00167 { this->Data->InsertTuple(id,x);};
00168 void InsertPoint(vtkIdType id, const double x[3])
00169 {this->Data->InsertTuple(id,x);};
00170 void InsertPoint(vtkIdType id, double x, double y, double z);
00172
00174
00175 vtkIdType InsertNextPoint(const float x[3]) {
00176 return this->Data->InsertNextTuple(x);};
00177 vtkIdType InsertNextPoint(const double x[3]) {
00178 return this->Data->InsertNextTuple(x);};
00179 vtkIdType InsertNextPoint(double x, double y, double z);
00181
00185 void SetNumberOfPoints(vtkIdType number);
00186
00188 void GetPoints(vtkIdList *ptId, vtkPoints *fp);
00189
00191 virtual void ComputeBounds();
00192
00194 float *GetBounds();
00195
00197 void GetBounds(float bounds[6]);
00198
00199 protected:
00200 vtkPoints(int dataType=VTK_FLOAT);
00201 ~vtkPoints();
00202
00203 float Bounds[6];
00204 vtkTimeStamp ComputeTime;
00205 vtkDataArray *Data;
00206
00207 private:
00208 vtkPoints(const vtkPoints&);
00209 void operator=(const vtkPoints&);
00210 };
00211
00212 inline void vtkPoints::SetNumberOfPoints(vtkIdType number)
00213 {
00214 this->Data->SetNumberOfComponents(3);
00215 this->Data->SetNumberOfTuples(number);
00216 }
00217
00218 inline void vtkPoints::SetPoint(vtkIdType id, double x, double y, double z)
00219 {
00220 double p[3];
00221 p[0] = x;
00222 p[1] = y;
00223 p[2] = z;
00224 this->Data->SetTuple(id,p);
00225 }
00226
00227 inline void vtkPoints::InsertPoint(vtkIdType id, double x, double y, double z)
00228 {
00229 double p[3];
00230
00231 p[0] = x;
00232 p[1] = y;
00233 p[2] = z;
00234 this->Data->InsertTuple(id,p);
00235 }
00236
00237 inline vtkIdType vtkPoints::InsertNextPoint(double x, double y, double z)
00238 {
00239 double p[3];
00240
00241 p[0] = x;
00242 p[1] = y;
00243 p[2] = z;
00244 return this->Data->InsertNextTuple(p);
00245 }
00246
00247
00248
00249
00250 #include "vtkIdList.h"
00251
00252 #endif
00253