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
00069 #ifndef __vtkDataSet_h
00070 #define __vtkDataSet_h
00071
00072 #include "vtkDataObject.h"
00073 #include "vtkCellData.h"
00074 #include "vtkPointData.h"
00075 #include "vtkGenericCell.h"
00076 #include "vtkCellTypes.h"
00077
00078 class VTK_EXPORT vtkDataSet : public vtkDataObject
00079 {
00080 public:
00081 vtkTypeMacro(vtkDataSet,vtkDataObject);
00082 void PrintSelf(ostream& os, vtkIndent indent);
00083
00087 virtual void CopyStructure(vtkDataSet *ds) = 0;
00088
00091 virtual int GetNumberOfPoints() = 0;
00092
00095 virtual int GetNumberOfCells() = 0;
00096
00099 virtual float *GetPoint(int ptId) = 0;
00100
00104 virtual void GetPoint(int id, float x[3]);
00105
00108 virtual vtkCell *GetCell(int cellId) = 0;
00109
00114 virtual void GetCell(int cellId, vtkGenericCell *cell) = 0;
00115
00124 virtual void GetCellBounds(int cellId, float bounds[6]);
00125
00129 virtual int GetCellType(int cellId) = 0;
00130
00138 virtual void GetCellTypes(vtkCellTypes *types);
00139
00143 virtual void GetCellPoints(int cellId, vtkIdList *ptIds) = 0;
00144
00148 virtual void GetPointCells(int ptId, vtkIdList *cellIds) = 0;
00149
00153 virtual void GetCellNeighbors(int cellId, vtkIdList *ptIds,
00154 vtkIdList *cellIds);
00155
00160 int FindPoint(float x, float y, float z)
00161 {
00162 float xyz[3];
00163 xyz[0] = x; xyz[1] = y; xyz[2] = z;
00164 return this->FindPoint (xyz);
00165 }
00166 virtual int FindPoint(float x[3]) = 0;
00167
00176 virtual int FindCell(float x[3], vtkCell *cell, int cellId, float tol2,
00177 int& subId, float pcoords[3], float *weights) = 0;
00178
00184 virtual int FindCell(float x[3], vtkCell *cell, vtkGenericCell *gencell,
00185 int cellId, float tol2, int& subId, float pcoords[3],
00186 float *weights) = 0;
00187
00194 virtual vtkCell *FindAndGetCell(float x[3], vtkCell *cell, int cellId,
00195 float tol2, int& subId, float pcoords[3],
00196 float *weights);
00197
00200 unsigned long int GetMTime();
00201
00204 vtkCellData *GetCellData() {return this->CellData;};
00205
00208 vtkPointData *GetPointData() {return this->PointData;};
00209
00212 virtual void Squeeze();
00213
00216 virtual void ComputeBounds();
00217
00220 float *GetBounds();
00221
00225 void GetBounds(float bounds[6]);
00226
00228 float *GetCenter();
00229
00232 void GetCenter(float center[3]);
00233
00237 float GetLength();
00238
00240 void Initialize();
00241
00248 void GetScalarRange(float range[2]);
00249
00252 float *GetScalarRange();
00253
00257 virtual int GetMaxCellSize() = 0;
00258
00264 unsigned long GetActualMemorySize();
00265
00267 int GetDataObjectType()
00268 {return VTK_DATA_SET;}
00269
00271 void ShallowCopy(vtkDataObject *src);
00272 void DeepCopy(vtkDataObject *src);
00273
00274 #ifndef VTK_REMOVE_LEGACY_CODE
00275
00276 void GetCellPoints(int cellId, vtkIdList &ptIds)
00277 {VTK_LEGACY_METHOD(GetCellPoints,"3.2"); this->GetCellPoints(cellId, &ptIds);}
00278 void GetPointCells(int ptId, vtkIdList &cellIds)
00279 {VTK_LEGACY_METHOD(GetPointCells,"3.2"); this->GetPointCells(ptId, &cellIds);}
00280 void GetCellNeighbors(int cellId, vtkIdList& ptIds, vtkIdList& cellIds)
00281 {VTK_LEGACY_METHOD(GetCellNeighbors,"3.2"); this->GetCellNeighbors(cellId, &ptIds, &cellIds);}
00282 virtual int GetDataSetType()
00283 {VTK_LEGACY_METHOD(GetDataSetType,"3.2"); return this->GetDataObjectType();}
00284 #endif
00285
00286 protected:
00287
00288 vtkDataSet();
00289 ~vtkDataSet();
00290 vtkDataSet(const vtkDataSet&) {};
00291 void operator=(const vtkDataSet&) {};
00292
00293 vtkCellData *CellData;
00294 vtkPointData *PointData;
00295 vtkTimeStamp ComputeTime;
00296 float Bounds[6];
00297 float ScalarRange[2];
00298 float Center[3];
00299
00300 private:
00301 void InternalDataSetCopy(vtkDataSet *src);
00302 };
00303
00304 inline void vtkDataSet::GetPoint(int id, float x[3])
00305 {
00306 float *pt = this->GetPoint(id);
00307 x[0] = pt[0]; x[1] = pt[1]; x[2] = pt[2];
00308 }
00309
00310 #endif