Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Related Pages

# Common/vtkDataSet.h

Go to the documentation of this file.

    00001 /*=========================================================================
    00002
    00003   Program:   Visualization Toolkit
    00004   Module:    $RCSfile: vtkDataSet.h,v $
    00005   Language:  C++
    00006
    00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen
    00008   All rights reserved.
    00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
    00010
    00011      This software is distributed WITHOUT ANY WARRANTY; without even
    00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
    00013      PURPOSE.  See the above copyright notice for more information.
    00014
    00015 =========================================================================*/
    00058 #ifndef __vtkDataSet_h
    00059 #define __vtkDataSet_h
    00060
    00061 #include "vtkDataObject.h"
    00062
    00063 class vtkCell;
    00064 class vtkCellData;
    00065 class vtkCellTypes;
    00066 class vtkGenericCell;
    00067 class vtkIdList;
    00068 class vtkPointData;
    00069
    00070 class VTK_COMMON_EXPORT vtkDataSet : public vtkDataObject
    00071 {
    00072 public:
    00073   vtkTypeRevisionMacro(vtkDataSet,vtkDataObject);
    00074   void PrintSelf(ostream& os, vtkIndent indent);
    00075
    00079   virtual void CopyStructure(vtkDataSet *ds) = 0;
    00080
    00083   virtual vtkIdType GetNumberOfPoints() = 0;
    00084
    00087   virtual vtkIdType GetNumberOfCells() = 0;
    00088
    00091   virtual float *GetPoint(vtkIdType ptId) = 0;
    00092
    00096   virtual void GetPoint(vtkIdType id, float x[3]);
    00097
    00100   virtual vtkCell *GetCell(vtkIdType cellId) = 0;
    00101
    00106   virtual void GetCell(vtkIdType cellId, vtkGenericCell *cell) = 0;
    00107
    00116   virtual void GetCellBounds(vtkIdType cellId, float bounds[6]);
    00117
    00121   virtual int GetCellType(vtkIdType cellId) = 0;
    00122
    00130   virtual void GetCellTypes(vtkCellTypes *types);
    00131
    00135   virtual void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds) = 0;
    00136
    00140   virtual void GetPointCells(vtkIdType ptId, vtkIdList *cellIds) = 0;
    00141
    00143
    00147   virtual void GetCellNeighbors(vtkIdType cellId, vtkIdList *ptIds,
    00148                                 vtkIdList *cellIds);
    00150
    00152
    00156   vtkIdType FindPoint(float x, float y, float z)
    00157     {
    00158     float xyz[3];
    00159     xyz[0] = x; xyz[1] = y; xyz[2] = z;
    00160     return this->FindPoint (xyz);
    00161     }
    00162   virtual vtkIdType FindPoint(float x[3]) = 0;
    00164
    00166
    00174   virtual vtkIdType FindCell(float x[3], vtkCell *cell, vtkIdType cellId,
    00175                              float tol2, int& subId, float pcoords[3],
    00176                              float *weights) = 0;
    00178
    00180
    00185   virtual vtkIdType FindCell(float x[3], vtkCell *cell,
    00186                              vtkGenericCell *gencell, vtkIdType cellId,
    00187                              float tol2, int& subId, float pcoords[3],
    00188                              float *weights) = 0;
    00190
    00192
    00198   virtual vtkCell *FindAndGetCell(float x[3], vtkCell *cell, vtkIdType cellId,
    00199                                   float tol2, int& subId, float pcoords[3],
    00200                                   float *weights);
    00202
    00205   unsigned long int GetMTime();
    00206
    00209   vtkCellData *GetCellData() {return this->CellData;};
    00210
    00213   vtkPointData *GetPointData() {return this->PointData;};
    00214
    00217   virtual void Squeeze();
    00218
    00221   virtual void ComputeBounds();
    00222
    00225   float *GetBounds();
    00226
    00230   void GetBounds(float bounds[6]);
    00231
    00233   float *GetCenter();
    00234
    00237   void GetCenter(float center[3]);
    00238
    00242   float GetLength();
    00243
    00245   void Initialize();
    00246
    00253   virtual void GetScalarRange(float range[2]);
    00254
    00257   float *GetScalarRange();
    00258
    00262   virtual int GetMaxCellSize() = 0;
    00263
    00269   unsigned long GetActualMemorySize();
    00270
    00272
    00273   int GetDataObjectType()
    00274     {return VTK_DATA_SET;}
    00276
    00278
    00279   void ShallowCopy(vtkDataObject *src);
    00280   void DeepCopy(vtkDataObject *src);
    00282
    00283 //BTX
    00284   enum FieldDataType
    00285   {
    00286     DATA_OBJECT_FIELD=0,
    00287     POINT_DATA_FIELD=1,
    00288     CELL_DATA_FIELD=2
    00289   };
    00290 //ETX
    00291
    00298   int CheckAttributes();
    00299
    00300 protected:
    00301   // Constructor with default bounds (0,1, 0,1, 0,1).
    00302   vtkDataSet();
    00303   ~vtkDataSet();
    00304
    00305   vtkCellData *CellData;   // Scalars, vectors, etc. associated w/ each cell
    00306   vtkPointData *PointData;   // Scalars, vectors, etc. associated w/ each point
    00307   vtkTimeStamp ComputeTime; // Time at which bounds, center, etc. computed
    00308   float Bounds[6];  // (xmin,xmax, ymin,ymax, zmin,zmax) geometric bounds
    00309   float ScalarRange[2];
    00310   float Center[3];
    00311
    00312 private:
    00313   void InternalDataSetCopy(vtkDataSet *src);
    00314 private:
    00315   vtkDataSet(const vtkDataSet&);  // Not implemented.
    00316   void operator=(const vtkDataSet&);    // Not implemented.
    00317 };
    00318
    00319 inline void vtkDataSet::GetPoint(vtkIdType id, float x[3])
    00320 {
    00321   float *pt = this->GetPoint(id);
    00322   x[0] = pt[0]; x[1] = pt[1]; x[2] = pt[2];
    00323 }
    00324
    00325 #endif