Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

dox/Common/vtkTetra.h

Go to the documentation of this file.
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkTetra.h,v $ 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 =========================================================================*/ 00032 #ifndef __vtkTetra_h 00033 #define __vtkTetra_h 00034 00035 #include "vtkCell3D.h" 00036 00037 class vtkLine; 00038 class vtkTriangle; 00039 class vtkUnstructuredGrid; 00040 00041 class VTK_COMMON_EXPORT vtkTetra : public vtkCell3D 00042 { 00043 public: 00044 static vtkTetra *New(); 00045 vtkTypeRevisionMacro(vtkTetra,vtkCell3D); 00046 00048 00049 virtual void GetEdgePoints(int edgeId, int* &pts); 00050 virtual void GetFacePoints(int faceId, int* &pts); 00052 00054 00055 int GetCellType() {return VTK_TETRA;} 00056 int GetNumberOfEdges() {return 6;} 00057 int GetNumberOfFaces() {return 4;} 00058 vtkCell *GetEdge(int edgeId); 00059 vtkCell *GetFace(int faceId); 00060 void Contour(double value, vtkDataArray *cellScalars, 00061 vtkPointLocator *locator, vtkCellArray *verts, 00062 vtkCellArray *lines, vtkCellArray *polys, 00063 vtkPointData *inPd, vtkPointData *outPd, 00064 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd); 00065 void Clip(double value, vtkDataArray *cellScalars, 00066 vtkPointLocator *locator, vtkCellArray *connectivity, 00067 vtkPointData *inPd, vtkPointData *outPd, 00068 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd, 00069 int insideOut); 00070 int EvaluatePosition(double x[3], double* closestPoint, 00071 int& subId, double pcoords[3], 00072 double& dist2, double *weights); 00073 void EvaluateLocation(int& subId, double pcoords[3], double x[3], 00074 double *weights); 00075 int IntersectWithLine(double p1[3], double p2[3], double tol, double& t, 00076 double x[3], double pcoords[3], int& subId); 00077 int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts); 00078 void Derivatives(int subId, double pcoords[3], double *values, 00079 int dim, double *derivs); 00080 virtual double *GetParametricCoords(); 00082 00086 int CellBoundary(int subId, double pcoords[3], vtkIdList *pts); 00087 00089 int GetParametricCenter(double pcoords[3]); 00090 00093 double GetParametricDistance(double pcoords[3]); 00094 00096 00097 static void TetraCenter(double p1[3], double p2[3], double p3[3], double p4[3], 00098 double center[3]); 00100 00102 00105 static double Circumsphere(double p1[3], double p2[3], double p3[3], 00106 double p4[3], double center[3]); 00108 00110 00113 static double Insphere(double p1[3], double p2[3], double p3[3], 00114 double p4[3], double center[3]); 00116 00118 00129 static int BarycentricCoords(double x[3], double x1[3], double x2[3], 00130 double x3[3], double x4[3], double bcoords[4]); 00132 00134 00136 static double ComputeVolume(double p1[3], double p2[3], double p3[3], 00137 double p4[3]); 00139 00143 int JacobianInverse(double **inverse, double derivs[12]); 00144 00146 00147 static void InterpolationFunctions(double pcoords[3], double weights[4]); 00148 static void InterpolationDerivs(double derivs[12]); 00149 static int *GetEdgeArray(int edgeId); 00150 static int *GetFaceArray(int faceId); 00152 00153 protected: 00154 vtkTetra(); 00155 ~vtkTetra(); 00156 00157 vtkLine *Line; 00158 vtkTriangle *Triangle; 00159 00160 private: 00161 vtkTetra(const vtkTetra&); // Not implemented. 00162 void operator=(const vtkTetra&); // Not implemented. 00163 }; 00164 00165 inline int vtkTetra::GetParametricCenter(double pcoords[3]) 00166 { 00167 pcoords[0] = pcoords[1] = pcoords[2] = 0.25; 00168 return 0; 00169 } 00170 00171 #endif 00172 00173 00174