OSDN Git Service

FIRST REPOSITORY
[eos/hostdependOTHERS.git] / I386LINUX / util / I386LINUX / include / vtk / vtkWedge.h
1 /*=========================================================================
2
3   Program:   Visualization Toolkit
4   Module:    $RCSfile: vtkWedge.h,v $
5   Language:  C++
6   Date:      $Date: 2003/01/06 20:36:14 $
7   Version:   $Revision: 1.26 $
8
9   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
10   All rights reserved.
11   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
12
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.
16
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).
27
28 #ifndef __vtkWedge_h
29 #define __vtkWedge_h
30
31 #include "vtkCell3D.h"
32
33 class vtkLine;
34 class vtkTriangle;
35 class vtkQuad;
36
37 class vtkUnstructuredGrid;
38
39 class VTK_COMMON_EXPORT vtkWedge : public vtkCell3D
40 {
41 public:
42   static vtkWedge *New();
43   vtkTypeRevisionMacro(vtkWedge,vtkCell3D);
44
45   // Description:
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();
50
51   // Description:
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],
69                         float *weights);
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);
75
76   // Description:
77   // Return the center of the wedge in parametric coordinates.
78   int GetParametricCenter(float pcoords[3]);
79
80   // Description:
81   // Wedge specific methods for computing interpolation functions and
82   // derivatives.
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);
88
89 protected:
90   vtkWedge();
91   ~vtkWedge();
92
93   vtkLine *Line;
94   vtkTriangle *Triangle;
95   vtkQuad *Quad;
96
97 private:
98   vtkWedge(const vtkWedge&);  // Not implemented.
99   void operator=(const vtkWedge&);  // Not implemented.
100 };
101
102 inline int vtkWedge::GetParametricCenter(float pcoords[3])
103 {
104   pcoords[0] = pcoords[1] = 0.333333f;
105   pcoords[2] = 0.5f;
106   return 0;
107 }
108
109 #endif
110
111
112