use of com.revolsys.geometry.algorithm.RectangleLineIntersector in project com.revolsys.open by revolsys.
the class SimpleRectangleIntersector method run.
public void run(final boolean useSegInt, final boolean useSideInt) {
final RectangleLineIntersector rectSegIntersector = new RectangleLineIntersector(this.rectEnv);
final SimpleRectangleIntersector rectSideIntersector = new SimpleRectangleIntersector(this.rectEnv);
for (int i = 0; i < this.pts.length; i++) {
for (int j = 0; j < this.pts.length; j++) {
if (i == j) {
continue;
}
boolean segResult = false;
if (useSegInt) {
segResult = rectSegIntersector.intersects(this.pts[i], this.pts[j]);
}
boolean sideResult = false;
if (useSideInt) {
sideResult = rectSideIntersector.intersects(this.pts[i], this.pts[j]);
}
if (useSegInt && useSideInt) {
if (segResult != sideResult) {
this.isValid = false;
}
}
}
}
}
use of com.revolsys.geometry.algorithm.RectangleLineIntersector in project com.revolsys.open by revolsys.
the class SimpleRectangleIntersector method run.
public void run(final boolean useSegInt, final boolean useSideInt) {
if (useSegInt) {
// System.out.println("Using Segment Intersector");
}
if (useSideInt) {
// System.out.println("Using Side Intersector");
}
// System.out.println("# pts: " + this.pts.length);
final RectangleLineIntersector rectSegIntersector = new RectangleLineIntersector(this.rectEnv);
final SimpleRectangleIntersector rectSideIntersector = new SimpleRectangleIntersector(this.rectEnv);
final Stopwatch sw = new Stopwatch();
for (int i = 0; i < this.pts.length; i++) {
for (int j = 0; j < this.pts.length; j++) {
if (i == j) {
continue;
}
boolean segResult = false;
if (useSegInt) {
segResult = rectSegIntersector.intersects(this.pts[i], this.pts[j]);
}
boolean sideResult = false;
if (useSideInt) {
sideResult = rectSideIntersector.intersects(this.pts[i], this.pts[j]);
}
if (useSegInt && useSideInt) {
if (segResult != sideResult) {
throw new IllegalStateException("Seg and Side values do not match");
}
}
}
}
// System.out.println("Finished in " + sw.getTimeString());
// System.out.println();
}
Aggregations