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 =========================================================================*/
50 #ifndef vtkStaticPointLocator_h
51 #define vtkStaticPointLocator_h
52 
53 #include "vtkCommonDataModelModule.h" // For export macro
55 
56 class vtkIdList;
57 class vtkBucketList;
58 
59 
60 class VTKCOMMONDATAMODEL_EXPORT vtkStaticPointLocator : public vtkAbstractPointLocator
61 {
62 friend class vtkBucketList;
63 public:
68  static vtkStaticPointLocator *New();
69 
71 
75  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
77 
79 
84  vtkSetClampMacro(NumberOfPointsPerBucket,int,1,VTK_INT_MAX);
85  vtkGetMacro(NumberOfPointsPerBucket,int);
87 
89 
94  vtkSetVector3Macro(Divisions,int);
95  vtkGetVectorMacro(Divisions,int,3);
97 
98  // Re-use any superclass signatures that we don't override.
103 
110  vtkIdType FindClosestPoint(const double x[3]) VTK_OVERRIDE;
111 
113 
122  double radius, const double x[3], double& dist2) VTK_OVERRIDE;
123  virtual vtkIdType FindClosestPointWithinRadius(double radius, const double x[3],
124  double inputDataLength,
125  double& dist2);
127 
136  void FindClosestNPoints(int N, const double x[3], vtkIdList *result) VTK_OVERRIDE;
137 
144  void FindPointsWithinRadius(double R, const double x[3],
145  vtkIdList *result) VTK_OVERRIDE;
146 
148 
152  void Initialize() VTK_OVERRIDE;
153  void FreeSearchStructure() VTK_OVERRIDE;
154  void BuildLocator() VTK_OVERRIDE;
155  void GenerateRepresentation(int level, vtkPolyData *pd) VTK_OVERRIDE;
157 
162  vtkIdType GetNumberOfPointsInBucket(vtkIdType bNum);
163 
169  void GetBucketIds(vtkIdType bNum, vtkIdList *bList);
170 
177  bool GetLargeIds() {return this->LargeIds;}
178 
179 protected:
181  ~vtkStaticPointLocator() VTK_OVERRIDE;
182 
183  int NumberOfPointsPerBucket; // Used with AutomaticOn to control subdivide
184  int Divisions[3]; // Number of sub-divisions in x-y-z directions
185  double H[3]; // Width of each bucket in x-y-z directions
186  vtkBucketList *Buckets; // Lists of point ids in each bucket
187  bool LargeIds; //indicate whether integer ids are small or large
188 
189 private:
190  vtkStaticPointLocator(const vtkStaticPointLocator&) VTK_DELETE_FUNCTION;
191  void operator=(const vtkStaticPointLocator&) VTK_DELETE_FUNCTION;
192 
193 };
194 
195 #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: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:79
a simple class to control print indentation
Definition: vtkIndent.h:33
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:30
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...