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 "vtkCell3D.h"
39 
40 class vtkLine;
41 class vtkTriangle;
42 class vtkUnstructuredGrid;
43 class vtkIncrementalPointLocator;
44 
45 class VTK_FILTERING_EXPORT vtkTetra : public vtkCell3D
46 {
47 public:
48  static vtkTetra *New();
49  vtkTypeMacro(vtkTetra,vtkCell3D);
50  void PrintSelf(ostream& os, vtkIndent indent);
51 
53 
54  virtual void GetEdgePoints(int edgeId, int* &pts);
55  virtual void GetFacePoints(int faceId, int* &pts);
57 
59 
60  int GetCellType() {return VTK_TETRA;}
61  int GetNumberOfEdges() {return 6;}
62  int GetNumberOfFaces() {return 4;}
63  vtkCell *GetEdge(int edgeId);
64  vtkCell *GetFace(int faceId);
65  void Contour(double value, vtkDataArray *cellScalars,
66  vtkIncrementalPointLocator *locator, vtkCellArray *verts,
67  vtkCellArray *lines, vtkCellArray *polys,
68  vtkPointData *inPd, vtkPointData *outPd,
69  vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd);
70  void Clip(double value, vtkDataArray *cellScalars,
71  vtkIncrementalPointLocator *locator, vtkCellArray *connectivity,
72  vtkPointData *inPd, vtkPointData *outPd,
73  vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd,
74  int insideOut);
75  int EvaluatePosition(double x[3], double* closestPoint,
76  int& subId, double pcoords[3],
77  double& dist2, double *weights);
78  void EvaluateLocation(int& subId, double pcoords[3], double x[3],
79  double *weights);
80  int IntersectWithLine(double p1[3], double p2[3], double tol, double& t,
81  double x[3], double pcoords[3], int& subId);
82  int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts);
83  void Derivatives(int subId, double pcoords[3], double *values,
84  int dim, double *derivs);
85  virtual double *GetParametricCoords();
87 
91  int CellBoundary(int subId, double pcoords[3], vtkIdList *pts);
92 
94  int GetParametricCenter(double pcoords[3]);
95 
98  double GetParametricDistance(double pcoords[3]);
99 
101 
102  static void TetraCenter(double p1[3], double p2[3], double p3[3], double p4[3],
103  double center[3]);
105 
107 
110  static double Circumsphere(double p1[3], double p2[3], double p3[3],
111  double p4[3], double center[3]);
113 
115 
118  static double Insphere(double p1[3], double p2[3], double p3[3],
119  double p4[3], double center[3]);
121 
123 
134  static int BarycentricCoords(double x[3], double x1[3], double x2[3],
135  double x3[3], double x4[3], double bcoords[4]);
137 
139 
141  static double ComputeVolume(double p1[3], double p2[3], double p3[3],
142  double p4[3]);
144 
148  int JacobianInverse(double **inverse, double derivs[12]);
149 
151 
152  static void InterpolationFunctions(double pcoords[3], double weights[4]);
153  // Description:
154  // @deprecated Replaced by vtkTetra::InterpolateDerivs as of VTK 5.2
155  static void InterpolationDerivs(double pcoords[3], double derivs[12]);
156  // Description:
157  // Compute the interpolation functions/derivatives
158  // (aka shape functions/derivatives)
159  virtual void InterpolateFunctions(double pcoords[3], double weights[4])
160  {
161  vtkTetra::InterpolationFunctions(pcoords,weights);
162  }
163  virtual void InterpolateDerivs(double pcoords[3], double derivs[12])
164  {
165  vtkTetra::InterpolationDerivs(pcoords,derivs);
166  }
168 
170 
172  static int *GetEdgeArray(int edgeId);
173  static int *GetFaceArray(int faceId);
175 
176 protected:
177  vtkTetra();
178  ~vtkTetra();
179 
182 
183 private:
184  vtkTetra(const vtkTetra&); // Not implemented.
185  void operator=(const vtkTetra&); // Not implemented.
186 };
187 
188 inline int vtkTetra::GetParametricCenter(double pcoords[3])
189 {
190  pcoords[0] = pcoords[1] = pcoords[2] = 0.25;
191  return 0;
192 }
193 
194 #endif
195 
196 
197 
static void InterpolationDerivs(double pcoords[3], double derivs[12])
represent and manipulate point attribute data
Definition: vtkPointData.h:35
int GetNumberOfFaces()
Definition: vtkTetra.h:62
static void InterpolationFunctions(double pcoords[3], double weights[4])
#define VTK_FILTERING_EXPORT
virtual void InterpolateDerivs(double pcoords[3], double derivs[12])
Definition: vtkTetra.h:163
int GetCellType()
Definition: vtkTetra.h:60
int GetParametricCenter(double pcoords[3])
Definition: vtkTetra.h:188
int vtkIdType
Definition: vtkType.h:255
a 3D cell that represents a tetrahedron
Definition: vtkTetra.h:45
cell represents a 1D line
Definition: vtkLine.h:33
a simple class to control print indentation
Definition: vtkIndent.h:37
list of point or cell ids
Definition: vtkIdList.h:34
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:53
virtual void InterpolateFunctions(double pcoords[3], double weights[4])
Definition: vtkTetra.h:159
vtkLine * Line
Definition: vtkTetra.h:180
object to represent cell connectivity
Definition: vtkCellArray.h:48
a cell that represents a triangle
Definition: vtkTriangle.h:39
int GetNumberOfEdges()
Definition: vtkTetra.h:61
vtkTriangle * Triangle
Definition: vtkTetra.h:181
represent and manipulate 3D points
Definition: vtkPoints.h:38