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

Common/vtkWedge.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkWedge.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 __vtkWedge_h
00049 #define __vtkWedge_h
00050 
00051 #include "vtkCell3D.h"
00052 
00053 class vtkLine;
00054 class vtkTriangle;
00055 class vtkQuad;
00056 
00057 class vtkUnstructuredGrid;
00058 
00059 class VTK_COMMON_EXPORT vtkWedge : public vtkCell3D
00060 {
00061 public:
00062   static vtkWedge *New();
00063   vtkTypeRevisionMacro(vtkWedge,vtkCell3D);
00064 
00066 
00067   virtual void GetEdgePoints(int edgeId, int* &pts);
00068   virtual void GetFacePoints(int faceId, int* &pts);
00069   virtual float *GetParametricCoords();
00071 
00073 
00074   int GetCellType() {return VTK_WEDGE;}
00075   int GetCellDimension() {return 3;}
00076   int GetNumberOfEdges() {return 9;}
00077   int GetNumberOfFaces() {return 5;}
00078   vtkCell *GetEdge(int edgeId);
00079   vtkCell *GetFace(int faceId);
00080   int CellBoundary(int subId, float pcoords[3], vtkIdList *pts);
00081   void Contour(float value, vtkDataArray *cellScalars, 
00082                vtkPointLocator *locator, vtkCellArray *verts, 
00083                vtkCellArray *lines, vtkCellArray *polys,
00084                vtkPointData *inPd, vtkPointData *outPd,
00085                vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd);
00086   int EvaluatePosition(float x[3], float* closestPoint,
00087                        int& subId, float pcoords[3],
00088                        float& dist2, float *weights);
00089   void EvaluateLocation(int& subId, float pcoords[3], float x[3],
00090                         float *weights);
00091   int IntersectWithLine(float p1[3], float p2[3], float tol, float& t,
00092                         float x[3], float pcoords[3], int& subId);
00093   int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts);
00094   void Derivatives(int subId, float pcoords[3], float *values, 
00095                    int dim, float *derivs);
00097 
00099   int GetParametricCenter(float pcoords[3]);
00100 
00102 
00104   static void InterpolationFunctions(float pcoords[3], float weights[6]);
00105   static void InterpolationDerivs(float pcoords[3], float derivs[18]);
00106   int JacobianInverse(float pcoords[3], double **inverse, float derivs[18]);
00107   static int *GetEdgeArray(int edgeId);
00108   static int *GetFaceArray(int faceId);
00110 
00111 protected:
00112   vtkWedge();
00113   ~vtkWedge();
00114 
00115   vtkLine *Line;
00116   vtkTriangle *Triangle;
00117   vtkQuad *Quad;
00118 
00119 private:
00120   vtkWedge(const vtkWedge&);  // Not implemented.
00121   void operator=(const vtkWedge&);  // Not implemented.
00122 };
00123 
00124 inline int vtkWedge::GetParametricCenter(float pcoords[3])
00125 {
00126   pcoords[0] = pcoords[1] = 0.333333f;
00127   pcoords[2] = 0.5f;
00128   return 0;
00129 }
00130 
00131 #endif
00132 
00133 
00134