00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00035 #ifndef __vtkTetra_h
00036 #define __vtkTetra_h
00037
00038 #include "vtkCell3D.h"
00039
00040 class vtkLine;
00041 class vtkTriangle;
00042 class vtkUnstructuredGrid;
00043 class vtkIncrementalPointLocator;
00044
00045 class VTK_FILTERING_EXPORT vtkTetra : public vtkCell3D
00046 {
00047 public:
00048 static vtkTetra *New();
00049 vtkTypeMacro(vtkTetra,vtkCell3D);
00050 void PrintSelf(ostream& os, vtkIndent indent);
00051
00053
00054 virtual void GetEdgePoints(int edgeId, int* &pts);
00055 virtual void GetFacePoints(int faceId, int* &pts);
00057
00059
00060 int GetCellType() {return VTK_TETRA;}
00061 int GetNumberOfEdges() {return 6;}
00062 int GetNumberOfFaces() {return 4;}
00063 vtkCell *GetEdge(int edgeId);
00064 vtkCell *GetFace(int faceId);
00065 void Contour(double value, vtkDataArray *cellScalars,
00066 vtkIncrementalPointLocator *locator, vtkCellArray *verts,
00067 vtkCellArray *lines, vtkCellArray *polys,
00068 vtkPointData *inPd, vtkPointData *outPd,
00069 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd);
00070 void Clip(double value, vtkDataArray *cellScalars,
00071 vtkIncrementalPointLocator *locator, vtkCellArray *connectivity,
00072 vtkPointData *inPd, vtkPointData *outPd,
00073 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd,
00074 int insideOut);
00075 int EvaluatePosition(double x[3], double* closestPoint,
00076 int& subId, double pcoords[3],
00077 double& dist2, double *weights);
00078 void EvaluateLocation(int& subId, double pcoords[3], double x[3],
00079 double *weights);
00080 int IntersectWithLine(double p1[3], double p2[3], double tol, double& t,
00081 double x[3], double pcoords[3], int& subId);
00082 int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts);
00083 void Derivatives(int subId, double pcoords[3], double *values,
00084 int dim, double *derivs);
00085 virtual double *GetParametricCoords();
00087
00091 int CellBoundary(int subId, double pcoords[3], vtkIdList *pts);
00092
00094 int GetParametricCenter(double pcoords[3]);
00095
00098 double GetParametricDistance(double pcoords[3]);
00099
00101
00102 static void TetraCenter(double p1[3], double p2[3], double p3[3], double p4[3],
00103 double center[3]);
00105
00107
00110 static double Circumsphere(double p1[3], double p2[3], double p3[3],
00111 double p4[3], double center[3]);
00113
00115
00118 static double Insphere(double p1[3], double p2[3], double p3[3],
00119 double p4[3], double center[3]);
00121
00123
00134 static int BarycentricCoords(double x[3], double x1[3], double x2[3],
00135 double x3[3], double x4[3], double bcoords[4]);
00137
00139
00141 static double ComputeVolume(double p1[3], double p2[3], double p3[3],
00142 double p4[3]);
00144
00148 int JacobianInverse(double **inverse, double derivs[12]);
00149
00151
00152 static void InterpolationFunctions(double pcoords[3], double weights[4]);
00153
00154
00155 static void InterpolationDerivs(double pcoords[3], double derivs[12]);
00156
00157
00158
00159 virtual void InterpolateFunctions(double pcoords[3], double weights[4])
00160 {
00161 vtkTetra::InterpolationFunctions(pcoords,weights);
00162 }
00163 virtual void InterpolateDerivs(double pcoords[3], double derivs[12])
00164 {
00165 vtkTetra::InterpolationDerivs(pcoords,derivs);
00166 }
00168
00170
00172 static int *GetEdgeArray(int edgeId);
00173 static int *GetFaceArray(int faceId);
00175
00176 protected:
00177 vtkTetra();
00178 ~vtkTetra();
00179
00180 vtkLine *Line;
00181 vtkTriangle *Triangle;
00182
00183 private:
00184 vtkTetra(const vtkTetra&);
00185 void operator=(const vtkTetra&);
00186 };
00187
00188 inline int vtkTetra::GetParametricCenter(double pcoords[3])
00189 {
00190 pcoords[0] = pcoords[1] = pcoords[2] = 0.25;
00191 return 0;
00192 }
00193
00194 #endif
00195
00196
00197