VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkPentagonalPrism.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 =========================================================================*/ 00037 #ifndef __vtkPentagonalPrism_h 00038 #define __vtkPentagonalPrism_h 00039 00040 #include "vtkCell3D.h" 00041 00042 class vtkLine; 00043 class vtkPolygon; 00044 class vtkQuad; 00045 class vtkTriangle; 00046 00047 class VTK_FILTERING_EXPORT vtkPentagonalPrism : public vtkCell3D 00048 { 00049 public: 00050 static vtkPentagonalPrism *New(); 00051 vtkTypeMacro(vtkPentagonalPrism,vtkCell3D); 00052 void PrintSelf(ostream& os, vtkIndent indent); 00053 00055 00056 virtual void GetEdgePoints(int edgeId, int* &pts); 00057 virtual void GetFacePoints(int faceId, int* &pts); 00059 00061 00062 int GetCellType() {return VTK_PENTAGONAL_PRISM;}; 00063 int GetCellDimension() {return 3;}; 00064 int GetNumberOfEdges() {return 15;}; 00065 int GetNumberOfFaces() {return 7;}; 00066 vtkCell *GetEdge(int edgeId); 00067 vtkCell *GetFace(int faceId); 00068 int CellBoundary(int subId, double pcoords[3], vtkIdList *pts); 00070 00071 int EvaluatePosition(double x[3], double* closestPoint, 00072 int& subId, double pcoords[3], 00073 double& dist2, double *weights); 00074 void EvaluateLocation(int& subId, double pcoords[3], double x[3], 00075 double *weights); 00076 int IntersectWithLine(double p1[3], double p2[3], double tol, double& t, 00077 double x[3], double pcoords[3], int& subId); 00078 int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts); 00079 void Derivatives(int subId, double pcoords[3], double *values, 00080 int dim, double *derivs); 00081 double *GetParametricCoords(); 00082 00084 int GetParametricCenter(double pcoords[3]); 00085 00087 00089 static void InterpolationFunctions(double pcoords[3], double weights[10]); 00090 // Description: 00091 // @deprecated Replaced by vtkPentagonalPrism::InterpolateDerivs as of VTK 5.2 00092 static void InterpolationDerivs(double pcoords[3], double derivs[30]); 00093 // Description: 00094 // Compute the interpolation functions/derivatives 00095 // (aka shape functions/derivatives) 00096 virtual void InterpolateFunctions(double pcoords[3], double weights[10]) 00097 { 00098 vtkPentagonalPrism::InterpolationFunctions(pcoords, weights); 00099 } 00100 virtual void InterpolateDerivs(double pcoords[3], double derivs[30]) 00101 { 00102 vtkPentagonalPrism::InterpolationDerivs(pcoords, derivs); 00103 } 00105 00107 00109 static int *GetEdgeArray(int edgeId); 00110 static int *GetFaceArray(int faceId); 00112 00116 void JacobianInverse(double pcoords[3], double **inverse, double derivs[30]); 00117 00118 protected: 00119 vtkPentagonalPrism(); 00120 ~vtkPentagonalPrism(); 00121 00122 vtkLine *Line; 00123 vtkQuad *Quad; 00124 vtkPolygon *Polygon; 00125 vtkTriangle *Triangle; 00126 00127 private: 00128 vtkPentagonalPrism(const vtkPentagonalPrism&); // Not implemented. 00129 void operator=(const vtkPentagonalPrism&); // Not implemented. 00130 }; 00131 00132 //---------------------------------------------------------------------------- 00133 inline int vtkPentagonalPrism::GetParametricCenter(double pcoords[3]) 00134 { 00135 pcoords[0] = pcoords[1] = 0.5; 00136 pcoords[2] = 0.5; 00137 00138 return 0; 00139 } 00140 #endif 00141 00142