public class Mbr
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
Point2d |
ll
Lower left corner of the bounding box.
|
Point2d |
ur
Upper right corner of the bounding box.
|
Constructor and Description |
---|
Mbr()
Construct the bounding box empty.
|
Mbr(Point2d inLL,
Point2d inUR)
Construct with the lower left and upper right coordinates.
|
Modifier and Type | Method and Description |
---|---|
void |
addPoint(Point2d pt)
Add a point to the bounding box, expanding the extents.
|
java.util.List<Point2d> |
asPoints()
Return a list of points corresponding to the corners of the MBR.
|
boolean |
equals(java.lang.Object thatObj)
Compare coordinate values.
|
void |
expandByFraction(double bufferZone) |
void |
initialize()
We don't create the points by default, but we may need them.
|
boolean |
insideOrOnEdge(Point2d pt)
Check if the given point lies inside the bounding box or one of the edges.
|
boolean |
isValid()
True if the bounding box has been set.
|
Point2d |
middle()
The center of the bounding box.
|
boolean |
overlaps(Mbr that)
Check if the given bounding boxes overlap.
|
Point2d |
span()
The span is just the upper right minus the lower left.
|
java.lang.String |
toString() |
public Point2d ll
public Point2d ur
public void initialize()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object thatObj)
equals
in class java.lang.Object
public void addPoint(Point2d pt)
pt
- Point to expand the bounding box with.public Point2d span()
public Point2d middle()
public void expandByFraction(double bufferZone)
public boolean insideOrOnEdge(Point2d pt)
public boolean overlaps(Mbr that)
public java.util.List<Point2d> asPoints()
public boolean isValid()