cs252proj.api
Interface ConstrainedTriangulator
- public interface ConstrainedTriangulator
An interface for the constrained triangulation of a graph of vertices
and edges.
Method Summary |
void |
execute(jdsl.graph.api.InspectableGraph g)
Triangulates the given graph such that all vertices and edges
present in the original graph are present in the triangulation. |
jdsl.graph.api.Edge |
getCorrespEdge(jdsl.graph.api.Edge e)
Given an edge in the original graph, returns the corresponding edge
in the triangulation. |
jdsl.graph.api.Vertex |
getCorrespVertex(jdsl.graph.api.Vertex v)
Given a vertex in the original graph, returns the corresponding
vertex in the triangulation. |
jdsl.map.api.InspectableEmbeddedPlanarGraph |
getTriangulation()
|
execute
public void execute(jdsl.graph.api.InspectableGraph g)
throws java.lang.IllegalArgumentException,
java.lang.ClassCastException
- Triangulates the given graph such that all vertices and edges
present in the original graph are present in the triangulation.
- Parameters:
g
- an InspectableGraph with Point2Ds stored at the vertices.- Throws:
java.lang.IllegalArgumentException
- if g is non-planar.java.lang.ClassCastException
- if g's vertices contain objects that are
not Point2Ds.
getTriangulation
public jdsl.map.api.InspectableEmbeddedPlanarGraph getTriangulation()
throws java.lang.IllegalStateException
- Returns:
- an EmbeddedPlanarGraph with Point2Ds stored at the vertices
such that all faces (except the outside face) are triangles.
- Throws:
java.lang.IllegalStateException
- if execute() was not called first.
getCorrespEdge
public jdsl.graph.api.Edge getCorrespEdge(jdsl.graph.api.Edge e)
throws java.lang.IllegalStateException
- Given an edge in the original graph, returns the corresponding edge
in the triangulation. Only guaranteed to work if the original graph
has not been modified.
- Parameters:
e
- the original edge.- Returns:
- the corresponding edge.
- Throws:
java.lang.IllegalStateException
- if execute() was not called first.
getCorrespVertex
public jdsl.graph.api.Vertex getCorrespVertex(jdsl.graph.api.Vertex v)
throws java.lang.IllegalStateException
- Given a vertex in the original graph, returns the corresponding
vertex in the triangulation. Only guaranteed to work if the original
graph has not been modified.
- Parameters:
v
- the original vertex.- Returns:
- the corresponding vertex.
- Throws:
java.lang.IllegalStateException
- if execute() was not called first.