Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Related Pages

# vtkPointLocator2D Class Reference

`#include <vtkPointLocator2D.h>`

Inheritance diagram for vtkPointLocator2D:

[legend]
Collaboration diagram for vtkPointLocator2D:

[legend]
List of all members.

## Detailed Description

quickly locate points in 2-space

Date:
  2002/06/08 00:28:44

Revision:
  1.21

vtkPointLocator2D is a spatial search object to quickly locate points in 2D. vtkPointLocator2D 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 2D and finding the closest point.

vtkPointLocator2D has two distinct methods of interaction. In the first method, you supply 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.

This class is similar to vtkPointLocator except that it assumes the points are located in 2D (or at least that the z-coordinate is ignored).

Warning:
  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:
  vtkPointLocator vtkCellPicker vtkPointPicker

Created by:
  - Martin, Ken

CVS contributions (if > 5%):
  - Martin, Ken (76%)
  - Lorensen, Bill (15%)
  - Miller, Jim (5%)

CVS logs (CVSweb):
  - .`cxx` (`/Common/vtkPointLocator2D.cxx)`
  - .`h` (`/Common/vtkPointLocator2D.h)`

Definition at line 67 of file vtkPointLocator2D.h.

## Public Types
typedef vtkLocator | Superclass
## Public Methods
virtual const char * | GetClassName ()
virtual int | IsA (const char *type)
void | PrintSelf (ostream &os, vtkIndent indent)
virtual int | FindClosestPoint (float x[2])
virtual int | IsInsertedPoint (float x[2])
virtual void | SetDivisions (int, int)
void | SetDivisions (int[2])
virtual int * | GetDivisions ()
virtual void | GetDivisions (int data[2])
virtual void | SetNumberOfPointsPerBucket (int)
virtual int | GetNumberOfPointsPerBucket ()
virtual void | FindClosestNPoints (int N, float x[2], vtkIdList *result)
virtual void | FindClosestNPoints (int N, float x, float y, vtkIdList *result)
virtual void | FindDistributedPoints (int N, float x[2], vtkIdList *result, int M)
virtual void | FindDistributedPoints (int N, float x, float y, vtkIdList *result, int M)
virtual void | FindPointsWithinRadius (float R, float x[2], vtkIdList *result)
virtual void | FindPointsWithinRadius (float R, float x, float y, vtkIdList *result)
void | Initialize ()
void | FreeSearchStructure ()
void | BuildLocator ()
void | GenerateRepresentation (int level, vtkPolyData *pd)
virtual void | SetPoints (vtkPoints *)
virtual vtkPoints * | GetPoints ()
## Static Public Methods
vtkPointLocator2D * | New ()
int | IsTypeOf (const char *type)
vtkPointLocator2D * | SafeDownCast (vtkObject *o)
## Protected Methods
| vtkPointLocator2D ()
| ~vtkPointLocator2D ()
void | GetBucketNeighbors (int ijk[2], int ndivs[2], int level)
void | GetOverlappingBuckets (float x[2], int ijk[2], float dist, int level)
void | GenerateFace (int face, int i, int j, int k, vtkPoints *pts, vtkCellArray *polys)
## Protected Attributes
vtkPoints * | Points
int | Divisions [2]
int | NumberOfPointsPerBucket
float | Bounds [4]
vtkIdList ** | HashTable
int | NumberOfBuckets
float | H [2]
vtkNeighborPoints2D * | Buckets
float | InsertionTol2

## Member Typedef Documentation

typedef vtkLocator vtkPointLocator2D::Superclass

| Reimplemented from vtkLocator. Reimplemented in vtkMergePoints2D. Definition at line 74 of file vtkPointLocator2D.h.

## Constructor & Destructor Documentation

vtkPointLocator2D::vtkPointLocator2D | ( |  | ) | `[protected]`

vtkPointLocator2D::~vtkPointLocator2D | ( |  | ) | `[protected]`

## Member Function Documentation

vtkPointLocator2D* vtkPointLocator2D::New | ( |  | ) | `[static]`

| Construct with automatic computation of divisions, averaging 25 points per bucket. Reimplemented from vtkObject. Reimplemented in vtkMergePoints2D.

virtual const char* vtkPointLocator2D::GetClassName | ( |  | ) | `[virtual]`

| Reimplemented from vtkLocator. Reimplemented in vtkMergePoints2D.

int vtkPointLocator2D::IsTypeOf | ( | const char * | type | ) | `[static]`

| Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeRevisionMacro found in vtkSetGet.h. Reimplemented from vtkLocator. Reimplemented in vtkMergePoints2D.

virtual int vtkPointLocator2D::IsA | ( | const char * | type | ) | `[virtual]`

| Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeRevisionMacro found in vtkSetGet.h. Reimplemented from vtkLocator. Reimplemented in vtkMergePoints2D.

vtkPointLocator2D* vtkPointLocator2D::SafeDownCast | ( | vtkObject * | o | ) | `[static]`

| Reimplemented from vtkLocator. Reimplemented in vtkMergePoints2D.

void vtkPointLocator2D::PrintSelf | ( | ostream & | os,
|  | vtkIndent | indent
| ) | `[virtual]`

| Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes. Reimplemented from vtkLocator. Reimplemented in vtkMergePoints2D.

virtual void vtkPointLocator2D::SetDivisions | ( | int | ,
|  | int |
| ) | `[virtual]`

| Set the number of divisions in x-y directions.

void vtkPointLocator2D::SetDivisions | ( | int | [2] | ) |

| Set the number of divisions in x-y directions.

virtual int* vtkPointLocator2D::GetDivisions | ( |  | ) | `[virtual]`

| Set the number of divisions in x-y directions.

virtual void vtkPointLocator2D::GetDivisions | ( | int | data[2] | ) | `[virtual]`

| Set the number of divisions in x-y directions.

virtual void vtkPointLocator2D::SetNumberOfPointsPerBucket | ( | int |  | ) | `[virtual]`

| Specify the average number of points in each bucket.

virtual int vtkPointLocator2D::GetNumberOfPointsPerBucket | ( |  | ) | `[virtual]`

| Specify the average number of points in each bucket.

virtual int vtkPointLocator2D::FindClosestPoint | ( | float | x[2] | ) | `[virtual]`

| Given a position x, return the id of the point closest to it.

virtual int vtkPointLocator2D::IsInsertedPoint | ( | float | x[2] | ) | `[virtual]`

| Determine whether point given by x[2] has been inserted into points list. Return id of previously inserted point if this is true, otherwise return -1. Reimplemented in vtkMergePoints2D.

virtual void vtkPointLocator2D::FindClosestNPoints | ( | int | N,
|  | float | x[2],
|  | vtkIdList * | result
| ) | `[virtual]`

| Find the closest N points to a position. This returns the closest N points to a position. A faster method could be created that returned N close points to a position, but necessarily the exact N closest. The returned points are sorted from closest to farthest.

virtual void vtkPointLocator2D::FindClosestNPoints | ( | int | N,
|  | float | x,
|  | float | y,
|  | vtkIdList * | result
| ) | `[virtual]`

| Find the closest N points to a position. This returns the closest N points to a position. A faster method could be created that returned N close points to a position, but necessarily the exact N closest. The returned points are sorted from closest to farthest.

virtual void vtkPointLocator2D::FindDistributedPoints | ( | int | N,
|  | float | x[2],
|  | vtkIdList * | result,
|  | int | M
| ) | `[virtual]`

| Find the closest points to a position such that each quadrant of space around the position contains at least N points. Loosely limit the search to a maximum number of points evaluated, M.

virtual void vtkPointLocator2D::FindDistributedPoints | ( | int | N,
|  | float | x,
|  | float | y,
|  | vtkIdList * | result,
|  | int | M
| ) | `[virtual]`

| Find the closest points to a position such that each quadrant of space around the position contains at least N points. Loosely limit the search to a maximum number of points evaluated, M.

virtual void vtkPointLocator2D::FindPointsWithinRadius | ( | float | R,
|  | float | x[2],
|  | vtkIdList * | result
| ) | `[virtual]`

| Find all points within a specified radius R of position x. The result is not sorted in any specific manner.

virtual void vtkPointLocator2D::FindPointsWithinRadius | ( | float | R,
|  | float | x,
|  | float | y,
|  | vtkIdList * | result
| ) | `[virtual]`

| Find all points within a specified radius R of position x. The result is not sorted in any specific manner.

void vtkPointLocator2D::Initialize | ( |  | ) | `[virtual]`

| Find all points within a specified radius R of position x. The result is not sorted in any specific manner. Reimplemented from vtkLocator.

void vtkPointLocator2D::FreeSearchStructure | ( |  | ) | `[virtual]`

| Find all points within a specified radius R of position x. The result is not sorted in any specific manner. Implements vtkLocator.

void vtkPointLocator2D::BuildLocator | ( |  | ) | `[virtual]`

| Find all points within a specified radius R of position x. The result is not sorted in any specific manner. Implements vtkLocator.

void vtkPointLocator2D::GenerateRepresentation | ( | int | level,
|  | vtkPolyData * | pd
| ) | `[virtual]`

| Find all points within a specified radius R of position x. The result is not sorted in any specific manner. Implements vtkLocator.

virtual void vtkPointLocator2D::SetPoints | ( | vtkPoints * |  | ) | `[virtual]`

| set the points to use when looking up a coordinate

virtual vtkPoints* vtkPointLocator2D::GetPoints | ( |  | ) | `[virtual]`

| set the points to use when looking up a coordinate

void vtkPointLocator2D::GetBucketNeighbors | ( | int | ijk[2],
|  | int | ndivs[2],
|  | int | level
| ) | `[protected]`

void vtkPointLocator2D::GetOverlappingBuckets | ( | float | x[2],
|  | int | ijk[2],
|  | float | dist,
|  | int | level
| ) | `[protected]`

void vtkPointLocator2D::GenerateFace | ( | int | face,
|  | int | i,
|  | int | j,
|  | int | k,
|  | vtkPoints * | pts,
|  | vtkCellArray * | polys
| ) | `[protected]`

## Member Data Documentation

vtkPoints* vtkPointLocator2D::Points`[protected]`

| Definition at line 147 of file vtkPointLocator2D.h.

int vtkPointLocator2D::Divisions[2]`[protected]`

| Definition at line 148 of file vtkPointLocator2D.h.

int vtkPointLocator2D::NumberOfPointsPerBucket`[protected]`

| Definition at line 149 of file vtkPointLocator2D.h.

float vtkPointLocator2D::Bounds[4]`[protected]`

| Definition at line 150 of file vtkPointLocator2D.h.

vtkIdList** vtkPointLocator2D::HashTable`[protected]`

| Definition at line 151 of file vtkPointLocator2D.h.

int vtkPointLocator2D::NumberOfBuckets`[protected]`

| Definition at line 152 of file vtkPointLocator2D.h.

float vtkPointLocator2D::H[2]`[protected]`

| Definition at line 153 of file vtkPointLocator2D.h.

vtkNeighborPoints2D* vtkPointLocator2D::Buckets`[protected]`

| Definition at line 154 of file vtkPointLocator2D.h.

float vtkPointLocator2D::InsertionTol2`[protected]`

| Definition at line 155 of file vtkPointLocator2D.h.

The documentation for this class was generated from the following file:

- Common/vtkPointLocator2D.h