Class that represents an axis-aligned 2D rectangle. It is defined in terms of its (2D) center, its width and its height.
More...
|
| Axis_aligned_rectangle_2d (const Vector ¢er=Vector(2, 0.0), double width=1.0, double height=1.0) |
| Constructs a Axis_aligned_rectangle_2d. More...
|
|
| Axis_aligned_rectangle_2d (const Vector &p1, const Vector &p2) |
| Constructs a Axis_aligned_rectangle_2d. More...
|
|
Axis_aligned_rectangle_2d * | clone () const |
| Clones this Axis_aligned_rectangle_2d. More...
|
|
| ~Axis_aligned_rectangle_2d () |
| Deletes this Axis_aligned_rectangle_2d. More...
|
|
const Vector & | get_center () const |
| returns the center of this Axis_aligned_rectangle_2d More...
|
|
double | get_width () const |
| returns the width of this bounding box More...
|
|
double | get_height () const |
| returns the height of this bounding box More...
|
|
double | get_left () const |
|
double | get_right () const |
|
double | get_bottom () const |
|
double | get_top () const |
|
Vector | get_top_left () const |
|
Vector | get_bottom_right () const |
|
Vector | get_top_center () const |
|
Vector | get_bottom_center () const |
|
void | set_center (const Vector ¢er) |
| sets the center of this bounding box More...
|
|
void | set_width (double width) |
| sets the width of this bounding box More...
|
|
void | set_height (double height) |
| sets the height of this bounding box More...
|
|
void | wire_render () const |
|
bool | contains (const kjb::Vector &pt) const |
|
bool | intersects (const Self &other) const |
|
void | draw (kjb::Image &img, double ir=255, double ig=0, double ib=0, double iwidth=1.0) const |
|
void | write_corners_on (std::ostream &ofs) |
|
void | swap (Axis_aligned_rectangle_2d &r) |
| Swaps this rectangle with another. More...
|
|
| Axis_aligned_rectangle_2d (double center_x, double center_y, double iwidth, double iheight) |
| Constructs a Axis_aligned_rectangle_2d. More...
|
|
const Vector & | get_centre () const |
| returns the center of this Axis_aligned_rectangle_2d More...
|
|
double | get_centre_x () const |
| returns the x-coordinate of the center of this Axis_aligned_rectangle_2d More...
|
|
double | get_centre_y () const |
| returns the y-coordinate of the center of this Axis_aligned_rectangle_2d More...
|
|
double | get_area () const |
| returns the area of the box More...
|
|
void | set_centre (const Vector &icenter) |
| sets the center of this bounding box More...
|
|
void | set_centre_x (double center_x) |
| sets the x-coordinate of the center of this bounding box More...
|
|
void | set_centre_y (double center_y) |
| sets the y-coordinate of the center of this bounding box More...
|
|
Class that represents an axis-aligned 2D rectangle. It is defined in terms of its (2D) center, its width and its height.