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 "vtkCell3D.h"
40 
41 class vtkLine;
42 class vtkQuad;
43 class vtkTriangle;
46 
48 {
49 public:
50  static vtkPyramid *New();
51  vtkTypeMacro(vtkPyramid,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_PYRAMID;}
63  int GetCellDimension() {return 3;}
64  int GetNumberOfEdges() {return 8;}
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 
93  static void InterpolationFunctions(double pcoords[3], double weights[5]);
94  // Description:
95  // @deprecated Replaced by vtkPyramid::InterpolateDerivs as of VTK 5.2
96  static void InterpolationDerivs(double pcoords[3], double derivs[15]);
97  // Description:
98  // Compute the interpolation functions/derivatives
99  // (aka shape functions/derivatives)
100  virtual void InterpolateFunctions(double pcoords[3], double weights[5])
101  {
102  vtkPyramid::InterpolationFunctions(pcoords,weights);
103  }
104  virtual void InterpolateDerivs(double pcoords[3], double derivs[15])
105  {
106  vtkPyramid::InterpolationDerivs(pcoords,derivs);
107  }
109 
110  int JacobianInverse(double pcoords[3], double **inverse, double derivs[15]);
111 
113 
115  static int *GetEdgeArray(int edgeId);
116  static int *GetFaceArray(int faceId);
118 
119 protected:
120  vtkPyramid();
121  ~vtkPyramid();
122 
126 
127 private:
128  vtkPyramid(const vtkPyramid&); // Not implemented.
129  void operator=(const vtkPyramid&); // Not implemented.
130 };
131 
132 //----------------------------------------------------------------------------
133 inline int vtkPyramid::GetParametricCenter(double pcoords[3])
134 {
135  pcoords[0] = pcoords[1] = 0.4;
136  pcoords[2] = 0.2;
137  return 0;
138 }
139 
140 #endif
141 
142 
143 
vtkQuad * Quad
Definition: vtkPyramid.h:125
represent and manipulate point attribute data
Definition: vtkPointData.h:35
int GetCellDimension()
Definition: vtkPyramid.h:63
#define VTK_FILTERING_EXPORT
virtual double * GetParametricCoords()
a 3D cell that represents a linear pyramid
Definition: vtkPyramid.h:47
int GetParametricCenter(double pcoords[3])
Definition: vtkPyramid.h:133
represent and manipulate cell attribute data
Definition: vtkCellData.h:36
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:39
int vtkIdType
Definition: vtkType.h:255
vtkTriangle * Triangle
Definition: vtkPyramid.h:124
abstract class to specify 3D cell interface
Definition: vtkCell3D.h:36
virtual void InterpolateDerivs(double pcoords[3], double derivs[15])
Definition: vtkPyramid.h:104
int GetCellType()
Definition: vtkPyramid.h:62
cell represents a 1D line
Definition: vtkLine.h:33
abstract class to specify cell behavior
Definition: vtkCell.h:57
virtual void InterpolateFunctions(double pcoords[3], double weights[5])
Definition: vtkPyramid.h:100
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:64
a simple class to control print indentation
Definition: vtkIndent.h:37
list of point or cell ids
Definition: vtkIdList.h:34
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:53
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:123
virtual vtkCell * GetFace(int faceId)=0
object to represent cell connectivity
Definition: vtkCellArray.h:48
virtual vtkCell * GetEdge(int edgeId)=0
a cell that represents a triangle
Definition: vtkTriangle.h:39
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:65
represent and manipulate 3D points
Definition: vtkPoints.h:38