- 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
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
containsPoint(Box2D box, Point2D p)
Test whether a box contains a point.static boolean
containsPoint(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.
-
-
-
Method Detail
-
containsPoint
public static boolean containsPoint(Box2D box, Point2D p)
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
public static Pair<Box2D,Box2D> splitAlongXAxis(Box2D box)
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
public static Pair<Box2D,Box2D> splitAlongYAxis(Box2D box)
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
-
-