use of com.revolsys.geometry.geomgraph.DirectedEdge 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);
}
use of com.revolsys.geometry.geomgraph.DirectedEdge in project com.revolsys.open by revolsys.
the class MaximalEdgeRing method buildMinimalRings.
public List<MinimalEdgeRing> buildMinimalRings() {
final List<MinimalEdgeRing> minEdgeRings = new ArrayList<>();
DirectedEdge de = this.startDe;
do {
if (de.getMinEdgeRing() == null) {
final MinimalEdgeRing minEr = new MinimalEdgeRing(de, this.geometryFactory);
minEdgeRings.add(minEr);
}
de = de.getNext();
} while (de != this.startDe);
return minEdgeRings;
}
use of com.revolsys.geometry.geomgraph.DirectedEdge in project com.revolsys.open by revolsys.
the class PolygonBuilder method buildMaximalEdgeRings.
/**
* for all DirectedEdges in result, form them into MaximalEdgeRings
*/
private List<MaximalEdgeRing> buildMaximalEdgeRings(final Collection<DirectedEdge> dirEdges) {
final List<MaximalEdgeRing> maxEdgeRings = new ArrayList<>();
for (final DirectedEdge de : dirEdges) {
if (de.isInResult() && de.getLabel().isArea()) {
// if this edge has not yet been processed
if (de.getEdgeRing() == null) {
final MaximalEdgeRing er = new MaximalEdgeRing(de, this.geometryFactory);
maxEdgeRings.add(er);
er.setInResult();
}
}
}
return maxEdgeRings;
}
use of com.revolsys.geometry.geomgraph.DirectedEdge in project com.revolsys.open by revolsys.
the class ConnectedInteriorTester method visitLinkedDirectedEdges.
protected void visitLinkedDirectedEdges(final DirectedEdge start) {
final DirectedEdge startDe = start;
DirectedEdge de = start;
do {
Assert.isTrue(de != null, "found null Directed Edge");
de.setVisited(true);
de = de.getNext();
} while (de != startDe);
}
use of com.revolsys.geometry.geomgraph.DirectedEdge in project com.revolsys.open by revolsys.
the class ConnectedInteriorTester method visitInteriorRing.
private void visitInteriorRing(final LineString ring, final PlanarGraph graph) {
final Point pt0 = ring.getVertex(0).newPoint2D();
/**
* Find first point in coord list different to initial point.
* Need special check since the first point may be repeated.
*/
final Point pt1 = findDifferentPoint(ring, pt0);
final Edge e = graph.findEdgeInSameDirection(pt0, pt1);
final DirectedEdge de = (DirectedEdge) graph.findEdgeEnd(e);
if (de != null) {
DirectedEdge intDe = null;
final Label label = de.getLabel();
if (label.getLocation(0, Position.RIGHT) == Location.INTERIOR) {
intDe = de;
} else if (de.getSym().getLabel().getLocation(0, Position.RIGHT) == Location.INTERIOR) {
intDe = de.getSym();
}
Assert.isTrue(intDe != null, "unable to find dirEdge with Interior on RHS");
visitLinkedDirectedEdges(intDe);
}
}
Aggregations