00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00042 #ifndef __vtkDataSet_h
00043 #define __vtkDataSet_h
00044
00045 #include "vtkDataObject.h"
00046
00047 class vtkCell;
00048 class vtkCellData;
00049 class vtkCellTypes;
00050 class vtkGenericCell;
00051 class vtkIdList;
00052 class vtkPointData;
00053 class vtkSourceToDataSetFriendship;
00054
00055 class VTK_FILTERING_EXPORT vtkDataSet : public vtkDataObject
00056 {
00057 public:
00058 vtkTypeRevisionMacro(vtkDataSet,vtkDataObject);
00059 void PrintSelf(ostream& os, vtkIndent indent);
00060
00064 virtual void CopyStructure(vtkDataSet *ds) = 0;
00065
00068 virtual void CopyAttributes(vtkDataSet *ds);
00069
00072 virtual vtkIdType GetNumberOfPoints() = 0;
00073
00076 virtual vtkIdType GetNumberOfCells() = 0;
00077
00080 virtual double *GetPoint(vtkIdType ptId) = 0;
00081
00085 virtual void GetPoint(vtkIdType id, double x[3]);
00086
00089 virtual vtkCell *GetCell(vtkIdType cellId) = 0;
00090
00095 virtual void GetCell(vtkIdType cellId, vtkGenericCell *cell) = 0;
00096
00105 virtual void GetCellBounds(vtkIdType cellId, double bounds[6]);
00106
00110 virtual int GetCellType(vtkIdType cellId) = 0;
00111
00119 virtual void GetCellTypes(vtkCellTypes *types);
00120
00124 virtual void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds) = 0;
00125
00129 virtual void GetPointCells(vtkIdType ptId, vtkIdList *cellIds) = 0;
00130
00132
00136 virtual void GetCellNeighbors(vtkIdType cellId, vtkIdList *ptIds,
00137 vtkIdList *cellIds);
00139
00141
00145 vtkIdType FindPoint(double x, double y, double z)
00146 {
00147 double xyz[3];
00148 xyz[0] = x; xyz[1] = y; xyz[2] = z;
00149 return this->FindPoint (xyz);
00150 }
00151 virtual vtkIdType FindPoint(double x[3]) = 0;
00153
00155
00163 virtual vtkIdType FindCell(double x[3], vtkCell *cell, vtkIdType cellId,
00164 double tol2, int& subId, double pcoords[3],
00165 double *weights) = 0;
00167
00169
00174 virtual vtkIdType FindCell(double x[3], vtkCell *cell,
00175 vtkGenericCell *gencell, vtkIdType cellId,
00176 double tol2, int& subId, double pcoords[3],
00177 double *weights) = 0;
00179
00181
00187 virtual vtkCell *FindAndGetCell(double x[3], vtkCell *cell, vtkIdType cellId,
00188 double tol2, int& subId, double pcoords[3],
00189 double *weights);
00191
00194 unsigned long int GetMTime();
00195
00198 vtkCellData *GetCellData() {return this->CellData;};
00199
00202 vtkPointData *GetPointData() {return this->PointData;};
00203
00206 virtual void Squeeze();
00207
00210 virtual void ComputeBounds();
00211
00214 double *GetBounds();
00215
00219 void GetBounds(double bounds[6]);
00220
00222 double *GetCenter();
00223
00226 void GetCenter(double center[3]);
00227
00231 double GetLength();
00232
00234 void Initialize();
00235
00242 virtual void GetScalarRange(double range[2]);
00243
00246 double *GetScalarRange();
00247
00251 virtual int GetMaxCellSize() = 0;
00252
00258 unsigned long GetActualMemorySize();
00259
00261
00262 int GetDataObjectType()
00263 {return VTK_DATA_SET;}
00265
00267
00268 void ShallowCopy(vtkDataObject *src);
00269 void DeepCopy(vtkDataObject *src);
00271
00272
00273 enum FieldDataType
00274 {
00275 DATA_OBJECT_FIELD=0,
00276 POINT_DATA_FIELD=1,
00277 CELL_DATA_FIELD=2
00278 };
00279
00280
00287 int CheckAttributes();
00288
00291 virtual void GenerateGhostLevelArray();
00292
00293
00295
00296 static vtkDataSet* GetData(vtkInformation* info);
00297 static vtkDataSet* GetData(vtkInformationVector* v, int i=0);
00298
00300
00305 virtual vtkFieldData* GetAttributesAsFieldData(int type);
00306
00309 virtual vtkIdType GetNumberOfElements(int type);
00310
00311 protected:
00312
00313 vtkDataSet();
00314 ~vtkDataSet();
00315
00318 virtual void ComputeScalarRange();
00319
00320 vtkCellData *CellData;
00321 vtkPointData *PointData;
00322 vtkTimeStamp ComputeTime;
00323 double Bounds[6];
00324 double Center[3];
00325
00326
00327 double ScalarRange[2];
00328
00329
00330 vtkTimeStamp ScalarRangeComputeTime;
00331
00332 private:
00333 void InternalDataSetCopy(vtkDataSet *src);
00334
00335 friend class vtkSourceToDataSetFriendship;
00336 friend class vtkImageAlgorithmToDataSetFriendship;
00337
00338 private:
00339 vtkDataSet(const vtkDataSet&);
00340 void operator=(const vtkDataSet&);
00341 };
00342
00343 inline void vtkDataSet::GetPoint(vtkIdType id, double x[3])
00344 {
00345 double *pt = this->GetPoint(id);
00346 x[0] = pt[0]; x[1] = pt[1]; x[2] = pt[2];
00347 }
00348
00349 #endif