Package org.anchoranalysis.spatial.box
Class BoundingBoxIntersection
Object
org.anchoranalysis.spatial.box.BoundingBoxIntersection
public final class BoundingBoxIntersection extends Object
Methods for checking intersection between a particular bounding-box and others.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors Constructor Description BoundingBoxIntersection(BoundingBox box) -
Method Summary
Modifier and Type Method Description booleanexistsWith(BoundingBox other)Does intersection exist with another bounding-box?booleanexistsWithAny(List<BoundingBox> others)Does intersection exist with with any of the others in the list?Optional<BoundingBox>with(BoundingBox other)Finds the intersection with another bounding-box, if it exists.Optional<BoundingBox>withInside(BoundingBox other, Extent containingExtent)Finds the intersection and clamp to a containing extent.
-
Constructor Details
-
Method Details
-
existsWith
Does intersection exist with another bounding-box?- Parameters:
other- the other bounding-box to test intersection with.- Returns:
- true iff intersection exists.
-
existsWithAny
Does intersection exist with with any of the others in the list?- Parameters:
others- the other bounding-boxes to test intersection with.- Returns:
- true iff intersection exists with at least one box in
others.
-
with
Finds the intersection with another bounding-box, if it exists.- Parameters:
other- the bounding-box to find intersection with.- Returns:
- a bounding-box describing the in the intersection, or
Optional.empty()if no intersection exists.
-
withInside
Finds the intersection and clamp to a containing extent.- Parameters:
other- the bounding-box to find intersection with.containingExtent- the extent the intersection is clamped to.- Returns:
- a bounding-box describing the in the intersection, or
Optional.empty()if no intersection exists.
-