com.vividsolutions.jts.operation.buffer

Class BufferSubgraph

Implemented Interfaces:
Comparable

public class BufferSubgraph
extends java.lang.Object
implements Comparable

A connected subset of the graph of DirectedEdges and Nodes. Its edges will generate either
Version:
1.6

Constructor Summary

BufferSubgraph(CGAlgorithms cga)

Method Summary

int
compareTo(Object o)
BufferSubgraphs are compared on the x-value of their rightmost Coordinate.
void
computeDepth(int outsideDepth)
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).
List
getDirectedEdges()
List
getNodes()
Coordinate
getRightmostCoordinate()
Gets the rightmost coordinate in the edges of the subgraph

Constructor Details

BufferSubgraph

public BufferSubgraph(CGAlgorithms cga)

Method Details

compareTo

public int compareTo(Object o)
BufferSubgraphs are compared on the x-value of their rightmost Coordinate. This defines a partial ordering on the graphs such that:

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.


computeDepth

public void computeDepth(int outsideDepth)

create

public void create(Node node)
Creates the subgraph consisting of all edges reachable from this node. Finds the edges in the graph and the rightmost coordinate.
Parameters:
node - a node to start the graph traversal from

findResultEdges

public void findResultEdges()
Find all edges whose depths indicates that they are in the result area(s). Since we want polygon shells to be oriented CW, choose dirEdges with the interior of the result on the RHS. Mark them as being in the result. Interior Area edges are the result of dimensional collapses. They do not form part of the result area boundary.

getDirectedEdges

public List getDirectedEdges()

getNodes

public List getNodes()

getRightmostCoordinate

public Coordinate getRightmostCoordinate()
Gets the rightmost coordinate in the edges of the subgraph