VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkPyramid.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 =========================================================================*/ 00033 #ifndef __vtkPyramid_h 00034 #define __vtkPyramid_h 00035 00036 #include "vtkCell3D.h" 00037 00038 class vtkLine; 00039 class vtkQuad; 00040 class vtkTriangle; 00041 class vtkUnstructuredGrid; 00042 00043 class VTK_FILTERING_EXPORT vtkPyramid : public vtkCell3D 00044 { 00045 public: 00046 static vtkPyramid *New(); 00047 vtkTypeRevisionMacro(vtkPyramid,vtkCell3D); 00048 void PrintSelf(ostream& os, vtkIndent indent); 00049 00051 00052 virtual void GetEdgePoints(int edgeId, int* &pts); 00053 virtual void GetFacePoints(int faceId, int* &pts); 00055 00057 00058 int GetCellType() {return VTK_PYRAMID;} 00059 int GetCellDimension() {return 3;} 00060 int GetNumberOfEdges() {return 8;} 00061 int GetNumberOfFaces() {return 5;} 00062 vtkCell *GetEdge(int edgeId); 00063 vtkCell *GetFace(int faceId); 00064 int CellBoundary(int subId, double pcoords[3], vtkIdList *pts); 00065 void Contour(double value, vtkDataArray *cellScalars, 00066 vtkPointLocator *locator, vtkCellArray *verts, 00067 vtkCellArray *lines, vtkCellArray *polys, 00068 vtkPointData *inPd, vtkPointData *outPd, 00069 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd); 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 00084 int GetParametricCenter(double pcoords[3]); 00085 00087 00089 static void InterpolationFunctions(double pcoords[3], double weights[5]); 00090 // Description: 00091 // @deprecated Replaced by vtkPyramid::InterpolateDerivs as of VTK 5.2 00092 static void InterpolationDerivs(double pcoords[3], double derivs[15]); 00093 // Description: 00094 // Compute the interpolation functions/derivatives 00095 // (aka shape functions/derivatives) 00096 virtual void InterpolateFunctions(double pcoords[3], double weights[5]) 00097 { 00098 vtkPyramid::InterpolationFunctions(pcoords,weights); 00099 } 00100 virtual void InterpolateDerivs(double pcoords[3], double derivs[15]) 00101 { 00102 vtkPyramid::InterpolationDerivs(pcoords,derivs); 00103 } 00105 00106 int JacobianInverse(double pcoords[3], double **inverse, double derivs[15]); 00107 00109 00111 static int *GetEdgeArray(int edgeId); 00112 static int *GetFaceArray(int faceId); 00114 00115 protected: 00116 vtkPyramid(); 00117 ~vtkPyramid(); 00118 00119 vtkLine *Line; 00120 vtkTriangle *Triangle; 00121 vtkQuad *Quad; 00122 00123 private: 00124 vtkPyramid(const vtkPyramid&); // Not implemented. 00125 void operator=(const vtkPyramid&); // Not implemented. 00126 }; 00127 00128 //---------------------------------------------------------------------------- 00129 inline int vtkPyramid::GetParametricCenter(double pcoords[3]) 00130 { 00131 pcoords[0] = pcoords[1] = 0.4; 00132 pcoords[2] = 0.2; 00133 return 0; 00134 } 00135 00136 #endif 00137 00138 00139