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 =========================================================================*/
42 #ifndef vtkCell_h
43 #define vtkCell_h
44 
45 #define VTK_CELL_SIZE 512
46 #define VTK_TOL 1.e-05 // Tolerance for geometric calculation
47 
48 #include "vtkCommonDataModelModule.h" // For export macro
49 #include "vtkObject.h"
50 
51 #include "vtkIdList.h" // Needed for inline methods
52 #include "vtkCellType.h" // Needed to define cell types
53 
54 class vtkCellArray;
55 class vtkCellData;
56 class vtkDataArray;
57 class vtkPointData;
59 class vtkPoints;
60 
62 {
63 public:
65  void PrintSelf(ostream& os, vtkIndent indent);
66 
69  void Initialize(int npts, vtkIdType *pts, vtkPoints *p);
70 
74  virtual void ShallowCopy(vtkCell *c);
75 
78  virtual void DeepCopy(vtkCell *c);
79 
81  virtual int GetCellType() = 0;
82 
84  virtual int GetCellDimension() = 0;
85 
89  virtual int IsLinear() {return 1;}
90 
92 
95  virtual int RequiresInitialization() {return 0;}
96  virtual void Initialize() {}
98 
102  virtual int IsExplicitCell() {return 0;}
103 
105 
108  virtual int RequiresExplicitFaceRepresentation() {return 0;}
109  virtual void SetFaces(vtkIdType *vtkNotUsed(faces)) {}
110  virtual vtkIdType *GetFaces() {return NULL;}
112 
114  vtkPoints *GetPoints() {return this->Points;}
115 
117  vtkIdType GetNumberOfPoints() {return this->PointIds->GetNumberOfIds();}
118 
120  virtual int GetNumberOfEdges() = 0;
121 
123  virtual int GetNumberOfFaces() = 0;
124 
126  vtkIdList *GetPointIds() {return this->PointIds;}
127 
129  vtkIdType GetPointId(int ptId) {return this->PointIds->GetId(ptId);}
130 
132  virtual vtkCell *GetEdge(int edgeId) = 0;
133 
135  virtual vtkCell *GetFace(int faceId) = 0;
136 
142  virtual int CellBoundary(int subId, double pcoords[3], vtkIdList *pts) = 0;
143 
145 
160  virtual int EvaluatePosition(double x[3], double* closestPoint,
161  int& subId, double pcoords[3],
162  double& dist2, double *weights) = 0;
164 
166 
169  virtual void EvaluateLocation(int& subId, double pcoords[3],
170  double x[3], double *weights) = 0;
172 
174 
185  virtual void Contour(double value, vtkDataArray *cellScalars,
186  vtkIncrementalPointLocator *locator, vtkCellArray *verts,
187  vtkCellArray *lines, vtkCellArray *polys,
188  vtkPointData *inPd, vtkPointData *outPd,
189  vtkCellData *inCd, vtkIdType cellId,
190  vtkCellData *outCd) = 0;
192 
194 
205  virtual void Clip(double value, vtkDataArray *cellScalars,
206  vtkIncrementalPointLocator *locator, vtkCellArray *connectivity,
207  vtkPointData *inPd, vtkPointData *outPd,
208  vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd,
209  int insideOut) = 0;
211 
213 
221  virtual int IntersectWithLine(double p1[3], double p2[3],
222  double tol, double& t, double x[3],
223  double pcoords[3], int& subId) = 0;
225 
235  virtual int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts) = 0;
236 
238 
250  virtual void Derivatives(int subId, double pcoords[3], double *values,
251  int dim, double *derivs) = 0;
253 
254 
257  void GetBounds(double bounds[6]);
258 
259 
262  double *GetBounds();
263 
264 
266  double GetLength2();
267 
268 
274  virtual int GetParametricCenter(double pcoords[3]);
275 
276 
282  virtual double GetParametricDistance(double pcoords[3]);
283 
284 
290  virtual int IsPrimaryCell() {return 1;}
291 
292 
300  virtual double *GetParametricCoords();
301 
303 
306  virtual void InterpolateFunctions(double vtkNotUsed(pcoords)[3], double* vtkNotUsed(weight))
307  {
308  }
309  virtual void InterpolateDerivs(double vtkNotUsed(pcoords)[3], double* vtkNotUsed(derivs))
310  {
311  }
313 
314  // left public for quick computational access
317 
318 protected:
321 
322  double Bounds[6];
323 
324 private:
325  vtkCell(const vtkCell&); // Not implemented.
326  void operator=(const vtkCell&); // Not implemented.
327 };
328 
329 #endif
330 
331 
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:39
vtkCell::Initialize
void Initialize(int npts, vtkIdType *pts, vtkPoints *p)
vtkCell::CellBoundary
virtual int CellBoundary(int subId, double pcoords[3], vtkIdList *pts)=0
vtkCell::GetBounds
double * GetBounds()
vtkgl::weights
const GLbyte * weights
Definition: vtkgl.h:12766
vtkCell::DeepCopy
virtual void DeepCopy(vtkCell *c)
vtkCell::Contour
virtual void Contour(double value, vtkDataArray *cellScalars, vtkIncrementalPointLocator *locator, vtkCellArray *verts, vtkCellArray *lines, vtkCellArray *polys, vtkPointData *inPd, vtkPointData *outPd, vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd)=0
vtkCell::ShallowCopy
virtual void ShallowCopy(vtkCell *c)
vtkPointData
represent and manipulate point attribute data
Definition: vtkPointData.h:37
vtkCell::RequiresExplicitFaceRepresentation
virtual int RequiresExplicitFaceRepresentation()
Definition: vtkCell.h:108
vtkIdType
int vtkIdType
Definition: vtkType.h:275
vtkCommonDataModelModule.h
vtkCell::Points
vtkPoints * Points
Definition: vtkCell.h:315
vtkCell::GetCellDimension
virtual int GetCellDimension()=0
vtkCell::Initialize
virtual void Initialize()
Definition: vtkCell.h:96
vtkX3D::weight
@ weight
Definition: vtkX3D.h:532
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkgl::x
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
vtkCell::GetParametricDistance
virtual double GetParametricDistance(double pcoords[3])
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
vtkCell::GetCellType
virtual int GetCellType()=0
vtkCell::InterpolateFunctions
virtual void InterpolateFunctions(double vtkNotUsed(pcoords)[3], double *vtkNotUsed(weight))
Definition: vtkCell.h:306
vtkCell::EvaluateLocation
virtual void EvaluateLocation(int &subId, double pcoords[3], double x[3], double *weights)=0
vtkCell::IsLinear
virtual int IsLinear()
Definition: vtkCell.h:89
vtkNotUsed
#define vtkNotUsed(x)
Definition: vtkSetGet.h:557
vtkgl::value
GLsizei const GLfloat * value
Definition: vtkgl.h:12021
vtkgl::c
const GLubyte * c
Definition: vtkgl.h:15720
vtkCell::Triangulate
virtual int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts)=0
vtkgl::values
GLboolean GLenum GLenum GLvoid * values
Definition: vtkgl.h:11354
vtkCell::GetPointIds
vtkIdList * GetPointIds()
Definition: vtkCell.h:126
vtkCell::GetFaces
virtual vtkIdType * GetFaces()
Definition: vtkCell.h:110
vtkCell::InterpolateDerivs
virtual void InterpolateDerivs(double vtkNotUsed(pcoords)[3], double *vtkNotUsed(derivs))
Definition: vtkCell.h:309
vtkCell::GetBounds
void GetBounds(double bounds[6])
vtkCell
abstract class to specify cell behavior
Definition: vtkCell.h:62
vtkCell::Derivatives
virtual void Derivatives(int subId, double pcoords[3], double *values, int dim, double *derivs)=0
vtkCellData
represent and manipulate cell attribute data
Definition: vtkCellData.h:38
vtkCell::GetFace
virtual vtkCell * GetFace(int faceId)=0
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:50
vtkCellType.h
vtkIncrementalPointLocator
Abstract class in support of both point location and point insertion.
Definition: vtkIncrementalPointLocator.h:54
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:36
vtkCell::GetParametricCoords
virtual double * GetParametricCoords()
vtkCell::IsPrimaryCell
virtual int IsPrimaryCell()
Definition: vtkCell.h:290
vtkCell::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkCell::GetNumberOfEdges
virtual int GetNumberOfEdges()=0
vtkCell::GetNumberOfFaces
virtual int GetNumberOfFaces()=0
vtkCell::IsExplicitCell
virtual int IsExplicitCell()
Definition: vtkCell.h:102
vtkCell::GetNumberOfPoints
vtkIdType GetNumberOfPoints()
Definition: vtkCell.h:117
vtkObject.h
vtkCell::RequiresInitialization
virtual int RequiresInitialization()
Definition: vtkCell.h:95
vtkgl::index
GLuint index
Definition: vtkgl.h:11983
vtkgl::t
GLdouble GLdouble t
Definition: vtkgl.h:11602
vtkCell::SetFaces
virtual void SetFaces(vtkIdType *vtkNotUsed(faces))
Definition: vtkCell.h:109
vtkCell::PointIds
vtkIdList * PointIds
Definition: vtkCell.h:316
vtkCell::Clip
virtual void Clip(double value, vtkDataArray *cellScalars, vtkIncrementalPointLocator *locator, vtkCellArray *connectivity, vtkPointData *inPd, vtkPointData *outPd, vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd, int insideOut)=0
vtkCell::GetEdge
virtual vtkCell * GetEdge(int edgeId)=0
vtkCell::~vtkCell
~vtkCell()
vtkCell::GetPointId
vtkIdType GetPointId(int ptId)
Definition: vtkCell.h:129
vtkCell::GetParametricCenter
virtual int GetParametricCenter(double pcoords[3])
vtkCell::GetLength2
double GetLength2()
vtkgl::p
GLfloat GLfloat p
Definition: vtkgl.h:15717
VTKCOMMONDATAMODEL_EXPORT
#define VTKCOMMONDATAMODEL_EXPORT
Definition: vtkCommonDataModelModule.h:15
vtkCell::GetPoints
vtkPoints * GetPoints()
Definition: vtkCell.h:114
vtkIdList.h
vtkCell::vtkCell
vtkCell()
vtkCell::EvaluatePosition
virtual int EvaluatePosition(double x[3], double *closestPoint, int &subId, double pcoords[3], double &dist2, double *weights)=0
vtkCell::IntersectWithLine
virtual int IntersectWithLine(double p1[3], double p2[3], double tol, double &t, double x[3], double pcoords[3], int &subId)=0