org.apache.lucene.spatial3d.geom

## Class GeoCompositeMembershipShape

- java.lang.Object
- - org.apache.lucene.spatial3d.geom.GeoCompositeMembershipShape

- All Implemented Interfaces:
    GeoMembershipShape, GeoOutsideDistance, GeoShape, Membership
  Direct Known Subclasses:
    GeoCompositePolygon

      public class GeoCompositeMembershipShape
      extends Object
      implements GeoMembershipShape

  GeoComposite is a set of GeoMembershipShape's, treated as a unit.
  WARNING: This API is experimental and might change in incompatible ways in the next release.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected List<GeoMembershipShape>` | `shapes` The list of shapes.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GeoCompositeMembershipShape()` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addShape(GeoMembershipShape shape)` Add a shape to the composite.
    `double` | `computeOutsideDistance(DistanceStyle distanceStyle, double x, double y, double z)` Compute this shape's distance to the GeoPoint.
    `double` | `computeOutsideDistance(DistanceStyle distanceStyle, GeoPoint point)` Compute this shape's distance to the GeoPoint.
    `boolean` | `equals(Object o)`
    `void` | `getBounds(Bounds bounds)` Compute bounds for the shape.
    `GeoPoint[]` | `getEdgePoints()` Return a sample point that is on the outside edge/boundary of the shape.
    `int` | `hashCode()`
    `boolean` | `intersects(Plane p, GeoPoint[] notablePoints, Membership... bounds)` Assess whether a plane, within the provided bounds, intersects with the shape.
    `boolean` | `isWithin(double x, double y, double z)` Check if a point is within this shape.
    `boolean` | `isWithin(Vector point)` Check if a point is within this shape.
    `String` | `toString()`

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

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

- - ### Field Detail

    - #### shapes

          protected final List<GeoMembershipShape> shapes

      The list of shapes.

  - ### Constructor Detail

    - #### GeoCompositeMembershipShape

          public GeoCompositeMembershipShape()

      Constructor.

  - ### Method Detail

    - #### addShape

          public void addShape(GeoMembershipShape shape)

      Add a shape to the composite.
      Parameters:
        `shape` - is the shape to add.

    - #### isWithin

          public boolean isWithin(Vector point)

      Description copied from interface: `Membership`
      Check if a point is within this shape.
      Specified by:
        `isWithin` in interface `Membership`
      Parameters:
        `point` - is the point to check.
      Returns:
        true if the point is within this shape

    - #### isWithin

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

      Description copied from interface: `Membership`
      Check if a point is within this shape.
      Specified by:
        `isWithin` in interface `Membership`
      Parameters:
        `x` - is x coordinate of point to check.
        `y` - is y coordinate of point to check.
        `z` - is z coordinate of point to check.
      Returns:
        true if the point is within this shape

    - #### getEdgePoints

          public GeoPoint[] getEdgePoints()

      Description copied from interface: `GeoShape`
      Return a sample point that is on the outside edge/boundary of the shape.
      Specified by:
        `getEdgePoints` in interface `GeoShape`
      Returns:
        samples of all edge points from distinct edge sections. Typically one point is returned, but zero or two are also possible.

    - #### intersects

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

      Description copied from interface: `GeoShape`
      Assess whether a plane, within the provided bounds, intersects with the shape. Note well that this method is allowed to return "true" if there are internal edges of a composite shape which intersect the plane. Doing this can cause getRelationship() for most GeoBBox shapes to return OVERLAPS rather than the more correct CONTAINS, but that cannot be helped for some complex shapes that are built out of overlapping parts.
      Specified by:
        `intersects` in interface `GeoShape`
      Parameters:
        `p` - is the plane to assess for intersection with the shape's edges or bounding curves.
        `notablePoints` - represents the intersections of the plane with the supplied bounds. These are used to disambiguate when two planes are identical and it needs to be determined whether any points exist that fulfill all the bounds.
        `bounds` - are a set of bounds that define an area that an intersection must be within in order to qualify (provided by a GeoArea).
      Returns:
        true if there's such an intersection, false if not.

    - #### getBounds

          public void getBounds(Bounds bounds)

      Description copied from interface: `GeoShape`
      Compute bounds for the shape.
      Specified by:
        `getBounds` in interface `GeoShape`
      Parameters:
        `bounds` - is the input bounds object. The input object will be modified.

    - #### computeOutsideDistance

          public double computeOutsideDistance(DistanceStyle distanceStyle,
                                               GeoPoint point)

      Description copied from interface: `GeoOutsideDistance`
      Compute this shape's distance to the GeoPoint. A return value of 0.0 should be returned for points inside of the shape.
      Specified by:
        `computeOutsideDistance` in interface `GeoOutsideDistance`
      Parameters:
        `distanceStyle` - is the distance style.
        `point` - is the point to compute the distance to.
      Returns:
        the distance.

    - #### computeOutsideDistance

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

      Description copied from interface: `GeoOutsideDistance`
      Compute this shape's distance to the GeoPoint. A return value of 0.0 should be returned for points inside of the shape.
      Specified by:
        `computeOutsideDistance` in interface `GeoOutsideDistance`
      Parameters:
        `distanceStyle` - is the distance style.
        `x` - is the point's unit x coordinate (using U.S. convention).
        `y` - is the point's unit y coordinate (using U.S. convention).
        `z` - is the point's unit z coordinate (using U.S. convention).
      Returns:
        the distance.

    - #### 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-2019 Apache Software Foundation. All Rights Reserved.