VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkTetra.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00035 #ifndef __vtkTetra_h 00036 #define __vtkTetra_h 00037 00038 #include "vtkCommonDataModelModule.h" // For export macro 00039 #include "vtkCell3D.h" 00040 00041 class vtkLine; 00042 class vtkTriangle; 00043 class vtkUnstructuredGrid; 00044 class vtkIncrementalPointLocator; 00045 00046 class VTKCOMMONDATAMODEL_EXPORT vtkTetra : public vtkCell3D 00047 { 00048 public: 00049 static vtkTetra *New(); 00050 vtkTypeMacro(vtkTetra,vtkCell3D); 00051 void PrintSelf(ostream& os, vtkIndent indent); 00052 00054 00055 virtual void GetEdgePoints(int edgeId, int* &pts); 00056 virtual void GetFacePoints(int faceId, int* &pts); 00058 00060 00061 int GetCellType() {return VTK_TETRA;} 00062 int GetNumberOfEdges() {return 6;} 00063 int GetNumberOfFaces() {return 4;} 00064 vtkCell *GetEdge(int edgeId); 00065 vtkCell *GetFace(int faceId); 00066 void Contour(double value, vtkDataArray *cellScalars, 00067 vtkIncrementalPointLocator *locator, vtkCellArray *verts, 00068 vtkCellArray *lines, vtkCellArray *polys, 00069 vtkPointData *inPd, vtkPointData *outPd, 00070 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd); 00071 void Clip(double value, vtkDataArray *cellScalars, 00072 vtkIncrementalPointLocator *locator, vtkCellArray *connectivity, 00073 vtkPointData *inPd, vtkPointData *outPd, 00074 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd, 00075 int insideOut); 00076 int EvaluatePosition(double x[3], double* closestPoint, 00077 int& subId, double pcoords[3], 00078 double& dist2, double *weights); 00079 void EvaluateLocation(int& subId, double pcoords[3], double x[3], 00080 double *weights); 00081 int IntersectWithLine(double p1[3], double p2[3], double tol, double& t, 00082 double x[3], double pcoords[3], int& subId); 00083 int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts); 00084 void Derivatives(int subId, double pcoords[3], double *values, 00085 int dim, double *derivs); 00086 virtual double *GetParametricCoords(); 00088 00092 int CellBoundary(int subId, double pcoords[3], vtkIdList *pts); 00093 00095 int GetParametricCenter(double pcoords[3]); 00096 00099 double GetParametricDistance(double pcoords[3]); 00100 00102 00103 static void TetraCenter(double p1[3], double p2[3], double p3[3], double p4[3], 00104 double center[3]); 00106 00108 00111 static double Circumsphere(double p1[3], double p2[3], double p3[3], 00112 double p4[3], double center[3]); 00114 00116 00119 static double Insphere(double p1[3], double p2[3], double p3[3], 00120 double p4[3], double center[3]); 00122 00124 00135 static int BarycentricCoords(double x[3], double x1[3], double x2[3], 00136 double x3[3], double x4[3], double bcoords[4]); 00138 00140 00142 static double ComputeVolume(double p1[3], double p2[3], double p3[3], 00143 double p4[3]); 00145 00149 int JacobianInverse(double **inverse, double derivs[12]); 00150 00152 static void InterpolationFunctions(double pcoords[3], double weights[4]); 00154 static void InterpolationDerivs(double pcoords[3], double derivs[12]); 00156 00158 virtual void InterpolateFunctions(double pcoords[3], double weights[4]) 00159 { 00160 vtkTetra::InterpolationFunctions(pcoords,weights); 00161 } 00162 virtual void InterpolateDerivs(double pcoords[3], double derivs[12]) 00163 { 00164 vtkTetra::InterpolationDerivs(pcoords,derivs); 00165 } 00167 00169 00171 static int *GetEdgeArray(int edgeId); 00172 static int *GetFaceArray(int faceId); 00174 00175 protected: 00176 vtkTetra(); 00177 ~vtkTetra(); 00178 00179 vtkLine *Line; 00180 vtkTriangle *Triangle; 00181 00182 private: 00183 vtkTetra(const vtkTetra&); // Not implemented. 00184 void operator=(const vtkTetra&); // Not implemented. 00185 }; 00186 00187 inline int vtkTetra::GetParametricCenter(double pcoords[3]) 00188 { 00189 pcoords[0] = pcoords[1] = pcoords[2] = 0.25; 00190 return 0; 00191 } 00192 00193 #endif 00194 00195 00196