VTK  9.2.20230528
vtkAbstractPointLocator.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkAbstractPointLocator.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 =========================================================================*/
33 #ifndef vtkAbstractPointLocator_h
34 #define vtkAbstractPointLocator_h
35 
36 #include "vtkCommonDataModelModule.h" // For export macro
37 #include "vtkLocator.h"
38 
39 VTK_ABI_NAMESPACE_BEGIN
40 class vtkIdList;
41 
42 class VTKCOMMONDATAMODEL_EXPORT vtkAbstractPointLocator : public vtkLocator
43 {
44 public:
46 
50  void PrintSelf(ostream& os, vtkIndent indent) override;
52 
54 
60  virtual vtkIdType FindClosestPoint(const double x[3]) = 0;
61  vtkIdType FindClosestPoint(double x, double y, double z);
63 
70  double radius, const double x[3], double& dist2) = 0;
71 
73 
81  virtual void FindClosestNPoints(int N, const double x[3], vtkIdList* result) = 0;
82  void FindClosestNPoints(int N, double x, double y, double z, vtkIdList* result);
84 
86 
92  virtual void FindPointsWithinRadius(double R, const double x[3], vtkIdList* result) = 0;
93  void FindPointsWithinRadius(double R, double x, double y, double z, vtkIdList* result);
95 
97 
100  virtual double* GetBounds() { return this->Bounds; }
101  virtual void GetBounds(double*);
103 
105 
109  vtkGetMacro(NumberOfBuckets, vtkIdType);
111 
112 protected:
115 
116  double Bounds[6]; // bounds of points
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
abstract class to quickly locate points in 3-space
~vtkAbstractPointLocator() override
virtual void GetBounds(double *)
Provide an accessor to the bounds.
virtual void FindPointsWithinRadius(double R, const double x[3], vtkIdList *result)=0
Find all points within a specified radius R of position x.
virtual vtkIdType FindClosestPoint(const double x[3])=0
Given a position x, return the id of the point closest to it.
virtual double * GetBounds()
Provide an accessor to the bounds.
vtkIdType FindClosestPoint(double x, double y, double z)
Given a position x, return the id of the point closest to it.
virtual void FindClosestNPoints(int N, const double x[3], vtkIdList *result)=0
Find the closest N points to a position.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard type and print methods.
void FindPointsWithinRadius(double R, double x, double y, double z, vtkIdList *result)
Find all points within a specified radius R of position x.
void FindClosestNPoints(int N, double x, double y, double z, vtkIdList *result)
Find the closest N points to a position.
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.
list of point or cell ids
Definition: vtkIdList.h:144
a simple class to control print indentation
Definition: vtkIndent.h:120
abstract base class for objects that accelerate spatial searches
Definition: vtkLocator.h:90
@ radius
Definition: vtkX3D.h:264
int vtkIdType
Definition: vtkType.h:327