1 /*=========================================================================
3 Program: Visualization Toolkit
4 Module: $RCSfile: vtkQuad.h,v $
6 Date: $Date: 2002/12/26 18:24:22 $
7 Version: $Revision: 1.63 $
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 vtkQuad - a cell that represents a 2D quadrilateral
19 // .SECTION Description
20 // vtkQuad is a concrete implementation of vtkCell to represent a 2D
21 // quadrilateral. vtkQuad is defined by the four points (0,1,2,3) in
22 // counterclockwise order. vtkQuad uses the standard isoparametric
23 // interpolation functions for a linear quadrilateral.
32 class VTK_COMMON_EXPORT vtkQuad : public vtkCell
35 static vtkQuad *New();
36 vtkTypeRevisionMacro(vtkQuad,vtkCell);
39 // See the vtkCell API for descriptions of these methods.
40 int GetCellType() {return VTK_QUAD;};
41 int GetCellDimension() {return 2;};
42 int GetNumberOfEdges() {return 4;};
43 int GetNumberOfFaces() {return 0;};
44 vtkCell *GetEdge(int edgeId);
45 vtkCell *GetFace(int) {return 0;};
46 int CellBoundary(int subId, float pcoords[3], vtkIdList *pts);
47 void Contour(float value, vtkDataArray *cellScalars,
48 vtkPointLocator *locator, vtkCellArray *verts,
49 vtkCellArray *lines, vtkCellArray *polys,
50 vtkPointData *inPd, vtkPointData *outPd,
51 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd);
52 int EvaluatePosition(float x[3], float* closestPoint,
53 int& subId, float pcoords[3],
54 float& dist2, float *weights);
55 void EvaluateLocation(int& subId, float pcoords[3], float x[3],
57 int IntersectWithLine(float p1[3], float p2[3], float tol, float& t,
58 float x[3], float pcoords[3], int& subId);
59 int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts);
60 void Derivatives(int subId, float pcoords[3], float *values,
61 int dim, float *derivs);
64 // Clip this quad using scalar value provided. Like contouring, except
65 // that it cuts the quad to produce other quads and/or triangles.
66 void Clip(float value, vtkDataArray *cellScalars,
67 vtkPointLocator *locator, vtkCellArray *polys,
68 vtkPointData *inPd, vtkPointData *outPd,
69 vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd,
73 // vtkQuad specific methods.
74 static void InterpolationFunctions(float pcoords[3], float sf[4]);
75 static void InterpolationDerivs(float pcoords[3], float derivs[8]);
85 vtkQuad(const vtkQuad&); // Not implemented.
86 void operator=(const vtkQuad&); // Not implemented.