VTK
vtkTetra.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkTetra.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 =========================================================================*/
35 #ifndef vtkTetra_h
36 #define vtkTetra_h
37 
38 #include "vtkCommonDataModelModule.h" // For export macro
39 #include "vtkCell3D.h"
40 
41 class vtkLine;
42 class vtkTriangle;
45 
47 {
48 public:
49  static vtkTetra *New();
51  void PrintSelf(ostream& os, vtkIndent indent);
52 
54 
55  virtual void GetEdgePoints(int edgeId, int* &pts);
56  virtual void GetFacePoints(int faceId, int* &pts);
58 
60 
61  int GetCellType() {return VTK_TETRA;}
62  int GetNumberOfEdges() {return 6;}
63  int GetNumberOfFaces() {return 4;}
64  vtkCell *GetEdge(int edgeId);
65  vtkCell *GetFace(int faceId);
66  void Contour(double value, vtkDataArray *cellScalars,
68  vtkCellArray *lines, vtkCellArray *polys,
69  vtkPointData *inPd, vtkPointData *outPd,
70  vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd);
71  void Clip(double value, vtkDataArray *cellScalars,
72  vtkIncrementalPointLocator *locator, vtkCellArray *connectivity,
73  vtkPointData *inPd, vtkPointData *outPd,
74  vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd,
75  int insideOut);
76  int EvaluatePosition(double x[3], double* closestPoint,
77  int& subId, double pcoords[3],
78  double& dist2, double *weights);
79  void EvaluateLocation(int& subId, double pcoords[3], double x[3],
80  double *weights);
81  int IntersectWithLine(double p1[3], double p2[3], double tol, double& t,
82  double x[3], double pcoords[3], int& subId);
83  int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts);
84  void Derivatives(int subId, double pcoords[3], double *values,
85  int dim, double *derivs);
86  virtual double *GetParametricCoords();
88 
92  int CellBoundary(int subId, double pcoords[3], vtkIdList *pts);
93 
95  int GetParametricCenter(double pcoords[3]);
96 
99  double GetParametricDistance(double pcoords[3]);
100 
102 
103  static void TetraCenter(double p1[3], double p2[3], double p3[3], double p4[3],
104  double center[3]);
106 
108 
111  static double Circumsphere(double p1[3], double p2[3], double p3[3],
112  double p4[3], double center[3]);
114 
116 
119  static double Insphere(double p1[3], double p2[3], double p3[3],
120  double p4[3], double center[3]);
122 
124 
135  static int BarycentricCoords(double x[3], double x1[3], double x2[3],
136  double x3[3], double x4[3], double bcoords[4]);
138 
140 
142  static double ComputeVolume(double p1[3], double p2[3], double p3[3],
143  double p4[3]);
145 
149  int JacobianInverse(double **inverse, double derivs[12]);
150 
152  static void InterpolationFunctions(double pcoords[3], double weights[4]);
154  static void InterpolationDerivs(double pcoords[3], double derivs[12]);
156 
158  virtual void InterpolateFunctions(double pcoords[3], double weights[4])
159  {
161  }
162  virtual void InterpolateDerivs(double pcoords[3], double derivs[12])
163  {
164  vtkTetra::InterpolationDerivs(pcoords,derivs);
165  }
167 
169 
171  static int *GetEdgeArray(int edgeId);
172  static int *GetFaceArray(int faceId);
174 
175 protected:
178 
181 
182 private:
183  vtkTetra(const vtkTetra&); // Not implemented.
184  void operator=(const vtkTetra&); // Not implemented.
185 };
186 
187 inline int vtkTetra::GetParametricCenter(double pcoords[3])
188 {
189  pcoords[0] = pcoords[1] = pcoords[2] = 0.25;
190  return 0;
191 }
192 
193 #endif
194 
195 
196 
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:39
vtkTetra::Triangulate
int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts)
vtkTetra::GetEdgePoints
virtual void GetEdgePoints(int edgeId, int *&pts)
vtkgl::weights
const GLbyte * weights
Definition: vtkgl.h:12766
vtkTetra::GetEdgeArray
static int * GetEdgeArray(int edgeId)
vtkPointData
represent and manipulate point attribute data
Definition: vtkPointData.h:37
vtkIdType
int vtkIdType
Definition: vtkType.h:275
vtkCommonDataModelModule.h
vtkTetra::~vtkTetra
~vtkTetra()
vtkTetra::InterpolateDerivs
virtual void InterpolateDerivs(double pcoords[3], double derivs[12])
Definition: vtkTetra.h:162
vtkTetra::CellBoundary
int CellBoundary(int subId, double pcoords[3], vtkIdList *pts)
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkTetra::EvaluatePosition
int EvaluatePosition(double x[3], double *closestPoint, int &subId, double pcoords[3], double &dist2, double *weights)
vtkTetra::Derivatives
void Derivatives(int subId, double pcoords[3], double *values, int dim, double *derivs)
vtkTetra::TetraCenter
static void TetraCenter(double p1[3], double p2[3], double p3[3], double p4[3], double center[3])
vtkTetra::InterpolationDerivs
static void InterpolationDerivs(double pcoords[3], double derivs[12])
vtkgl::x
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
vtkX3D::center
@ center
Definition: vtkX3D.h:230
vtkTetra::Insphere
static double Insphere(double p1[3], double p2[3], double p3[3], double p4[3], double center[3])
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
vtkTetra::JacobianInverse
int JacobianInverse(double **inverse, double derivs[12])
vtkTetra::InterpolateFunctions
virtual void InterpolateFunctions(double pcoords[3], double weights[4])
Definition: vtkTetra.h:158
vtkCell3D.h
vtkTetra::GetNumberOfEdges
int GetNumberOfEdges()
Definition: vtkTetra.h:62
vtkLine
cell represents a 1D line
Definition: vtkLine.h:35
vtkTetra::New
static vtkTetra * New()
vtkTetra::GetParametricCenter
int GetParametricCenter(double pcoords[3])
Definition: vtkTetra.h:187
vtkTetra::GetFace
vtkCell * GetFace(int faceId)
vtkCell3D
abstract class to specify 3D cell interface
Definition: vtkCell3D.h:38
vtkTetra::IntersectWithLine
int IntersectWithLine(double p1[3], double p2[3], double tol, double &t, double x[3], double pcoords[3], int &subId)
vtkTetra::EvaluateLocation
void EvaluateLocation(int &subId, double pcoords[3], double x[3], double *weights)
vtkTetra::GetFacePoints
virtual void GetFacePoints(int faceId, int *&pts)
vtkTetra::GetNumberOfFaces
int GetNumberOfFaces()
Definition: vtkTetra.h:63
vtkgl::value
GLsizei const GLfloat * value
Definition: vtkgl.h:12021
vtkgl::values
GLboolean GLenum GLenum GLvoid * values
Definition: vtkgl.h:11354
vtkTetra::GetCellType
int GetCellType()
Definition: vtkTetra.h:61
vtkCell
abstract class to specify cell behavior
Definition: vtkCell.h:62
vtkCellData
represent and manipulate cell attribute data
Definition: vtkCellData.h:38
vtkTetra::Contour
void Contour(double value, vtkDataArray *cellScalars, vtkIncrementalPointLocator *locator, vtkCellArray *verts, vtkCellArray *lines, vtkCellArray *polys, vtkPointData *inPd, vtkPointData *outPd, vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:50
vtkIncrementalPointLocator
Abstract class in support of both point location and point insertion.
Definition: vtkIncrementalPointLocator.h:54
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:36
VTK_TETRA
@ VTK_TETRA
Definition: vtkCellType.h:54
vtkTetra::GetEdge
vtkCell * GetEdge(int edgeId)
vtkTriangle
a cell that represents a triangle
Definition: vtkTriangle.h:41
vtkgl::index
GLuint index
Definition: vtkgl.h:11983
vtkgl::t
GLdouble GLdouble t
Definition: vtkgl.h:11602
vtkTetra::BarycentricCoords
static int BarycentricCoords(double x[3], double x1[3], double x2[3], double x3[3], double x4[3], double bcoords[4])
vtkTetra::Line
vtkLine * Line
Definition: vtkTetra.h:179
vtkTetra::Triangle
vtkTriangle * Triangle
Definition: vtkTetra.h:180
vtkTetra::GetParametricCoords
virtual double * GetParametricCoords()
vtkCell::GetParametricCenter
virtual int GetParametricCenter(double pcoords[3])
vtkTetra::ComputeVolume
static double ComputeVolume(double p1[3], double p2[3], double p3[3], double p4[3])
VTKCOMMONDATAMODEL_EXPORT
#define VTKCOMMONDATAMODEL_EXPORT
Definition: vtkCommonDataModelModule.h:15
vtkUnstructuredGrid
dataset represents arbitrary combinations of all possible cell types
Definition: vtkUnstructuredGrid.h:82
vtkTetra::Circumsphere
static double Circumsphere(double p1[3], double p2[3], double p3[3], double p4[3], double center[3])
vtkTetra
a 3D cell that represents a tetrahedron
Definition: vtkTetra.h:47
vtkTetra::GetParametricDistance
double GetParametricDistance(double pcoords[3])
vtkTetra::vtkTetra
vtkTetra()
vtkTetra::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkTetra::InterpolationFunctions
static void InterpolationFunctions(double pcoords[3], double weights[4])
vtkTetra::GetFaceArray
static int * GetFaceArray(int faceId)
vtkTetra::Clip
void Clip(double value, vtkDataArray *cellScalars, vtkIncrementalPointLocator *locator, vtkCellArray *connectivity, vtkPointData *inPd, vtkPointData *outPd, vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd, int insideOut)