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
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 Summary
FieldsModifier and TypeFieldDescriptionprivate final List
<HyperplaneConvexSubset<P>> Portion of the cut oriented such that the plus side of the cut points to the inside of the region.private final List
<HyperplaneConvexSubset<P>> Portion of the cut oriented such that the plus side of the cut points to the outside of the region. -
Constructor Summary
ConstructorsConstructorDescriptionRegionCutBoundary
(List<HyperplaneConvexSubset<P>> insideFacing, List<HyperplaneConvexSubset<P>> outsideFacing) Construct a new instance from the inside-facing and outside-facing portions of a node cut. -
Method Summary
Modifier and TypeMethodDescriptionprivate boolean
anyContains
(P pt, List<? extends HyperplaneConvexSubset<P>> boundaries) Return true if the point is contained in any of the given boundaries.Return the closest point to the argument in the inside and outside facing portions of the cut boundary.boolean
Return true if the given point is contained in the boundary, in either the inside facing portion or the outside facing portion.boolean
Return true if the given point is contained in the inside-facing portion of the region boundary.boolean
Return true if the given point is contained in the outside-facing portion of the region boundary.Get the portion of the cut with its plus side facing the inside of the region.Get the portion of the cut with its plus side facing the outside of the region.double
getSize()
Get the total size of the cut boundary, including inside and outside facing components.private double
getTotalSize
(List<? extends HyperplaneConvexSubset<P>> boundaries) Get the total size of all boundaries in the given list.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.commons.geometry.core.Sized
isFinite, isInfinite
-
Field Details
-
insideFacing
Portion of the cut oriented such that the plus side of the cut points to the inside of the region. -
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 cutoutsideFacing
- the outside-facing portion of the node cut
-
-
Method Details
-
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
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. -
getTotalSize
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
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
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
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
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
Return true if the point is contained in any of the given boundaries.- Parameters:
pt
- point to testboundaries
-- Returns:
- true if the point is contained in any of the given boundaries
-