|
| BBox () |
| Uninitialised bounding box.
|
|
| BBox (int xmin, int ymin, int xmax, int ymax) |
| Construct from the x and y coordinates.
|
|
| BBox (const BBox &other) |
| Construct from another bounding box.
|
|
| BBox (const Point &imin, const Point &imax) |
| Construct from the minimum and maximum points of the box.
|
|
| BBox (const Point &imin, const Size &size) |
| Construct from the minimum point and size of the box.
|
|
const Point & | bottom_left () const |
| Get the bottom left of the box. More...
|
|
void | bottom_left (const Point &pos) |
| Set the bottom left of the box.
|
|
const Point & | top_right () const |
| Get the top right of the box. More...
|
|
void | top_right (const Point &pos) |
| Set the top right of the box.
|
|
Point | top_left () const |
| Get top left of box.
|
|
void | top_left (const Point &pos) |
| Set top left of box.
|
|
Point | bottom_right () const |
| Get bottom right of box.
|
|
void | bottom_right (const Point &pos) |
| Set bottom right of box.
|
|
BBox & | operator= (const BBox &other) |
| Assign value from another bounding box.
|
|
bool | operator== (const BBox &other) const |
| Check if two bounding boxes are equal.
|
|
bool | operator!= (const BBox &other) const |
| Check if two bounding boxes are not equal.
|
|
int | width () const |
| Return the width of the bounding box.
|
|
int | height () const |
| Return the height of the bounding box.
|
|
Size | size () const |
| Return the width and height of the bounding box as a Size.
|
|
void | size (int width, int height) |
| Resize the bounding box.
|
|
void | size (const Size &size) |
| Resize the bounding box.
|
|
void | move (int bx, int by) |
| Move whole box by given amounts.
|
|
void | move_right (int bx) |
| Move box right.
|
|
void | move_left (int bx) |
| Move box left.
|
|
void | move_up (int by) |
| Move box up.
|
|
void | move_down (int by) |
| Move box down.
|
|
void | move_to (int x, int y) |
| Move box to position without resizing. More...
|
|
void | move_to (const Point &pos) |
| Move box to position without resizing. More...
|
|
void | cover (const BBox &to_cover) |
| Increase bounds to cover given box.
|
|
void | inflate (int amount) |
| Inflate box by given amount on each side.
|
|
bool | contains (const Point &pt) const |
| Check if point is in rectangle.
|
|
bool | contains (int x, int y) const |
| Check if point is in rectangle.
|
|
bool | intersects (const BBox &other) const |
| Check if bounds intesect with another rect.
|
|
void | normalise () |
| Ensure min.x <= max.x and min.y <= max.y.
|
|
Class to represent a two dimensional bounding box.