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
59class vtkIdList;
60class vtkBucketList;
61
62
63class VTKCOMMONDATAMODEL_EXPORT vtkStaticPointLocator : public vtkAbstractPointLocator
64{
65friend class vtkBucketList;
66public:
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
182protected:
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
192private:
193 vtkStaticPointLocator(const vtkStaticPointLocator&) VTK_DELETE_FUNCTION;
194 void operator=(const vtkStaticPointLocator&) VTK_DELETE_FUNCTION;
195
196};
197
198#endif
abstract class to quickly locate points in 3-space
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.
virtual void FindClosestNPoints(int N, const double x[3], vtkIdList *result)=0
Find the closest N points to a position.
list of point or cell ids
Definition: vtkIdList.h:37
a simple class to control print indentation
Definition: vtkIndent.h:40
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
quickly locate points in 3-space
void Initialize() override
See vtkLocator and vtkAbstractPointLocator interface documentation.
vtkIdType FindClosestPointWithinRadius(double radius, const double x[3], double &dist2) override
Given a position x and a radius r, return the id of the point closest to the point in that radius.
void FindClosestNPoints(int N, const double x[3], vtkIdList *result) override
Find the closest N points to a position.
~vtkStaticPointLocator() override
virtual vtkIdType FindClosestPointWithinRadius(double radius, const double x[3], double inputDataLength, double &dist2)
void FindPointsWithinRadius(double R, const double x[3], vtkIdList *result) override
Find all points within a specified radius R of position x.
static vtkStaticPointLocator * New()
Construct with automatic computation of divisions, averaging 5 points per bucket.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkIdType FindClosestPoint(const double x[3]) override
Given a position x, return the id of the point closest to it.
@ level
Definition: vtkX3D.h:395
@ radius
Definition: vtkX3D.h:252
int vtkIdType
Definition: vtkType.h:287
#define VTK_INT_MAX
Definition: vtkType.h:153