VTK  9.7.1
vtkAbstractPointLocator.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
21 #ifndef vtkAbstractPointLocator_h
22 #define vtkAbstractPointLocator_h
23 
24 #include "vtkCommonDataModelModule.h" // For export macro
25 #include "vtkLocator.h"
26 
27 VTK_ABI_NAMESPACE_BEGIN
28 class vtkIdList;
29 
30 class VTKCOMMONDATAMODEL_EXPORT vtkAbstractPointLocator : public vtkLocator
31 {
32 public:
34 
38  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
42 
48  vtkSetClampMacro(Tolerance, double, 0.0, VTK_DOUBLE_MAX);
49  vtkGetMacro(Tolerance, double);
51 
53 
59  virtual vtkIdType FindClosestPoint(const double x[3]) = 0;
60  vtkIdType FindClosestPoint(double x, double y, double z);
62 
68  virtual vtkIdType FindClosestPointWithinRadius(
69  double radius, const double x[3], double& dist2) = 0;
70 
72 
80  virtual void FindClosestNPoints(int N, const double x[3], vtkIdList* result) = 0;
81  void FindClosestNPoints(int N, double x, double y, double z, vtkIdList* result);
83 
85 
91  virtual void FindPointsWithinRadius(double R, const double x[3], vtkIdList* result) = 0;
92  void FindPointsWithinRadius(double R, double x, double y, double z, vtkIdList* result);
94 
96 
99  virtual double* GetBounds() { return this->Bounds; }
100  virtual void GetBounds(double*);
102 
104 
108  vtkGetMacro(NumberOfBuckets, vtkIdType);
110 
111 protected:
113  ~vtkAbstractPointLocator() override;
114 
115  double Bounds[6]; // bounds of points
116  double Tolerance; // for performing merging
117  vtkIdType NumberOfBuckets; // total size of locator
118 
119 private:
121  void operator=(const vtkAbstractPointLocator&) = delete;
122 };
123 
124 VTK_ABI_NAMESPACE_END
125 #endif
void GetBounds(T a, double bds[6])
#define VTK_DOUBLE_MAX
Definition: vtkType.h:202
virtual double * GetBounds()
Provide an accessor to the bounds.
abstract base class for objects that accelerate spatial searches
Definition: vtkLocator.h:59
void PrintSelf(ostream &os, vtkIndent indent) override
Standard type and print methods.
int vtkIdType
Definition: vtkType.h:363
a simple class to control print indentation
Definition: vtkIndent.h:28
abstract class to quickly locate points in 3-space
list of point or cell ids
Definition: vtkIdList.h:25