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