VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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;
43 class vtkUnstructuredGrid;
45 
46 class VTKCOMMONDATAMODEL_EXPORT vtkTetra : public vtkCell3D
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 
179  vtkLine *Line;
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])
int GetNumberOfFaces()
Definition: vtkTetra.h:63
static void InterpolationFunctions(double pcoords[3], double weights[4])
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
int GetParametricCenter(double pcoords[3])
Definition: vtkTetra.h:187
a 3D cell that represents a tetrahedron
Definition: vtkTetra.h:46
virtual void InterpolateFunctions(double pcoords[3], double weights[4])
Definition: vtkTetra.h:158
vtkLine * Line
Definition: vtkTetra.h:179
object to represent cell connectivity
Definition: vtkCellArray.h:49
a cell that represents a triangle
Definition: vtkTriangle.h:40
int GetNumberOfEdges()
Definition: vtkTetra.h:62
vtkTriangle * Triangle
Definition: vtkTetra.h:180