VTK  9.1.0
vtkKdTreePointLocator.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkKdTreePointLocator.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
95 #ifndef vtkKdTreePointLocator_h
96 #define vtkKdTreePointLocator_h
97 
99 #include "vtkCommonDataModelModule.h" // For export macro
100 
101 class vtkIdList;
102 class vtkKdTree;
103 
104 class VTKCOMMONDATAMODEL_EXPORT vtkKdTreePointLocator : public vtkAbstractPointLocator
105 {
106 public:
109  void PrintSelf(ostream& os, vtkIndent indent) override;
110 
117  vtkIdType FindClosestPoint(const double x[3]) override;
118 
124  vtkIdType FindClosestPointWithinRadius(double radius, const double x[3], double& dist2) override;
125 
134  void FindClosestNPoints(int N, const double x[3], vtkIdList* result) override;
135 
142  void FindPointsWithinRadius(double R, const double x[3], vtkIdList* result) override;
143 
145 
149  void FreeSearchStructure() override;
150  void BuildLocator() override;
151  void GenerateRepresentation(int level, vtkPolyData* pd) override;
153 
154 protected:
157 
159 
160 private:
162  void operator=(const vtkKdTreePointLocator&) = delete;
163 };
164 
165 #endif
abstract class to quickly locate points in 3-space
list of point or cell ids
Definition: vtkIdList.h:140
a simple class to control print indentation
Definition: vtkIndent.h:113
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.
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 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:135
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:195
@ level
Definition: vtkX3D.h:401
@ radius
Definition: vtkX3D.h:258
int vtkIdType
Definition: vtkType.h:332