Class EmbeddedTreeGreatCircleSubset

java.lang.Object
org.apache.commons.geometry.spherical.twod.GreatCircleSubset
org.apache.commons.geometry.spherical.twod.EmbeddedTreeGreatCircleSubset
All Implemented Interfaces:
Embedding<Point2S,Point1S>, HyperplaneSubset<Point2S>, Splittable<Point2S,HyperplaneSubset<Point2S>>, RegionEmbedding<Point2S,Point1S>, Sized

public final class EmbeddedTreeGreatCircleSubset extends GreatCircleSubset
Class representing an arbitrary subset of the points on a great circle using a RegionBSPTree1S. This class can represent convex, non-convex, and empty regions.

This class is mutable and not thread safe.

  • Field Details

    • region

      private final RegionBSPTree1S region
      The 1D region on the great circle.
  • Constructor Details

    • EmbeddedTreeGreatCircleSubset

      public EmbeddedTreeGreatCircleSubset(GreatCircle greatCircle)
      Construct a new, empty hyperplane subset for the given great circle.
      Parameters:
      greatCircle - great circle defining this instance
    • EmbeddedTreeGreatCircleSubset

      public EmbeddedTreeGreatCircleSubset(GreatCircle circle, boolean full)
      Construct a new sub-region for the given great circle. If full is true, then the region will cover the entire circle; otherwise, it will be empty.
      Parameters:
      circle - great circle that the sub-region will belong to
      full - if true, the sub-region will cover the entire circle; otherwise it will be empty
    • EmbeddedTreeGreatCircleSubset

      public EmbeddedTreeGreatCircleSubset(GreatCircle circle, RegionBSPTree1S region)
      Construct a new instance from its defining great circle and subspace region.
      Parameters:
      circle - great circle that the sub-region will belong to
      region - subspace region
  • Method Details

    • getSubspaceRegion

      public RegionBSPTree1S getSubspaceRegion()
      Get the embedded subspace region.
      Specified by:
      getSubspaceRegion in interface RegionEmbedding<Point2S,Point1S>
      Specified by:
      getSubspaceRegion in class GreatCircleSubset
      Returns:
      the embedded subspace region
    • transform

      public EmbeddedTreeGreatCircleSubset transform(Transform<Point2S> transform)
      Return a new hyperplane subset resulting from the application of the given transform. The current instance is not modified.
      Parameters:
      transform - the transform instance to apply
      Returns:
      new transformed hyperplane subset
    • toConvex

      public List<GreatArc> toConvex()
      Convert this instance into a list of convex child subsets representing the same region. Implementations are not required to return an optimal convex subdivision of the current instance. They are free to return whatever subdivision is readily available.
      Specified by:
      toConvex in interface HyperplaneSubset<Point2S>
      Specified by:
      toConvex in class GreatCircleSubset
      Returns:
      a list of hyperplane convex subsets representing the same subspace region as this instance
    • split

      Split this instance with the given hyperplane.

      In all cases, the current instance is not modified. However, In order to avoid unnecessary copying, this method will use the current instance as the split value when the instance lies entirely on the plus or minus side of the splitter. For example, if this instance lies entirely on the minus side of the splitter, the sub great circle returned by Split.getMinus() will be this instance. Similarly, Split.getPlus() will return the current instance if it lies entirely on the plus side. Callers need to make special note of this, since this class is mutable.

      Parameters:
      splitter - the hyperplane to split this object with.
      Returns:
      result of the split operation
    • add

      public void add(GreatArc arc)
      Add an arc to this instance.
      Parameters:
      arc - arc to add
      Throws:
      IllegalArgumentException - if the given arc is not from a great circle equivalent to this instance
    • add

      public void add(EmbeddedTreeGreatCircleSubset subcircle)
      Add the region represented by the given subcircle to this instance. The argument is not modified.
      Parameters:
      subcircle - subcircle to add
      Throws:
      IllegalArgumentException - if the given subcircle is not from a great circle equivalent to this instance
    • toString

      public String toString()
      Overrides:
      toString in class Object