Class RegionCutBoundary<P extends Point<P>>

java.lang.Object
org.apache.commons.geometry.core.partitioning.bsp.RegionCutBoundary<P>
Type Parameters:
P - Point implementation type
All Implemented Interfaces:
Sized

public final class RegionCutBoundary<P extends Point<P>> extends Object implements Sized
Class representing the portion of an AbstractRegionNode's cut that lies on the boundary of the region. Portions of the node cut may be oriented so that the plus side of the cut points toward the outside of the region (getOutsideFacing()) and other portions toward the inside of the region (getInsideFacing()). The inside-facing and outside-facing portions of the region boundary are represented as lists of disjoint hyperplane convex subsets, all originating from the same hyperplane convex subset forming the node cut.
  • Field Details

    • insideFacing

      private final List<HyperplaneConvexSubset<P extends Point<P>>> insideFacing
      Portion of the cut oriented such that the plus side of the cut points to the inside of the region.
    • outsideFacing

      private final List<HyperplaneConvexSubset<P extends Point<P>>> outsideFacing
      Portion of the cut oriented such that the plus side of the cut points to the outside of the region.
  • Constructor Details

    • RegionCutBoundary

      RegionCutBoundary(List<HyperplaneConvexSubset<P>> insideFacing, List<HyperplaneConvexSubset<P>> outsideFacing)
      Construct a new instance from the inside-facing and outside-facing portions of a node cut. The given lists are expected to be disjoint regions originating from the same hyperplane convex subset. No validation is performed.
      Parameters:
      insideFacing - the inside-facing portion of the node cut
      outsideFacing - the outside-facing portion of the node cut
  • Method Details

    • getInsideFacing

      public List<HyperplaneConvexSubset<P>> getInsideFacing()
      Get the portion of the cut with its plus side facing the inside of the region.
      Returns:
      the portion of the cut with its plus side facing the inside of the region
    • getOutsideFacing

      public List<HyperplaneConvexSubset<P>> getOutsideFacing()
      Get the portion of the cut with its plus side facing the outside of the region.
      Returns:
      the portion of the cut with its plus side facing the outside of the region
    • getSize

      public double getSize()
      Get the total size of the cut boundary, including inside and outside facing components.
      Specified by:
      getSize in interface Sized
      Returns:
      the total size of the cut boundary, including inside and outside facing components
    • getTotalSize

      private double getTotalSize(List<? extends HyperplaneConvexSubset<P>> boundaries)
      Get the total size of all boundaries in the given list.
      Parameters:
      boundaries - boundaries to compute the size for
      Returns:
      the total size of all boundaries in the given list
    • closest

      public P closest(P pt)
      Return the closest point to the argument in the inside and outside facing portions of the cut boundary.
      Parameters:
      pt - the reference point
      Returns:
      the point in the cut boundary closest to the reference point
      See Also:
    • contains

      public boolean contains(P pt)
      Return true if the given point is contained in the boundary, in either the inside facing portion or the outside facing portion.
      Parameters:
      pt - point to test
      Returns:
      true if the point is contained in the boundary
      See Also:
    • containsInsideFacing

      public boolean containsInsideFacing(P pt)
      Return true if the given point is contained in the inside-facing portion of the region boundary.
      Parameters:
      pt - point to test
      Returns:
      true if the point is contained in the inside-facing portion of the region boundary
    • containsOutsideFacing

      public boolean containsOutsideFacing(P pt)
      Return true if the given point is contained in the outside-facing portion of the region boundary.
      Parameters:
      pt - point to test
      Returns:
      true if the point is contained in the outside-facing portion of the region boundary
    • anyContains

      private boolean anyContains(P pt, List<? extends HyperplaneConvexSubset<P>> boundaries)
      Return true if the point is contained in any of the given boundaries.
      Parameters:
      pt - point to test
      boundaries -
      Returns:
      true if the point is contained in any of the given boundaries