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;
}
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;
}
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);
}
}
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;
}
}
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);
}
Aggregations