VTK
vtkDataSet.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkDataSet.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
45 #ifndef vtkDataSet_h
46 #define vtkDataSet_h
47 
48 #include "vtkCommonDataModelModule.h" // For export macro
49 #include "vtkDataObject.h"
50 
51 class vtkCell;
52 class vtkCellData;
53 class vtkCellIterator;
54 class vtkCellTypes;
55 class vtkGenericCell;
56 class vtkIdList;
57 class vtkPointData;
58 
60 {
61 public:
63  void PrintSelf(ostream& os, vtkIndent indent);
64 
68  virtual void CopyStructure(vtkDataSet *ds) = 0;
69 
72  virtual void CopyAttributes(vtkDataSet *ds);
73 
76  virtual vtkIdType GetNumberOfPoints() = 0;
77 
80  virtual vtkIdType GetNumberOfCells() = 0;
81 
84  virtual double *GetPoint(vtkIdType ptId) = 0;
85 
89  virtual void GetPoint(vtkIdType id, double x[3]);
90 
92  virtual vtkCellIterator* NewCellIterator();
93 
96  virtual vtkCell *GetCell(vtkIdType cellId) = 0;
97 
102  virtual void GetCell(vtkIdType cellId, vtkGenericCell *cell) = 0;
103 
112  virtual void GetCellBounds(vtkIdType cellId, double bounds[6]);
113 
117  virtual int GetCellType(vtkIdType cellId) = 0;
118 
126  virtual void GetCellTypes(vtkCellTypes *types);
127 
131  virtual void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds) = 0;
132 
136  virtual void GetPointCells(vtkIdType ptId, vtkIdList *cellIds) = 0;
137 
139 
143  virtual void GetCellNeighbors(vtkIdType cellId, vtkIdList *ptIds,
144  vtkIdList *cellIds);
146 
148 
152  vtkIdType FindPoint(double x, double y, double z)
153  {
154  double xyz[3];
155  xyz[0] = x; xyz[1] = y; xyz[2] = z;
156  return this->FindPoint (xyz);
157  }
158  virtual vtkIdType FindPoint(double x[3]) = 0;
160 
162 
170  virtual vtkIdType FindCell(double x[3], vtkCell *cell, vtkIdType cellId,
171  double tol2, int& subId, double pcoords[3],
172  double *weights) = 0;
174 
176 
181  virtual vtkIdType FindCell(double x[3], vtkCell *cell,
182  vtkGenericCell *gencell, vtkIdType cellId,
183  double tol2, int& subId, double pcoords[3],
184  double *weights) = 0;
186 
188 
194  virtual vtkCell *FindAndGetCell(double x[3], vtkCell *cell, vtkIdType cellId,
195  double tol2, int& subId, double pcoords[3],
196  double *weights);
198 
201  unsigned long int GetMTime();
202 
205  vtkCellData *GetCellData() {return this->CellData;};
206 
209  vtkPointData *GetPointData() {return this->PointData;};
210 
213  virtual void Squeeze();
214 
217  virtual void ComputeBounds();
218 
221  double *GetBounds();
222 
226  void GetBounds(double bounds[6]);
227 
229  double *GetCenter();
230 
233  void GetCenter(double center[3]);
234 
238  double GetLength();
239 
241  void Initialize();
242 
251  virtual void GetScalarRange(double range[2]);
252 
260  double *GetScalarRange();
261 
265  virtual int GetMaxCellSize() = 0;
266 
272  unsigned long GetActualMemorySize();
273 
275 
277  {return VTK_DATA_SET;}
279 
281 
283  void DeepCopy(vtkDataObject *src);
285 
286 //BTX
288  {
289  DATA_OBJECT_FIELD=0,
290  POINT_DATA_FIELD=1,
291  CELL_DATA_FIELD=2
292  };
293 //ETX
294 
301  int CheckAttributes();
302 
306  virtual void GenerateGhostLevelArray(int zeroExt[6]);
307 
308  //BTX
310 
312  static vtkDataSet* GetData(vtkInformationVector* v, int i=0);
313  //ETX
315 
321 
324  virtual vtkIdType GetNumberOfElements(int type);
325 
326 protected:
327  // Constructor with default bounds (0,1, 0,1, 0,1).
328  vtkDataSet();
329  ~vtkDataSet();
330 
333  virtual void ComputeScalarRange();
334 
335  vtkCellData *CellData; // Scalars, vectors, etc. associated w/ each cell
336  vtkPointData *PointData; // Scalars, vectors, etc. associated w/ each point
337  vtkTimeStamp ComputeTime; // Time at which bounds, center, etc. computed
338  double Bounds[6]; // (xmin,xmax, ymin,ymax, zmin,zmax) geometric bounds
339  double Center[3];
340 
341  // Cached scalar range
342  double ScalarRange[2];
343 
344  // Time at which scalar range is computed
346 
347 private:
348  void InternalDataSetCopy(vtkDataSet *src);
349  //BTX
350  friend class vtkImageAlgorithmToDataSetFriendship;
351  //ETX
352 private:
353  vtkDataSet(const vtkDataSet&); // Not implemented.
354  void operator=(const vtkDataSet&); // Not implemented.
355 };
356 
357 inline void vtkDataSet::GetPoint(vtkIdType id, double x[3])
358 {
359  double *pt = this->GetPoint(id);
360  x[0] = pt[0]; x[1] = pt[1]; x[2] = pt[2];
361 }
362 
363 #endif
static vtkDataObject * GetData(vtkInformation *info)
GLuint GLuint GLsizei GLenum type
Definition: vtkgl.h:11315
virtual vtkFieldData * GetAttributesAsFieldData(int type)
represent and manipulate point attribute data
Definition: vtkPointData.h:36
const GLdouble * v
Definition: vtkgl.h:11595
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:59
vtkCellData * CellData
Definition: vtkDataSet.h:335
vtkPointData * PointData
Definition: vtkDataSet.h:336
record modification and/or execution time
Definition: vtkTimeStamp.h:34
represent and manipulate cell attribute data
Definition: vtkCellData.h:37
unsigned long int GetMTime()
vtkCellData * GetCellData()
Definition: vtkDataSet.h:205
virtual void Initialize()
int vtkIdType
Definition: vtkType.h:281
GLint GLint GLint GLint GLint GLint y
Definition: vtkgl.h:11318
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:632
provides thread-safe access to cells
vtkTimeStamp ScalarRangeComputeTime
Definition: vtkDataSet.h:345
vtkPointData * GetPointData()
Definition: vtkDataSet.h:209
GLdouble GLdouble z
Definition: vtkgl.h:11754
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
abstract class to specify cell behavior
Definition: vtkCell.h:61
GLenum src
Definition: vtkgl.h:12525
const GLbyte * weights
Definition: vtkgl.h:12766
a simple class to control print indentation
Definition: vtkIndent.h:38
list of point or cell ids
Definition: vtkIdList.h:35
#define VTK_DATA_SET
Definition: vtkType.h:74
int GetDataObjectType()
Definition: vtkDataSet.h:276
void PrintSelf(ostream &os, vtkIndent indent)
GLsizei GLenum GLenum * types
Definition: vtkgl.h:14417
virtual unsigned long GetActualMemorySize()
virtual vtkIdType GetNumberOfElements(int type)
vtkTimeStamp ComputeTime
Definition: vtkDataSet.h:337
Store zero or more vtkInformation instances.
Efficient cell iterator for vtkDataSet topologies.
virtual double * GetPoint(vtkIdType ptId)=0
general representation of visualization data
Definition: vtkDataObject.h:64
vtkIdType FindPoint(double x, double y, double z)
Definition: vtkDataSet.h:152
object provides direct access to cells in vtkCellArray and type information
Definition: vtkCellTypes.h:51
GLenum GLint * range
Definition: vtkgl.h:14180
virtual void DeepCopy(vtkDataObject *src)
#define VTKCOMMONDATAMODEL_EXPORT
virtual void ShallowCopy(vtkDataObject *src)
represent and manipulate fields of data
Definition: vtkFieldData.h:55