VTK  9.3.20240423
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
86#ifndef vtkKdTreePointLocator_h
87#define vtkKdTreePointLocator_h
88
90#include "vtkCommonDataModelModule.h" // For export macro
91
92VTK_ABI_NAMESPACE_BEGIN
93class vtkIdList;
94class vtkKdTree;
95
96class VTKCOMMONDATAMODEL_EXPORT vtkKdTreePointLocator : public vtkAbstractPointLocator
97{
98public:
101 void PrintSelf(ostream& os, vtkIndent indent) override;
102
109 vtkIdType FindClosestPoint(const double x[3]) override;
110
116 vtkIdType FindClosestPointWithinRadius(double radius, const double x[3], double& dist2) override;
117
126 void FindClosestNPoints(int N, const double x[3], vtkIdList* result) override;
127
134 void FindPointsWithinRadius(double R, const double x[3], vtkIdList* result) override;
135
137
141 void FreeSearchStructure() override;
142 void BuildLocator() override;
143 void ForceBuildLocator() override;
144 void GenerateRepresentation(int level, vtkPolyData* pd) override;
146
147protected:
150
151 void BuildLocatorInternal() override;
152
154
155private:
157 void operator=(const vtkKdTreePointLocator&) = delete;
158};
159
160VTK_ABI_NAMESPACE_END
161#endif
abstract class to quickly locate points in 3-space
list of point or cell ids
Definition vtkIdList.h:133
a simple class to control print indentation
Definition vtkIndent.h:108
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.
~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.
static vtkKdTreePointLocator * New()
a Kd-tree spatial decomposition of a set of points
Definition vtkKdTree.h:117
concrete dataset represents vertices, lines, polygons, and triangle strips
int vtkIdType
Definition vtkType.h:315