00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00036 #ifndef __vtkPyramid_h
00037 #define __vtkPyramid_h
00038
00039 #include "vtkCell3D.h"
00040
00041 class vtkLine;
00042 class vtkQuad;
00043 class vtkTriangle;
00044 class vtkUnstructuredGrid;
00045
00046 class VTK_FILTERING_EXPORT vtkPyramid : public vtkCell3D
00047 {
00048 public:
00049 static vtkPyramid *New();
00050 vtkTypeRevisionMacro(vtkPyramid,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_PYRAMID;}
00062 int GetCellDimension() {return 3;}
00063 int GetNumberOfEdges() {return 8;}
00064 int GetNumberOfFaces() {return 5;}
00065 vtkCell *GetEdge(int edgeId);
00066 vtkCell *GetFace(int faceId);
00067 int CellBoundary(int subId, double pcoords[3], vtkIdList *pts);
00068 void Contour(double value, vtkDataArray *cellScalars,
00069 vtkPointLocator *locator, vtkCellArray *verts,
00070 vtkCellArray *lines, vtkCellArray *polys,
00071 vtkPointData *inPd, vtkPointData *outPd,
00072 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd);
00073 int EvaluatePosition(double x[3], double* closestPoint,
00074 int& subId, double pcoords[3],
00075 double& dist2, double *weights);
00076 void EvaluateLocation(int& subId, double pcoords[3], double x[3],
00077 double *weights);
00078 int IntersectWithLine(double p1[3], double p2[3], double tol, double& t,
00079 double x[3], double pcoords[3], int& subId);
00080 int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts);
00081 void Derivatives(int subId, double pcoords[3], double *values,
00082 int dim, double *derivs);
00083 virtual double *GetParametricCoords();
00085
00087 int GetParametricCenter(double pcoords[3]);
00088
00090
00092 static void InterpolationFunctions(double pcoords[3], double weights[5]);
00093
00094
00095 static void InterpolationDerivs(double pcoords[3], double derivs[15]);
00096
00097
00098
00099 virtual void InterpolateFunctions(double pcoords[3], double weights[5])
00100 {
00101 vtkPyramid::InterpolationFunctions(pcoords,weights);
00102 }
00103 virtual void InterpolateDerivs(double pcoords[3], double derivs[15])
00104 {
00105 vtkPyramid::InterpolationDerivs(pcoords,derivs);
00106 }
00108
00109 int JacobianInverse(double pcoords[3], double **inverse, double derivs[15]);
00110
00112
00114 static int *GetEdgeArray(int edgeId);
00115 static int *GetFaceArray(int faceId);
00117
00118 protected:
00119 vtkPyramid();
00120 ~vtkPyramid();
00121
00122 vtkLine *Line;
00123 vtkTriangle *Triangle;
00124 vtkQuad *Quad;
00125
00126 private:
00127 vtkPyramid(const vtkPyramid&);
00128 void operator=(const vtkPyramid&);
00129 };
00130
00131
00132 inline int vtkPyramid::GetParametricCenter(double pcoords[3])
00133 {
00134 pcoords[0] = pcoords[1] = 0.4;
00135 pcoords[2] = 0.2;
00136 return 0;
00137 }
00138
00139 #endif
00140
00141
00142