Search in sources :

Example 1 with DirectedEdgeStar

use of com.revolsys.geometry.geomgraph.DirectedEdgeStar in project com.revolsys.open by revolsys.

the class RightmostEdgeFinder method findRightmostEdgeAtNode.

private void findRightmostEdgeAtNode() {
    final Node node = this.minDe.getNode();
    final DirectedEdgeStar star = (DirectedEdgeStar) node.getEdges();
    this.minDe = star.getRightmostEdge();
    // necessarily in the forward direction. Use the sym edge if it isn't.
    if (!this.minDe.isForward()) {
        this.minDe = this.minDe.getSym();
        this.minIndex = this.minDe.getEdge().getVertexCount() - 1;
    }
}
Also used : DirectedEdgeStar(com.revolsys.geometry.geomgraph.DirectedEdgeStar) Node(com.revolsys.geometry.geomgraph.Node)

Example 2 with DirectedEdgeStar

use of com.revolsys.geometry.geomgraph.DirectedEdgeStar in project com.revolsys.open by revolsys.

the class MaximalEdgeRing method linkDirectedEdgesForMinimalEdgeRings.

/**
 * For all nodes in this EdgeRing,
 * link the DirectedEdges at the node to form minimalEdgeRings
 */
public void linkDirectedEdgesForMinimalEdgeRings() {
    DirectedEdge de = this.startDe;
    do {
        final Node node = de.getNode();
        ((DirectedEdgeStar) node.getEdges()).linkMinimalDirectedEdges(this);
        de = de.getNext();
    } while (de != this.startDe);
}
Also used : DirectedEdge(com.revolsys.geometry.geomgraph.DirectedEdge) DirectedEdgeStar(com.revolsys.geometry.geomgraph.DirectedEdgeStar) Node(com.revolsys.geometry.geomgraph.Node)

Example 3 with DirectedEdgeStar

use of com.revolsys.geometry.geomgraph.DirectedEdgeStar in project com.revolsys.open by revolsys.

the class OverlayOp method updateNodeLabelling.

private void updateNodeLabelling() {
    // because it is a point in one of the input geometries)
    for (final Node node : this.graph.getNodes()) {
        final Label label = ((DirectedEdgeStar) node.getEdges()).getLabel();
        node.getLabel().merge(label);
    }
}
Also used : DirectedEdgeStar(com.revolsys.geometry.geomgraph.DirectedEdgeStar) Node(com.revolsys.geometry.geomgraph.Node) Label(com.revolsys.geometry.geomgraph.Label)

Example 4 with DirectedEdgeStar

use of com.revolsys.geometry.geomgraph.DirectedEdgeStar in project com.revolsys.open by revolsys.

the class OverlayOp method labelIncompleteNodes.

/**
 * Incomplete nodes are nodes whose labels are incomplete.
 * (e.g. the location for one Geometry is null).
 * These are either isolated nodes,
 * or nodes which have edges from only a single Geometry incident on them.
 *
 * Isolated nodes are found because nodes in one graph which don't intersect
 * nodes in the other are not completely labelled by the initial process
 * of adding nodes to the nodeList.
 * To complete the labelling we need to check for nodes that lie in the
 * interior of edges, and in the interior of areas.
 * <p>
 * When each node labelling is completed, the labelling of the incident
 * edges is updated, to complete their labelling as well.
 */
private void labelIncompleteNodes() {
    for (final Node n : this.graph.getNodes()) {
        final Label label = n.getLabel();
        if (n.isIsolated()) {
            if (label.isNull(0)) {
                labelIncompleteNode(n, 0);
            } else {
                labelIncompleteNode(n, 1);
            }
        }
        // now update the labelling for the DirectedEdges incident on this node
        ((DirectedEdgeStar) n.getEdges()).updateLabelling(label);
    }
}
Also used : DirectedEdgeStar(com.revolsys.geometry.geomgraph.DirectedEdgeStar) Node(com.revolsys.geometry.geomgraph.Node) Label(com.revolsys.geometry.geomgraph.Label)

Example 5 with DirectedEdgeStar

use of com.revolsys.geometry.geomgraph.DirectedEdgeStar in project com.revolsys.open by revolsys.

the class LineBuilder method findCoveredLineEdges.

/**
 * Find and mark L edges which are "covered" by the result area (if any).
 * L edges at nodes which also have A edges can be checked by checking
 * their depth at that node.
 * L edges at nodes which do not have A edges can be checked by doing a
 * point-in-polygon test with the previously computed result areas.
 */
private void findCoveredLineEdges() {
    // first set covered for all L edges at nodes which have A edges too
    for (final Object element : this.op.getGraph().getNodes()) {
        final Node node = (Node) element;
        // node.print(System.out);
        ((DirectedEdgeStar) node.getEdges()).findCoveredLineEdges();
    }
    /**
     * For all L edges which weren't handled by the above,
     * use a point-in-poly test to determine whether they are covered
     */
    for (final Object element : this.op.getGraph().getEdgeEnds()) {
        final DirectedEdge de = (DirectedEdge) element;
        final Edge e = de.getEdge();
        if (de.isLineEdge() && !e.isCoveredSet()) {
            final boolean isCovered = this.op.isCoveredByA(de.getX1(), de.getY1());
            e.setCovered(isCovered);
        }
    }
}
Also used : DirectedEdge(com.revolsys.geometry.geomgraph.DirectedEdge) DirectedEdgeStar(com.revolsys.geometry.geomgraph.DirectedEdgeStar) Node(com.revolsys.geometry.geomgraph.Node) DirectedEdge(com.revolsys.geometry.geomgraph.DirectedEdge) Edge(com.revolsys.geometry.geomgraph.Edge)

Aggregations

DirectedEdgeStar (com.revolsys.geometry.geomgraph.DirectedEdgeStar)8 Node (com.revolsys.geometry.geomgraph.Node)7 DirectedEdge (com.revolsys.geometry.geomgraph.DirectedEdge)5 Label (com.revolsys.geometry.geomgraph.Label)2 Edge (com.revolsys.geometry.geomgraph.Edge)1 TopologyException (com.revolsys.geometry.model.TopologyException)1 HashSet (java.util.HashSet)1 LinkedList (java.util.LinkedList)1