VTK
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;
47 
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 
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
represent and manipulate point attribute data
Definition: vtkPointData.h:36
int GetCellDimension()
Definition: vtkPyramid.h:64
virtual double * GetParametricCoords()
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.
virtual int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts)=0
virtual void EvaluateLocation(int &subId, double pcoords[3], double x[3], double *weights)=0
virtual int EvaluatePosition(double x[3], double *closestPoint, int &subId, double pcoords[3], double &dist2, double *weights)=0
a cell that represents a 2D quadrilateral
Definition: vtkQuad.h:40
int vtkIdType
Definition: vtkType.h:247
vtkTriangle * Triangle
Definition: vtkPyramid.h:123
abstract class to specify 3D cell interface
Definition: vtkCell3D.h:37
virtual void InterpolateDerivs(double pcoords[3], double derivs[15])
Definition: vtkPyramid.h:103
int GetCellType()
Definition: vtkPyramid.h:63
cell represents a 1D line
Definition: vtkLine.h:34
abstract class to specify cell behavior
Definition: vtkCell.h:58
virtual void InterpolateFunctions(double pcoords[3], double weights[5])
Definition: vtkPyramid.h:99
virtual void Contour(double value, vtkDataArray *cellScalars, vtkIncrementalPointLocator *locator, vtkCellArray *verts, vtkCellArray *lines, vtkCellArray *polys, vtkPointData *inPd, vtkPointData *outPd, vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd)
int GetNumberOfEdges()
Definition: vtkPyramid.h:65
a simple class to control print indentation
Definition: vtkIndent.h:38
list of point or cell ids
Definition: vtkIdList.h:35
virtual void Derivatives(int subId, double pcoords[3], double *values, int dim, double *derivs)=0
dataset represents arbitrary combinations of all possible cell types
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
virtual int IntersectWithLine(double p1[3], double p2[3], double tol, double &t, double x[3], double pcoords[3], int &subId)=0
virtual void GetFacePoints(int faceId, int *&pts)=0
void PrintSelf(ostream &os, vtkIndent indent)
vtkLine * Line
Definition: vtkPyramid.h:122
virtual vtkCell * GetFace(int faceId)=0
object to represent cell connectivity
Definition: vtkCellArray.h:49
virtual vtkCell * GetEdge(int edgeId)=0
a cell that represents a triangle
Definition: vtkTriangle.h:40
static void InterpolationDerivs(double pcoords[3], double derivs[15])
virtual int CellBoundary(int subId, double pcoords[3], vtkIdList *pts)=0
static vtkObject * New()
static void InterpolationFunctions(double pcoords[3], double weights[5])
virtual int GetParametricCenter(double pcoords[3])
virtual void GetEdgePoints(int edgeId, int *&pts)=0
int GetNumberOfFaces()
Definition: vtkPyramid.h:66
#define VTKCOMMONDATAMODEL_EXPORT
represent and manipulate 3D points
Definition: vtkPoints.h:38