Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

Common/vtkPyramid.h

Go to the documentation of this file.
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_COMMON_EXPORT vtkPyramid : public vtkCell3D
00044 {
00045 public:
00046   vtkTypeRevisionMacro(vtkPyramid,vtkCell3D);
00047 
00049   static vtkPyramid *New();
00050 
00052 
00053   virtual void GetEdgePoints(int edgeId, int* &pts);
00054   virtual void GetFacePoints(int faceId, int* &pts);
00056 
00058 
00059   int GetCellType() {return VTK_PYRAMID;}
00060   int GetCellDimension() {return 3;}
00061   int GetNumberOfEdges() {return 8;}
00062   int GetNumberOfFaces() {return 5;}
00063   vtkCell *GetEdge(int edgeId);
00064   vtkCell *GetFace(int faceId);
00065   int CellBoundary(int subId, double pcoords[3], vtkIdList *pts);
00066   void Contour(double value, vtkDataArray *cellScalars, 
00067                vtkPointLocator *locator, vtkCellArray *verts, 
00068                vtkCellArray *lines, vtkCellArray *polys,
00069                vtkPointData *inPd, vtkPointData *outPd,
00070                vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd);
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   virtual double *GetParametricCoords();
00083 
00085   int GetParametricCenter(double pcoords[3]);
00086 
00088 
00090   static void InterpolationFunctions(double pcoords[3], double weights[5]);
00091   static void InterpolationDerivs(double pcoords[3], double derivs[15]);
00092   int JacobianInverse(double pcoords[3], double **inverse, double derivs[15]);
00093   static int *GetEdgeArray(int edgeId);
00094   static int *GetFaceArray(int faceId);
00096 
00097 protected:
00098   vtkPyramid();
00099   ~vtkPyramid();
00100 
00101   vtkLine *Line;
00102   vtkTriangle *Triangle;
00103   vtkQuad *Quad;
00104 
00105 private:
00106   vtkPyramid(const vtkPyramid&);  // Not implemented.
00107   void operator=(const vtkPyramid&);  // Not implemented.
00108 };
00109 
00110 inline int vtkPyramid::GetParametricCenter(double pcoords[3])
00111 {
00112   pcoords[0] = pcoords[1] = 0.5f;
00113   pcoords[2] = 0.333333f;
00114   return 0;
00115 }
00116 
00117 #endif
00118 
00119 
00120