VTK
vtkQuadraticPyramid.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkQuadraticPyramid.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 =========================================================================*/
41 #ifndef __vtkQuadraticPyramid_h
42 #define __vtkQuadraticPyramid_h
43 
44 #include "vtkNonLinearCell.h"
45 
46 class vtkQuadraticEdge;
47 class vtkQuadraticQuad;
48 class vtkQuadraticTriangle;
49 class vtkTetra;
50 class vtkPyramid;
51 class vtkDoubleArray;
52 
54 {
55 public:
56  static vtkQuadraticPyramid *New();
58  void PrintSelf(ostream& os, vtkIndent indent);
59 
61 
63  int GetCellType() {return VTK_QUADRATIC_PYRAMID;};
64  int GetCellDimension() {return 3;}
65  int GetNumberOfEdges() {return 8;}
66  int GetNumberOfFaces() {return 5;}
67  vtkCell *GetEdge(int edgeId);
68  vtkCell *GetFace(int faceId);
70 
71  int CellBoundary(int subId, double pcoords[3], vtkIdList *pts);
72  void Contour(double value, vtkDataArray *cellScalars,
74  vtkCellArray *lines, vtkCellArray *polys,
75  vtkPointData *inPd, vtkPointData *outPd,
76  vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd);
77  int EvaluatePosition(double x[3], double* closestPoint,
78  int& subId, double pcoords[3],
79  double& dist2, double *weights);
80  void EvaluateLocation(int& subId, double pcoords[3], double x[3],
81  double *weights);
82  int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts);
83  void Derivatives(int subId, double pcoords[3], double *values,
84  int dim, double *derivs);
85  virtual double *GetParametricCoords();
86 
88 
91  void Clip(double value, vtkDataArray *cellScalars,
93  vtkPointData *inPd, vtkPointData *outPd,
94  vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd,
95  int insideOut);
97 
99 
101  int IntersectWithLine(double p1[3], double p2[3], double tol, double& t,
102  double x[3], double pcoords[3], int& subId);
104 
105 
107  int GetParametricCenter(double pcoords[3]);
108 
110 
112  static void InterpolationFunctions(double pcoords[3], double weights[13]);
113  // Description:
114  // @deprecated Replaced by vtkQuadraticPyramid::InterpolateDerivs as of VTK 5.2
115  static void InterpolationDerivs(double pcoords[3], double derivs[39]);
116  // Description:
117  // Compute the interpolation functions/derivatives
118  // (aka shape functions/derivatives)
119  virtual void InterpolateFunctions(double pcoords[3], double weights[13])
120  {
122  }
123  virtual void InterpolateDerivs(double pcoords[3], double derivs[39])
124  {
126  }
127  // Description:
128  // Return the ids of the vertices defining edge/face (`edgeId`/`faceId').
129  // Ids are related to the cell, not to the dataset.
130  static int *GetEdgeArray(int edgeId);
131  static int *GetFaceArray(int faceId);
133 
137  void JacobianInverse(double pcoords[3], double **inverse, double derivs[39]);
138 
139 protected:
142 
144  vtkQuadraticTriangle *TriangleFace;
148  vtkPointData *PointData;
151  vtkDoubleArray *Scalars; //used to avoid New/Delete in contouring/clipping
152 
153  void Subdivide(vtkPointData *inPd, vtkCellData *inCd, vtkIdType cellId,
154  vtkDataArray *cellScalars);
155 
156 private:
157  vtkQuadraticPyramid(const vtkQuadraticPyramid&); // Not implemented.
158  void operator=(const vtkQuadraticPyramid&); // Not implemented.
159 };
160 //----------------------------------------------------------------------------
161 // Return the center of the quadratic pyramid in parametric coordinates.
162 //
163 inline int vtkQuadraticPyramid::GetParametricCenter(double pcoords[3])
164 {
165  pcoords[0] = pcoords[1] = 6./13;
166  pcoords[2] = 3./13;
167  return 0;
168 }
169 
170 
171 #endif
static void InterpolationFunctions(double pcoords[3], double weights[13])
vtkDoubleArray * CellScalars
cell represents a parabolic, 13-node isoparametric pyramid
#define VTK_FILTERING_EXPORT
a 3D cell that represents a linear pyramid
Definition: vtkPyramid.h:47
represent and manipulate cell attribute data
Definition: vtkCellData.h:36
Abstract class in support of both point location and point insertion.
vtkQuadraticEdge * Edge
abstract superclass for non-linear cells
int vtkIdType
Definition: vtkType.h:255
virtual void InterpolateDerivs(double pcoords[3], double derivs[39])
dynamic, self-adjusting array of double
a 3D cell that represents a tetrahedron
Definition: vtkTetra.h:45
static void InterpolationDerivs(double pcoords[3], double derivs[39])
int GetParametricCenter(double pcoords[3])
cell represents a parabolic, 8-node isoparametric quad
a simple class to control print indentation
Definition: vtkIndent.h:37
vtkQuadraticTriangle * TriangleFace
list of point or cell ids
Definition: vtkIdList.h:34
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:53
void PrintSelf(ostream &os, vtkIndent indent)
object to represent cell connectivity
Definition: vtkCellArray.h:48
vtkQuadraticQuad * Face
cell represents a parabolic, isoparametric edge
virtual void InterpolateFunctions(double pcoords[3], double weights[13])
vtkDoubleArray * Scalars
represent and manipulate 3D points
Definition: vtkPoints.h:38