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