Search in sources :

Example 1 with Node

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

the class SegmentIntersector method isBoundaryPoint.

private boolean isBoundaryPoint(final Collection<Node> boundaryNodes) {
    final LineIntersector lineIntersector = this.lineIntersector;
    for (final Node node : boundaryNodes) {
        final double x = node.getX();
        final double y = node.getY();
        if (lineIntersector.isIntersection(x, y)) {
            return true;
        }
    }
    return false;
}
Also used : LineIntersector(com.revolsys.geometry.algorithm.LineIntersector) Node(com.revolsys.geometry.geomgraph.Node)

Example 2 with Node

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

the class Buffer method newSubgraphs.

private static List<BufferSubgraph> newSubgraphs(final PlanarGraph graph) {
    final List<BufferSubgraph> subgraphList = new ArrayList<>();
    for (final Node node : graph.getNodes()) {
        if (!node.isVisited()) {
            final BufferSubgraph subgraph = new BufferSubgraph();
            subgraph.newNode(node);
            subgraphList.add(subgraph);
        }
    }
    /**
     * Sort the subgraphs in descending order of their rightmost coordinate.
     * This ensures that when the Polygons for the subgraphs are built,
     * subgraphs for shells will have been built before the subgraphs for
     * any holes they contain.
     */
    Collections.sort(subgraphList, Collections.reverseOrder());
    return subgraphList;
}
Also used : Node(com.revolsys.geometry.geomgraph.Node) ArrayList(java.util.ArrayList)

Example 3 with Node

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

the class ConsistentPolygonRingChecker method check.

/**
 * Tests whether the result geometry is consistent
 *
 * @throws TopologyException if inconsistent topology is found
 */
public void check(final int opCode) {
    for (final Iterator nodeit = this.graph.getNodeIterator(); nodeit.hasNext(); ) {
        final Node node = (Node) nodeit.next();
        testLinkResultDirectedEdges((DirectedEdgeStar) node.getEdges(), opCode);
    }
}
Also used : Node(com.revolsys.geometry.geomgraph.Node) Iterator(java.util.Iterator)

Example 4 with Node

use of com.revolsys.geometry.geomgraph.Node 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 5 with Node

use of com.revolsys.geometry.geomgraph.Node 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)

Aggregations

Node (com.revolsys.geometry.geomgraph.Node)17 DirectedEdgeStar (com.revolsys.geometry.geomgraph.DirectedEdgeStar)7 DirectedEdge (com.revolsys.geometry.geomgraph.DirectedEdge)5 Label (com.revolsys.geometry.geomgraph.Label)3 ArrayList (java.util.ArrayList)2 Iterator (java.util.Iterator)2 LineIntersector (com.revolsys.geometry.algorithm.LineIntersector)1 Edge (com.revolsys.geometry.geomgraph.Edge)1 Point (com.revolsys.geometry.model.Point)1 HashSet (java.util.HashSet)1 LinkedList (java.util.LinkedList)1 Stack (java.util.Stack)1