Rectangle in 2-dimensional plane, with edges parallel to axes. More...
#include <rectangle.hpp>
Public Member Functions | |
Special member functions | |
~rectangle () throw () | |
Destructor. | |
rectangle () throw () | |
Default constructor. | |
rectangle (coordinate_type l, coordinate_type b, coordinate_type r, coordinate_type t) throw () | |
Create rectangle with given coordinates. | |
rectangle (const rectangle &r) throw () | |
Copy constructor. | |
template<typename R > | |
rectangle (const R &r) | |
Generic copy constructor. | |
rectangle & | operator= (const rectangle &r) throw () |
operator = | |
template<typename R > | |
rectangle & | operator= (const R &r) |
Template assignment operator. | |
Coordinates of the rectangle | |
| |
typedef point::coordinate_type | coordinate_type |
coordinate_type | get_left () const throw () |
Returns the left coordinate (x1) of the rectangle. | |
coordinate_type | get_bottom () const throw () |
Returns the bottom coordinate (y1) of the rectangle. | |
coordinate_type | get_right () const throw () |
Returns the right coordinate (x2) of the rectangle. | |
coordinate_type | get_top () const throw () |
Returns the top coordinate (y2) of the rectangle. | |
void | set_left (const coordinate_type &l) throw () |
Sets the left coordinate of the rectangle. | |
void | set_bottom (const coordinate_type &b) throw () |
Sets the bottom coordinate of the rectangle. | |
void | set_right (const coordinate_type &r) throw () |
Sets the right coordinate of the rectangle. | |
void | set_top (const coordinate_type &t) throw () |
Sets the top coordinate of the rectangle. |
Rectangle in 2-dimensional plane, with edges parallel to axes.
This class is a model of geometry::concept::rectangle
coordinate type is same as for instigate::geometry::point
instigate::geometry::rectangle::rectangle | ( | coordinate_type | l, | |
coordinate_type | b, | |||
coordinate_type | r, | |||
coordinate_type | t | |||
) | throw () [inline] |
Create rectangle with given coordinates.
l | is the left coordinate (x1) | |
b | is the bottom coordinate (y1) | |
r | is the right coordinate (x2) | |
t | is the right coordinate (y2) |
instigate::geometry::rectangle::rectangle | ( | const rectangle & | r | ) | throw () |
Copy constructor.
r | - object to copy from |
instigate::geometry::rectangle::rectangle | ( | const R & | r | ) | [inline] |
Generic copy constructor.
r | - rectangle object |
coordinate_type instigate::geometry::rectangle::get_bottom | ( | ) | const throw () |
Returns the bottom coordinate (y1) of the rectangle.
Referenced by operator=().
coordinate_type instigate::geometry::rectangle::get_left | ( | ) | const throw () |
Returns the left coordinate (x1) of the rectangle.
Referenced by operator=().
coordinate_type instigate::geometry::rectangle::get_right | ( | ) | const throw () |
Returns the right coordinate (x2) of the rectangle.
Referenced by operator=().
coordinate_type instigate::geometry::rectangle::get_top | ( | ) | const throw () |
Returns the top coordinate (y2) of the rectangle.
Referenced by operator=().
rectangle& instigate::geometry::rectangle::operator= | ( | const R & | r | ) | [inline] |
Template assignment operator.
r | - object to copy from |
References CHECK, get_bottom(), get_left(), get_right(), and get_top().
operator =
r | - object to copy from |
void instigate::geometry::rectangle::set_bottom | ( | const coordinate_type & | b | ) | throw () |
Sets the bottom coordinate of the rectangle.
b | - the new value for the bottom coordinate |
void instigate::geometry::rectangle::set_left | ( | const coordinate_type & | l | ) | throw () |
Sets the left coordinate of the rectangle.
l | - the new value for the left coordinate |
void instigate::geometry::rectangle::set_right | ( | const coordinate_type & | r | ) | throw () |
Sets the right coordinate of the rectangle.
r | - the new value for the right coordinate |
void instigate::geometry::rectangle::set_top | ( | const coordinate_type & | t | ) | throw () |
Sets the top coordinate of the rectangle.
t | - the new value for the top coordinate |