Go to the documentation of this file.
42 #ifndef vtkPointLocator_h
43 #define vtkPointLocator_h
45 #include "vtkCommonDataModelModule.h"
50 class vtkNeighborPoints;
74 vtkSetVector3Macro(Divisions,
int);
75 vtkGetVectorMacro(Divisions,
int,3);
82 vtkSetClampMacro(NumberOfPointsPerBucket,
int,1,
VTK_INT_MAX);
83 vtkGetMacro(NumberOfPointsPerBucket,
int);
106 double radius,
const double x[3],
double& dist2)
override;
108 double radius,
const double x[3],
109 double inputDataLength,
double& dist2);
119 const double bounds[6])
override;
162 xyz[0] = x; xyz[1] = y; xyz[2] = z;
207 virtual void FindDistributedPoints(
int N,
const double x[3],
209 virtual void FindDistributedPoints(
int N,
double x,
double y,
228 virtual vtkIdList *GetPointsInBucket(
const double x[3],
int ijk[3]);
253 void GetBucketNeighbors(vtkNeighborPoints* buckets,
254 const int ijk[3],
const int ndivs[3],
int level);
255 void GetOverlappingBuckets(vtkNeighborPoints* buckets,
256 const double x[3],
const int ijk[3],
double dist,
258 void GetOverlappingBuckets(vtkNeighborPoints* buckets,
259 const double x[3],
double dist,
261 int prevMaxLevel[3]);
262 void GenerateFace(
int face,
int i,
int j,
int k,
264 double Distance2ToBucket(
const double x[3],
const int nei[3]);
265 double Distance2ToBounds(
const double x[3],
const double bounds[6]);
279 double FX, FY,
FZ, BX, BY, BZ;
285 vtkIdType tmp0 = static_cast<vtkIdType>(((x[0] - this->BX) * this->FX));
286 vtkIdType tmp1 = static_cast<vtkIdType>(((x[1] - this->BY) * this->FY));
287 vtkIdType tmp2 = static_cast<vtkIdType>(((x[2] - this->BZ) * this->FZ));
289 ijk[0] = tmp0 < 0 ? 0 : (tmp0 >= this->XD ? this->XD-1 : tmp0);
290 ijk[1] = tmp1 < 0 ? 0 : (tmp1 >= this->YD ? this->YD-1 : tmp1);
291 ijk[2] = tmp2 < 0 ? 0 : (tmp2 >= this->ZD ? this->ZD-1 : tmp2);
297 this->GetBucketIndices(x, ijk);
298 return ijk[0] + ijk[1]*this->XD + ijk[2]*this->SliceSize;
301 void ComputePerformanceFactors();
represent and manipulate 3D points
vtkIdType InsertionPointId
virtual int InsertUniquePoint(const double x[3], vtkIdType &ptId)=0
Insert a point unless there has been a duplciate in the search structure.
virtual vtkIdType IsInsertedPoint(double x, double y, double z)=0
Determine whether or not a given point has been inserted.
vtkIdType GetBucketIndex(const double *x) const
virtual void InsertPoint(vtkIdType ptId, const double x[3])=0
Insert a given point with a specified point index ptId.
quickly locate points in 3-space
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
virtual vtkIdType InsertNextPoint(const double x[3])=0
Insert a given point and return the point index.
int NumberOfPointsPerBucket
virtual void Initialize()
Initialize locator.
virtual void GenerateRepresentation(int level, vtkPolyData *pd)=0
Method to build a representation at a particular level.
virtual void FindPointsWithinRadius(double R, const double x[3], vtkIdList *result)=0
Find all points within a specified radius R of position x.
a simple class to control print indentation
object to represent cell connectivity
virtual vtkIdType FindClosestInsertedPoint(const double x[3])=0
Given a point x assumed to be covered by the search structure, return the index of the closest point ...
Abstract class in support of both point location and point insertion.
list of point or cell ids
void GetBucketIndices(const double *x, int ijk[3]) const
virtual void BuildLocator()=0
Build the locator from the input dataset.
virtual int InitPointInsertion(vtkPoints *newPts, const double bounds[6])=0
Initialize the point insertion process.
virtual void FindClosestNPoints(int N, const double x[3], vtkIdList *result)=0
Find the closest N points to a position.
vtkIdType IsInsertedPoint(double x, double y, double z) override
Determine whether point given by x[3] has been inserted into points list.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
concrete dataset represents vertices, lines, polygons, and triangle strips
virtual vtkIdType FindClosestPoint(const double x[3])=0
Given a position x, return the id of the point closest to it.
virtual void FreeSearchStructure()=0
Free the memory required for the spatial data structure.
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.