VTK  9.3.1
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
17 #ifndef vtkKdTreePointLocator_h
18 #define vtkKdTreePointLocator_h
19 
21 #include "vtkCommonDataModelModule.h" // For export macro
22 
23 VTK_ABI_NAMESPACE_BEGIN
24 class vtkIdList;
25 class vtkKdTree;
26 
27 class VTKCOMMONDATAMODEL_EXPORT vtkKdTreePointLocator : public vtkAbstractPointLocator
28 {
29 public:
31  static vtkKdTreePointLocator* New();
32  void PrintSelf(ostream& os, vtkIndent indent) override;
33 
40  vtkIdType FindClosestPoint(const double x[3]) override;
41 
47  vtkIdType FindClosestPointWithinRadius(double radius, const double x[3], double& dist2) override;
48 
57  void FindClosestNPoints(int N, const double x[3], vtkIdList* result) override;
58 
65  void FindPointsWithinRadius(double R, const double x[3], vtkIdList* result) override;
66 
68 
72  void FreeSearchStructure() override;
73  void BuildLocator() override;
74  void ForceBuildLocator() override;
75  void GenerateRepresentation(int level, vtkPolyData* pd) override;
77 
78 protected:
80  ~vtkKdTreePointLocator() override;
81 
82  void BuildLocatorInternal() override;
83 
85 
86 private:
88  void operator=(const vtkKdTreePointLocator&) = delete;
89 };
90 
91 VTK_ABI_NAMESPACE_END
92 #endif
class to quickly locate points in 3-space
virtual void BuildLocator()=0
Build the locator from the input dataset.
virtual vtkIdType FindClosestPointWithinRadius(double radius, const double x[3], double &dist2)=0
Given a position x and a radius r, return the id of the point closest to the point in that radius...
int vtkIdType
Definition: vtkType.h:315
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
virtual void FreeSearchStructure()=0
Free the memory required for the spatial data structure.
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual void BuildLocatorInternal()
This function is not pure virtual to maintain backwards compatibility.
Definition: vtkLocator.h:192
void PrintSelf(ostream &os, vtkIndent indent) override
Standard type and print methods.
abstract class to quickly locate points in 3-space
list of point or cell ids
Definition: vtkIdList.h:22
virtual void FindPointsWithinRadius(double R, const double x[3], vtkIdList *result)=0
Find all points within a specified radius R of position x.
virtual void FindClosestNPoints(int N, const double x[3], vtkIdList *result)=0
Find the closest N points to a position.
a Kd-tree spatial decomposition of a set of points
Definition: vtkKdTree.h:67
virtual vtkIdType FindClosestPoint(const double x[3])=0
Given a position x, return the id of the point closest to it.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
virtual void GenerateRepresentation(int level, vtkPolyData *pd)=0
Method to build a representation at a particular level.
virtual void ForceBuildLocator()
Build the locator from the input dataset (even if UseExistingSearchStructure is on).
Definition: vtkLocator.h:156