VTK
dox/Filtering/vtkPyramid.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkPyramid.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 =========================================================================*/
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 class vtkIncrementalPointLocator;
00046 
00047 class VTK_FILTERING_EXPORT vtkPyramid : public vtkCell3D
00048 {
00049 public:
00050   static vtkPyramid *New();
00051   vtkTypeMacro(vtkPyramid,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_PYRAMID;}
00063   int GetCellDimension() {return 3;}
00064   int GetNumberOfEdges() {return 8;}
00065   int GetNumberOfFaces() {return 5;}
00066   vtkCell *GetEdge(int edgeId);
00067   vtkCell *GetFace(int faceId);
00068   int CellBoundary(int subId, double pcoords[3], vtkIdList *pts);
00069   void Contour(double value, vtkDataArray *cellScalars,
00070                vtkIncrementalPointLocator *locator, vtkCellArray *verts,
00071                vtkCellArray *lines, vtkCellArray *polys,
00072                vtkPointData *inPd, vtkPointData *outPd,
00073                vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd);
00074   int EvaluatePosition(double x[3], double* closestPoint,
00075                        int& subId, double pcoords[3],
00076                        double& dist2, double *weights);
00077   void EvaluateLocation(int& subId, double pcoords[3], double x[3],
00078                         double *weights);
00079   int IntersectWithLine(double p1[3], double p2[3], double tol, double& t,
00080                         double x[3], double pcoords[3], int& subId);
00081   int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts);
00082   void Derivatives(int subId, double pcoords[3], double *values,
00083                    int dim, double *derivs);
00084   virtual double *GetParametricCoords();
00086 
00088   int GetParametricCenter(double pcoords[3]);
00089 
00091 
00093   static void InterpolationFunctions(double pcoords[3], double weights[5]);
00094   // Description:
00095   // @deprecated Replaced by vtkPyramid::InterpolateDerivs as of VTK 5.2
00096   static void InterpolationDerivs(double pcoords[3], double derivs[15]);
00097   // Description:
00098   // Compute the interpolation functions/derivatives
00099   // (aka shape functions/derivatives)
00100   virtual void InterpolateFunctions(double pcoords[3], double weights[5])
00101     {
00102     vtkPyramid::InterpolationFunctions(pcoords,weights);
00103     }
00104   virtual void InterpolateDerivs(double pcoords[3], double derivs[15])
00105     {
00106     vtkPyramid::InterpolationDerivs(pcoords,derivs);
00107     }
00109 
00110   int JacobianInverse(double pcoords[3], double **inverse, double derivs[15]);
00111 
00113 
00115   static int *GetEdgeArray(int edgeId);
00116   static int *GetFaceArray(int faceId);
00118 
00119 protected:
00120   vtkPyramid();
00121   ~vtkPyramid();
00122 
00123   vtkLine *Line;
00124   vtkTriangle *Triangle;
00125   vtkQuad *Quad;
00126 
00127 private:
00128   vtkPyramid(const vtkPyramid&);  // Not implemented.
00129   void operator=(const vtkPyramid&);  // Not implemented.
00130 };
00131 
00132 //----------------------------------------------------------------------------
00133 inline int vtkPyramid::GetParametricCenter(double pcoords[3])
00134 {
00135   pcoords[0] = pcoords[1] = 0.4;
00136   pcoords[2] = 0.2;
00137   return 0;
00138 }
00139 
00140 #endif
00141 
00142 
00143