astex
Class NeighbourGrid2D

java.lang.Object
  extended by astex.NeighbourGrid2D

public class NeighbourGrid2D
extends java.lang.Object


Constructor Summary
NeighbourGrid2D()
          Construct a neighbour grid with the following specification.
 
Method Summary
 void add(int i, double x, double y)
          Add an object to the appropriate cell.
 int getPossibleNeighbours(int id, double x, double y, double d, IntArray neighbours, boolean allNeighbours)
          Return the possible neighbours of the point.
 double getSpacing()
          Get the spacing.
 void reset(double xmin, double ymin, double xmax, double ymax, double dmin)
          Reset and reuse a neighbour grid.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NeighbourGrid2D

public NeighbourGrid2D()
Construct a neighbour grid with the following specification.

Method Detail

getSpacing

public double getSpacing()
Get the spacing.


reset

public void reset(double xmin,
                  double ymin,
                  double xmax,
                  double ymax,
                  double dmin)
Reset and reuse a neighbour grid.


add

public void add(int i,
                double x,
                double y)
Add an object to the appropriate cell.


getPossibleNeighbours

public int getPossibleNeighbours(int id,
                                 double x,
                                 double y,
                                 double d,
                                 IntArray neighbours,
                                 boolean allNeighbours)
Return the possible neighbours of the point. d - is the distance we want to find neighbours out to.