VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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;
56 class vtkGenericCell;
57 class vtkIdList;
58 class vtkPointData;
59 
61 {
62 public:
64  void PrintSelf(ostream& os, vtkIndent indent);
65 
69  virtual void CopyStructure(vtkDataSet *ds) = 0;
70 
73  virtual void CopyAttributes(vtkDataSet *ds);
74 
77  virtual vtkIdType GetNumberOfPoints() = 0;
78 
81  virtual vtkIdType GetNumberOfCells() = 0;
82 
85  virtual double *GetPoint(vtkIdType ptId) = 0;
86 
90  virtual void GetPoint(vtkIdType id, double x[3]);
91 
93  virtual vtkCellIterator* NewCellIterator();
94 
97  virtual vtkCell *GetCell(vtkIdType cellId) = 0;
98 
103  virtual void GetCell(vtkIdType cellId, vtkGenericCell *cell) = 0;
104 
113  virtual void GetCellBounds(vtkIdType cellId, double bounds[6]);
114 
118  virtual int GetCellType(vtkIdType cellId) = 0;
119 
127  virtual void GetCellTypes(vtkCellTypes *types);
128 
132  virtual void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds) = 0;
133 
137  virtual void GetPointCells(vtkIdType ptId, vtkIdList *cellIds) = 0;
138 
140 
144  virtual void GetCellNeighbors(vtkIdType cellId, vtkIdList *ptIds,
145  vtkIdList *cellIds);
147 
149 
153  vtkIdType FindPoint(double x, double y, double z)
154  {
155  double xyz[3];
156  xyz[0] = x; xyz[1] = y; xyz[2] = z;
157  return this->FindPoint (xyz);
158  }
159  virtual vtkIdType FindPoint(double x[3]) = 0;
161 
163 
171  virtual vtkIdType FindCell(double x[3], vtkCell *cell, vtkIdType cellId,
172  double tol2, int& subId, double pcoords[3],
173  double *weights) = 0;
175 
177 
182  virtual vtkIdType FindCell(double x[3], vtkCell *cell,
183  vtkGenericCell *gencell, vtkIdType cellId,
184  double tol2, int& subId, double pcoords[3],
185  double *weights) = 0;
187 
189 
195  virtual vtkCell *FindAndGetCell(double x[3], vtkCell *cell, vtkIdType cellId,
196  double tol2, int& subId, double pcoords[3],
197  double *weights);
199 
202  unsigned long int GetMTime();
203 
206  vtkCellData *GetCellData() {return this->CellData;};
207 
210  vtkPointData *GetPointData() {return this->PointData;};
211 
214  virtual void Squeeze();
215 
218  virtual void ComputeBounds();
219 
222  double *GetBounds();
223 
227  void GetBounds(double bounds[6]);
228 
230  double *GetCenter();
231 
234  void GetCenter(double center[3]);
235 
239  double GetLength();
240 
242  void Initialize();
243 
252  virtual void GetScalarRange(double range[2]);
253 
261  double *GetScalarRange();
262 
266  virtual int GetMaxCellSize() = 0;
267 
273  unsigned long GetActualMemorySize();
274 
276 
278  {return VTK_DATA_SET;}
280 
282 
284  void DeepCopy(vtkDataObject *src);
286 
287 //BTX
289  {
290  DATA_OBJECT_FIELD=0,
291  POINT_DATA_FIELD=1,
292  CELL_DATA_FIELD=2
293  };
294 //ETX
295 
302  int CheckAttributes();
303 
305 
307  virtual void GenerateGhostLevelArray(int update_piece,
308  int update_num_pieces,
309  int update_ghost_level,
310  int* whole_extent,
311  vtkExtentTranslator* translator);
313 
314  //BTX
316 
318  static vtkDataSet* GetData(vtkInformationVector* v, int i=0);
319  //ETX
321 
327 
330  virtual vtkIdType GetNumberOfElements(int type);
331 
332 protected:
333  // Constructor with default bounds (0,1, 0,1, 0,1).
334  vtkDataSet();
335  ~vtkDataSet();
336 
339  virtual void ComputeScalarRange();
340 
341  vtkCellData *CellData; // Scalars, vectors, etc. associated w/ each cell
342  vtkPointData *PointData; // Scalars, vectors, etc. associated w/ each point
343  vtkTimeStamp ComputeTime; // Time at which bounds, center, etc. computed
344  double Bounds[6]; // (xmin,xmax, ymin,ymax, zmin,zmax) geometric bounds
345  double Center[3];
346 
347  // Cached scalar range
348  double ScalarRange[2];
349 
350  // Time at which scalar range is computed
352 
353 private:
354  void InternalDataSetCopy(vtkDataSet *src);
355  //BTX
356  friend class vtkImageAlgorithmToDataSetFriendship;
357  //ETX
358 private:
359  vtkDataSet(const vtkDataSet&); // Not implemented.
360  void operator=(const vtkDataSet&); // Not implemented.
361 };
362 
363 inline void vtkDataSet::GetPoint(vtkIdType id, double x[3])
364 {
365  double *pt = this->GetPoint(id);
366  x[0] = pt[0]; x[1] = pt[1]; x[2] = pt[2];
367 }
368 
369 #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:60
vtkCellData * CellData
Definition: vtkDataSet.h:341
vtkPointData * PointData
Definition: vtkDataSet.h:342
record modification and/or execution time
Definition: vtkTimeStamp.h:34
represent and manipulate cell attribute data
Definition: vtkCellData.h:37
unsigned long int GetMTime()
Generates a structured extent from unstructured.
vtkCellData * GetCellData()
Definition: vtkDataSet.h:206
virtual void Initialize()
int vtkIdType
Definition: vtkType.h:268
GLint GLint GLint GLint GLint GLint y
Definition: vtkgl.h:11318
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:619
provides thread-safe access to cells
vtkTimeStamp ScalarRangeComputeTime
Definition: vtkDataSet.h:351
vtkPointData * GetPointData()
Definition: vtkDataSet.h:210
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:58
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:277
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:343
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:153
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