VTK
dox/Filtering/vtkHexagonalPrism.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkHexagonalPrism.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 __vtkHexagonalPrism_h
00038 #define __vtkHexagonalPrism_h
00039 
00040 #include "vtkCell3D.h"
00041 
00042 class vtkLine;
00043 class vtkPolygon;
00044 class vtkQuad;
00045 
00046 class VTK_FILTERING_EXPORT vtkHexagonalPrism : public vtkCell3D
00047 {
00048 public:
00049   static vtkHexagonalPrism *New();
00050   vtkTypeMacro(vtkHexagonalPrism,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_HEXAGONAL_PRISM;};
00062   int GetCellDimension() {return 3;};
00063   int GetNumberOfEdges() {return 18;};
00064   int GetNumberOfFaces() {return 8;};
00065   vtkCell *GetEdge(int edgeId);
00066   vtkCell *GetFace(int faceId);
00067   int CellBoundary(int subId, double pcoords[3], vtkIdList *pts);
00069 
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   double *GetParametricCoords();
00081 
00083   int GetParametricCenter(double pcoords[3]);
00084 
00087   static void InterpolationFunctions(double pcoords[3], double weights[12]);
00090   static void InterpolationDerivs(double pcoords[3], double derivs[36]);
00092 
00094   virtual void InterpolateFunctions(double pcoords[3], double weights[12])
00095     {
00096     vtkHexagonalPrism::InterpolationFunctions(pcoords,weights);
00097     }
00098   virtual void InterpolateDerivs(double pcoords[3], double derivs[36])
00099     {
00100     vtkHexagonalPrism::InterpolationDerivs(pcoords,derivs);
00101     }
00103 
00105 
00107   static int *GetEdgeArray(int edgeId);
00108   static int *GetFaceArray(int faceId);
00110 
00114   void JacobianInverse(double pcoords[3], double **inverse, double derivs[36]);
00115 
00116 protected:
00117   vtkHexagonalPrism();
00118   ~vtkHexagonalPrism();
00119 
00120   vtkLine          *Line;
00121   vtkQuad          *Quad;
00122   vtkPolygon       *Polygon;
00123 
00124 private:
00125   vtkHexagonalPrism(const vtkHexagonalPrism&);  // Not implemented.
00126   void operator=(const vtkHexagonalPrism&);  // Not implemented.
00127 };
00128 
00129 //----------------------------------------------------------------------------
00130 inline int vtkHexagonalPrism::GetParametricCenter(double pcoords[3])
00131 {
00132   pcoords[0] = pcoords[1] = 0.5;
00133   pcoords[2] = 0.5;
00134   return 0;
00135 }
00136 #endif
00137 
00138