00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00046 #ifndef __vtkPyramid_h
00047 #define __vtkPyramid_h
00048
00049 #include "vtkCell3D.h"
00050
00051 class vtkLine;
00052 class vtkQuad;
00053 class vtkTriangle;
00054 class vtkUnstructuredGrid;
00055
00056 class VTK_FILTERING_EXPORT vtkPyramid : public vtkCell3D
00057 {
00058 public:
00059 vtkTypeRevisionMacro(vtkPyramid,vtkCell3D);
00060 void PrintSelf(ostream& os, vtkIndent indent);
00061
00063 static vtkPyramid *New();
00064
00066
00067 virtual void GetEdgePoints(int edgeId, int* &pts);
00068 virtual void GetFacePoints(int faceId, int* &pts);
00070
00072
00073 int GetCellType() {return VTK_PYRAMID;}
00074 int GetCellDimension() {return 3;}
00075 int GetNumberOfEdges() {return 8;}
00076 int GetNumberOfFaces() {return 5;}
00077 vtkCell *GetEdge(int edgeId);
00078 vtkCell *GetFace(int faceId);
00079 int CellBoundary(int subId, double pcoords[3], vtkIdList *pts);
00080 void Contour(double value, vtkDataArray *cellScalars,
00081 vtkPointLocator *locator, vtkCellArray *verts,
00082 vtkCellArray *lines, vtkCellArray *polys,
00083 vtkPointData *inPd, vtkPointData *outPd,
00084 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd);
00085 int EvaluatePosition(double x[3], double* closestPoint,
00086 int& subId, double pcoords[3],
00087 double& dist2, double *weights);
00088 void EvaluateLocation(int& subId, double pcoords[3], double x[3],
00089 double *weights);
00090 int IntersectWithLine(double p1[3], double p2[3], double tol, double& t,
00091 double x[3], double pcoords[3], int& subId);
00092 int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts);
00093 void Derivatives(int subId, double pcoords[3], double *values,
00094 int dim, double *derivs);
00095 virtual double *GetParametricCoords();
00097
00099 int GetParametricCenter(double pcoords[3]);
00100
00102
00104 static void InterpolationFunctions(double pcoords[3], double weights[5]);
00105 static void InterpolationDerivs(double pcoords[3], double derivs[15]);
00106 int JacobianInverse(double pcoords[3], double **inverse, double derivs[15]);
00107 static int *GetEdgeArray(int edgeId);
00108 static int *GetFaceArray(int faceId);
00110
00111 protected:
00112 vtkPyramid();
00113 ~vtkPyramid();
00114
00115 vtkLine *Line;
00116 vtkTriangle *Triangle;
00117 vtkQuad *Quad;
00118
00119 private:
00120 vtkPyramid(const vtkPyramid&);
00121 void operator=(const vtkPyramid&);
00122 };
00123
00124
00125 inline int vtkPyramid::GetParametricCenter(double pcoords[3])
00126 {
00127 pcoords[0] = pcoords[1] = 0.5;
00128 pcoords[2] = 0.333333;
00129 return 0;
00130 }
00131
00132 #endif
00133
00134
00135