View Javadoc

1   /**
2    * 
3    */
4   
5   package math.geom2d.grid;
6   
7   import java.util.Collection;
8   
9   import math.geom2d.Box2D;
10  import math.geom2d.Point2D;
11  import math.geom2d.point.PointSet2D;
12  import math.geom2d.line.LineSegment2D;
13  
14  /**
15   * Defines a grid for snapping mouse pointer. The main purpose of a grid is to
16   * find the closest vertex to a given point. It also provides methods for
17   * accessing the collection of vertices and edges visible in a Box2D.
18   * 
19   * @author dlegland
20   */
21  public interface Grid2D {
22  
23  	public Point2D getOrigin();
24  	
25      public PointSet2D getVertices(Box2D box);
26  
27      public Collection<LineSegment2D> getEdges(Box2D box);
28  
29      public Point2D getClosestVertex(java.awt.geom.Point2D point);
30  }