org.apache.lucene.geo3d

## Class GeoPath.SegmentEndpoint

- java.lang.Object
- - org.apache.lucene.geo3d.GeoPath.SegmentEndpoint

- Enclosing class:
    GeoPath

      public static class GeoPath.SegmentEndpoint
      extends Object

  This is precalculated data for segment endpoint. Note well: This is not necessarily a circle. There are four cases: (1) The path consists of a single endpoint. In this case, we build a simple circle with the proper cutoff offset. (2) This is the end of a path. The circle plane must be constructed to go through two supplied points and be perpendicular to a connecting plane. (2.5) Intersection, but the path on both sides is linear. We generate a circle, but we use the cutoff planes to limit its influence in the straight line case. (3) This is an intersection in a path. We are supplied FOUR planes. If there are intersections within bounds for both upper and lower, then we generate no circle at all. If there is one intersection only, then we generate a plane that includes that intersection, as well as the remaining cutoff plane/edge plane points.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `SidedPlane` | `circlePlane` A plane describing the circle
    `static GeoPoint[]` | `circlePoints` No notable points from the circle itself
    `Membership[]` | `cutoffPlanes` Pertinent cutoff planes from adjoining segments
    `static Membership[]` | `NO_MEMBERSHIP` Null membership
    `GeoPoint[]` | `notablePoints` Notable points for this segment endpoint
    `GeoPoint` | `point` The center point of the endpoint

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GeoPath.SegmentEndpoint(GeoPoint point)` Base case.
    `GeoPath.SegmentEndpoint(GeoPoint point, Plane normalPlane, GeoPoint upperPoint, GeoPoint lowerPoint)` Constructor for case (1).
    `GeoPath.SegmentEndpoint(GeoPoint point, SidedPlane cutoffPlane, GeoPoint topEdgePoint, GeoPoint bottomEdgePoint)` Constructor for case (2).
    `GeoPath.SegmentEndpoint(GeoPoint point, SidedPlane cutoffPlane1, SidedPlane cutoffPlane2, GeoPoint topEdgePoint, GeoPoint bottomEdgePoint)` Constructor for case (2.5).
    `GeoPath.SegmentEndpoint(GeoPoint point, SidedPlane prevCutoffPlane, SidedPlane nextCutoffPlane, GeoPoint notCand2Point, GeoPoint notCand1Point, GeoPoint notCand3Point, GeoPoint notCand4Point, SidedPlane candidate1, SidedPlane candidate2, SidedPlane candidate3, SidedPlane candidate4)` Constructor for case (3).

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)`
    `void` | `getBounds(PlanetModel planetModel, Bounds bounds)` Get the bounds for a segment endpoint.
    `int` | `hashCode()`
    `boolean` | `intersects(PlanetModel planetModel, Plane p, GeoPoint[] notablePoints, Membership[] bounds)` Determine if this endpoint intersects a specified plane.
    `boolean` | `isWithin(double x, double y, double z)` Check if point is within this endpoint.
    `boolean` | `isWithin(Vector point)` Check if point is within this endpoint.
    `double` | `outsideDistance(DistanceStyle distanceStyle, double x, double y, double z)` Compute external distance.
    `double` | `pathDistance(DistanceStyle distanceStyle, double x, double y, double z)` Compute interior path distance.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### point

          public final GeoPoint point

      The center point of the endpoint

    - #### circlePlane

          public final SidedPlane circlePlane

      A plane describing the circle

    - #### cutoffPlanes

          public final Membership[] cutoffPlanes

      Pertinent cutoff planes from adjoining segments

    - #### notablePoints

          public final GeoPoint[] notablePoints

      Notable points for this segment endpoint

    - #### circlePoints

          public static final GeoPoint[] circlePoints

      No notable points from the circle itself

    - #### NO_MEMBERSHIP

          public static final Membership[] NO_MEMBERSHIP

      Null membership

  - ### Constructor Detail

    - #### GeoPath.SegmentEndpoint

          public GeoPath.SegmentEndpoint(GeoPoint point)

      Base case. Does nothing at all.

    - #### GeoPath.SegmentEndpoint

          public GeoPath.SegmentEndpoint(GeoPoint point,
                                 Plane normalPlane,
                                 GeoPoint upperPoint,
                                 GeoPoint lowerPoint)

      Constructor for case (1). Generate a simple circle cutoff plane.
      Parameters:
        `point` - is the center point.
        `upperPoint` - is a point that must be on the circle plane.
        `lowerPoint` - is another point that must be on the circle plane.

    - #### GeoPath.SegmentEndpoint

          public GeoPath.SegmentEndpoint(GeoPoint point,
                                 SidedPlane cutoffPlane,
                                 GeoPoint topEdgePoint,
                                 GeoPoint bottomEdgePoint)

      Constructor for case (2). Generate an endpoint, given a single cutoff plane plus upper and lower edge points.
      Parameters:
        `point` - is the center point.
        `cutoffPlane` - is the plane from the adjoining path segment marking the boundary between this endpoint and that segment.
        `topEdgePoint` - is a point on the cutoffPlane that should be also on the circle plane.
        `bottomEdgePoint` - is another point on the cutoffPlane that should be also on the circle plane.

    - #### GeoPath.SegmentEndpoint

          public GeoPath.SegmentEndpoint(GeoPoint point,
                                 SidedPlane cutoffPlane1,
                                 SidedPlane cutoffPlane2,
                                 GeoPoint topEdgePoint,
                                 GeoPoint bottomEdgePoint)

      Constructor for case (2.5). Generate an endpoint, given two cutoff planes plus upper and lower edge points.
      Parameters:
        `point` - is the center.
        `cutoffPlane1` - is one adjoining path segment cutoff plane.
        `cutoffPlane2` - is another adjoining path segment cutoff plane.
        `topEdgePoint` - is a point on the cutoffPlane that should be also on the circle plane.
        `bottomEdgePoint` - is another point on the cutoffPlane that should be also on the circle plane.

    - #### GeoPath.SegmentEndpoint

          public GeoPath.SegmentEndpoint(GeoPoint point,
                                 SidedPlane prevCutoffPlane,
                                 SidedPlane nextCutoffPlane,
                                 GeoPoint notCand2Point,
                                 GeoPoint notCand1Point,
                                 GeoPoint notCand3Point,
                                 GeoPoint notCand4Point,
                                 SidedPlane candidate1,
                                 SidedPlane candidate2,
                                 SidedPlane candidate3,
                                 SidedPlane candidate4)

      Constructor for case (3). Generate an endpoint for an intersection, given four points.
      Parameters:
        `point` - is the center.
        `prevCutoffPlane` - is the previous adjoining segment cutoff plane.
        `nextCutoffPlane` - is the next path segment cutoff plane.
        `notCand2Point` - is a point NOT on candidate2.
        `notCand1Point` - is a point NOT on candidate1.
        `notCand3Point` - is a point NOT on candidate3.
        `notCand4Point` - is a point NOT on candidate4.
        `candidate1` - one of four candidate circle planes.
        `candidate2` - one of four candidate circle planes.
        `candidate3` - one of four candidate circle planes.
        `candidate4` - one of four candidate circle planes.

  - ### Method Detail

    - #### isWithin

          public boolean isWithin(Vector point)

      Check if point is within this endpoint.
      Parameters:
        `point` - is the point.
      Returns:
        true of within.

    - #### isWithin

          public boolean isWithin(double x,
                         double y,
                         double z)

      Check if point is within this endpoint.
      Parameters:
        `x` - is the point x.
        `y` - is the point y.
        `z` - is the point z.
      Returns:
        true of within.

    - #### pathDistance

          public double pathDistance(DistanceStyle distanceStyle,
                            double x,
                            double y,
                            double z)

      Compute interior path distance.
      Parameters:
        `distanceStyle` - is the distance style.
        `x` - is the point x.
        `y` - is the point y.
        `z` - is the point z.
      Returns:
        the distance metric.

    - #### outsideDistance

          public double outsideDistance(DistanceStyle distanceStyle,
                               double x,
                               double y,
                               double z)

      Compute external distance.
      Parameters:
        `distanceStyle` - is the distance style.
        `x` - is the point x.
        `y` - is the point y.
        `z` - is the point z.
      Returns:
        the distance metric.

    - #### intersects

          public boolean intersects(PlanetModel planetModel,
                           Plane p,
                           GeoPoint[] notablePoints,
                           Membership[] bounds)

      Determine if this endpoint intersects a specified plane.
      Parameters:
        `planetModel` - is the planet model.
        `p` - is the plane.
        `notablePoints` - are the points associated with the plane.
        `bounds` - are any bounds which the intersection must lie within.
      Returns:
        true if there is a matching intersection.

    - #### getBounds

          public void getBounds(PlanetModel planetModel,
                       Bounds bounds)

      Get the bounds for a segment endpoint.
      Parameters:
        `planetModel` - is the planet model.
        `bounds` - are the bounds to be modified.

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.