Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtkDataSet.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkDataSet.h,v $
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00055 #ifndef __vtkDataSet_h
00056 #define __vtkDataSet_h
00057 
00058 #include "vtkDataObject.h"
00059 
00060 class vtkCell;
00061 class vtkCellData;
00062 class vtkCellTypes;
00063 class vtkGenericCell;
00064 class vtkIdList;
00065 class vtkPointData;
00066 class vtkSourceToDataSetFriendship;
00067 
00068 class VTK_FILTERING_EXPORT vtkDataSet : public vtkDataObject
00069 {
00070 public:
00071   vtkTypeRevisionMacro(vtkDataSet,vtkDataObject);
00072   void PrintSelf(ostream& os, vtkIndent indent);
00073   
00077   virtual void CopyStructure(vtkDataSet *ds) = 0;
00078 
00081   virtual vtkIdType GetNumberOfPoints() = 0;
00082 
00085   virtual vtkIdType GetNumberOfCells() = 0;
00086 
00089   virtual double *GetPoint(vtkIdType ptId) = 0;
00090 
00094   virtual void GetPoint(vtkIdType id, double x[3]);
00095 
00098   virtual vtkCell *GetCell(vtkIdType cellId) = 0;
00099 
00104   virtual void GetCell(vtkIdType cellId, vtkGenericCell *cell) = 0;
00105 
00114   virtual void GetCellBounds(vtkIdType cellId, double bounds[6]);
00115   
00119   virtual int GetCellType(vtkIdType cellId) = 0;
00120 
00128   virtual void GetCellTypes(vtkCellTypes *types);
00129 
00133   virtual void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds) = 0;
00134 
00138   virtual void GetPointCells(vtkIdType ptId, vtkIdList *cellIds) = 0;
00139 
00141 
00145   virtual void GetCellNeighbors(vtkIdType cellId, vtkIdList *ptIds, 
00146                                 vtkIdList *cellIds);
00148 
00150 
00154   vtkIdType FindPoint(double x, double y, double z)
00155     {
00156     double xyz[3];
00157     xyz[0] = x; xyz[1] = y; xyz[2] = z;
00158     return this->FindPoint (xyz);
00159     }
00160   virtual vtkIdType FindPoint(double x[3]) = 0;
00162 
00164 
00172   virtual vtkIdType FindCell(double x[3], vtkCell *cell, vtkIdType cellId,
00173                              double tol2, int& subId, double pcoords[3],
00174                              double *weights) = 0;
00176 
00178 
00183   virtual vtkIdType FindCell(double x[3], vtkCell *cell,
00184                              vtkGenericCell *gencell, vtkIdType cellId,
00185                              double tol2, int& subId, double pcoords[3],
00186                              double *weights) = 0;
00188   
00190 
00196   virtual vtkCell *FindAndGetCell(double x[3], vtkCell *cell, vtkIdType cellId, 
00197                                   double tol2, int& subId, double pcoords[3], 
00198                                   double *weights);
00200 
00203   unsigned long int GetMTime();
00204 
00207   vtkCellData *GetCellData() {return this->CellData;};
00208 
00211   vtkPointData *GetPointData() {return this->PointData;};
00212 
00215   virtual void Squeeze();
00216 
00219   virtual void ComputeBounds();
00220 
00223   double *GetBounds();
00224 
00228   void GetBounds(double bounds[6]);
00229 
00231   double *GetCenter();
00232 
00235   void GetCenter(double center[3]);
00236   
00240   double GetLength();
00241 
00243   void Initialize();
00244 
00251   virtual void GetScalarRange(double range[2]);
00252 
00255   double *GetScalarRange();
00256   
00260   virtual int GetMaxCellSize() = 0;
00261 
00267   unsigned long GetActualMemorySize();
00268   
00270 
00271   int GetDataObjectType() 
00272     {return VTK_DATA_SET;}
00274   
00276 
00277   void ShallowCopy(vtkDataObject *src);  
00278   void DeepCopy(vtkDataObject *src);
00280 
00281 //BTX
00282   enum FieldDataType 
00283   {
00284     DATA_OBJECT_FIELD=0,
00285     POINT_DATA_FIELD=1,
00286     CELL_DATA_FIELD=2
00287   };
00288 //ETX
00289   
00296   int CheckAttributes();
00297   
00298 protected:
00299   // Constructor with default bounds (0,1, 0,1, 0,1).
00300   vtkDataSet();
00301   ~vtkDataSet();  
00302 
00303   vtkCellData *CellData;   // Scalars, vectors, etc. associated w/ each cell
00304   vtkPointData *PointData;   // Scalars, vectors, etc. associated w/ each point
00305   vtkTimeStamp ComputeTime; // Time at which bounds, center, etc. computed
00306   double Bounds[6];  // (xmin,xmax, ymin,ymax, zmin,zmax) geometric bounds
00307   double ScalarRange[2];
00308   double Center[3];
00309 
00310   virtual void GenerateGhostLevelArray();
00311 private:
00312   void InternalDataSetCopy(vtkDataSet *src);  
00313   //BTX
00314   friend class vtkSourceToDataSetFriendship;
00315   //ETX
00316 private:
00317   vtkDataSet(const vtkDataSet&);  // Not implemented.
00318   void operator=(const vtkDataSet&);    // Not implemented.
00319 };
00320 
00321 inline void vtkDataSet::GetPoint(vtkIdType id, double x[3])
00322 {
00323   double *pt = this->GetPoint(id);
00324   x[0] = pt[0]; x[1] = pt[1]; x[2] = pt[2]; 
00325 }
00326 
00327 #endif