VTK  9.6.20260515
vtkJumpAndWalkCellLocator.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
44
45#ifndef vtkJumpAndWalkCellLocator_h
46#define vtkJumpAndWalkCellLocator_h
47
49#include "vtkAbstractPointLocator.h" // For vtkAbstractPointLocator
50#include "vtkCommonDataModelModule.h" // For export macro
51#include "vtkSMPThreadLocal.h" // For vtkSMPThreadLocal
52#include "vtkSmartPointer.h" // For vtkSmartPointer
53
54#include <unordered_set> // For unordered_set
55
56VTK_ABI_NAMESPACE_BEGIN
57
59
60class VTKCOMMONDATAMODEL_EXPORT vtkJumpAndWalkCellLocator : public vtkAbstractCellLocator
61{
62public:
64
68 void PrintSelf(ostream& os, vtkIndent indent) override;
71
72 // Reuse any superclass signatures that we don't override.
75
77
82 vtkSetSmartPointerMacro(PointLocator, vtkAbstractPointLocator);
83 vtkGetSmartPointerMacro(PointLocator, vtkAbstractPointLocator);
85
87
93 vtkSetClampMacro(NumberOfClosestPoints, unsigned int, 1, 1000);
94 vtkGetMacro(NumberOfClosestPoints, unsigned int);
96
107 vtkIdType FindCell(double x[3], double tol2, vtkGenericCell* genCell, int& subId,
108 double pcoords[3], double* weights) override;
109
131 vtkIdType FindClosestPointWithinRadius(double x[3], double radius, double closestPoint[3],
132 vtkGenericCell* genCell, vtkIdType& cellId, int& subId, double& dist2, int& inside) override;
133
135
138 void FreeSearchStructure() override;
139 void BuildLocator() override;
140 void ForceBuildLocator() override;
141 void GenerateRepresentation(int level, vtkPolyData* pd) override;
143
149 void ShallowCopy(vtkAbstractCellLocator* locator) override;
150
151protected:
154
155 void BuildLocatorInternal() override;
156
158
159private:
161 void operator=(const vtkJumpAndWalkCellLocator&) = delete;
162
163 vtkIdType FindCellWalk(vtkIdList* cellIds, double x[3], double tol2, vtkGenericCell* genCell,
164 int& subId, double pcoords[3], double* weights, std::unordered_set<vtkIdType>& visitedCellIds,
165 vtkIdList* ptIds, vtkIdList* neighbors);
166
167 // Bounding box of the whole dataset
170 unsigned int NumberOfClosestPoints = 1;
171
172 vtkSmartPointer<vtkAbstractPointLocator> PointLocator = nullptr;
173
174 struct ThreadLocalData;
176};
177VTK_ABI_NAMESPACE_END
178
179#endif // vtkJumpAndWalkCellLocator_h
vtkIdType FindCell(double x[3])
Returns the Id of the cell containing the point, returns -1 if no cell found.
virtual vtkIdType FindClosestPointWithinRadius(double x[3], double radius, double closestPoint[3], vtkIdType &cellId, int &subId, double &dist2)
Return the closest point within a specified radius and the cell which is closest to the point x.
vtkAbstractCellLocator()
Find the cell containing a given point.
abstract class to quickly locate points in 3-space
Detect and break reference loops.
provides thread-safe access to cells
list of point or cell ids
Definition vtkIdList.h:135
a simple class to control print indentation
Definition vtkIndent.h:108
vtkIdType FindClosestPointWithinRadius(double x[3], double radius, double closestPoint[3], vtkGenericCell *genCell, vtkIdType &cellId, int &subId, double &dist2, int &inside) override
Return the closest point within a specified radius and the cell which is closest to the point x.
void BuildLocator() override
Satisfy vtkLocator abstract interface.
void ReportReferences(vtkGarbageCollector *) override
void ForceBuildLocator() override
Satisfy vtkLocator abstract interface.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods to instantiate, print and obtain type-related information.
vtkIdType FindCell(double x[3], double tol2, vtkGenericCell *genCell, int &subId, double pcoords[3], double *weights) override
Find the cell containing a given point.
void FreeSearchStructure() override
Satisfy vtkLocator abstract interface.
static vtkJumpAndWalkCellLocator * New()
Standard methods to instantiate, print and obtain type-related information.
void ShallowCopy(vtkAbstractCellLocator *locator) override
Shallow copy of a vtkJumpAndWalkCellLocator.
void BuildLocatorInternal() override
This function is not pure virtual to maintain backwards compatibility.
~vtkJumpAndWalkCellLocator() override
void GenerateRepresentation(int level, vtkPolyData *pd) override
Satisfy vtkLocator abstract interface.
concrete dataset represents vertices, lines, polygons, and triangle strips
Thread local storage for VTK objects.
Hold a reference to a vtkObjectBase instance.
int vtkIdType
Definition vtkType.h:363
#define VTK_DOUBLE_MIN
Definition vtkType.h:201
#define VTK_DOUBLE_MAX
Definition vtkType.h:202