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
00070 #ifndef __vtkDataSet_h
00071 #define __vtkDataSet_h
00072
00073 #include "vtkDataObject.h"
00074 #include "vtkCellData.h"
00075 #include "vtkPointData.h"
00076 #include "vtkGenericCell.h"
00077 #include "vtkCellTypes.h"
00078
00079 class VTK_COMMON_EXPORT vtkDataSet : public vtkDataObject
00080 {
00081 public:
00082 vtkTypeMacro(vtkDataSet,vtkDataObject);
00083 void PrintSelf(ostream& os, vtkIndent indent);
00084
00088 virtual void CopyStructure(vtkDataSet *ds) = 0;
00089
00092 virtual vtkIdType GetNumberOfPoints() = 0;
00093
00096 virtual vtkIdType GetNumberOfCells() = 0;
00097
00100 virtual float *GetPoint(vtkIdType ptId) = 0;
00101
00105 virtual void GetPoint(vtkIdType id, float x[3]);
00106
00109 virtual vtkCell *GetCell(vtkIdType cellId) = 0;
00110
00115 virtual void GetCell(vtkIdType cellId, vtkGenericCell *cell) = 0;
00116
00125 virtual void GetCellBounds(vtkIdType cellId, float bounds[6]);
00126
00130 virtual int GetCellType(vtkIdType cellId) = 0;
00131
00139 virtual void GetCellTypes(vtkCellTypes *types);
00140
00144 virtual void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds) = 0;
00145
00149 virtual void GetPointCells(vtkIdType ptId, vtkIdList *cellIds) = 0;
00150
00152
00156 virtual void GetCellNeighbors(vtkIdType cellId, vtkIdList *ptIds,
00157 vtkIdList *cellIds);
00159
00161
00165 vtkIdType FindPoint(float x, float y, float z)
00166 {
00167 float xyz[3];
00168 xyz[0] = x; xyz[1] = y; xyz[2] = z;
00169 return this->FindPoint (xyz);
00170 }
00171 virtual vtkIdType FindPoint(float x[3]) = 0;
00173
00175
00183 virtual vtkIdType FindCell(float x[3], vtkCell *cell, vtkIdType cellId,
00184 float tol2, int& subId, float pcoords[3],
00185 float *weights) = 0;
00187
00189
00194 virtual vtkIdType FindCell(float x[3], vtkCell *cell,
00195 vtkGenericCell *gencell, vtkIdType cellId,
00196 float tol2, int& subId, float pcoords[3],
00197 float *weights) = 0;
00199
00201
00207 virtual vtkCell *FindAndGetCell(float x[3], vtkCell *cell, vtkIdType cellId,
00208 float tol2, int& subId, float pcoords[3],
00209 float *weights);
00211
00214 unsigned long int GetMTime();
00215
00218 vtkCellData *GetCellData() {return this->CellData;};
00219
00222 vtkPointData *GetPointData() {return this->PointData;};
00223
00226 virtual void Squeeze();
00227
00230 virtual void ComputeBounds();
00231
00234 float *GetBounds();
00235
00239 void GetBounds(float bounds[6]);
00240
00242 float *GetCenter();
00243
00246 void GetCenter(float center[3]);
00247
00251 float GetLength();
00252
00254 void Initialize();
00255
00262 virtual void GetScalarRange(float range[2]);
00263
00266 float *GetScalarRange();
00267
00271 virtual int GetMaxCellSize() = 0;
00272
00278 unsigned long GetActualMemorySize();
00279
00281
00282 int GetDataObjectType()
00283 {return VTK_DATA_SET;}
00285
00287
00288 void ShallowCopy(vtkDataObject *src);
00289 void DeepCopy(vtkDataObject *src);
00291
00292
00293 enum FieldDataType
00294 {
00295 DATA_OBJECT_FIELD=0,
00296 POINT_DATA_FIELD=1,
00297 CELL_DATA_FIELD=2
00298 };
00299
00300
00301 protected:
00302
00303 vtkDataSet();
00304 ~vtkDataSet();
00305
00306 vtkCellData *CellData;
00307 vtkPointData *PointData;
00308 vtkTimeStamp ComputeTime;
00309 float Bounds[6];
00310 float ScalarRange[2];
00311 float Center[3];
00312
00313 private:
00314 void InternalDataSetCopy(vtkDataSet *src);
00315 private:
00316 vtkDataSet(const vtkDataSet&);
00317 void operator=(const vtkDataSet&);
00318 };
00319
00320 inline void vtkDataSet::GetPoint(vtkIdType id, float x[3])
00321 {
00322 float *pt = this->GetPoint(id);
00323 x[0] = pt[0]; x[1] = pt[1]; x[2] = pt[2];
00324 }
00325
00326 #endif