VTK
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 =========================================================================*/
29 #ifndef vtkKdTreePointLocator_h
30 #define vtkKdTreePointLocator_h
31 
32 #include "vtkCommonDataModelModule.h" // For export macro
34 
35 class vtkIdList;
36 class vtkKdTree;
37 
38 class VTKCOMMONDATAMODEL_EXPORT vtkKdTreePointLocator : public vtkAbstractPointLocator
39 {
40 public:
42  static vtkKdTreePointLocator* New();
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
51  vtkIdType FindClosestPoint(const double x[3]) override;
52 
59  double radius, const double x[3], double& dist2) override;
60 
69  void FindClosestNPoints(
70  int N, const double x[3], vtkIdList *result) override;
71 
78  void FindPointsWithinRadius(double R, const double x[3],
79  vtkIdList *result) override;
80 
82 
86  void FreeSearchStructure() override;
87  void BuildLocator() override;
88  void GenerateRepresentation(int level, vtkPolyData *pd) override;
90 
91 protected:
93  ~vtkKdTreePointLocator() override;
94 
96 
97 private:
99  void operator=(const vtkKdTreePointLocator&) = delete;
100 };
101 
102 #endif
103 
104 
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:347
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
virtual void FreeSearchStructure()=0
Free the memory required for the spatial data structure.
a simple class to control print indentation
Definition: vtkIndent.h:39
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:36
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:78
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.