public class PlanarGraph extends Object
IntersectionMatrix relies on the use of a structure
called a "topology graph". The topology graph contains nodes and edges
corresponding to the nodes and line segments of a Geometry. Each
node and edge in the graph is labeled with its topological location relative to
the source geometry.
Note that there is no requirement that points of self-intersection be a vertex.
Thus to obtain a correct topology graph, Geometrys must be
self-noded before constructing their graphs.
Two fundamental operations are supported by topology graphs:
| Modifier and Type | Field and Description |
|---|---|
protected List<DirectedEdge> |
edgeEndList |
protected List<Edge> |
edges |
| Constructor and Description |
|---|
PlanarGraph() |
PlanarGraph(NodeFactory nodeFact) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(DirectedEdge e) |
void |
addEdges(List edgesToAdd)
Add a set of edges to the graph.
|
Node |
addNode(Node node) |
Node |
addNode(Point coord) |
Iterable<Edge> |
edges() |
Node |
find(Point coord) |
Edge |
findEdge(Point p0,
Point p1)
Returns the edge whose first two coordinates are p0 and p1
|
EdgeEnd |
findEdgeEnd(Edge e)
Returns the EdgeEnd which has edge e as its base edge
(MD 18 Feb 2002 - this should return a pair of edges)
|
Edge |
findEdgeInSameDirection(Point p0,
Point p1)
Returns the edge which starts at p0 and whose first segment is
parallel to p1
|
Collection<DirectedEdge> |
getEdgeEnds() |
Iterator |
getEdgeIterator() |
Iterator<Node> |
getNodeIterator() |
protected NodeMap |
getNodeMap() |
Collection<Node> |
getNodes() |
protected void |
insertEdge(Edge e) |
boolean |
isBoundaryNode(int geomIndex,
Point coord) |
void |
linkAllDirectedEdges()
Link the DirectedEdges at the nodes of the graph.
|
void |
linkResultDirectedEdges()
Link the DirectedEdges at the nodes of the graph.
|
static void |
linkResultDirectedEdges(Collection nodes)
For nodes in the Collection, link the DirectedEdges at the node that are in the result.
|
protected List<DirectedEdge> edgeEndList
public PlanarGraph()
public PlanarGraph(NodeFactory nodeFact)
public static void linkResultDirectedEdges(Collection nodes)
public void add(DirectedEdge e)
public void addEdges(List edgesToAdd)
public Edge findEdge(Point p0, Point p1)
null if the edge was not foundpublic EdgeEnd findEdgeEnd(Edge e)
null if the edge was not foundpublic Edge findEdgeInSameDirection(Point p0, Point p1)
null if the edge was not foundpublic Collection<DirectedEdge> getEdgeEnds()
public Iterator getEdgeIterator()
protected NodeMap getNodeMap()
public Collection<Node> getNodes()
protected void insertEdge(Edge e)
public boolean isBoundaryNode(int geomIndex,
Point coord)
public void linkAllDirectedEdges()
public void linkResultDirectedEdges()
Copyright © 2015 Revolution Systems Inc.. All rights reserved.