VTK
vtkStaticPointLocator.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkStaticPointLocator.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 =========================================================================*/
53 #ifndef vtkStaticPointLocator_h
54 #define vtkStaticPointLocator_h
55 
56 #include "vtkCommonDataModelModule.h" // For export macro
58 
59 class vtkIdList;
60 class vtkBucketList;
61 
62 
63 class VTKCOMMONDATAMODEL_EXPORT vtkStaticPointLocator : public vtkAbstractPointLocator
64 {
65 friend class vtkBucketList;
66 public:
71  static vtkStaticPointLocator *New();
72 
74 
78  void PrintSelf(ostream& os, vtkIndent indent) override;
80 
82 
87  vtkSetClampMacro(NumberOfPointsPerBucket,int,1,VTK_INT_MAX);
88  vtkGetMacro(NumberOfPointsPerBucket,int);
90 
92 
98  vtkSetVector3Macro(Divisions,int);
99  vtkGetVectorMacro(Divisions,int,3);
101 
102  // Re-use any superclass signatures that we don't override.
107 
114  vtkIdType FindClosestPoint(const double x[3]) override;
115 
117 
126  double radius, const double x[3], double& dist2) override;
127  virtual vtkIdType FindClosestPointWithinRadius(double radius, const double x[3],
128  double inputDataLength,
129  double& dist2);
131 
140  void FindClosestNPoints(int N, const double x[3], vtkIdList *result) override;
141 
148  void FindPointsWithinRadius(double R, const double x[3],
149  vtkIdList *result) override;
150 
152 
156  void Initialize() override;
157  void FreeSearchStructure() override;
158  void BuildLocator() override;
160 
166  void GenerateRepresentation(int level, vtkPolyData *pd) override;
167 
172  vtkIdType GetNumberOfPointsInBucket(vtkIdType bNum);
173 
179  void GetBucketIds(vtkIdType bNum, vtkIdList *bList);
180 
182 
196  vtkSetClampMacro(MaxNumberOfBuckets,vtkIdType,1000,VTK_ID_MAX);
197  vtkGetMacro(MaxNumberOfBuckets,vtkIdType);
199 
207  bool GetLargeIds() {return this->LargeIds;}
208 
209 protected:
211  ~vtkStaticPointLocator() override;
212 
213  int NumberOfPointsPerBucket; // Used with AutomaticOn to control subdivide
214  int Divisions[3]; // Number of sub-divisions in x-y-z directions
215  double H[3]; // Width of each bucket in x-y-z directions
216  vtkBucketList *Buckets; // Lists of point ids in each bucket
217  vtkIdType MaxNumberOfBuckets; // Maximum number of buckets in locator
218  bool LargeIds; //indicate whether integer ids are small or large
219 
220 private:
222  void operator=(const vtkStaticPointLocator&) = delete;
223 
224 };
225 
226 #endif
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...
#define VTK_INT_MAX
Definition: vtkType.h:157
virtual double * GetBounds()
Provide an accessor to the bounds.
int vtkIdType
Definition: vtkType.h:345
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.
quickly locate points in 3-space
virtual void FindClosestNPoints(int N, const double x[3], vtkIdList *result)=0
Find the closest N points to a position.
#define VTK_ID_MAX
Definition: vtkType.h:349
bool GetLargeIds()
Inform the user as to whether large ids are being used.
virtual vtkIdType FindClosestPoint(const double x[3])=0
Given a position x, return the id of the point closest to it.
virtual void Initialize()
Initialize locator.
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.