java.lang.Object
org.jgrapht.alg.drawing.model.Boxes
public abstract class Boxes
extends java.lang.Object
A collection of utilities to assist with boxes manipulation.
- Author:
- Dimitrios Michail
-
Constructor Summary
Constructors Constructor Description Boxes() -
Method Summary
Modifier and Type Method Description static booleancontainsPoint(Box2D box, Point2D p)Test whether a box contains a point.static booleancontainsPoint(Box2D box, Point2D p, java.util.Comparator<java.lang.Double> comparator)Test whether a box contains a point.static Pair<Box2D,Box2D>splitAlongXAxis(Box2D box)Split a box along the x axis into two equal boxes.static Pair<Box2D,Box2D>splitAlongYAxis(Box2D box)Split a box along the y axis into two equal boxes.
-
Constructor Details
-
Boxes
public Boxes()
-
-
Method Details
-
containsPoint
Test whether a box contains a point.- Parameters:
box- the boxp- the point- Returns:
- true if the point is contained inside the box, false otherwise
-
splitAlongXAxis
Split a box along the x axis into two equal boxes.- Parameters:
box- the box to split- Returns:
- a pair with the two resulting boxes
-
splitAlongYAxis
Split a box along the y axis into two equal boxes.- Parameters:
box- the box to split- Returns:
- a pair with the two resulting boxes
-
containsPoint
public static boolean containsPoint(Box2D box, Point2D p, java.util.Comparator<java.lang.Double> comparator)Test whether a box contains a point.- Parameters:
box- the boxp- the pointcomparator- the comparator to use- Returns:
- true if the point is contained inside the box, false otherwise
-