VTK
vtkTetra.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkTetra.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 =========================================================================*/
35 #ifndef vtkTetra_h
36 #define vtkTetra_h
37 
38 #include "vtkCommonDataModelModule.h" // For export macro
39 #include "vtkCell3D.h"
40 
41 class vtkLine;
42 class vtkTriangle;
45 
47 {
48 public:
49  static vtkTetra *New();
50  vtkTypeMacro(vtkTetra,vtkCell3D);
51  void PrintSelf(ostream& os, vtkIndent indent);
52 
54 
55  virtual void GetEdgePoints(int edgeId, int* &pts);
56  virtual void GetFacePoints(int faceId, int* &pts);
58 
60 
61  int GetCellType() {return VTK_TETRA;}
62  int GetNumberOfEdges() {return 6;}
63  int GetNumberOfFaces() {return 4;}
64  vtkCell *GetEdge(int edgeId);
65  vtkCell *GetFace(int faceId);
66  void Contour(double value, vtkDataArray *cellScalars,
68  vtkCellArray *lines, vtkCellArray *polys,
69  vtkPointData *inPd, vtkPointData *outPd,
70  vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd);
71  void Clip(double value, vtkDataArray *cellScalars,
72  vtkIncrementalPointLocator *locator, vtkCellArray *connectivity,
73  vtkPointData *inPd, vtkPointData *outPd,
74  vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd,
75  int insideOut);
76  int EvaluatePosition(double x[3], double* closestPoint,
77  int& subId, double pcoords[3],
78  double& dist2, double *weights);
79  void EvaluateLocation(int& subId, double pcoords[3], double x[3],
80  double *weights);
81  int IntersectWithLine(double p1[3], double p2[3], double tol, double& t,
82  double x[3], double pcoords[3], int& subId);
83  int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts);
84  void Derivatives(int subId, double pcoords[3], double *values,
85  int dim, double *derivs);
86  virtual double *GetParametricCoords();
88 
92  int CellBoundary(int subId, double pcoords[3], vtkIdList *pts);
93 
95  int GetParametricCenter(double pcoords[3]);
96 
99  double GetParametricDistance(double pcoords[3]);
100 
102 
103  static void TetraCenter(double p1[3], double p2[3], double p3[3], double p4[3],
104  double center[3]);
106 
108 
111  static double Circumsphere(double p1[3], double p2[3], double p3[3],
112  double p4[3], double center[3]);
114 
116 
119  static double Insphere(double p1[3], double p2[3], double p3[3],
120  double p4[3], double center[3]);
122 
124 
135  static int BarycentricCoords(double x[3], double x1[3], double x2[3],
136  double x3[3], double x4[3], double bcoords[4]);
138 
140 
142  static double ComputeVolume(double p1[3], double p2[3], double p3[3],
143  double p4[3]);
145 
149  int JacobianInverse(double **inverse, double derivs[12]);
150 
152  static void InterpolationFunctions(double pcoords[3], double weights[4]);
154  static void InterpolationDerivs(double pcoords[3], double derivs[12]);
156 
158  virtual void InterpolateFunctions(double pcoords[3], double weights[4])
159  {
160  vtkTetra::InterpolationFunctions(pcoords,weights);
161  }
162  virtual void InterpolateDerivs(double pcoords[3], double derivs[12])
163  {
164  vtkTetra::InterpolationDerivs(pcoords,derivs);
165  }
167 
169 
171  static int *GetEdgeArray(int edgeId);
172  static int *GetFaceArray(int faceId);
174 
175 protected:
176  vtkTetra();
177  ~vtkTetra();
178 
181 
182 private:
183  vtkTetra(const vtkTetra&); // Not implemented.
184  void operator=(const vtkTetra&); // Not implemented.
185 };
186 
187 inline int vtkTetra::GetParametricCenter(double pcoords[3])
188 {
189  pcoords[0] = pcoords[1] = pcoords[2] = 0.25;
190  return 0;
191 }
192 
193 #endif
194 
195 
196 
static void InterpolationDerivs(double pcoords[3], double derivs[12])
represent and manipulate point attribute data
Definition: vtkPointData.h:36
int GetNumberOfFaces()
Definition: vtkTetra.h:63
static void InterpolationFunctions(double pcoords[3], double weights[4])
virtual double * GetParametricCoords()
represent and manipulate cell attribute data
Definition: vtkCellData.h:37
virtual void InterpolateDerivs(double pcoords[3], double derivs[12])
Definition: vtkTetra.h:162
Abstract class in support of both point location and point insertion.
int GetCellType()
Definition: vtkTetra.h:61
virtual int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts)=0
int GetParametricCenter(double pcoords[3])
Definition: vtkTetra.h:187
virtual void EvaluateLocation(int &subId, double pcoords[3], double x[3], double *weights)=0
virtual int EvaluatePosition(double x[3], double *closestPoint, int &subId, double pcoords[3], double &dist2, double *weights)=0
virtual void Clip(double value, vtkDataArray *cellScalars, vtkIncrementalPointLocator *locator, vtkCellArray *connectivity, vtkPointData *inPd, vtkPointData *outPd, vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd, int insideOut)
int vtkIdType
Definition: vtkType.h:275
abstract class to specify 3D cell interface
Definition: vtkCell3D.h:37
a 3D cell that represents a tetrahedron
Definition: vtkTetra.h:46
cell represents a 1D line
Definition: vtkLine.h:34
abstract class to specify cell behavior
Definition: vtkCell.h:61
virtual double GetParametricDistance(double pcoords[3])
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)
a simple class to control print indentation
Definition: vtkIndent.h:38
list of point or cell ids
Definition: vtkIdList.h:35
virtual void Derivatives(int subId, double pcoords[3], double *values, int dim, double *derivs)=0
dataset represents arbitrary combinations of all possible cell types
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
virtual int IntersectWithLine(double p1[3], double p2[3], double tol, double &t, double x[3], double pcoords[3], int &subId)=0
virtual void InterpolateFunctions(double pcoords[3], double weights[4])
Definition: vtkTetra.h:158
virtual void GetFacePoints(int faceId, int *&pts)=0
void PrintSelf(ostream &os, vtkIndent indent)
vtkLine * Line
Definition: vtkTetra.h:179
virtual vtkCell * GetFace(int faceId)=0
object to represent cell connectivity
Definition: vtkCellArray.h:49
virtual vtkCell * GetEdge(int edgeId)=0
a cell that represents a triangle
Definition: vtkTriangle.h:40
virtual int CellBoundary(int subId, double pcoords[3], vtkIdList *pts)=0
static vtkObject * New()
virtual int GetParametricCenter(double pcoords[3])
virtual void GetEdgePoints(int edgeId, int *&pts)=0
int GetNumberOfEdges()
Definition: vtkTetra.h:62
#define VTKCOMMONDATAMODEL_EXPORT
vtkTriangle * Triangle
Definition: vtkTetra.h:180
represent and manipulate 3D points
Definition: vtkPoints.h:38