You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by kw...@apache.org on 2016/04/29 02:30:46 UTC
[02/25] lucene-solr:branch_6x: Add Edge subclass
Add Edge subclass
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/266a9a94
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/266a9a94
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/266a9a94
Branch: refs/heads/branch_6x
Commit: 266a9a949e00635241fb1ebb43abcba2438d89bc
Parents: 086330f
Author: Karl Wright <Da...@gmail.com>
Authored: Sun Apr 24 02:18:23 2016 -0400
Committer: Karl Wright <Da...@gmail.com>
Committed: Thu Apr 28 20:18:09 2016 -0400
----------------------------------------------------------------------
.../spatial3d/geom/GeoComplexPolygon.java | 23 ++++++++++++++++++++
1 file changed, 23 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/266a9a94/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoComplexPolygon.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoComplexPolygon.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoComplexPolygon.java
index 7fc53e8..3071fc8 100644
--- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoComplexPolygon.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoComplexPolygon.java
@@ -93,6 +93,29 @@ class GeoComplexPolygon extends GeoBasePolygon {
// MHL
}
+ /**
+ * An instance of this class describes a single edge, and includes what is necessary to reliably determine intersection
+ * in the context of the even/odd algorithm used.
+ */
+ private static class Edge {
+ public final GeoPoint startPoint;
+ public final GeoPoint endPoint;
+ public final SidedPlane startPlane;
+ public final SidedPlane endPlane;
+ public final Plane plane;
+ public final XYZBounds planeBounds;
+
+ public Edge(final PlanetModel pm, final GeoPoint startPoint, final GeoPoint endPoint) {
+ this.startPoint = startPoint;
+ this.endPoint = endPoint;
+ this.plane = new Plane(startPoint, endPoint);
+ this.startPlane = new SidedPlane(endPoint, plane, startPoint);
+ this.endPlane = new SidedPlane(startPoint, plane, endPoint);
+ this.planeBounds = new XYZBounds();
+ this.plane.recordBounds(pm, this.planeBounds, this.startPlane, this.endPlane);
+ }
+ }
+
@Override
public boolean equals(Object o) {
// MHL