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:02:34 UTC

[02/26] lucene-solr:master: 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/c75df440
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/c75df440
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/c75df440

Branch: refs/heads/master
Commit: c75df440d3d4e2f234013bdc8566bb21628c1df9
Parents: a5e24b2
Author: Karl Wright <Da...@gmail.com>
Authored: Sun Apr 24 02:18:23 2016 -0400
Committer: Karl Wright <Da...@gmail.com>
Committed: Sun Apr 24 02:18:23 2016 -0400

----------------------------------------------------------------------
 .../spatial3d/geom/GeoComplexPolygon.java       | 23 ++++++++++++++++++++
 1 file changed, 23 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c75df440/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