class BufferSubgraph
extends java.lang.Object
implements java.lang.Comparable
DirectedEdge
s and Node
s.
Its edges will generate either
Modifier and Type | Field and Description |
---|---|
private java.util.List |
dirEdgeList |
private Envelope |
env |
private RightmostEdgeFinder |
finder |
private java.util.List |
nodes |
private Coordinate |
rightMostCoord |
Constructor and Description |
---|
BufferSubgraph() |
Modifier and Type | Method and Description |
---|---|
private void |
add(Node node,
java.util.Stack nodeStack)
Adds the argument node and all its out edges to the subgraph
|
private void |
addReachable(Node startNode)
Adds all nodes and edges reachable from this node to the subgraph.
|
private void |
clearVisitedEdges() |
int |
compareTo(java.lang.Object o)
BufferSubgraphs are compared on the x-value of their rightmost Coordinate.
|
void |
computeDepth(int outsideDepth) |
private void |
computeDepths(DirectedEdge startEdge)
Compute depths for all dirEdges via breadth-first traversal of nodes in graph
|
private void |
computeNodeDepth(Node n) |
private void |
copySymDepths(DirectedEdge de) |
void |
create(Node node)
Creates the subgraph consisting of all edges reachable from this node.
|
void |
findResultEdges()
Find all edges whose depths indicates that they are in the result area(s).
|
java.util.List |
getDirectedEdges() |
Envelope |
getEnvelope()
Computes the envelope of the edges in the subgraph.
|
java.util.List |
getNodes() |
Coordinate |
getRightmostCoordinate()
Gets the rightmost coordinate in the edges of the subgraph
|
private RightmostEdgeFinder finder
private java.util.List dirEdgeList
private java.util.List nodes
private Coordinate rightMostCoord
private Envelope env
public java.util.List getDirectedEdges()
public java.util.List getNodes()
public Envelope getEnvelope()
public Coordinate getRightmostCoordinate()
public void create(Node node)
node
- a node to start the graph traversal fromprivate void addReachable(Node startNode)
node
- a node known to be in the subgraphprivate void add(Node node, java.util.Stack nodeStack)
node
- the node to addnodeStack
- the current set of nodes being traversedprivate void clearVisitedEdges()
public void computeDepth(int outsideDepth)
private void computeDepths(DirectedEdge startEdge)
startEdge
- edge to start processing withprivate void computeNodeDepth(Node n)
private void copySymDepths(DirectedEdge de)
public void findResultEdges()
public int compareTo(java.lang.Object o)
g1 >= g2 <==> Ring(g2) does not contain Ring(g1)
where Polygon(g) is the buffer polygon that is built from g.
This relationship is used to sort the BufferSubgraphs so that shells are guaranteed to be built before holes.
compareTo
in interface java.lang.Comparable