|
Milo
0.1
Milo:EquationManipulationProgram
|
#include <util.h>
Public Member Functions | |
Constructors | |
| Rectangle () | |
| Rectangle (T x, T y, T x0, T y0) | |
Mutators | |
| void | set (T x, T y, T x0, T y0) |
| void | setOrigin (T x0, T y0) |
| void | setSize (T x, T y) |
Accessors | |
| int & | x0 () |
| int & | y0 () |
| int & | width () |
| int & | height () |
| int | x0 () const |
| int | y0 () const |
| int | width () const |
| int | height () const |
Private Types | |
| enum | { WIDTH, HEIGHT, X0, Y0, SIZE } |
Private Attributes | |
| std::array< T, SIZE > | m_rect |
| Storage of rectangle parameters. | |
Helper Member Functions | |
| std::string | toString () |
| T | area () |
| bool | inside (T x, T y) const |
| bool | inside (Rectangle r) const |
| bool | intersect (const Rectangle &r) const |
| void | merge (const Rectangle &r) |
| static Rectangle | merge (const Rectangle &r1, const Rectangle &r2) |
Rectangle template class. Holds a rectange as an origin and a width and height, plus helper member functions. Template type can be any numerical type.
Default constructor for Rectangle. Set origin and dimensions to zero.
Constructor for Rectangle from all 4 coordinates.
| x | Width of rectangle. |
| y | Height of rectangle. |
| x0 | Horizontal origin of rectangle. |
| y0 | Vertical origin of rectangle. |
|
inline |
Return area of rectangle.
|
inline |
|
inline |
|
inline |
Detect overlap between this rectangle and another.
Merge rectangle in class object with rectangle r
|
inlinestatic |
return rectangle that is merger of r1 and r2
|
inline |
Set origin and dimension of Rectangle.
| x | Width of rectangle. |
| y | Height of rectangle. |
| x0 | Horizontal origin of rectangle. |
| y0 | Vertical origin of rectangle. |
|
inline |
Set origin of Rectangle.
| x0 | Horizontal origin of rectangle. |
| y0 | Vertical origin of rectangle. |
|
inline |
Set dimension of Rectangle.
| x | Width of rectangle. |
| y | Height of rectangle. |
|
inline |
Convert state of this class to string
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
1.8.11