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) VTK_OVERRIDE;
80 
82 
87  vtkSetClampMacro(NumberOfPointsPerBucket,int,1,VTK_INT_MAX);
88  vtkGetMacro(NumberOfPointsPerBucket,int);
90 
92 
97  vtkSetVector3Macro(Divisions,int);
98  vtkGetVectorMacro(Divisions,int,3);
100 
101  // Re-use any superclass signatures that we don't override.
106 
113  vtkIdType FindClosestPoint(const double x[3]) VTK_OVERRIDE;
114 
116 
125  double radius, const double x[3], double& dist2) VTK_OVERRIDE;
126  virtual vtkIdType FindClosestPointWithinRadius(double radius, const double x[3],
127  double inputDataLength,
128  double& dist2);
130 
139  void FindClosestNPoints(int N, const double x[3], vtkIdList *result) VTK_OVERRIDE;
140 
147  void FindPointsWithinRadius(double R, const double x[3],
148  vtkIdList *result) VTK_OVERRIDE;
149 
151 
155  void Initialize() VTK_OVERRIDE;
156  void FreeSearchStructure() VTK_OVERRIDE;
157  void BuildLocator() VTK_OVERRIDE;
158  void GenerateRepresentation(int level, vtkPolyData *pd) VTK_OVERRIDE;
160 
165  vtkIdType GetNumberOfPointsInBucket(vtkIdType bNum);
166 
172  void GetBucketIds(vtkIdType bNum, vtkIdList *bList);
173 
180  bool GetLargeIds() {return this->LargeIds;}
181 
182 protected:
184  ~vtkStaticPointLocator() VTK_OVERRIDE;
185 
186  int NumberOfPointsPerBucket; // Used with AutomaticOn to control subdivide
187  int Divisions[3]; // Number of sub-divisions in x-y-z directions
188  double H[3]; // Width of each bucket in x-y-z directions
189  vtkBucketList *Buckets; // Lists of point ids in each bucket
190  bool LargeIds; //indicate whether integer ids are small or large
191 
192 private:
193  vtkStaticPointLocator(const vtkStaticPointLocator&) VTK_DELETE_FUNCTION;
194  void operator=(const vtkStaticPointLocator&) VTK_DELETE_FUNCTION;
195 
196 };
197 
198 #endif
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:153
virtual double * GetBounds()
Provide an accessor to the bounds.
int vtkIdType
Definition: vtkType.h:287
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
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.
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...