VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vtkPyramid.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPyramid.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 __vtkPyramid_h
37 #define __vtkPyramid_h
38 
39 #include "vtkCommonDataModelModule.h" // For export macro
40 #include "vtkCell3D.h"
41 
42 class vtkLine;
43 class vtkQuad;
44 class vtkTriangle;
45 class vtkUnstructuredGrid;
47 
48 class VTKCOMMONDATAMODEL_EXPORT vtkPyramid : public vtkCell3D
49 {
50 public:
51  static vtkPyramid *New();
52  vtkTypeMacro(vtkPyramid,vtkCell3D);
53  void PrintSelf(ostream& os, vtkIndent indent);
54 
56 
57  virtual void GetEdgePoints(int edgeId, int* &pts);
58  virtual void GetFacePoints(int faceId, int* &pts);
60 
62 
63  int GetCellType() {return VTK_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);
69  int CellBoundary(int subId, double pcoords[3], vtkIdList *pts);
70  void Contour(double value, vtkDataArray *cellScalars,
72  vtkCellArray *lines, vtkCellArray *polys,
73  vtkPointData *inPd, vtkPointData *outPd,
74  vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd);
75  int EvaluatePosition(double x[3], double* closestPoint,
76  int& subId, double pcoords[3],
77  double& dist2, double *weights);
78  void EvaluateLocation(int& subId, double pcoords[3], double x[3],
79  double *weights);
80  int IntersectWithLine(double p1[3], double p2[3], double tol, double& t,
81  double x[3], double pcoords[3], int& subId);
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();
87 
89  int GetParametricCenter(double pcoords[3]);
90 
93  static void InterpolationFunctions(double pcoords[3], double weights[5]);
95  static void InterpolationDerivs(double pcoords[3], double derivs[15]);
97 
99  virtual void InterpolateFunctions(double pcoords[3], double weights[5])
100  {
101  vtkPyramid::InterpolationFunctions(pcoords,weights);
102  }
103  virtual void InterpolateDerivs(double pcoords[3], double derivs[15])
104  {
105  vtkPyramid::InterpolationDerivs(pcoords,derivs);
106  }
108 
109  int JacobianInverse(double pcoords[3], double **inverse, double derivs[15]);
110 
112 
114  static int *GetEdgeArray(int edgeId);
115  static int *GetFaceArray(int faceId);
117 
118 protected:
119  vtkPyramid();
120  ~vtkPyramid();
121 
122  vtkLine *Line;
124  vtkQuad *Quad;
125 
126 private:
127  vtkPyramid(const vtkPyramid&); // Not implemented.
128  void operator=(const vtkPyramid&); // Not implemented.
129 };
130 
131 //----------------------------------------------------------------------------
132 inline int vtkPyramid::GetParametricCenter(double pcoords[3])
133 {
134  pcoords[0] = pcoords[1] = 0.4;
135  pcoords[2] = 0.2;
136  return 0;
137 }
138 
139 #endif
140 
141 
142 
vtkQuad * Quad
Definition: vtkPyramid.h:124
int GetCellDimension()
Definition: vtkPyramid.h:64
a 3D cell that represents a linear pyramid
Definition: vtkPyramid.h:48
int GetParametricCenter(double pcoords[3])
Definition: vtkPyramid.h:132
represent and manipulate cell attribute data
Definition: vtkCellData.h:37
Abstract class in support of both point location and point insertion.
vtkTriangle * Triangle
Definition: vtkPyramid.h:123
virtual void InterpolateDerivs(double pcoords[3], double derivs[15])
Definition: vtkPyramid.h:103
int GetCellType()
Definition: vtkPyramid.h:63
virtual void InterpolateFunctions(double pcoords[3], double weights[5])
Definition: vtkPyramid.h:99
int GetNumberOfEdges()
Definition: vtkPyramid.h:65
vtkLine * Line
Definition: vtkPyramid.h:122
object to represent cell connectivity
Definition: vtkCellArray.h:49
a cell that represents a triangle
Definition: vtkTriangle.h:40
static void InterpolationDerivs(double pcoords[3], double derivs[15])
static void InterpolationFunctions(double pcoords[3], double weights[5])
int GetNumberOfFaces()
Definition: vtkPyramid.h:66