00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00045 #ifndef __vtkDataSet_h
00046 #define __vtkDataSet_h
00047
00048 #include "vtkDataObject.h"
00049
00050 class vtkCell;
00051 class vtkCellData;
00052 class vtkCellTypes;
00053 class vtkGenericCell;
00054 class vtkIdList;
00055 class vtkPointData;
00056 class vtkSourceToDataSetFriendship;
00057
00058 class VTK_FILTERING_EXPORT vtkDataSet : public vtkDataObject
00059 {
00060 public:
00061 vtkTypeRevisionMacro(vtkDataSet,vtkDataObject);
00062 void PrintSelf(ostream& os, vtkIndent indent);
00063
00067 virtual void CopyStructure(vtkDataSet *ds) = 0;
00068
00071 virtual vtkIdType GetNumberOfPoints() = 0;
00072
00075 virtual vtkIdType GetNumberOfCells() = 0;
00076
00079 virtual double *GetPoint(vtkIdType ptId) = 0;
00080
00084 virtual void GetPoint(vtkIdType id, double x[3]);
00085
00088 virtual vtkCell *GetCell(vtkIdType cellId) = 0;
00089
00094 virtual void GetCell(vtkIdType cellId, vtkGenericCell *cell) = 0;
00095
00104 virtual void GetCellBounds(vtkIdType cellId, double bounds[6]);
00105
00109 virtual int GetCellType(vtkIdType cellId) = 0;
00110
00118 virtual void GetCellTypes(vtkCellTypes *types);
00119
00123 virtual void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds) = 0;
00124
00128 virtual void GetPointCells(vtkIdType ptId, vtkIdList *cellIds) = 0;
00129
00131
00135 virtual void GetCellNeighbors(vtkIdType cellId, vtkIdList *ptIds,
00136 vtkIdList *cellIds);
00138
00140
00144 vtkIdType FindPoint(double x, double y, double z)
00145 {
00146 double xyz[3];
00147 xyz[0] = x; xyz[1] = y; xyz[2] = z;
00148 return this->FindPoint (xyz);
00149 }
00150 virtual vtkIdType FindPoint(double x[3]) = 0;
00152
00154
00162 virtual vtkIdType FindCell(double x[3], vtkCell *cell, vtkIdType cellId,
00163 double tol2, int& subId, double pcoords[3],
00164 double *weights) = 0;
00166
00168
00173 virtual vtkIdType FindCell(double x[3], vtkCell *cell,
00174 vtkGenericCell *gencell, vtkIdType cellId,
00175 double tol2, int& subId, double pcoords[3],
00176 double *weights) = 0;
00178
00180
00186 virtual vtkCell *FindAndGetCell(double x[3], vtkCell *cell, vtkIdType cellId,
00187 double tol2, int& subId, double pcoords[3],
00188 double *weights);
00190
00193 unsigned long int GetMTime();
00194
00197 vtkCellData *GetCellData() {return this->CellData;};
00198
00201 vtkPointData *GetPointData() {return this->PointData;};
00202
00205 virtual void Squeeze();
00206
00209 virtual void ComputeBounds();
00210
00213 double *GetBounds();
00214
00218 void GetBounds(double bounds[6]);
00219
00221 double *GetCenter();
00222
00225 void GetCenter(double center[3]);
00226
00230 double GetLength();
00231
00233 void Initialize();
00234
00241 virtual void GetScalarRange(double range[2]);
00242
00245 double *GetScalarRange();
00246
00250 virtual int GetMaxCellSize() = 0;
00251
00257 unsigned long GetActualMemorySize();
00258
00260
00261 int GetDataObjectType()
00262 {return VTK_DATA_SET;}
00264
00266
00267 void ShallowCopy(vtkDataObject *src);
00268 void DeepCopy(vtkDataObject *src);
00270
00271
00272 enum FieldDataType
00273 {
00274 DATA_OBJECT_FIELD=0,
00275 POINT_DATA_FIELD=1,
00276 CELL_DATA_FIELD=2
00277 };
00278
00279
00286 int CheckAttributes();
00287
00290 virtual void GenerateGhostLevelArray();
00291
00292
00294
00295 static vtkDataSet* GetData(vtkInformation* info);
00296 static vtkDataSet* GetData(vtkInformationVector* v, int i=0);
00297
00299
00300 protected:
00301
00302 vtkDataSet();
00303 ~vtkDataSet();
00304
00305 vtkCellData *CellData;
00306 vtkPointData *PointData;
00307 vtkTimeStamp ComputeTime;
00308 double Bounds[6];
00309 double ScalarRange[2];
00310 double Center[3];
00311
00312 private:
00313 void InternalDataSetCopy(vtkDataSet *src);
00314
00315 friend class vtkSourceToDataSetFriendship;
00316 friend class vtkImageAlgorithmToDataSetFriendship;
00317
00318 private:
00319 vtkDataSet(const vtkDataSet&);
00320 void operator=(const vtkDataSet&);
00321 };
00322
00323 inline void vtkDataSet::GetPoint(vtkIdType id, double x[3])
00324 {
00325 double *pt = this->GetPoint(id);
00326 x[0] = pt[0]; x[1] = pt[1]; x[2] = pt[2];
00327 }
00328
00329 #endif