VTK
vtkCell.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkCell.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 =========================================================================*/
39 #ifndef vtkCell_h
40 #define vtkCell_h
41 
42 #define VTK_CELL_SIZE 512
43 #define VTK_TOL 1.e-05 // Tolerance for geometric calculation
44 
45 #include "vtkCommonDataModelModule.h" // For export macro
46 #include "vtkObject.h"
47 
48 #include "vtkIdList.h" // Needed for inline methods
49 #include "vtkCellType.h" // Needed to define cell types
50 
51 class vtkCellArray;
52 class vtkCellData;
53 class vtkDataArray;
54 class vtkPointData;
56 class vtkPoints;
57 
59 {
60 public:
61  vtkTypeMacro(vtkCell,vtkObject);
62  void PrintSelf(ostream& os, vtkIndent indent);
63 
66  void Initialize(int npts, vtkIdType *pts, vtkPoints *p);
67 
71  virtual void ShallowCopy(vtkCell *c);
72 
75  virtual void DeepCopy(vtkCell *c);
76 
78  virtual int GetCellType() = 0;
79 
81  virtual int GetCellDimension() = 0;
82 
86  virtual int IsLinear() {return 1;}
87 
89 
92  virtual int RequiresInitialization() {return 0;}
93  virtual void Initialize() {}
95 
99  virtual int IsExplicitCell() {return 0;}
100 
102 
105  virtual int RequiresExplicitFaceRepresentation() {return 0;}
106  virtual void SetFaces(vtkIdType *vtkNotUsed(faces)) {}
107  virtual vtkIdType *GetFaces() {return NULL;}
109 
111  vtkPoints *GetPoints() {return this->Points;}
112 
114  vtkIdType GetNumberOfPoints() {return this->PointIds->GetNumberOfIds();}
115 
117  virtual int GetNumberOfEdges() = 0;
118 
120  virtual int GetNumberOfFaces() = 0;
121 
123  vtkIdList *GetPointIds() {return this->PointIds;}
124 
126  vtkIdType GetPointId(int ptId) {return this->PointIds->GetId(ptId);}
127 
129  virtual vtkCell *GetEdge(int edgeId) = 0;
130 
132  virtual vtkCell *GetFace(int faceId) = 0;
133 
139  virtual int CellBoundary(int subId, double pcoords[3], vtkIdList *pts) = 0;
140 
142 
157  virtual int EvaluatePosition(double x[3], double* closestPoint,
158  int& subId, double pcoords[3],
159  double& dist2, double *weights) = 0;
161 
163 
166  virtual void EvaluateLocation(int& subId, double pcoords[3],
167  double x[3], double *weights) = 0;
169 
171 
182  virtual void Contour(double value, vtkDataArray *cellScalars,
183  vtkIncrementalPointLocator *locator, vtkCellArray *verts,
184  vtkCellArray *lines, vtkCellArray *polys,
185  vtkPointData *inPd, vtkPointData *outPd,
186  vtkCellData *inCd, vtkIdType cellId,
187  vtkCellData *outCd) = 0;
189 
191 
202  virtual void Clip(double value, vtkDataArray *cellScalars,
203  vtkIncrementalPointLocator *locator, vtkCellArray *connectivity,
204  vtkPointData *inPd, vtkPointData *outPd,
205  vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd,
206  int insideOut) = 0;
208 
210 
218  virtual int IntersectWithLine(double p1[3], double p2[3],
219  double tol, double& t, double x[3],
220  double pcoords[3], int& subId) = 0;
222 
232  virtual int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts) = 0;
233 
235 
247  virtual void Derivatives(int subId, double pcoords[3], double *values,
248  int dim, double *derivs) = 0;
250 
251 
254  void GetBounds(double bounds[6]);
255 
256 
259  double *GetBounds();
260 
261 
263  double GetLength2();
264 
265 
271  virtual int GetParametricCenter(double pcoords[3]);
272 
273 
279  virtual double GetParametricDistance(double pcoords[3]);
280 
281 
287  virtual int IsPrimaryCell() {return 1;}
288 
289 
297  virtual double *GetParametricCoords();
298 
300 
303  virtual void InterpolateFunctions(double vtkNotUsed(pcoords)[3], double* vtkNotUsed(weight))
304  {
305  }
306  virtual void InterpolateDerivs(double vtkNotUsed(pcoords)[3], double* vtkNotUsed(derivs))
307  {
308  }
310 
311  // left public for quick computational access
314 
315 protected:
316  vtkCell();
317  ~vtkCell();
318 
319  double Bounds[6];
320 
321 private:
322  vtkCell(const vtkCell&); // Not implemented.
323  void operator=(const vtkCell&); // Not implemented.
324 };
325 
326 #endif
327 
328 
vtkIdList * PointIds
Definition: vtkCell.h:313
vtkIdType GetNumberOfPoints()
Definition: vtkCell.h:114
abstract base class for most VTK objects
Definition: vtkObject.h:61
represent and manipulate point attribute data
Definition: vtkPointData.h:36
virtual void InterpolateFunctions(double vtkNotUsed(pcoords)[3], double *vtkNotUsed(weight))
Definition: vtkCell.h:303
vtkPoints * GetPoints()
Definition: vtkCell.h:111
represent and manipulate cell attribute data
Definition: vtkCellData.h:37
Abstract class in support of both point location and point insertion.
void DeepCopy(vtkPistonReference *self, vtkPistonReference *other)
int vtkIdType
Definition: vtkType.h:247
vtkIdType GetPointId(int ptId)
Definition: vtkCell.h:126
virtual int IsLinear()
Definition: vtkCell.h:86
virtual void SetFaces(vtkIdType *vtkNotUsed(faces))
Definition: vtkCell.h:106
abstract class to specify cell behavior
Definition: vtkCell.h:58
virtual void PrintSelf(ostream &os, vtkIndent indent)
vtkPoints * Points
Definition: vtkCell.h:312
a simple class to control print indentation
Definition: vtkIndent.h:38
list of point or cell ids
Definition: vtkIdList.h:35
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
virtual int RequiresInitialization()
Definition: vtkCell.h:92
virtual int RequiresExplicitFaceRepresentation()
Definition: vtkCell.h:105
virtual void InterpolateDerivs(double vtkNotUsed(pcoords)[3], double *vtkNotUsed(derivs))
Definition: vtkCell.h:306
object to represent cell connectivity
Definition: vtkCellArray.h:49
virtual int IsExplicitCell()
Definition: vtkCell.h:99
virtual int IsPrimaryCell()
Definition: vtkCell.h:287
int Contour(vtkDataSet *input, vtkPolyData *output, vtkDataArray *field, float isoValue, bool computeScalars)
vtkIdList * GetPointIds()
Definition: vtkCell.h:123
virtual vtkIdType * GetFaces()
Definition: vtkCell.h:107
virtual void Initialize()
Definition: vtkCell.h:93
#define VTKCOMMONDATAMODEL_EXPORT
represent and manipulate 3D points
Definition: vtkPoints.h:38