00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00045 #ifndef __vtkTetra_h
00046 #define __vtkTetra_h
00047
00048 #include "vtkCell3D.h"
00049
00050 class vtkLine;
00051 class vtkTriangle;
00052 class vtkUnstructuredGrid;
00053
00054 class VTK_FILTERING_EXPORT vtkTetra : public vtkCell3D
00055 {
00056 public:
00057 static vtkTetra *New();
00058 vtkTypeRevisionMacro(vtkTetra,vtkCell3D);
00059 void PrintSelf(ostream& os, vtkIndent indent);
00060
00062
00063 virtual void GetEdgePoints(int edgeId, int* &pts);
00064 virtual void GetFacePoints(int faceId, int* &pts);
00066
00068
00069 int GetCellType() {return VTK_TETRA;}
00070 int GetNumberOfEdges() {return 6;}
00071 int GetNumberOfFaces() {return 4;}
00072 vtkCell *GetEdge(int edgeId);
00073 vtkCell *GetFace(int faceId);
00074 void Contour(double value, vtkDataArray *cellScalars,
00075 vtkPointLocator *locator, vtkCellArray *verts,
00076 vtkCellArray *lines, vtkCellArray *polys,
00077 vtkPointData *inPd, vtkPointData *outPd,
00078 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd);
00079 void Clip(double value, vtkDataArray *cellScalars,
00080 vtkPointLocator *locator, vtkCellArray *connectivity,
00081 vtkPointData *inPd, vtkPointData *outPd,
00082 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd,
00083 int insideOut);
00084 int EvaluatePosition(double x[3], double* closestPoint,
00085 int& subId, double pcoords[3],
00086 double& dist2, double *weights);
00087 void EvaluateLocation(int& subId, double pcoords[3], double x[3],
00088 double *weights);
00089 int IntersectWithLine(double p1[3], double p2[3], double tol, double& t,
00090 double x[3], double pcoords[3], int& subId);
00091 int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts);
00092 void Derivatives(int subId, double pcoords[3], double *values,
00093 int dim, double *derivs);
00094 virtual double *GetParametricCoords();
00096
00100 int CellBoundary(int subId, double pcoords[3], vtkIdList *pts);
00101
00103 int GetParametricCenter(double pcoords[3]);
00104
00107 double GetParametricDistance(double pcoords[3]);
00108
00110
00111 static void TetraCenter(double p1[3], double p2[3], double p3[3], double p4[3],
00112 double center[3]);
00114
00116
00119 static double Circumsphere(double p1[3], double p2[3], double p3[3],
00120 double p4[3], double center[3]);
00122
00124
00127 static double Insphere(double p1[3], double p2[3], double p3[3],
00128 double p4[3], double center[3]);
00130
00132
00143 static int BarycentricCoords(double x[3], double x1[3], double x2[3],
00144 double x3[3], double x4[3], double bcoords[4]);
00146
00148
00150 static double ComputeVolume(double p1[3], double p2[3], double p3[3],
00151 double p4[3]);
00153
00157 int JacobianInverse(double **inverse, double derivs[12]);
00158
00160
00161 static void InterpolationFunctions(double pcoords[3], double weights[4]);
00162 static void InterpolationDerivs(double derivs[12]);
00163 static int *GetEdgeArray(int edgeId);
00164 static int *GetFaceArray(int faceId);
00166
00167 protected:
00168 vtkTetra();
00169 ~vtkTetra();
00170
00171 vtkLine *Line;
00172 vtkTriangle *Triangle;
00173
00174 private:
00175 vtkTetra(const vtkTetra&);
00176 void operator=(const vtkTetra&);
00177 };
00178
00179 inline int vtkTetra::GetParametricCenter(double pcoords[3])
00180 {
00181 pcoords[0] = pcoords[1] = pcoords[2] = 0.25;
00182 return 0;
00183 }
00184
00185 #endif
00186
00187
00188