Man Page for vtkPointLocator
Table of Contents

NAME

vtkPointLocator - quickly locate points in 3-space

SYNOPSIS


#include "/opt/vtk-c++/common/vtkPointLocator.h"

class VTK_EXPORT vtkPointLocator : public vtkLocator

vtkPointLocator();
static vtkPointLocator *New() {return new vtkPointLocator;};
const char *GetClassName() {return "vtkPointLocator";};
void PrintSelf(ostream& os, vtkIndent indent);
void SetDivisions(int, int, int);
void SetDivisions(int *);
int *GetDivisions();
void GetDivisions(int data[3]);
void SetNumberOfPointsPerBucket(int);
int GetNumberOfPointsPerBucket();
virtual int FindClosestPoint(float x[3]);
virtual int *MergePoints();
virtual int InitPointInsertion(vtkPoints *newPts, float bounds[6]);
virtual void InsertPoint(int ptId, float x[3]);
virtual int InsertNextPoint(float x[3]);
virtual int IsInsertedPoint(float x[3]);
virtual int FindClosestInsertedPoint(float x[3]);
void Initialize();
void FreeSearchStructure();
void BuildLocator();
void GenerateRepresentation(int level, vtkPolyData *pd);

DESCRIPTION

vtkPointLocator is a spatial search object to quickly locate points in 3D. vtkPointLocator works by dividing a specified region of space into a regular array of "rectangular" buckets, and then keeping a list of points that lie in each bucket. Typical operation involves giving a position in 3D and finding the closest point.

vtkPointLocator has two distinct methods of interaction. In the first method, you suppy it with a dataset, and it operates on the points in the dataset. In the second method, you supply it with an array of points, and the object operates on the array.

CAVEATS

Many other types of spatial locators have been developed such as octrees and kd-trees. These are often more efficient for the operations described here.

SEE ALSO

vtkCellPicker vtkPointPicker

SUMMARY

void SetDivisions(int, int, int)
void SetDivisions(int *)
Set the number of divisions in x-y-z directions.

void SetNumberOfPointsPerBucket(int)
Specify the average number of points in each bucket.

vtkPointLocator()
Construct with automatic computation of divisions, averaging 25 points per bucket.

int FindClosestPoint(float x[3])
Given a position x, return the id of the point closest to it.

int *MergePoints()
Merge points together based on tolerance specified. Return a list that maps unmerged point ids into new point ids.

int InitPointInsertion(vtkPoints *newPts, float bounds[6]) Initialize the point insertion process. The newPts is an object representing point coordinates into which incremental insertion methods place their data. Bounds are the box that the points lie in.

int InsertNextPoint(float x[3])
Incrementally insert a point into search structure. The method returns the insertion location (i.e., point id). You should use the method IsInsertedPoint() to see whether this point has already been inserted (that is, if you desire to prevent dulicate points). Before using this method you must make sure that newPts have been supplied, the bounds has been set properly, and that divs are properly set. (See InitPointInsertion().)

void InsertPoint(int ptId, float x[3])
Incrementally insert a point into search structure with a particular index value. You should use the method IsInsertedPoint() to see whether this point has already been inserted (that is, if you desire to prevent dulicate points). Before using this method you must make sure that newPts have been supplied, the bounds has been set properly, and that divs are properly set. (See InitPointInsertion().)

int IsInsertedPoint(float x[3])
Determine whether point given by x[3] has been inserted into points list. Return id of previously inserted point if this is true, otherwise return -1.

int FindClosestInsertedPoint(float x[3])
Given a position x, return the id of the point closest to it. This method is used when performing incremental point insertion.


Table of Contents