buildSubgraphs method

void buildSubgraphs(
  1. List subgraphList,
  2. PolygonBuilder polyBuilder
)

Completes the building of the input subgraphs by depth-labelling them, and adds them to the PolygonBuilder. The subgraph list must be sorted in rightmost-coordinate order.

@param subgraphList the subgraphs to build @param polyBuilder the PolygonBuilder which will build the final polygons

Implementation

void buildSubgraphs(List subgraphList, PolygonBuilder polyBuilder) {
  List processedGraphs = [];
  for (BufferSubgraph subgraph in subgraphList) {
    Coordinate p = subgraph.getRightmostCoordinate()!;
//      int outsideDepth = 0;
//      if (polyBuilder.containsPoint(p))
//        outsideDepth = 1;
    SubgraphDepthLocater locater = new SubgraphDepthLocater(processedGraphs);
    int outsideDepth = locater.getDepth(p);
//      try {
    subgraph.computeDepth(outsideDepth);
//      }
//      catch (RuntimeException ex) {
//        // debugging only
//        //subgraph.saveDirEdges();
//        throw ex;
//      }
    subgraph.findResultEdges();
    processedGraphs.add(subgraph);
    polyBuilder.add(subgraph.getDirectedEdges(), subgraph.getNodes());
  }
}