Maven module :un.api : api-geometry :
Class : un.api.geometry.index.BoundingAreaCheck
Extends/Implements : -
Subclasses : -

Overlap and containment checks between bounding areas.
see  BBox
author  Mark Raynsford


Variables : -
Functions : checkAgainst, checkWellFormed, containedWithin, contains, isWellFormed, overlaps, overlapsArea, rayBoxIntersects




Determine whether b overlaps a, or is
completely contained by a.
param  container
The container
param  item
The item that may or may not be contained
return  The containment result
public Result checkAgainst (BBox container, BBox item)


Evaluates {@link #isWellFormed(BBox)} for the given item and
raises {@link IllegalArgumentException} if the result is
false.

@param item
The area.
public void checkWellFormed (BBox item)


return  true iff item is completely contained
within container.
param  container
The container
param  item
The item that may or may not be contained
public boolean containedWithin (BBox container, BBox item)


The area a described by the given vertices contains
b.

@param a_x0
The X coordinate of the lower corner of a
@param a_x1
The X coordinate of the upper corner of a
@param a_y0
The Y coordinate of the lower corner of a
@param a_y1
The Y coordinate of the upper corner of a
@param b_x0
The X coordinate of the lower corner of b
@param b_x1
The X coordinate of the upper corner of b
@param b_y0
The Y coordinate of the lower corner of b
@param b_y1
The Y coordinate of the upper corner of b
@return true if a contains b.
public boolean contains (double a_x0, double a_x1, double a_y0, double a_y1, double b_x0, double b_x1, double b_y0, double b_y1)


@param container
The bounding area to examine.
@return true iff the given bounding area is well formed.
That is, iff
container.getLower().getX() <= container.getUpper().getX()
and
container.getLower().getY() <= container.getUpper().getY()
.
public boolean isWellFormed (BBox container)


The area a described by the given vertices overlaps
b.

@param a_x0
The X coordinate of the lower corner of a
@param a_x1
The X coordinate of the upper corner of a
@param a_y0
The Y coordinate of the lower corner of a
@param a_y1
The Y coordinate of the upper corner of a
@param b_x0
The X coordinate of the lower corner of b
@param b_x1
The X coordinate of the upper corner of b
@param b_y0
The Y coordinate of the lower corner of b
@param b_y1
The Y coordinate of the upper corner of b
@return true if a overlaps b.
public boolean overlaps (double a_x0, double a_x1, double a_y0, double a_y1, double b_x0, double b_x1, double b_y0, double b_y1)


@return true iff item overlaps
container.
@param container
The container
@param item
The item that may or may not be overlapping
public boolean overlapsArea (BBox container, BBox item)


Branchless optimization of the Kay-Kajiya slab ray/AABB intersection test
by Tavian Barnes.


See tavianator.com.



@param ray
The ray.
@param x0
The lower X coordinate.
@param x1
The upper X coordinate.
@param y0
The lower Y coordinate.
@param y1
The upper Y coordinate.

@return true if the ray is intersecting the box.
public boolean rayBoxIntersects (Ray ray, double x0, double y0, double x1, double y1)