VTK
vtkQuad.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkQuad.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 =========================================================================*/
25 #ifndef vtkQuad_h
26 #define vtkQuad_h
27 
28 #include "vtkCommonDataModelModule.h" // For export macro
29 #include "vtkCell.h"
30 
31 class vtkLine;
32 class vtkTriangle;
34 
35 class VTKCOMMONDATAMODEL_EXPORT vtkQuad : public vtkCell
36 {
37 public:
38  static vtkQuad *New();
39  vtkTypeMacro(vtkQuad,vtkCell);
40  void PrintSelf(ostream& os, vtkIndent indent) override;
41 
43 
46  int GetCellType() override {return VTK_QUAD;};
47  int GetCellDimension() override {return 2;};
48  int GetNumberOfEdges() override {return 4;};
49  int GetNumberOfFaces() override {return 0;};
50  vtkCell *GetEdge(int edgeId) override;
51  vtkCell *GetFace(int) override {return nullptr;};
52  int CellBoundary(int subId, double pcoords[3], vtkIdList *pts) override;
53  void Contour(double value, vtkDataArray *cellScalars,
55  vtkCellArray *lines, vtkCellArray *polys,
56  vtkPointData *inPd, vtkPointData *outPd,
57  vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd) override;
58  int EvaluatePosition(double x[3], double* closestPoint,
59  int& subId, double pcoords[3],
60  double& dist2, double *weights) override;
61  void EvaluateLocation(int& subId, double pcoords[3], double x[3],
62  double *weights) override;
63  int IntersectWithLine(double p1[3], double p2[3], double tol, double& t,
64  double x[3], double pcoords[3], int& subId) override;
65  int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts) override;
66  void Derivatives(int subId, double pcoords[3], double *values,
67  int dim, double *derivs) override;
68  double *GetParametricCoords() override;
70 
74  int GetParametricCenter(double pcoords[3]) override;
75 
80  void Clip(double value, vtkDataArray *cellScalars,
82  vtkPointData *inPd, vtkPointData *outPd,
83  vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd,
84  int insideOut) override;
85 
89  static void InterpolationFunctions(double pcoords[3], double sf[4]);
93  static void InterpolationDerivs(double pcoords[3], double derivs[8]);
95 
99  void InterpolateFunctions(double pcoords[3], double sf[4]) override
100  {
102  }
103  void InterpolateDerivs(double pcoords[3], double derivs[8]) override
104  {
105  vtkQuad::InterpolationDerivs(pcoords,derivs);
106  }
108 
113  int *GetEdgeArray(int edgeId);
114 
115 protected:
116  vtkQuad();
117  ~vtkQuad() override;
118 
121 
122 private:
123  vtkQuad(const vtkQuad&) = delete;
124  void operator=(const vtkQuad&) = delete;
125 };
126 //----------------------------------------------------------------------------
127 inline int vtkQuad::GetParametricCenter(double pcoords[3])
128 {
129  pcoords[0] = pcoords[1] = 0.5;
130  pcoords[2] = 0.0;
131  return 0;
132 }
133 
134 
135 #endif
136 
137 
int GetCellType() override
See the vtkCell API for descriptions of these methods.
Definition: vtkQuad.h:46
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
represent and manipulate point attribute data
Definition: vtkPointData.h:31
represent and manipulate cell attribute data
Definition: vtkCellData.h:32
Abstract class in support of both point location and point insertion.
virtual int Triangulate(int index, vtkIdList *ptIds, vtkPoints *pts)=0
Generate simplices of proper dimension.
virtual void EvaluateLocation(int &subId, double pcoords[3], double x[3], double *weights)=0
Determine global coordinate (x[3]) from subId and parametric coordinates.
virtual int EvaluatePosition(double x[3], double *closestPoint, int &subId, double pcoords[3], double &dist2, double *weights)=0
Given a point x[3] return inside(=1), outside(=0) cell, or (-1) computational problem encountered; ev...
a cell that represents a 2D quadrilateral
Definition: vtkQuad.h:35
int vtkIdType
Definition: vtkType.h:345
int GetParametricCenter(double pcoords[3]) override
Return the center of the triangle in parametric coordinates.
Definition: vtkQuad.h:127
static void InterpolationFunctions(double pcoords[3], double sf[4])
cell represents a 1D line
Definition: vtkLine.h:29
abstract class to specify cell behavior
Definition: vtkCell.h:56
a simple class to control print indentation
Definition: vtkIndent.h:33
int GetNumberOfEdges() override
See the vtkCell API for descriptions of these methods.
Definition: vtkQuad.h:48
list of point or cell ids
Definition: vtkIdList.h:30
virtual void Derivatives(int subId, double pcoords[3], double *values, int dim, double *derivs)=0
Compute derivatives given cell subId and parametric coordinates.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:48
virtual int IntersectWithLine(double p1[3], double p2[3], double tol, double &t, double x[3], double pcoords[3], int &subId)=0
Intersect with a ray.
static void InterpolationDerivs(double pcoords[3], double derivs[8])
vtkCell * GetFace(int) override
See the vtkCell API for descriptions of these methods.
Definition: vtkQuad.h:51
void InterpolateDerivs(double pcoords[3], double derivs[8]) override
Compute the interpolation functions/derivatives (aka shape functions/derivatives) ...
Definition: vtkQuad.h:103
void InterpolateFunctions(double pcoords[3], double sf[4]) override
Compute the interpolation functions/derivatives (aka shape functions/derivatives) ...
Definition: vtkQuad.h:99
virtual void Clip(double value, vtkDataArray *cellScalars, vtkIncrementalPointLocator *locator, vtkCellArray *connectivity, vtkPointData *inPd, vtkPointData *outPd, vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd, int insideOut)=0
Cut (or clip) the cell based on the input cellScalars and the specified value.
object to represent cell connectivity
Definition: vtkCellArray.h:44
virtual vtkCell * GetEdge(int edgeId)=0
Return the edge cell from the edgeId of the cell.
a cell that represents a triangle
Definition: vtkTriangle.h:35
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)=0
Generate contouring primitives.
vtkLine * Line
Definition: vtkQuad.h:119
int GetCellDimension() override
See the vtkCell API for descriptions of these methods.
Definition: vtkQuad.h:47
virtual int CellBoundary(int subId, double pcoords[3], vtkIdList *pts)=0
Given parametric coordinates of a point, return the closest cell boundary, and whether the point is i...
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
virtual double * GetParametricCoords())
Return a contiguous array of parametric coordinates of the points defining this cell.
virtual int GetParametricCenter(double pcoords[3])
Return center of the cell in parametric coordinates.
int GetNumberOfFaces() override
See the vtkCell API for descriptions of these methods.
Definition: vtkQuad.h:49
represent and manipulate 3D points
Definition: vtkPoints.h:33
vtkTriangle * Triangle
Definition: vtkQuad.h:120