public void computeDepth(int outsideDepth) { clearVisitedEdges(); // find an outside edge to assign depth to DirectedEdge de = finder.getEdge(); Node n = de.getNode(); Label label = de.getLabel(); // right side of line returned by finder is on the outside de.setEdgeDepths(Position.RIGHT, outsideDepth); copySymDepths(de); //computeNodeDepth(n, de); computeDepths(de); }
private void computeNodeDepth(Node n) { // find a visited dirEdge to start at DirectedEdge startEdge = null; for (Iterator i = ((DirectedEdgeStar) n.getEdges()).iterator(); i.hasNext(); ) { DirectedEdge de = (DirectedEdge) i.next(); if (de.isVisited() || de.getSym().isVisited()) { startEdge = de; break; } } // MD - testing Result: breaks algorithm //if (startEdge == null) return; // only compute string append if assertion would fail if (startEdge == null) throw new TopologyException("unable to find edge to compute depths at " + n.getCoordinate()); ((DirectedEdgeStar) n.getEdges()).computeDepths(startEdge); // copy depths to sym edges for (Iterator i = ((DirectedEdgeStar) n.getEdges()).iterator(); i.hasNext(); ) { DirectedEdge de = (DirectedEdge) i.next(); de.setVisited(true); copySymDepths(de); } }
public void computeDepth(int outsideDepth) { clearVisitedEdges(); // find an outside edge to assign depth to DirectedEdge de = finder.getEdge(); Node n = de.getNode(); Label label = de.getLabel(); // right side of line returned by finder is on the outside de.setEdgeDepths(Position.RIGHT, outsideDepth); copySymDepths(de); //computeNodeDepth(n, de); computeDepths(de); }
private void computeNodeDepth(Node n) { // find a visited dirEdge to start at DirectedEdge startEdge = null; for (Iterator i = ((DirectedEdgeStar) n.getEdges()).iterator(); i.hasNext(); ) { DirectedEdge de = (DirectedEdge) i.next(); if (de.isVisited() || de.getSym().isVisited()) { startEdge = de; break; } } // MD - testing Result: breaks algorithm //if (startEdge == null) return; // only compute string append if assertion would fail if (startEdge == null) throw new TopologyException("unable to find edge to compute depths at " + n.getCoordinate()); ((DirectedEdgeStar) n.getEdges()).computeDepths(startEdge); // copy depths to sym edges for (Iterator i = ((DirectedEdgeStar) n.getEdges()).iterator(); i.hasNext(); ) { DirectedEdge de = (DirectedEdge) i.next(); de.setVisited(true); copySymDepths(de); } }