30 #ifndef __CLAW_BOX_2D_HPP__
31 #define __CLAW_BOX_2D_HPP__
131 #endif // __CLAW_BOX_2D_HPP__
bool operator!=(const self_type &vect) const
Difference operator.
coordinate_2d< value_type > size() const
Get the size of the box_2d.
self_type & operator+=(const point_type &vect)
Translation.
point_type first_point
The first of the two points, representing one corner.
point_type top_left() const
Get the coordinate of the top-left corner.
value_type area() const
Calculate the box's area.
Coordinates in a two dimensional space.
bool includes(const coordinate_2d< value_type > &p) const
Tell if a point is in a box.
bool intersects(const self_type &r) const
Tell if there is an intersection of two boxes.
Implementation of claw::math::box_2d class.
value_type right() const
Get the x-coordinate of the right edge.
self_type operator+(const point_type &vect) const
Translation.
value_type bottom() const
Get the y-coordinate of the bottom edge.
void set(const value_type &x1, const value_type &y1, const value_type &x2, const value_type &y2)
Set the coordinates of the two points.
bool empty() const
Tell if the box has a dimension equal to zero.
box_2d< value_type > self_type
The type of the current class.
A class representing a rectangle by his x,y coordinates, width and height.
self_type join(const self_type &r) const
Join two box_2ds.
coordinate_2d< value_type > point_type
The type of the coordinates of the points representing the corners.
self_type & operator-=(const point_type &vect)
Translation.
self_type operator-(const point_type &vect) const
Translation.
point_type top_right() const
Get the coordinate of the top-right corner.
void shift_y(const value_type &d)
Shift the position of the box on the y-axis.
T value_type
The type of the values we store.
value_type left() const
Get the x-coordinate of the left edge.
point_type second_point
The second of the two points, representing an other corner.
point_type bottom_right() const
Get the coordinate of the bottom-right corner.
value_type width() const
Return box' width.
point_type bottom_left() const
Get the coordinate of the bottom-left corner.
A rectangle represented by two points in a 2D space.
void shift_x(const value_type &d)
Shift the position of the box on the x-axis.
self_type intersection(const self_type &r) const
Intersection of two box_2ds.
value_type top() const
Get the y-coordinate of the top edge.
bool operator==(const self_type &vect) const
Equality operator.
value_type height() const
Return box' height.