use of com.revolsys.geometry.edgegraph.HalfEdge in project com.revolsys.open by revolsys.
the class LineDissolver method process.
private void process(final HalfEdge e) {
HalfEdge eNode = e.prevNode();
// if edge is in a ring, just process this edge
if (eNode == null) {
eNode = e;
}
stackEdges(eNode);
// extract lines from node edges in stack
buildLines();
}
use of com.revolsys.geometry.edgegraph.HalfEdge in project com.revolsys.open by revolsys.
the class LineDissolver method buildLines.
/**
* For each edge in stack
* (which must originate at a node)
* extracts the line it initiates.
*/
private void buildLines() {
while (!this.nodeEdgeStack.empty()) {
final HalfEdge e = (HalfEdge) this.nodeEdgeStack.pop();
if (MarkHalfEdge.isMarked(e)) {
continue;
}
buildLine(e);
}
}
use of com.revolsys.geometry.edgegraph.HalfEdge in project com.revolsys.open by revolsys.
the class LineDissolver method buildRing.
private void buildRing(final HalfEdge eStartRing) {
final PointList line = new PointList();
HalfEdge e = eStartRing;
line.add(e.orig().newPoint(), false);
// scan along the path until a node is found (if one exists)
while (e.sym().degree() == 2) {
final HalfEdge eNext = e.next();
// check if edges form a ring - if so, we're done
if (eNext == eStartRing) {
break;
}
// add point to line, and move to next edge
line.add(eNext.orig().newPoint(), false);
e = eNext;
}
// add final node
line.add(e.dest().newPoint(), false);
// store the scanned line
addLine(line);
}
use of com.revolsys.geometry.edgegraph.HalfEdge in project com.revolsys.open by revolsys.
the class EdgeGraphTest method checkEdgeRing.
private void checkEdgeRing(final EdgeGraph graph, final Point p, final Point[] dest) {
final HalfEdge e = graph.findEdge(p, dest[0]);
HalfEdge onext = e;
int i = 0;
do {
assertTrue(onext.dest().equals(2, dest[i++]));
onext = onext.oNext();
} while (onext != e);
}
use of com.revolsys.geometry.edgegraph.HalfEdge in project com.revolsys.open by revolsys.
the class EdgeGraphTest method checkEdge.
private void checkEdge(final EdgeGraph graph, final Point p0, final Point p1) {
final HalfEdge e = graph.findEdge(p0, p1);
assertNotNull(e);
}
Aggregations