cs252proj.api
Interface PolygonPathFinder
- public interface PolygonPathFinder
An interface for finding the shortest path within a simple polygonal
subdivision.
Method Summary |
void |
execute(jdsl.map.api.InspectableEmbeddedPlanarGraph g)
Initializes the PolygonPathFinder with the given embedded planar
graph. |
jdsl.core.api.ObjectIterator |
getPath(jdsl.geomobj.api.Point2D p1,
jdsl.geomobj.api.Point2D p2)
Finds a path within the polygonal subdivision. |
execute
public void execute(jdsl.map.api.InspectableEmbeddedPlanarGraph g)
throws java.lang.ClassCastException
- Initializes the PolygonPathFinder with the given embedded planar
graph.
- Parameters:
g
- the embedded planar graph on which to search.- Throws:
java.lang.ClassCastException
- if the embedded planar graph does not
contain Point2Ds at its vertices.
getPath
public jdsl.core.api.ObjectIterator getPath(jdsl.geomobj.api.Point2D p1,
jdsl.geomobj.api.Point2D p2)
throws java.lang.IllegalStateException
- Finds a path within the polygonal subdivision.
- Parameters:
p1
- the first point in the path.p2
- the last point in the path.- Returns:
- an iterator over the sequence of Point2Ds making up the path,
or null if no path exists, or one of the points lies on the
graph.
- Throws:
java.lang.IllegalStateException
- if execute was not called first.