cs252proj.api
Interface DelaunayTriangulator


public interface DelaunayTriangulator

An interface for finding the Delaunay triangulation of a collection of points.


Method Summary
 void execute(jdsl.core.api.ObjectIterator oi)
          Creates a triangulation with the given set of points.
 jdsl.graph.api.Vertex getCorrespVertex(jdsl.geomobj.api.Point2D p)
          Given a point in the original point set, returns the corresponding vertex in the triangulation.
 jdsl.core.api.ObjectIterator getOrigPoint(jdsl.graph.api.Vertex v)
          Given a vertex in the triangulation, returns an iterator over the points that correspond to it.
 jdsl.map.api.InspectableEmbeddedPlanarGraph getTriangulation()
          Returns a Delaunay triangulation for the collection of points.
 

Method Detail

execute

public void execute(jdsl.core.api.ObjectIterator oi)
             throws java.lang.ClassCastException
Creates a triangulation with the given set of points.
Parameters:
oi - an ObjectIterator containing Point2Ds.
Throws:
java.lang.ClassCastException - if the iterator contains objects that are not Point2Ds.

getTriangulation

public jdsl.map.api.InspectableEmbeddedPlanarGraph getTriangulation()
                                                             throws java.lang.IllegalArgumentException
Returns a Delaunay triangulation for the collection of points.
Returns:
a graph of the triangulation.
Throws:
java.lang.IllegalArgumentException - if execute() was not called first.

getCorrespVertex

public jdsl.graph.api.Vertex getCorrespVertex(jdsl.geomobj.api.Point2D p)
                                       throws java.lang.IllegalArgumentException,
                                              java.lang.IllegalStateException
Given a point in the original point set, returns the corresponding vertex in the triangulation.
Parameters:
p - the point in the original point set.
Returns:
the corresponding vertex.
Throws:
java.lang.IllegalArgumentException - if p is not in the original point set.
java.lang.IllegalStateException - if execute() was not called first.

getOrigPoint

public jdsl.core.api.ObjectIterator getOrigPoint(jdsl.graph.api.Vertex v)
                                          throws java.lang.IllegalArgumentException,
                                                 java.lang.IllegalStateException
Given a vertex in the triangulation, returns an iterator over the points that correspond to it.
Parameters:
v - the vertex in the triangulation.
Returns:
an iterator over the corresponding points.
Throws:
java.lang.IllegalArgumentException - if v is not in the triangulation.
java.lang.IllegalStateException - if execute() was not called first.