use of com.revolsys.geometry.geomgraph.Edge in project com.revolsys.open by revolsys.
the class RightmostEdgeFinder method getRightmostSideOfSegment.
private int getRightmostSideOfSegment(final DirectedEdge de, final int i) {
final Edge edge = de.getEdge();
if (i < 0 || i + 1 >= edge.getVertexCount()) {
return -1;
}
final Point p1 = edge.getPoint(i);
final Point p2 = edge.getPoint(i + 1);
if (p1.getY() == p2.getY()) {
// indicates edge is parallel to x-axis
return -1;
}
int pos = Position.LEFT;
if (p1.getY() < p2.getY()) {
pos = Position.RIGHT;
}
return pos;
}
use of com.revolsys.geometry.geomgraph.Edge in project com.revolsys.open by revolsys.
the class RightmostEdgeFinder method checkForRightmostCoordinate.
private void checkForRightmostCoordinate(final DirectedEdge de) {
final Edge edge = de.getEdge();
for (int i = 0; i < edge.getVertexCount() - 1; i++) {
// only check vertices which are the start or end point of a
// non-horizontal segment
// <FIX> MD 19 Sep 03 - NO! we can test all vertices, since the rightmost
// must have a non-horiz segment adjacent to it
final int i1 = i;
final Point point = edge.getPoint(i1);
if (this.minCoord == null || point.getX() > this.minCoord.getX()) {
this.minDe = de;
this.minIndex = i;
this.minCoord = point;
}
// }
}
}
use of com.revolsys.geometry.geomgraph.Edge in project com.revolsys.open by revolsys.
the class OverlayOp method replaceCollapsedEdges.
/**
* If edges which have undergone dimensional collapse are found,
* replace them with a new edge which is a L edge
*/
private void replaceCollapsedEdges() {
final List<Edge> newEdges = new ArrayList<>();
for (final Iterator<Edge> it = this.edgeList.iterator(); it.hasNext(); ) {
final Edge e = it.next();
if (e.isCollapsed()) {
it.remove();
newEdges.add(e.getCollapsedEdge());
}
}
this.edgeList.addAll(newEdges);
}
use of com.revolsys.geometry.geomgraph.Edge in project com.revolsys.open by revolsys.
the class RelateComputer method updateIM.
/**
* update the IM with the sum of the IMs for each component
*/
private void updateIM(final IntersectionMatrix im) {
// Debug.println(im);
for (final Iterator ei = this.isolatedEdges.iterator(); ei.hasNext(); ) {
final Edge e = (Edge) ei.next();
e.updateIM(im);
// Debug.println(im);
}
for (final Object element : this.nodes) {
final RelateNode node = (RelateNode) element;
node.updateIM(im);
// Debug.println(im);
node.updateIMFromEdges(im);
// Debug.println(im);
// node.print(System.out);
}
}
use of com.revolsys.geometry.geomgraph.Edge in project com.revolsys.open by revolsys.
the class RelateComputer method labelIsolatedEdges.
/**
* Processes isolated edges by computing their labelling and adding them
* to the isolated edges list.
* Isolated edges are guaranteed not to touch the boundary of the target (since if they
* did, they would have caused an intersection to be computed and hence would
* not be isolated)
*/
private void labelIsolatedEdges(final int thisIndex, final int targetIndex) {
for (final Iterator ei = this.arg[thisIndex].getEdgeIterator(); ei.hasNext(); ) {
final Edge e = (Edge) ei.next();
if (e.isIsolated()) {
labelIsolatedEdge(e, targetIndex, this.arg[targetIndex].getGeometry());
this.isolatedEdges.add(e);
}
}
}
Aggregations