Class GeoDegeneratePath.SegmentEndpoint

  • Enclosing class:
    GeoDegeneratePath

    private static class GeoDegeneratePath.SegmentEndpoint
    extends java.lang.Object
    This is precalculated data for segment endpoint. Since the path is degenerate, there are several different cases:
    1. The path consists of a single endpoint. In this case, the degenerate path consists of this one point.
    2. This is the end of a path. There is a bounding plane passed in which describes the part of the world that is considered to belong to this endpoint.
    3. Intersection. There are two cutoff planes, one for each end of the intersection.
    • Field Detail

      • point

        public final GeoPoint point
        The center point of the endpoint
      • cutoffPlanes

        public final Membership[] cutoffPlanes
        Pertinent cutoff planes from adjoining segments
      • NO_MEMBERSHIP

        public static final Membership[] NO_MEMBERSHIP
        Null membership
    • Constructor Detail

      • SegmentEndpoint

        public SegmentEndpoint​(GeoPoint point)
        Constructor for case (1).
        Parameters:
        point - is the center point.
      • SegmentEndpoint

        public SegmentEndpoint​(GeoPoint point,
                               SidedPlane cutoffPlane)
        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.
      • SegmentEndpoint

        public SegmentEndpoint​(GeoPoint point,
                               SidedPlane cutoffPlane1,
                               SidedPlane cutoffPlane2)
        Constructor for case (3). Generate an endpoint, given two cutoff planes.
        Parameters:
        point - is the center.
        cutoffPlane1 - is one adjoining path segment cutoff plane.
        cutoffPlane2 - is another adjoining path segment cutoff plane.
    • Method Detail

      • 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, in aggregation form.
      • pathCenterDistance

        public double pathCenterDistance​(DistanceStyle distanceStyle,
                                         double x,
                                         double y,
                                         double z)
        Compute path center 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, or POSITIVE_INFINITY if the point is not within the bounds of the endpoint.
      • 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.
      • intersects

        public boolean intersects​(GeoShape geoShape)
        Determine if this endpoint intersects a GeoShape.
        Parameters:
        geoShape - is the GeoShape.
        Returns:
        true if there is shape intersect this endpoint.
      • 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​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object