VTK
vtkWedge.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkWedge.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
36 #ifndef __vtkWedge_h
37 #define __vtkWedge_h
38 
39 #include "vtkCell3D.h"
40 
41 class vtkLine;
42 class vtkTriangle;
43 class vtkQuad;
46 
48 {
49 public:
50  static vtkWedge *New();
51  vtkTypeMacro(vtkWedge,vtkCell3D);
52  void PrintSelf(ostream& os, vtkIndent indent);
53 
55 
56  virtual void GetEdgePoints(int edgeId, int* &pts);
57  virtual void GetFacePoints(int faceId, int* &pts);
59 
61 
62  int GetCellType() {return VTK_WEDGE;}
63  int GetCellDimension() {return 3;}
64  int GetNumberOfEdges() {return 9;}
65  int GetNumberOfFaces() {return 5;}
66  vtkCell *GetEdge(int edgeId);
67  vtkCell *GetFace(int faceId);
68  int CellBoundary(int subId, double pcoords[3], vtkIdList *pts);
69  void Contour(double value, vtkDataArray *cellScalars,
71  vtkCellArray *lines, vtkCellArray *polys,
72  vtkPointData *inPd, vtkPointData *outPd,
73  vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd);
74  int EvaluatePosition(double x[3], double* closestPoint,
75  int& subId, double pcoords[3],
76  double& dist2, double *weights);
77  void EvaluateLocation(int& subId, double pcoords[3], double x[3],
78  double *weights);
79  int IntersectWithLine(double p1[3], double p2[3], double tol, double& t,
80  double x[3], double pcoords[3], int& subId);
81  int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts);
82  void Derivatives(int subId, double pcoords[3], double *values,
83  int dim, double *derivs);
84  virtual double *GetParametricCoords();
86 
88  int GetParametricCenter(double pcoords[3]);
89 
91  static void InterpolationFunctions(double pcoords[3], double weights[6]);
93  static void InterpolationDerivs(double pcoords[3], double derivs[18]);
95 
97  virtual void InterpolateFunctions(double pcoords[3], double weights[6])
98  {
99  vtkWedge::InterpolationFunctions(pcoords,weights);
100  }
101  virtual void InterpolateDerivs(double pcoords[3], double derivs[18])
102  {
103  vtkWedge::InterpolationDerivs(pcoords,derivs);
104  }
105  int JacobianInverse(double pcoords[3], double **inverse, double derivs[18]);
107 
109 
111  static int *GetEdgeArray(int edgeId);
112  static int *GetFaceArray(int faceId);
114 
115 protected:
116  vtkWedge();
117  ~vtkWedge();
118 
122 
123 private:
124  vtkWedge(const vtkWedge&); // Not implemented.
125  void operator=(const vtkWedge&); // Not implemented.
126 };
127 
128 inline int vtkWedge::GetParametricCenter(double pcoords[3])
129 {
130  pcoords[0] = pcoords[1] = 0.333333;
131  pcoords[2] = 0.5;
132  return 0;
133 }
134 
135 #endif
136 
137 
138