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

dox/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 =========================================================================*/ 00046 #ifndef __vtkDataSet_h 00047 #define __vtkDataSet_h 00048 00049 #include "vtkDataObject.h" 00050 00051 class vtkCell; 00052 class vtkCellData; 00053 class vtkCellTypes; 00054 class vtkGenericCell; 00055 class vtkIdList; 00056 class vtkPointData; 00057 00058 class VTK_COMMON_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 float *GetPoint(vtkIdType ptId) = 0; 00080 00084 virtual void GetPoint(vtkIdType id, float 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, float 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(float x, float y, float z) 00145 { 00146 float xyz[3]; 00147 xyz[0] = x; xyz[1] = y; xyz[2] = z; 00148 return this->FindPoint (xyz); 00149 } 00150 virtual vtkIdType FindPoint(float x[3]) = 0; 00152 00154 00162 virtual vtkIdType FindCell(float x[3], vtkCell *cell, vtkIdType cellId, 00163 float tol2, int& subId, float pcoords[3], 00164 float *weights) = 0; 00166 00168 00173 virtual vtkIdType FindCell(float x[3], vtkCell *cell, 00174 vtkGenericCell *gencell, vtkIdType cellId, 00175 float tol2, int& subId, float pcoords[3], 00176 float *weights) = 0; 00178 00180 00186 virtual vtkCell *FindAndGetCell(float x[3], vtkCell *cell, vtkIdType cellId, 00187 float tol2, int& subId, float pcoords[3], 00188 float *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 float *GetBounds(); 00214 00218 void GetBounds(float bounds[6]); 00219 00221 float *GetCenter(); 00222 00225 void GetCenter(float center[3]); 00226 00230 float GetLength(); 00231 00233 void Initialize(); 00234 00241 virtual void GetScalarRange(float range[2]); 00242 00245 float *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 //BTX 00272 enum FieldDataType 00273 { 00274 DATA_OBJECT_FIELD=0, 00275 POINT_DATA_FIELD=1, 00276 CELL_DATA_FIELD=2 00277 }; 00278 //ETX 00279 00286 int CheckAttributes(); 00287 00288 protected: 00289 // Constructor with default bounds (0,1, 0,1, 0,1). 00290 vtkDataSet(); 00291 ~vtkDataSet(); 00292 00293 vtkCellData *CellData; // Scalars, vectors, etc. associated w/ each cell 00294 vtkPointData *PointData; // Scalars, vectors, etc. associated w/ each point 00295 vtkTimeStamp ComputeTime; // Time at which bounds, center, etc. computed 00296 float Bounds[6]; // (xmin,xmax, ymin,ymax, zmin,zmax) geometric bounds 00297 float ScalarRange[2]; 00298 float Center[3]; 00299 00300 private: 00301 void InternalDataSetCopy(vtkDataSet *src); 00302 private: 00303 vtkDataSet(const vtkDataSet&); // Not implemented. 00304 void operator=(const vtkDataSet&); // Not implemented. 00305 }; 00306 00307 inline void vtkDataSet::GetPoint(vtkIdType id, float x[3]) 00308 { 00309 float *pt = this->GetPoint(id); 00310 x[0] = pt[0]; x[1] = pt[1]; x[2] = pt[2]; 00311 } 00312 00313 #endif