VTK
vtkHexahedron.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkHexahedron.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 __vtkHexahedron_h
37 #define __vtkHexahedron_h
38 
39 #include "vtkCell3D.h"
40 
41 class vtkLine;
42 class vtkQuad;
44 
46 {
47 public:
48  static vtkHexahedron *New();
49  vtkTypeMacro(vtkHexahedron,vtkCell3D);
50  void PrintSelf(ostream& os, vtkIndent indent);
51 
53 
54  virtual void GetEdgePoints(int edgeId, int* &pts);
55  virtual void GetFacePoints(int faceId, int* &pts);
57 
59 
60  int GetCellType() {return VTK_HEXAHEDRON;}
61  int GetNumberOfEdges() {return 12;}
62  int GetNumberOfFaces() {return 6;}
63  vtkCell *GetEdge(int edgeId);
64  vtkCell *GetFace(int faceId);
65  int CellBoundary(int subId, double pcoords[3], vtkIdList *pts);
66  void Contour(double value, vtkDataArray *cellScalars,
68  vtkCellArray *lines, vtkCellArray *polys,
69  vtkPointData *inPd, vtkPointData *outPd,
70  vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd);
72 
73  int EvaluatePosition(double x[3], double* closestPoint,
74  int& subId, double pcoords[3],
75  double& dist2, double *weights);
76  void EvaluateLocation(int& subId, double pcoords[3], double x[3],
77  double *weights);
78  int IntersectWithLine(double p1[3], double p2[3], double tol, double& t,
79  double x[3], double pcoords[3], int& subId);
80  int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts);
81  void Derivatives(int subId, double pcoords[3], double *values,
82  int dim, double *derivs);
83  virtual double *GetParametricCoords();
84 
87  static void InterpolationFunctions(double pcoords[3], double weights[8]);
90  static void InterpolationDerivs(double pcoords[3], double derivs[24]);
92 
94  virtual void InterpolateFunctions(double pcoords[3], double weights[8])
95  {
97  }
98  virtual void InterpolateDerivs(double pcoords[3], double derivs[24])
99  {
100  vtkHexahedron::InterpolationDerivs(pcoords,derivs);
101  }
103 
105 
107  static int *GetEdgeArray(int edgeId);
108  static int *GetFaceArray(int faceId);
110 
114  void JacobianInverse(double pcoords[3], double **inverse, double derivs[24]);
115 
116 protected:
117  vtkHexahedron();
118  ~vtkHexahedron();
119 
122 
123 private:
124  vtkHexahedron(const vtkHexahedron&); // Not implemented.
125  void operator=(const vtkHexahedron&); // Not implemented.
126 };
127 
128 #endif
129 
130