|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jdsl.core.ref.AbstractPositionalContainer | +--jdsl.graph.ref.AbstractGraph | +--jdsl.map.ref.TripartiteEmbeddedPlanarGraph
An implementation of an EmbeddedPlanarGraph via a tripartite OrderedGraph. The vertices of the OrderedGraph represent vertices, edges, and faces of the EmbeddedPlanarGraph. The edges of the OrderedGraph represent the incidence relationship between edges and vertices, and between edges and faces in the EmbeddedPlanarGraph. Each vertex of the OrderedGraph representing an edge of the EmbeddedPlanarGraph has four adjacent vertices: two representing vertices and two representing faces of the EmbeddedPlanarGraph. The convention adopted is the following:
Inner classes inherited from class jdsl.graph.ref.AbstractGraph |
AbstractGraph.OO_to_O_MergerIterator |
Field Summary | |
protected TripartiteEmbeddedPlanarGraph |
dual_
The dual of this graph |
protected static int |
DUAL_INDEX
|
protected int |
dualIndex_
|
protected static java.lang.Object |
MARKED
|
protected static int |
PRIMAL_INDEX
|
protected int |
thisIndex_
|
protected OrderedGraph |
tripartite_
The underlying representation of the graph |
Constructor Summary | |
|
TripartiteEmbeddedPlanarGraph()
Creates an initial embedded planar graph consisting of a single vertex, no edges, and one face (the external face). |
protected |
TripartiteEmbeddedPlanarGraph(TripartiteEmbeddedPlanarGraph primal)
Invoked by createDual(). |
Method Summary | |
Face |
aCommonFace(Edge e1,
Edge e2)
O(1) |
Face |
aCommonFace(Vertex v1,
Vertex v2)
O(degree(v1)+degree(v2)) |
FaceIterator |
adjacentFaces(Face f)
O(degree(f)) |
Face |
aFace()
in the current implementation there is always at least one face O(1) |
Edge |
anEdge()
O(1) |
Edge |
anIncidentEdge(Face f)
O(1) |
Edge |
anIncidentEdge(Vertex v)
O(1) |
Edge |
anIncidentEdge(Vertex v,
int edgetype)
O(degree(v)) |
Face |
anIncidentFace(Vertex v)
O(1) |
Vertex |
anIncidentVertex(Face f)
O(1) |
boolean |
areAdjacent(Edge e1,
Edge e2)
O(1) |
boolean |
areAdjacent(Face f1,
Face f2)
O(min(degree(f1),degree(f2))) |
boolean |
areIncident(Edge e,
Face f)
O(1) |
boolean |
areIncident(Vertex v,
Edge e)
O(1) |
boolean |
areIncident(Vertex v,
Face f)
O(degree(v)) |
Edge |
attachVertex(Vertex v,
Order order,
Edge e,
Face f,
java.lang.Object vertexInfo,
java.lang.Object edgeInfo)
O(1) |
Edge |
attachVertexFrom(Vertex origin,
Order order,
Edge e,
Face f,
java.lang.Object vertexInfo,
java.lang.Object edgeInfo)
O(1) |
Edge |
attachVertexTo(Vertex destination,
Order order,
Edge e,
Face f,
java.lang.Object vertexInfo,
java.lang.Object edgeInfo)
O(1) |
Vertex |
aVertex()
O(1) |
EdgeIterator |
connectingEdges(Face f1,
Face f2)
O(min(degree(f1),degree(f2))) |
boolean |
contains(Accessor p)
O(1) |
protected void |
createDual()
Allows overriding this class to create a modified dual. |
int |
degree(Face f)
O(1) |
int |
degree(Vertex v)
O(1) |
int |
degree(Vertex v,
int edgetype)
O(degree(v)) |
Vertex |
destination(Edge e)
O(1) |
EmbeddedPlanarGraph |
dual()
|
Edge |
dual(Edge e)
O(1) |
Vertex |
dual(Face f)
O(1) |
Face |
dual(Vertex v)
O(1) |
EdgeIterator |
edges()
O(m) |
ObjectIterator |
elements()
O(n+m+l) |
Vertex[] |
endVertices(Edge e)
O(1) |
FaceIterator |
faces()
O(l) |
Edge |
incidentEdge(Face f,
Order order,
Edge e,
Vertex v)
O(1) Implemented through the dual graph |
Edge |
incidentEdge(Vertex v,
Order order,
Edge e,
Face f)
O(1) |
EdgeIterator |
incidentEdges(Face f)
O(degree(f)) |
EdgeIterator |
incidentEdges(Vertex v)
O(degree(v)) |
EdgeIterator |
incidentEdges(Vertex v,
int edgetype)
O(degree(v)) |
Face |
incidentFace(Vertex v,
Order order,
Edge e)
|
Face[] |
incidentFaces(Edge e)
O(1) |
FaceIterator |
incidentFaces(Vertex v)
O(degree(v)) |
Vertex |
incidentVertex(Face f,
Order order,
Edge e)
|
VertexIterator |
incidentVertices(Face f)
O(degree(f)) |
Edge |
insertDirectedEdge(Vertex v1,
Order order1,
Edge e1,
Vertex v2,
Order order2,
Edge e2,
Face f,
java.lang.Object info)
Inserts a new directed edge from an existing origin vertex to an existing destination vertex in a specified order; the two vertices must be incident on a common face. |
Edge |
insertEdge(Vertex v1,
Order order1,
Edge e1,
Vertex v2,
Order order2,
Edge e2,
Face f,
java.lang.Object info)
O(degree(face)), where face is the face split by the insertion of the new edge |
InspectableEmbeddedPlanarGraph |
inspectableDual()
O(1) |
boolean |
isDirected(Edge e)
O(1) |
Face |
leftFace(Edge e)
O(1) |
static void |
main(java.lang.String[] argv)
|
void |
makeUndirected(Edge e)
O(1) |
Container |
newContainer()
O(1) |
int |
numEdges()
O(1) |
int |
numFaces()
O(1) |
int |
numVertices()
O(1) |
Face |
opposite(Face f,
Edge e)
O(1) |
Vertex |
opposite(Vertex v,
Edge e)
O(1) |
Vertex |
origin(Edge e)
O(1) |
PositionIterator |
positions()
O(n+m+l) |
Face |
removeEdge(Edge e)
O(1) |
Face |
removeVertex(Vertex v)
O(degree(v)) |
java.lang.Object |
replaceElement(Accessor p,
java.lang.Object newElement)
O(1) |
void |
reverseDirection(Edge e)
O(1) |
Face |
rightFace(Edge e)
O(1) |
void |
setDirectionFrom(Edge e,
Vertex newOrigin)
O(1) |
void |
setDirectionTo(Edge e,
Vertex newDestination)
O(1) |
void |
setLeftFace(Edge e,
Face f)
O(1) |
void |
setRightFace(Edge e,
Face f)
O(1) |
int |
size()
O(1) |
Vertex |
splitEdge(Edge e,
java.lang.Object info)
O(1) |
Edge |
splitVertex(Vertex v,
Edge e1,
Face f1,
Edge e2,
Face f2,
java.lang.Object edgeInfo)
Splits an existing vertex into two new vertices connected by a new edge. |
Edge |
unsplitEdge(Vertex v,
java.lang.Object info)
O(1) |
Vertex |
unsplitVertex(Edge e,
java.lang.Object vertexInfo)
Merges two adjacent vertices and removes the edge(s) connecting them. |
VertexIterator |
vertices()
O(n) |
Methods inherited from class jdsl.graph.ref.AbstractGraph |
aCommonVertex, aConnectingEdge, adjacentVertices, adjacentVertices, areAdjacent, connectingEdges, directedEdges, undirectedEdges |
Methods inherited from class jdsl.core.ref.AbstractPositionalContainer |
isEmpty, swapElements |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface jdsl.graph.api.InspectableGraph |
aCommonVertex, aConnectingEdge, adjacentVertices, adjacentVertices, areAdjacent, connectingEdges, directedEdges, undirectedEdges |
Methods inherited from interface jdsl.core.api.InspectableContainer |
isEmpty |
Methods inherited from interface jdsl.core.api.PositionalContainer |
swapElements |
Field Detail |
protected static final int PRIMAL_INDEX
protected static final int DUAL_INDEX
protected static final java.lang.Object MARKED
protected final int thisIndex_
protected final int dualIndex_
protected OrderedGraph tripartite_
protected TripartiteEmbeddedPlanarGraph dual_
Constructor Detail |
public TripartiteEmbeddedPlanarGraph()
protected TripartiteEmbeddedPlanarGraph(TripartiteEmbeddedPlanarGraph primal)
Method Detail |
protected void createDual()
public boolean contains(Accessor p)
contains
in interface InspectableContainer
jdsl.core.api.InspectableContainer
InvalidAccessorException
- if a is nullpublic ObjectIterator elements()
elements
in interface InspectableContainer
jdsl.core.api.InspectableContainer
public int size()
size
in interface InspectableContainer
size
in class AbstractGraph
jdsl.core.api.InspectableContainer
public Container newContainer()
newContainer
in interface Container
jdsl.core.api.Container
public java.lang.Object replaceElement(Accessor p, java.lang.Object newElement)
replaceElement
in interface Container
jdsl.core.api.Container
a
- Accessor in this containernewElement
- to be stored at aInvalidAccessorException
- if a is null or does not
belong to this containerpublic PositionIterator positions()
positions
in interface InspectablePositionalContainer
positions
in class AbstractGraph
jdsl.core.api.InspectablePositionalContainer
public int degree(Vertex v) throws InvalidAccessorException
degree
in interface InspectableGraph
jdsl.graph.api.InspectableGraph
v
- a vertexv
InvalidAccessorException
- if v
is
not contained in this graphpublic int degree(Vertex v, int edgetype) throws InvalidAccessorException
degree
in interface InspectableGraph
jdsl.graph.api.InspectableGraph
v
- a vertexedgetype
- A constant from the EdgeDirection
interfacev
InvalidAccessorException
- if v
is
not contained in this graphEdgeDirection
public int numVertices()
numVertices
in interface InspectableGraph
jdsl.graph.api.InspectableGraph
public int numEdges()
numEdges
in interface InspectableGraph
jdsl.graph.api.InspectableGraph
public VertexIterator vertices()
vertices
in interface InspectableGraph
jdsl.graph.api.InspectableGraph
public EdgeIterator edges()
edges
in interface InspectableGraph
jdsl.graph.api.InspectableGraph
public Vertex[] endVertices(Edge e) throws InvalidAccessorException
endVertices
in interface InspectableGraph
jdsl.graph.api.InspectableGraph
e
- an edgee
;
if e
is directed, the first element of the array is the origin of e
and the second element is the destination of e
InvalidAccessorException
- if e
is not
contained in this graphpublic Vertex origin(Edge e) throws InvalidAccessorException, InvalidEdgeException
origin
in interface InspectableGraph
jdsl.graph.api.InspectableGraph
e
- an edgee
, if e
is directedInvalidEdgeException
- if e
is undirectedInvalidAccessorException
- if e
is not
contained in this graphpublic Vertex destination(Edge e) throws InvalidAccessorException, InvalidEdgeException
destination
in interface InspectableGraph
jdsl.graph.api.InspectableGraph
e
- an edgee
, if
e
is directedInvalidEdgeException
- if e
is undirectedInvalidAccessorException
- if e
is not
contained in this graphpublic Vertex opposite(Vertex v, Edge e) throws InvalidVertexException, InvalidAccessorException
opposite
in interface InspectableGraph
jdsl.graph.api.InspectableGraph
v
- one endvertex of e
e
- an edgee
different from v
InvalidVertexException
- if v
is not an
endvertex of e
InvalidAccessorException
- if v
or e
is not contained in this graphpublic boolean isDirected(Edge e) throws InvalidAccessorException
isDirected
in interface InspectableGraph
jdsl.graph.api.InspectableGraph
e
- an edgetrue
if e
is directed,
false
otherwiseInvalidAccessorException
- if e
is not
contained in this graphpublic Vertex aVertex()
aVertex
in interface InspectableGraph
jdsl.graph.api.InspectableGraph
public Edge anEdge()
anEdge
in interface InspectableGraph
jdsl.graph.api.InspectableGraph
public Edge anIncidentEdge(Vertex v) throws InvalidAccessorException
anIncidentEdge
in interface InspectableGraph
jdsl.graph.api.InspectableGraph
v
- a vertexv
, or Edge.NONE if
there is no edge incident on v
InvalidAccessorException
- if v
is not
contained in this graphpublic Edge anIncidentEdge(Vertex v, int edgetype) throws InvalidAccessorException
anIncidentEdge
in interface InspectableGraph
jdsl.graph.api.InspectableGraph
v
- a vertexedgetype
- A constant from the EdgeDirection
interfacev
,
or Edge.NONE if there is no such edge incident on v
InvalidAccessorException
- if v
is not
contained in this graphEdgeDirection
public boolean areIncident(Vertex v, Edge e) throws InvalidAccessorException
areIncident
in interface InspectableGraph
jdsl.graph.api.InspectableGraph
v
- a vertexe
- an edgev
and e
are incident,
i.e., whether v
is an endvertex of e
InvalidAccessorException
- if either v
or
e
is not contained in this graphpublic EdgeIterator incidentEdges(Vertex v) throws InvalidAccessorException
incidentEdges
in interface InspectableGraph
jdsl.graph.api.InspectableGraph
v
- a vertexv
InvalidAccessorException
- if v
is not
contained in this graphpublic EdgeIterator incidentEdges(Vertex v, int edgetype) throws InvalidAccessorException
incidentEdges
in interface InspectableGraph
jdsl.graph.api.InspectableGraph
v
- a vertexedgetype
- A constant from the EdgeDirection
interfacev
InvalidAccessorException
- if v
is not
contained in this graphEdgeDirection
public void makeUndirected(Edge e) throws InvalidAccessorException
makeUndirected
in interface ModifiableGraph
jdsl.graph.api.ModifiableGraph
e
- an edgeInvalidAccessorException
- if the edge does not belong
to this graphpublic void reverseDirection(Edge e) throws InvalidEdgeException, InvalidAccessorException
reverseDirection
in interface ModifiableGraph
jdsl.graph.api.ModifiableGraph
e
- an edgeInvalidEdgeException
- If the edge is undirectedInvalidAccessorException
- if the edge does not belong
to this graphpublic Vertex splitEdge(Edge e, java.lang.Object info) throws InvalidAccessorException
splitEdge
in interface ModifiableGraph
jdsl.graph.api.ModifiableGraph
e
- the edge to be splitvertElement
- the object to be stored in v
w
; to get the new edges, use method
incidentEdges(w)
InvalidAccessorException
- if the edge does not belong
to this graphpublic Edge unsplitEdge(Vertex v, java.lang.Object info) throws InvalidAccessorException, InvalidVertexException
unsplitEdge
in interface ModifiableGraph
jdsl.graph.api.ModifiableGraph
v
- the vertex to be removededgeElement
- the element to be stored in the new edgeInvalidVertexException
- If the vertex is not of degree 2
or is of degree 2 but the "two" edges are a single self-loopInvalidAccessorException
- if the vertex does not
belong to this graphpublic Face aFace()
aFace
in interface InspectableEmbeddedPlanarGraph
jdsl.map.api.InspectableEmbeddedPlanarGraph
public int numFaces()
numFaces
in interface InspectableEmbeddedPlanarGraph
jdsl.map.api.InspectableEmbeddedPlanarGraph
public FaceIterator faces()
faces
in interface InspectableEmbeddedPlanarGraph
jdsl.map.api.InspectableEmbeddedPlanarGraph
public Face leftFace(Edge e) throws InvalidAccessorException, InvalidEdgeException
leftFace
in interface InspectableEmbeddedPlanarGraph
jdsl.map.api.InspectableEmbeddedPlanarGraph
e
- a directed edgeInvalidAccessorException
- if e
is null or
not contained in this graphInvalidEdgeException
- if e
is not directedpublic Face rightFace(Edge e) throws InvalidAccessorException, InvalidEdgeException
rightFace
in interface InspectableEmbeddedPlanarGraph
jdsl.map.api.InspectableEmbeddedPlanarGraph
e
- a directed edgeInvalidAccessorException
- if e
is null or not
contained in this graphInvalidEdgeException
- if e
is not directedpublic boolean areAdjacent(Edge e1, Edge e2)
areAdjacent
in interface InspectableEmbeddedPlanarGraph
areAdjacent
in class AbstractGraph
jdsl.map.api.InspectableEmbeddedPlanarGraph
e1
- an edgee2
- an edgeInvalidAccessorException
- if either e1
or
e2
is null or not contained in this graphpublic boolean areAdjacent(Face f1, Face f2)
areAdjacent
in interface InspectableEmbeddedPlanarGraph
jdsl.map.api.InspectableEmbeddedPlanarGraph
f1
- a facef2
- a faceInvalidAccessorException
- if either f1
or
f2
is null or not contained in this graphpublic boolean areIncident(Edge e, Face f) throws InvalidAccessorException
areIncident
in interface InspectableEmbeddedPlanarGraph
jdsl.map.api.InspectableEmbeddedPlanarGraph
e
- an edgef
- a faceInvalidAccessorException
- if either e
or
f
is null or not contained in this graphpublic boolean areIncident(Vertex v, Face f)
areIncident
in interface InspectableEmbeddedPlanarGraph
jdsl.map.api.InspectableEmbeddedPlanarGraph
v
- a vertexf
- a faceInvalidAccessorException
- if either v
or
f
is null or not contained in this graphpublic InspectableEmbeddedPlanarGraph inspectableDual()
inspectableDual
in interface InspectableEmbeddedPlanarGraph
jdsl.map.api.InspectableEmbeddedPlanarGraph
public Vertex anIncidentVertex(Face f) throws InvalidAccessorException
anIncidentVertex
in interface InspectableEmbeddedPlanarGraph
jdsl.map.api.InspectableEmbeddedPlanarGraph
f
- a faceInvalidAccessorException
- if f
is null or not
contained in this graphpublic Edge anIncidentEdge(Face f) throws InvalidAccessorException
anIncidentEdge
in interface InspectableEmbeddedPlanarGraph
jdsl.map.api.InspectableEmbeddedPlanarGraph
f
- a faceInvalidAccessorException
- if f
is null or not
contained in this graphpublic Face anIncidentFace(Vertex v) throws InvalidAccessorException
anIncidentFace
in interface InspectableEmbeddedPlanarGraph
jdsl.map.api.InspectableEmbeddedPlanarGraph
v
- a vertexv
InvalidAccessorException
- if v
is null or not
contained in this graphpublic int degree(Face f) throws InvalidAccessorException
degree
in interface InspectableEmbeddedPlanarGraph
jdsl.map.api.InspectableEmbeddedPlanarGraph
f
- a faceInvalidAccessorException
- if f
is null or not
contained in this graphpublic Face dual(Vertex v) throws InvalidAccessorException
dual
in interface InspectableEmbeddedPlanarGraph
jdsl.map.api.InspectableEmbeddedPlanarGraph
v
- a vertexv
InvalidAccessorException
- if v
is null or
not contained in this graphpublic Edge dual(Edge e) throws InvalidAccessorException
dual
in interface InspectableEmbeddedPlanarGraph
jdsl.map.api.InspectableEmbeddedPlanarGraph
e
- an edgee
InvalidAccessorException
- if e
is null or not
contained in this graphpublic Vertex dual(Face f) throws InvalidAccessorException
dual
in interface InspectableEmbeddedPlanarGraph
jdsl.map.api.InspectableEmbeddedPlanarGraph
f
- a facef
InvalidAccessorException
- if f
is null or not
contained in this graphpublic Face[] incidentFaces(Edge e) throws InvalidAccessorException
incidentFaces
in interface InspectableEmbeddedPlanarGraph
jdsl.map.api.InspectableEmbeddedPlanarGraph
e
- an edgeInvalidAccessorException
- if e
is null or
not contained in this graphpublic FaceIterator adjacentFaces(Face f) throws InvalidAccessorException
adjacentFaces
in interface InspectableEmbeddedPlanarGraph
jdsl.map.api.InspectableEmbeddedPlanarGraph
f
- a faceInvalidAccessorException
- if f
is null or not
contained in this graphpublic EdgeIterator incidentEdges(Face f) throws InvalidAccessorException
incidentEdges
in interface InspectableEmbeddedPlanarGraph
jdsl.map.api.InspectableEmbeddedPlanarGraph
f
- a faceInvalidAccessorException
- if f
is null or not
contained in this graphpublic FaceIterator incidentFaces(Vertex v) throws InvalidAccessorException
incidentFaces
in interface InspectableEmbeddedPlanarGraph
jdsl.map.api.InspectableEmbeddedPlanarGraph
v
- a vertexv
InvalidAccessorException
- if v
is null or not
contained in this graphpublic VertexIterator incidentVertices(Face f) throws InvalidFaceException
incidentVertices
in interface InspectableEmbeddedPlanarGraph
jdsl.map.api.InspectableEmbeddedPlanarGraph
f
- a faceInvalidAccessorException
- if f
is null or not
contained in this graphpublic Edge incidentEdge(Vertex v, Order order, Edge e, Face f) throws InvalidAccessorException, InvalidOrderException, InvalidEdgeException, InvalidFaceException
incidentEdge
in interface InspectableEmbeddedPlanarGraph
jdsl.map.api.InspectableEmbeddedPlanarGraph
v
- a vertexorder
- indicates if the edge to return is the one
Order.AFTER_CW
or Order.AFTER_CCW e
around v
e
- an edge incident with v
f
- a face incident with e
; this parameter is
meaningful only if e
is a self-loop, otherwise null
can be passedv
(and
f
, if e
is a self-loop) that comes
order e
InvalidAccessorException
- if v
, or
e
, or f
is null or not contained in
this graphInvalidOrderException
- if order
is
different from Order.AFTER_CW
or
Order.AFTER_CCW
InvalidEdgeException
- if e
is not an edge
incident with v
InvalidFaceException
- if f
is not a face
incident with e
public Edge incidentEdge(Face f, Order order, Edge e, Vertex v) throws InvalidAccessorException, InvalidOrderException, InvalidEdgeException, InvalidVertexException
incidentEdge
in interface InspectableEmbeddedPlanarGraph
jdsl.map.api.InspectableEmbeddedPlanarGraph
f
- a faceorder
- indicates if the edge to return is the one
Order.AFTER_LHS
or Order.AFTER_RHS e
around f
e
- an edge incident with f
v
- an endvertex of e
; this parameter is
meaningful only if e
is a bridge, otherwise null
can be passedf
(and
v
, if e
is a bridge) that comes
order e
InvalidAccessorException
- if f
, or
e
, or v
is null or not contained in
this graphInvalidOrderException
- if order is different from
Order.AFTER_LHS
or Order.AFTER_RHS
InvalidEdgeException
- if e
is not an edge
incident with f
InvalidVertexException
- if v
is not an
endvertex of e
public Face incidentFace(Vertex v, Order order, Edge e) throws InvalidAccessorException, InvalidOrderException, InvalidEdgeException, NoUniqueResultException
incidentFace
in interface InspectableEmbeddedPlanarGraph
jdsl.map.api.InspectableEmbeddedPlanarGraph
v
- a vertexorder
- indicates if the face to return is the one
Order.AFTER_CW
or Order.AFTER_CCW e
around v
e
- an edge incident with v
v
that comes
order e
InvalidAccessorException
- if v
, or
e
is null or not contained in this graphInvalidOrderException
- if order
is
different from Order.AFTER_CW
or
Order.AFTER_CCW
InvalidEdgeException
- if e
is not an edge
incident with v
NoUniqueResultException
- if e
is a
self-looppublic Vertex incidentVertex(Face f, Order order, Edge e) throws InvalidAccessorException, InvalidOrderException, InvalidEdgeException, InvalidVertexException
incidentVertex
in interface InspectableEmbeddedPlanarGraph
jdsl.map.api.InspectableEmbeddedPlanarGraph
f
- a faceorder
- indicates if the vertex to return is the one
Order.AFTER_LHS
or Order.AFTER_RHS e
around f
e
- an edge incident with f
f
that comes
order e
InvalidAccessorException
- if f
, or
e
is null or not contained in this graphInvalidOrderException
- if order is different from
Order.AFTER_LHS
or Order.AFTER_RHS
InvalidEdgeException
- if e
is not an edge
incident with f
NoUniqueResultException
- if e
is a bridgepublic Face aCommonFace(Edge e1, Edge e2) throws InvalidAccessorException
aCommonFace
in interface InspectableEmbeddedPlanarGraph
jdsl.map.api.InspectableEmbeddedPlanarGraph
e1
- an edgee2
- an edgeInvalidAccessorException
- if e1
or
e2
is null or not contained in this graphpublic Face aCommonFace(Vertex v1, Vertex v2) throws InvalidAccessorException
aCommonFace
in interface InspectableEmbeddedPlanarGraph
jdsl.map.api.InspectableEmbeddedPlanarGraph
v1
- a vertexv2
- a vertexInvalidAccessorException
- if v1
or
v2
is null or not contained in this graphpublic EdgeIterator connectingEdges(Face f1, Face f2) throws InvalidAccessorException
connectingEdges
in interface InspectableEmbeddedPlanarGraph
jdsl.map.api.InspectableEmbeddedPlanarGraph
f1
- a facef2
- a faceInvalidAccessorException
- if either f1
or
f2
is null or not contained in this graphpublic Face opposite(Face f, Edge e) throws InvalidAccessorException, InvalidFaceException
opposite
in interface InspectableEmbeddedPlanarGraph
jdsl.map.api.InspectableEmbeddedPlanarGraph
f
- one of the two faces incident with ee
- an edgeInvalidAccessorException
- if either f
or
e
is null or not contained in this graphInvalidFaceException
- if f
is not a face
incident with e
public void setDirectionFrom(Edge e, Vertex newOrigin) throws InvalidAccessorException, InvalidEdgeException, InvalidVertexException
setDirectionFrom
in interface EmbeddedPlanarGraph
jdsl.map.api.EmbeddedPlanarGraph
e
- an edgev
- an endvertex of eInvalidAccessorException
- if e or v is null or not
contained in this graphInvalidEdgeException
- if e is a self-loopInvalidVertexException
- if v is not an endvertex of eEmbeddedPlanarGraph.setLeftFace(Edge,Face)
,
EmbeddedPlanarGraph.setRightFace(Edge,Face)
public void setDirectionTo(Edge e, Vertex newDestination) throws InvalidAccessorException, InvalidEdgeException, InvalidVertexException
setDirectionTo
in interface EmbeddedPlanarGraph
jdsl.map.api.EmbeddedPlanarGraph
e
- an edgev
- an endvertex of eInvalidAccessorException
- if e or v is null or not
contained in this graphInvalidEdgeException
- if e is a self-loopInvalidVertexException
- if v is not an endvertex of eEmbeddedPlanarGraph.setLeftFace(Edge,Face)
,
EmbeddedPlanarGraph.setRightFace(Edge,Face)
public Face removeEdge(Edge e) throws InvalidAccessorException, ConnectivityViolationException
removeEdge
in interface EmbeddedPlanarGraph
jdsl.map.api.EmbeddedPlanarGraph
e
- the edge to be removede
InvalidAccessorException
- if e is null or not contained
in this graphConnectivityViolationException
- if the edge removal
disconnects the graphpublic Face removeVertex(Vertex v) throws InvalidAccessorException, ConnectivityViolationException
removeVertex
in interface EmbeddedPlanarGraph
jdsl.map.api.EmbeddedPlanarGraph
v
- the vertex to be removedv
, if
degree(v) > 1
; the face incident with
v
, if degree(v) == 1
InvalidAccessorException
- if v is null or not contained
in this graphConnectivityViolationException
- if the vertex removal
disconnects the graphpublic void setLeftFace(Edge e, Face f) throws InvalidAccessorException, InvalidFaceException
setLeftFace
in interface EmbeddedPlanarGraph
jdsl.map.api.EmbeddedPlanarGraph
e
- an edgef
- a face incident with eInvalidAccessorException
- if e or f is null or not
contained in this graphInvalidFaceException
- if f is not incident with epublic void setRightFace(Edge e, Face f) throws InvalidAccessorException, InvalidFaceException
setRightFace
in interface EmbeddedPlanarGraph
jdsl.map.api.EmbeddedPlanarGraph
e
- an edgef
- a face incident with eInvalidAccessorException
- if e or f is null or not
contained in this graphInvalidFaceException
- if f is not incident with epublic Edge attachVertex(Vertex v, Order order, Edge e, Face f, java.lang.Object vertexInfo, java.lang.Object edgeInfo) throws InvalidAccessorException, InvalidOrderException, InvalidEdgeException, InvalidFaceException
attachVertex
in interface EmbeddedPlanarGraph
jdsl.map.api.EmbeddedPlanarGraph
v
- a vertexorder
- indicates if the new edge is to be inserted
Order.AFTER_CW or Order.AFTER_CCW e around ve
- an edge incident with v or Edge.NONE if v is an isolated
vertexf
- a face incident with e
; this parameter is
meaningful only if e is a self-loop, otherwise null can be
passed; the new vertex and the new edge will be incident with
this facevertexInfo
- the object to be stored in the new vertex and
in its dual faceedgeInfo
- the object to be stored in the new edge and in
its dual edgeInvalidAccessorException
- if v or e (or f, if
meaningful) is null or not contained in this graphInvalidOrderException
- if order is different from
Order.AFTER_CW or Order.AFTER_CCWInvalidEdgeException
- if e is not an edge incident with
v, or if Edge.NONE is passed as the edge parameter and v is not
an isolated vertex, or if Edge.NONE is not passed as the edge
parameter and v is an isolated vertexInvalidFaceException
- if e is a self-loop and f is not
a face incident with eInspectableGraph.opposite(Vertex,Edge)
public Edge attachVertexFrom(Vertex origin, Order order, Edge e, Face f, java.lang.Object vertexInfo, java.lang.Object edgeInfo) throws InvalidAccessorException, InvalidOrderException, InvalidEdgeException, InvalidFaceException
attachVertexFrom
in interface EmbeddedPlanarGraph
jdsl.map.api.EmbeddedPlanarGraph
origin
- a vertexorder
- indicates if the new edge is to be inserted
Order.AFTER_CW or Order.AFTER_CCW e around ve
- an edge incident with v or Edge.NONE if v is an isolated
vertexf
- a face incident with e
; this parameter is
meaningful only if e is a self-loop, otherwise null can be
passed; the new vertex and the new edge will be incident with
this facevertexInfo
- the object to be stored in the new vertex and
in its dual faceedgeInfo
- the object to be stored in the new edge and in
its dual edgeInvalidAccessorException
- if v or e (or f, if
meaningful) is null or not contained in this graphInvalidOrderException
- if order is different from
Order.AFTER_CW or Order.AFTER_CCWInvalidEdgeException
- if e is not an edge incident with
v, or if Edge.NONE is passed as the edge parameter and v is not an
isolated vertex, or if Edge.NONE is not passed as the edge
parameter and v is an isolated vertexInvalidFaceException
- if e is a self-loop and f is not
a face incident with eInspectableGraph.opposite(Vertex,Edge)
public Edge attachVertexTo(Vertex destination, Order order, Edge e, Face f, java.lang.Object vertexInfo, java.lang.Object edgeInfo) throws InvalidAccessorException, InvalidOrderException, InvalidEdgeException, InvalidFaceException
attachVertexTo
in interface EmbeddedPlanarGraph
jdsl.map.api.EmbeddedPlanarGraph
destination
- a vertexorder
- indicates if the new edge is to be inserted
Order.AFTER_CW or Order.AFTER_CCW e around ve
- an edge incident with v or Edge.NONE if v is an isolated
vertexf
- a face incident with e
; this parameter is
meaningful only if e is a self-loop, otherwise null can be
passed; the new vertex and the new edge will be incident with
this facevertexInfo
- the object to be stored in the new vertex and
in its dual faceedgeInfo
- the object to be stored in the new edge and in
its dual edgeInvalidAccessorException
- if v or e (or f, if
meaningful) is null or not contained in this graphInvalidOrderException
- if order is different from
Order.AFTER_CW or Order.AFTER_CCWInvalidEdgeException
- if e is not an edge incident with
v, or if Edge.NONE is passed as the edge parameter and v is not an
isolated vertex, or if Edge.NONE is not passed as the edge
parameter and v is an isolated vertexInvalidFaceException
- if e is a self-loop and f is not
a face incident with eInspectableGraph.opposite(Vertex,Edge)
public Edge insertEdge(Vertex v1, Order order1, Edge e1, Vertex v2, Order order2, Edge e2, Face f, java.lang.Object info) throws InvalidAccessorException, InvalidOrderException, InvalidEdgeException, InvalidFaceException, PlanarityViolationException
insertEdge
in interface EmbeddedPlanarGraph
jdsl.map.api.EmbeddedPlanarGraph
v1
- the first endvertexorder1
- indicates if the new edge is to be inserted
Order.AFTER_CW or Order.AFTER_CCW e1 around v1e1
- an edge incident with v1 or Edge.NONE if v is an
isolated vertexv2
- the second endvertexorder2
- indicates if the new edge is to be inserted
Order.AFTER_CW or Order.AFTER_CCW e2 around v2e2
- an edge incident with v2 or Edge.NONE if v is an
isolated vertexf
- a face incident with e1
(e2
);
this parameter is meaningful only if e1
(e2
) is a self-loop, otherwise null can be passed;
the new edge will split this faceinfo
- the object to be stored in the new edge and in its
dual edgeInvalidAccessorException
- if v1, e1, v2, or e2 (or f,
if meaningful) is null or not contained in this graphInvalidOrderException
- if order is different from
Order.AFTER_CW or Order.AFTER_CCWInvalidEdgeException
- if e1 (e2) is not an edge
incident with v1 (v2), or if Edge.NONE is passed as the edge
parameter and v1 (v2) is not an isolated vertex, or if Edge.NONE
is not passed as the edge parameter and v1 (v2) is an isolated
vertexInvalidFaceException
- if e1 (e2) is a self-loop and f
is not a face incident with e1 (e2)PlanarityViolationException
- if the face identified by
v1, order1, e1 is different from the face identified by v2,
order2, e2public Edge insertDirectedEdge(Vertex v1, Order order1, Edge e1, Vertex v2, Order order2, Edge e2, Face f, java.lang.Object info) throws InvalidAccessorException, InvalidOrderException, InvalidEdgeException, InvalidFaceException, PlanarityViolationException
EmbeddedPlanarGraph
element()
can still be retrieved. Two
new adjacent faces storing null
are inserted.insertDirectedEdge
in interface EmbeddedPlanarGraph
jdsl.map.api.EmbeddedPlanarGraph
v1
- the origin vertexorder1
- indicates if the new edge is to be inserted
Order.AFTER_CW or Order.AFTER_CCW e1 around v1e1
- an edge incident with v1 or Edge.NONE if v is an
isolated vertexv2
- the destination vertexorder2
- indicates if the new edge is to be inserted
Order.AFTER_CW or Order.AFTER_CCW e2 around v2e2
- an edge incident with v2 or Edge.NONE if v is an
isolated vertexf
- a face incident with e1
(v2
);
this parameter is meaningful only if e1
(e2
) is a self-loop, otherwise null can be passed;
the new edge will split this faceinfo
- the object to be stored in the new edge and in its
dual edgeInvalidAccessorException
- if v1, e1, v2, or e2 (or f,
if meaningful) is null or not contained in this graphInvalidOrderException
- if order is different from
Order.AFTER_CW or Order.AFTER_CCWInvalidEdgeException
- if e1 (e2) is not an edge
incident with v1 (v2), or if Edge.NONE is passed as the edge
parameter and v1 (v2) is not an isolated vertex, or if Edge.NONE
is not passed as the edge parameter and v1 (v2) is an isolated
vertexInvalidFaceException
- if e1 (e2) is a self-loop and f
is not a face incident with e1 (e2)PlanarityViolationException
- if the face identified by
v1, order1, e1 is different from the face identified by v2,
order2, e2public Edge splitVertex(Vertex v, Edge e1, Face f1, Edge e2, Face f2, java.lang.Object edgeInfo) throws InvalidAccessorException, InvalidEdgeException, InvalidFaceException
EmbeddedPlanarGraph
e1 e1 \ / \ / -O- ---> -O---O- / \ / \ e2 e2
splitVertex
in interface EmbeddedPlanarGraph
jdsl.map.api.EmbeddedPlanarGraph
v
- the vertex to be splite1
- an edge incident with v or Edge.NONE if v is an
isolated vertexf1
- a face incident with e1; this parameter is meaningful
only if e1 is a self-loop, otherwise null can be passed; the new
edge will be incident with this facee2
- an edge incident with v or Edge.NONE if v is an
isolated vertexf2
- a face incident with e2; this parameter is meaningful
only if e2 is a self-loop, otherwise null can be passed; the new
edge will be incident with this faceedgeinfo
- the object to be stored in the new edge and in
its dual edgeInvalidAccessorException
- if v, e1, or e2 (or f1 or f2,
if meaningful) is null or not contained in this graphInvalidEdgeException
- if e1 or e2 is not an edge
incident with v, or if Edge.NONE is passed as e1 or e2 and v is
not an isolated vertex, or if Edge.NONE is not passed as e1 and
e2 and v is an isolated vertexInvalidFaceException
- if e1 (e2) is a self-loop and f1
(f2) is not a face incident with e1 (e2)InspectableGraph.endVertices(Edge)
public Vertex unsplitVertex(Edge e, java.lang.Object vertexInfo) throws InvalidAccessorException, InvalidEdgeException
EmbeddedPlanarGraph
\ e / \ / -O---O- ---> -O- / \ / \
unsplitVertex
in interface EmbeddedPlanarGraph
jdsl.map.api.EmbeddedPlanarGraph
e
- the edge to be removedvertexinfo
- the object to be stored in the new vertex and
in its dual faceInvalidAccessorException
- if e is null or not contained
in this graphInvalidEdgeException
- if e is a self-looppublic EmbeddedPlanarGraph dual()
dual
in interface EmbeddedPlanarGraph
jdsl.map.api.EmbeddedPlanarGraph
public static void main(java.lang.String[] argv)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |