VTK  9.7.0
vtkConvexPointSet.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
20
21#ifndef vtkConvexPointSet_h
22#define vtkConvexPointSet_h
23
24#include "vtkCell3D.h"
25#include "vtkCommonDataModelModule.h" // For export macro
26
27VTK_ABI_NAMESPACE_BEGIN
29class vtkCellArray;
30class vtkTriangle;
31class vtkTetra;
32class vtkDoubleArray;
33
34class VTKCOMMONDATAMODEL_EXPORT vtkConvexPointSet : public vtkCell3D
35{
36public:
39 void PrintSelf(ostream& os, vtkIndent indent) override;
40
42
46 void GetEdgePoints(vtkIdType vtkNotUsed(edgeId), const vtkIdType*& vtkNotUsed(pts)) override
47 {
48 vtkWarningMacro(<< "vtkConvexPointSet::GetEdgePoints Not Implemented");
49 }
50 vtkIdType GetFacePoints(vtkIdType vtkNotUsed(faceId), const vtkIdType*& vtkNotUsed(pts)) override
51 {
52 vtkWarningMacro(<< "vtkConvexPointSet::GetFacePoints Not Implemented");
53 return 0;
54 }
56 vtkIdType vtkNotUsed(edgeId), const vtkIdType*& vtkNotUsed(pts)) override
57 {
58 vtkWarningMacro(<< "vtkConvexPointSet::GetEdgeToAdjacentFaces Not Implemented");
59 }
61 vtkIdType vtkNotUsed(faceId), const vtkIdType*& vtkNotUsed(faceIds)) override
62 {
63 vtkWarningMacro(<< "vtkConvexPointSet::GetFaceToAdjacentFaces Not Implemented");
64 return 0;
65 }
67 vtkIdType vtkNotUsed(pointId), const vtkIdType*& vtkNotUsed(edgeIds)) override
68 {
69 vtkWarningMacro(<< "vtkConvexPointSet::GetPointToIncidentEdges Not Implemented");
70 return 0;
71 }
73 vtkIdType vtkNotUsed(pointId), const vtkIdType*& vtkNotUsed(faceIds)) override
74 {
75 vtkWarningMacro(<< "vtkConvexPointSet::GetPointToIncidentFaces Not Implemented");
76 return 0;
77 }
79 vtkIdType vtkNotUsed(pointId), const vtkIdType*& vtkNotUsed(pts)) override
80 {
81 vtkWarningMacro(<< "vtkConvexPointSet::GetPointToOneRingPoints Not Implemented");
82 return 0;
83 }
84 bool GetCentroid(double vtkNotUsed(centroid)[3]) const override
85 {
86 vtkWarningMacro(<< "vtkConvexPointSet::GetCentroid Not Implemented");
87 return false;
88 }
90
94 double* GetParametricCoords() override;
95
99 int GetCellType() override { return VTK_CONVEX_POINT_SET; }
100
104 int RequiresInitialization() override { return 1; }
105 void Initialize() override;
106
108
118 int GetNumberOfEdges() override { return 0; }
119 vtkCell* GetEdge(int) override { return nullptr; }
120 int GetNumberOfFaces() override;
121 vtkCell* GetFace(int faceId) override;
123
128 void Contour(double value, vtkDataArray* cellScalars, vtkIncrementalPointLocator* locator,
129 vtkCellArray* verts, vtkCellArray* lines, vtkCellArray* polys, vtkPointData* inPd,
130 vtkPointData* outPd, vtkCellData* inCd, vtkIdType cellId, vtkCellData* outCd) override;
131
137 void Clip(double value, vtkDataArray* cellScalars, vtkIncrementalPointLocator* locator,
138 vtkCellArray* connectivity, vtkPointData* inPd, vtkPointData* outPd, vtkCellData* inCd,
139 vtkIdType cellId, vtkCellData* outCd, int insideOut) override;
140
146 int EvaluatePosition(const double x[3], double closestPoint[3], int& subId, double pcoords[3],
147 double& dist2, double weights[]) override;
148
152 void EvaluateLocation(int& subId, const double pcoords[3], double x[3], double* weights) override;
153
158 int IntersectWithLine(const double p1[3], const double p2[3], double tol, double& t, double x[3],
159 double pcoords[3], int& subId) override;
160
164 int TriangulateLocalIds(int index, vtkIdList* ptIds) override;
165
171 int subId, const double pcoords[3], const double* values, int dim, double* derivs) override;
172
178 int CellBoundary(int subId, const double pcoords[3], vtkIdList* pts) override;
179
183 int GetParametricCenter(double pcoords[3]) override;
184
189 int IsPrimaryCell() VTK_FUTURE_CONST override { return 0; }
190
192
196 void InterpolateFunctions(const double pcoords[3], double* sf) override;
197 void InterpolateDerivs(const double pcoords[3], double* derivs) override;
199
200protected:
202 ~vtkConvexPointSet() override = default;
203
208
212
213private:
214 vtkConvexPointSet(const vtkConvexPointSet&) = delete;
215 void operator=(const vtkConvexPointSet&) = delete;
216};
217
218//----------------------------------------------------------------------------
219inline int vtkConvexPointSet::GetParametricCenter(double pcoords[3])
220{
221 pcoords[0] = pcoords[1] = pcoords[2] = 0.5;
222 return 0;
223}
224
225VTK_ABI_NAMESPACE_END
226#endif
object to represent cell connectivity
represent and manipulate cell attribute data
Definition vtkCellData.h:32
double * GetParametricCoords() override
See vtkCell3D API for description of this method.
bool GetCentroid(double centroid[3]) const override
See vtkCell3D API for description of these methods.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSmartPointer< vtkIdList > TetraIds
vtkCell * GetFace(int faceId) override
A convex point set has no explicit cell edge or faces; however implicitly (after triangulation) it do...
int GetNumberOfEdges() override
A convex point set has no explicit cell edge or faces; however implicitly (after triangulation) it do...
int RequiresInitialization() override
This cell requires that it be initialized prior to access.
vtkIdType GetPointToIncidentFaces(vtkIdType pointId, const vtkIdType *&faceIds) override
See vtkCell3D API for description of these methods.
static vtkConvexPointSet * New()
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
Satisfy the vtkCell API.
void GetEdgeToAdjacentFaces(vtkIdType edgeId, const vtkIdType *&pts) override
See vtkCell3D API for description of these methods.
int CellBoundary(int subId, const double pcoords[3], vtkIdList *pts) override
Returns the set of points forming a face of the triangulation of these points that are on the boundar...
void Clip(double value, vtkDataArray *cellScalars, vtkIncrementalPointLocator *locator, vtkCellArray *connectivity, vtkPointData *inPd, vtkPointData *outPd, vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd, int insideOut) override
Satisfy the vtkCell API.
vtkIdType GetFaceToAdjacentFaces(vtkIdType faceId, const vtkIdType *&faceIds) override
See vtkCell3D API for description of these methods.
void Initialize() override
void GetEdgePoints(vtkIdType edgeId, const vtkIdType *&pts) override
See vtkCell3D API for description of these methods.
int IsPrimaryCell() VTK_FUTURE_CONST override
A convex point set is triangulated prior to any operations on it so it is not a primary cell,...
int IntersectWithLine(const double p1[3], const double p2[3], double tol, double &t, double x[3], double pcoords[3], int &subId) override
Triangulates the cells and then intersects them to determine the intersection point.
~vtkConvexPointSet() override=default
vtkIdType GetPointToOneRingPoints(vtkIdType pointId, const vtkIdType *&pts) override
See vtkCell3D API for description of these methods.
vtkSmartPointer< vtkPoints > TetraPoints
vtkSmartPointer< vtkTetra > Tetra
void InterpolateDerivs(const double pcoords[3], double *derivs) override
Compute the interpolation functions/derivatives (aka shape functions/derivatives).
vtkSmartPointer< vtkCellArray > BoundaryTris
vtkIdType GetFacePoints(vtkIdType faceId, const vtkIdType *&pts) override
See vtkCell3D API for description of these methods.
int TriangulateLocalIds(int index, vtkIdList *ptIds) override
Triangulate using methods of vtkOrderedTriangulator.
int EvaluatePosition(const double x[3], double closestPoint[3], int &subId, double pcoords[3], double &dist2, double weights[]) override
Satisfy the vtkCell API.
vtkSmartPointer< vtkDoubleArray > ParametricCoords
int GetParametricCenter(double pcoords[3]) override
Return the center of the cell in parametric coordinates.
int GetCellType() override
See the vtkCell API for descriptions of these methods.
int GetNumberOfFaces() override
A convex point set has no explicit cell edge or faces; however implicitly (after triangulation) it do...
void Derivatives(int subId, const double pcoords[3], const double *values, int dim, double *derivs) override
Computes derivatives by triangulating and from subId and pcoords, evaluating derivatives on the resul...
void InterpolateFunctions(const double pcoords[3], double *sf) override
Compute the interpolation functions/derivatives (aka shape functions/derivatives).
vtkCell * GetEdge(int) override
A convex point set has no explicit cell edge or faces; however implicitly (after triangulation) it do...
vtkIdType GetPointToIncidentEdges(vtkIdType pointId, const vtkIdType *&edgeIds) override
See vtkCell3D API for description of these methods.
vtkSmartPointer< vtkDoubleArray > TetraScalars
void EvaluateLocation(int &subId, const double pcoords[3], double x[3], double *weights) override
The inverse of EvaluatePosition.
vtkSmartPointer< vtkTriangle > Triangle
dynamic, self-adjusting array of double
list of point or cell ids
Definition vtkIdList.h:26
Abstract class in support of both point location and point insertion.
a simple class to control print indentation
Definition vtkIndent.h:29
represent and manipulate point attribute data
Hold a reference to a vtkObjectBase instance.
a 3D cell that represents a tetrahedron
Definition vtkTetra.h:34
a cell that represents a triangle
Definition vtkTriangle.h:28
dataset represents arbitrary combinations of all possible cell types
@ VTK_CONVEX_POINT_SET
Definition vtkCellType.h:77
#define vtkDataArray
int vtkIdType
Definition vtkType.h:363