cs252proj.api
Interface VoronoiDiagrammer


public interface VoronoiDiagrammer

An interface for finding the Voronoi diagram of a collection of points.


Method Summary
 void execute(jdsl.core.api.ObjectIterator oi)
          Finds the Voronoi diagram for a given set of points.
 jdsl.map.api.Face getCorrespFace(jdsl.geomobj.api.Point2D p)
          Finds the corresponding face in the Voronoi diagram given the original point.
 jdsl.geomobj.api.Point2D getOrigPoint(jdsl.map.api.Face f)
          Finds the corresponding point in the original collection given a face in the Voronoi diagram.
 jdsl.map.api.InspectableEmbeddedPlanarGraph getVoronoi()
          Returns the Voronoi diagram for the collection of points.
 

Method Detail

execute

public void execute(jdsl.core.api.ObjectIterator oi)
             throws java.lang.ClassCastException,
                    java.lang.IllegalArgumentException
Finds the Voronoi diagram for a given set of points.
Parameters:
oi - an iterator over the set of points.
Throws:
java.lang.ClassCastException - if an object in the iterator is not a Point2D.
java.lang.IllegalArgumentException - if any points overlap.

getVoronoi

public jdsl.map.api.InspectableEmbeddedPlanarGraph getVoronoi()
                                                       throws java.lang.IllegalStateException
Returns the Voronoi diagram for the collection of points.
Returns:
a graph of the diagram.
Throws:
java.lang.IllegalStateException - if execute() was not called first.

getCorrespFace

public jdsl.map.api.Face getCorrespFace(jdsl.geomobj.api.Point2D p)
                                 throws java.lang.IllegalArgumentException,
                                        java.lang.IllegalStateException
Finds the corresponding face in the Voronoi diagram given the original point.
Parameters:
p - the original point.
Returns:
the face in the diagram.
Throws:
java.lang.IllegalArgumentException - if p is not in the original collection of points.
java.lang.IllegalStateException - if execute() was not called first.

getOrigPoint

public jdsl.geomobj.api.Point2D getOrigPoint(jdsl.map.api.Face f)
                                      throws java.lang.IllegalArgumentException,
                                             java.lang.IllegalStateException
Finds the corresponding point in the original collection given a face in the Voronoi diagram.
Parameters:
f - the face in the Voronoi diagram.
Returns:
the original point.
Throws:
java.lang.IllegalArgumentException - if f is not in the Voronoi diagram.
java.lang.IllegalStateException - if execute() was not called first.