#include <aarectangle.h>
Either corner may be inclusive or exclusive, depending on how this class is used; it is thus not a complete bounding box. To make it fast enough to use widely, it does not use any virtual functions; if such generality is needed use a full BoundingBox instead.
Definition at line 51 of file aarectangle.h.
Public Types | |
typedef T | value_type |
Public Methods | |
AARectangle (const T &xlow=0, const T &ylow=0, const T &xhigh=0, const T &yhigh=0) | |
Typical constructor: square box. | |
Boolean | inside (T x, T y) const |
Returns true if the given coordinates are inside the box, treating both corners as inclusive. | |
Boolean | upperexclusive_inside (T x, T y) const |
Returns true if the given coordinates are inside the box, treating the lower corner as inclusive and the upper as exclusive. | |
self & | operator+= (const self &o) |
Expands this rectangle to be an axis-aligned rectangle covering all area covered by the itself or the given rectangle. | |
self & | scale (T xscale, T yscale) |
Multiply the size times the indicated amounts in each dimension. | |
self & | rotate (Float theta) |
Rotate the box by the given angle (in radians) and take the smallest axis-aligned rectangle which encloses the result. | |
self & | translate (T xoffset, T yoffset) |
Translate the position by the indicated amounts. | |
self & | set (T xlow, T ylow, T xhigh, T yhigh) |
Set the rectangle to the given dimensions. | |
self & | set (const Points &o) |
Set the rectangle to the given dimensions. | |
self | intersection (const self &o) |
T | height () const |
The height of the rectangle, assuming inclusive bounds. | |
T | width () const |
The width of the rectangle, assuming inclusive bounds. | |
Points | corners () const |
Discouraged: returns the points making up the corners of the box. | |
Boolean | empty () const |
Regardless of whether the corners are exclusive or inclusive, enclosing a single point or line is always considered empty since zero area is enclosed. | |
std::ostream & | put (std::ostream &s) const |
Output a human-readable representation to the given stream. |
|
Expands this rectangle to be an axis-aligned rectangle covering all area covered by the itself or the given rectangle. Note that this is not the same as the union of the two areas, since it may include area not covered by either box so that the result remains a rectangle. Definition at line 82 of file aarectangle.h. References Boundary::AARectangle< T, Boolean, Float >::empty(). |