1 /*=========================================================================
3 Program: Visualization Toolkit
4 Module: $RCSfile: vtkWedge.h,v $
6 Date: $Date: 2003/01/06 20:36:14 $
7 Version: $Revision: 1.26 $
9 Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen
11 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notice for more information.
17 =========================================================================*/
18 // .NAME vtkWedge - a 3D cell that represents a linear wedge
19 // .SECTION Description
20 // vtkWedge is a concrete implementation of vtkCell to represent a linear 3D
21 // wedge. A wedge consists of two triangular and three quadrilateral faces
22 // and is defined by the six points (0-5). vtkWedge uses the standard
23 // isoparametric shape functions for a linear pyramid. The pyramid is defined
24 // by the six points (0-5) where (0,1,2) is the base of the wedge which,
25 // using the right hand rule, forms a triangle whose normal points in
26 // the direction of the opposite triangular face (3,4,5).
31 #include "vtkCell3D.h"
37 class vtkUnstructuredGrid;
39 class VTK_COMMON_EXPORT vtkWedge : public vtkCell3D
42 static vtkWedge *New();
43 vtkTypeRevisionMacro(vtkWedge,vtkCell3D);
46 // See vtkCell3D API for description of these methods.
47 virtual void GetEdgePoints(int edgeId, int* &pts);
48 virtual void GetFacePoints(int faceId, int* &pts);
49 virtual float *GetParametricCoords();
52 // See the vtkCell API for descriptions of these methods.
53 int GetCellType() {return VTK_WEDGE;}
54 int GetCellDimension() {return 3;}
55 int GetNumberOfEdges() {return 9;}
56 int GetNumberOfFaces() {return 5;}
57 vtkCell *GetEdge(int edgeId);
58 vtkCell *GetFace(int faceId);
59 int CellBoundary(int subId, float pcoords[3], vtkIdList *pts);
60 void Contour(float value, vtkDataArray *cellScalars,
61 vtkPointLocator *locator, vtkCellArray *verts,
62 vtkCellArray *lines, vtkCellArray *polys,
63 vtkPointData *inPd, vtkPointData *outPd,
64 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd);
65 int EvaluatePosition(float x[3], float* closestPoint,
66 int& subId, float pcoords[3],
67 float& dist2, float *weights);
68 void EvaluateLocation(int& subId, float pcoords[3], float x[3],
70 int IntersectWithLine(float p1[3], float p2[3], float tol, float& t,
71 float x[3], float pcoords[3], int& subId);
72 int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts);
73 void Derivatives(int subId, float pcoords[3], float *values,
74 int dim, float *derivs);
77 // Return the center of the wedge in parametric coordinates.
78 int GetParametricCenter(float pcoords[3]);
81 // Wedge specific methods for computing interpolation functions and
83 static void InterpolationFunctions(float pcoords[3], float weights[6]);
84 static void InterpolationDerivs(float pcoords[3], float derivs[18]);
85 int JacobianInverse(float pcoords[3], double **inverse, float derivs[18]);
86 static int *GetEdgeArray(int edgeId);
87 static int *GetFaceArray(int faceId);
94 vtkTriangle *Triangle;
98 vtkWedge(const vtkWedge&); // Not implemented.
99 void operator=(const vtkWedge&); // Not implemented.
102 inline int vtkWedge::GetParametricCenter(float pcoords[3])
104 pcoords[0] = pcoords[1] = 0.333333f;