VTK  9.7.20261031
vtkQuad.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
74
75#ifndef vtkQuad_h
76#define vtkQuad_h
77
78#include "vtkCell.h"
79#include "vtkCommonDataModelModule.h" // For export macro
80
81VTK_ABI_NAMESPACE_BEGIN
82class vtkLine;
83class vtkTriangle;
85
86class VTKCOMMONDATAMODEL_EXPORT vtkQuad : public vtkCell
87{
88public:
89 static vtkQuad* New();
90 vtkTypeMacro(vtkQuad, vtkCell);
91 void PrintSelf(ostream& os, vtkIndent indent) override;
92
97
99
102 int GetCellType() override { return Traits::CellType; }
103 int GetCellDimension() override { return Traits::Dimension; }
104 int GetNumberOfEdges() override { return Traits::NumberOfEdges; }
105 int GetNumberOfFaces() override { return Traits::NumberOfFaces; }
106 vtkCell* GetEdge(int edgeId) override;
107 vtkCell* GetFace(int) override { return nullptr; }
108 int CellBoundary(int subId, const double pcoords[3], vtkIdList* pts) override;
109 void Contour(double value, vtkDataArray* cellScalars, vtkIncrementalPointLocator* locator,
110 vtkCellArray* verts, vtkCellArray* lines, vtkCellArray* polys, vtkPointData* inPd,
111 vtkPointData* outPd, vtkCellData* inCd, vtkIdType cellId, vtkCellData* outCd) override;
112 int EvaluatePosition(const double x[3], double closestPoint[3], int& subId, double pcoords[3],
113 double& dist2, double weights[]) override;
114 void EvaluateLocation(int& subId, const double pcoords[3], double x[3], double* weights) override;
115 int IntersectWithLine(const double p1[3], const double p2[3], double tol, double& t, double x[3],
116 double pcoords[3], int& subId) override;
117 int TriangulateLocalIds(int index, vtkIdList* ptIds) override;
119 int subId, const double pcoords[3], const double* values, int dim, double* derivs) override;
120 double* GetParametricCoords() override;
122
126 int GetParametricCenter(double pcoords[3]) override;
127
132 void Clip(double value, vtkDataArray* cellScalars, vtkIncrementalPointLocator* locator,
133 vtkCellArray* polys, vtkPointData* inPd, vtkPointData* outPd, vtkCellData* inCd,
134 vtkIdType cellId, vtkCellData* outCd, int insideOut) override;
135
136 static void InterpolationFunctions(const double pcoords[3], double sf[4]);
137 static void InterpolationDerivs(const double pcoords[3], double derivs[8]);
139
143 void InterpolateFunctions(const double pcoords[3], double sf[4]) override
144 {
146 }
147 void InterpolateDerivs(const double pcoords[3], double derivs[8]) override
148 {
149 vtkQuad::InterpolationDerivs(pcoords, derivs);
150 }
151
152
161 static const vtkIdType* GetEdgeArray(vtkIdType edgeId);
162
163protected:
165 ~vtkQuad() override = default;
166
169
170private:
171 vtkQuad(const vtkQuad&) = delete;
172 void operator=(const vtkQuad&) = delete;
173};
174//----------------------------------------------------------------------------
175inline int vtkQuad::GetParametricCenter(double pcoords[3])
176{
177 pcoords[0] = pcoords[1] = 0.5;
178 pcoords[2] = 0.0;
179 return 0;
180}
181
182VTK_ABI_NAMESPACE_END
183#endif
object to represent cell connectivity
represent and manipulate cell attribute data
virtual int GetParametricCenter(double pcoords[3])
Return center of the cell in parametric coordinates.
list of point or cell ids
Definition vtkIdList.h:135
Abstract class in support of both point location and point insertion.
a simple class to control print indentation
Definition vtkIndent.h:108
cell represents a 1D line
Definition vtkLine.h:132
represent and manipulate point attribute data
void InterpolateDerivs(const double pcoords[3], double derivs[8]) override
Compute the interpolation functions/derivatives (aka shape functions/derivatives).
Definition vtkQuad.h:147
static void InterpolationDerivs(const double pcoords[3], double derivs[8])
~vtkQuad() override=default
int GetParametricCenter(double pcoords[3]) override
Return the center of the triangle in parametric coordinates.
Definition vtkQuad.h:175
static const vtkIdType * GetEdgeArray(vtkIdType edgeId)
Return the ids of the vertices defining edge (edgeId).
int CellBoundary(int subId, const double pcoords[3], vtkIdList *pts) override
See the vtkCell API for descriptions of these methods.
int TriangulateLocalIds(int index, vtkIdList *ptIds) override
See the vtkCell API for descriptions of these methods.
vtkSmartPointer< vtkTriangle > Triangle
Definition vtkQuad.h:168
void Clip(double value, vtkDataArray *cellScalars, vtkIncrementalPointLocator *locator, vtkCellArray *polys, vtkPointData *inPd, vtkPointData *outPd, vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd, int insideOut) override
Clip this quad using scalar value provided.
void Derivatives(int subId, const double pcoords[3], const double *values, int dim, double *derivs) override
See the vtkCell API for descriptions of these methods.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int IntersectWithLine(const double p1[3], const double p2[3], double tol, double &t, double x[3], double pcoords[3], int &subId) override
See the vtkCell API for descriptions of these methods.
int EvaluatePosition(const double x[3], double closestPoint[3], int &subId, double pcoords[3], double &dist2, double weights[]) override
See the vtkCell API for descriptions of these methods.
int GetNumberOfEdges() override
See the vtkCell API for descriptions of these methods.
Definition vtkQuad.h:104
void InterpolateFunctions(const double pcoords[3], double sf[4]) override
Compute the interpolation functions/derivatives (aka shape functions/derivatives).
Definition vtkQuad.h:143
static vtkQuad * New()
void EvaluateLocation(int &subId, const double pcoords[3], double x[3], double *weights) override
See the vtkCell API for descriptions of these methods.
vtkSmartPointer< vtkLine > Line
Definition vtkQuad.h:167
vtkCell * GetEdge(int edgeId) override
See the vtkCell API for descriptions of these methods.
int GetCellType() override
See the vtkCell API for descriptions of these methods.
Definition vtkQuad.h:102
vtkCellTypeTraitsMembersMacro(VTK_QUAD)
The traits of the cell type, see vtkCellTypeTraits.
double * GetParametricCoords() override
See the vtkCell API for descriptions of these methods.
int GetNumberOfFaces() override
See the vtkCell API for descriptions of these methods.
Definition vtkQuad.h:105
vtkCell * GetFace(int) override
See the vtkCell API for descriptions of these methods.
Definition vtkQuad.h:107
static void InterpolationFunctions(const double pcoords[3], double sf[4])
int GetCellDimension() override
See the vtkCell API for descriptions of these methods.
Definition vtkQuad.h:103
void Contour(double value, vtkDataArray *cellScalars, vtkIncrementalPointLocator *locator, vtkCellArray *verts, vtkCellArray *lines, vtkCellArray *polys, vtkPointData *inPd, vtkPointData *outPd, vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd) override
See the vtkCell API for descriptions of these methods.
Hold a reference to a vtkObjectBase instance.
a cell that represents a triangle
@ VTK_QUAD
Definition vtkCellType.h:46
#define vtkDataArray
int vtkIdType
Definition vtkType.h:363