31 #ifndef __CLAW_RECTANGLE_HPP__
32 #define __CLAW_RECTANGLE_HPP__
122 #endif // __CLAW_RECTANGLE_HPP__
T value_type
The type of the values we store.
coordinate_2d< value_type > position
value_typeop left coordinates.
coordinate_2d< value_type > size() const
Get the size of the rectangle.
Coordinates in a two dimensional space.
A rectangle represented by two points in a 2D space.
bool operator!=(const self_type &that) const
Tell if this rectangle equals an other rectangle.
void set(const value_type &new_x, const value_type &new_y, const value_type &new_width, const value_type &new_height)
set new position and size to the rectangle.
Implementation of claw::math::rectangle class.
value_type right() const
Get the x-coordinate of the right edge.
self_type join(const self_type &r) const
Get the smallest rectangle bounding both this rectangle and another one.
bool intersects(const self_type &r) const
Tell if there is an intersection of two rectangles.
Coordinates in a two dimensional space.
A class representing a rectangle by his x,y coordinates, width and height.
value_type left() const
Get the x-coordinate of the left edge.
value_type area() const
Calculate the rectangle's area.
self_type intersection(const self_type &r) const
Intersection of two rectangles.
value_type bottom() const
Get the y-coordinate of the bottom edge.
rectangle< value_type > self_type
The type of the current class.
bool operator==(const self_type &that) const
Tell if this rectangle equals an other rectangle.
A rectangle represented by two points in a 2D space.
value_type top() const
Get the y-coordinate of the top edge.
bool includes(const coordinate_2d< value_type > &p) const
Tell if a point is in a rectangle.