VTK  9.3.0
vtkKdTreePointLocator.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
26 #ifndef vtkKdTreePointLocator_h
27 #define vtkKdTreePointLocator_h
28 
30 #include "vtkCommonDataModelModule.h" // For export macro
31 
32 VTK_ABI_NAMESPACE_BEGIN
33 class vtkIdList;
34 class vtkKdTree;
35 
36 class VTKCOMMONDATAMODEL_EXPORT vtkKdTreePointLocator : public vtkAbstractPointLocator
37 {
38 public:
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
49  vtkIdType FindClosestPoint(const double x[3]) override;
50 
56  vtkIdType FindClosestPointWithinRadius(double radius, const double x[3], double& dist2) override;
57 
66  void FindClosestNPoints(int N, const double x[3], vtkIdList* result) override;
67 
74  void FindPointsWithinRadius(double R, const double x[3], vtkIdList* result) override;
75 
77 
81  void FreeSearchStructure() override;
82  void BuildLocator() override;
83  void ForceBuildLocator() override;
84  void GenerateRepresentation(int level, vtkPolyData* pd) override;
86 
87 protected:
90 
91  void BuildLocatorInternal() override;
92 
94 
95 private:
97  void operator=(const vtkKdTreePointLocator&) = delete;
98 };
99 
100 VTK_ABI_NAMESPACE_END
101 #endif
abstract class to quickly locate points in 3-space
list of point or cell ids
Definition: vtkIdList.h:32
a simple class to control print indentation
Definition: vtkIndent.h:38
class to quickly locate points in 3-space
void FindClosestNPoints(int N, const double x[3], vtkIdList *result) override
Find the closest N points to a position.
void BuildLocatorInternal() override
This function is not pure virtual to maintain backwards compatibility.
vtkIdType FindClosestPointWithinRadius(double radius, const double x[3], double &dist2) override
Given a position x and a radius r, return the id of the point closest to the point in that radius.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard type and print methods.
void GenerateRepresentation(int level, vtkPolyData *pd) override
See vtkLocator interface documentation.
static vtkKdTreePointLocator * New()
~vtkKdTreePointLocator() override
void ForceBuildLocator() override
See vtkLocator interface documentation.
void FindPointsWithinRadius(double R, const double x[3], vtkIdList *result) override
Find all points within a specified radius R of position x.
void BuildLocator() override
See vtkLocator interface documentation.
vtkIdType FindClosestPoint(const double x[3]) override
Given a position x, return the id of the point closest to it.
void FreeSearchStructure() override
See vtkLocator interface documentation.
a Kd-tree spatial decomposition of a set of points
Definition: vtkKdTree.h:77
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:89
@ level
Definition: vtkX3D.h:395
@ radius
Definition: vtkX3D.h:252
int vtkIdType
Definition: vtkType.h:315