Main Page Class Hierarchy Alphabetical List Compound List File List Compound 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   Language:  C++
    00006
    00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen
    00008   All rights reserved.
    00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
    00010
    00011      This software is distributed WITHOUT ANY WARRANTY; without even
    00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
    00013      PURPOSE.  See the above copyright notice for more information.
    00014
    00015 =========================================================================*/
    00048 #ifndef __vtkPyramid_h
    00049 #define __vtkPyramid_h
    00050
    00051 #include "vtkCell3D.h"
    00052
    00053 class vtkLine;
    00054 class vtkQuad;
    00055 class vtkTriangle;
    00056 class vtkUnstructuredGrid;
    00057
    00058 class VTK_COMMON_EXPORT vtkPyramid : public vtkCell3D
    00059 {
    00060 public:
    00061   vtkTypeRevisionMacro(vtkPyramid,vtkCell3D);
    00062
    00064   static vtkPyramid *New();
    00065
    00067
    00068   virtual void GetEdgePoints(int edgeId, int* &pts);
    00069   virtual void GetFacePoints(int faceId, int* &pts);
    00070   virtual float *GetParametricCoords();
    00072
    00074
    00075   int GetCellType() {return VTK_PYRAMID;}
    00076   int GetCellDimension() {return 3;}
    00077   int GetNumberOfEdges() {return 8;}
    00078   int GetNumberOfFaces() {return 5;}
    00079   vtkCell *GetEdge(int edgeId);
    00080   vtkCell *GetFace(int faceId);
    00081   int CellBoundary(int subId, float pcoords[3], vtkIdList *pts);
    00082   void Contour(float value, vtkDataArray *cellScalars,
    00083                vtkPointLocator *locator, vtkCellArray *verts,
    00084                vtkCellArray *lines, vtkCellArray *polys,
    00085                vtkPointData *inPd, vtkPointData *outPd,
    00086                vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd);
    00087   int EvaluatePosition(float x[3], float* closestPoint,
    00088                        int& subId, float pcoords[3],
    00089                        float& dist2, float *weights);
    00090   void EvaluateLocation(int& subId, float pcoords[3], float x[3],
    00091                         float *weights);
    00092   int IntersectWithLine(float p1[3], float p2[3], float tol, float& t,
    00093                         float x[3], float pcoords[3], int& subId);
    00094   int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts);
    00095   void Derivatives(int subId, float pcoords[3], float *values,
    00096                    int dim, float *derivs);
    00098
    00100   int GetParametricCenter(float pcoords[3]);
    00101
    00103
    00105   static void InterpolationFunctions(float pcoords[3], float weights[5]);
    00106   static void InterpolationDerivs(float pcoords[3], float derivs[15]);
    00107   int JacobianInverse(float pcoords[3], double **inverse, float derivs[15]);
    00108   static int *GetEdgeArray(int edgeId);
    00109   static int *GetFaceArray(int faceId);
    00111
    00112 protected:
    00113   vtkPyramid();
    00114   ~vtkPyramid();
    00115
    00116   vtkLine *Line;
    00117   vtkTriangle *Triangle;
    00118   vtkQuad *Quad;
    00119
    00120 private:
    00121   vtkPyramid(const vtkPyramid&);  // Not implemented.
    00122   void operator=(const vtkPyramid&);  // Not implemented.
    00123 };
    00124
    00125 inline int vtkPyramid::GetParametricCenter(float pcoords[3])
    00126 {
    00127   pcoords[0] = pcoords[1] = 0.5f;
    00128   pcoords[2] = 0.333333f;
    00129   return 0;
    00130 }
    00131
    00132 #endif
    00133
    00134
    00135