30 #ifndef __CLAW_BOX_2D_HPP__ 31 #define __CLAW_BOX_2D_HPP__ 61 box_2d(
const self_type& that );
63 box_2d(
const point_type& p1,
const point_type& p2 );
64 box_2d(
const value_type& x1,
const value_type& y1,
65 const value_type& x2,
const value_type& y2 );
67 void set(
const value_type& x1,
const value_type& y1,
68 const value_type& x2,
const value_type& y2 );
73 value_type area()
const;
75 bool includes(
const self_type& r )
const;
76 bool intersects(
const self_type& r )
const;
77 self_type intersection(
const self_type& r )
const;
78 self_type join(
const self_type& r )
const;
81 value_type top()
const;
82 value_type bottom()
const;
83 value_type left()
const;
84 value_type right()
const;
85 point_type top_left()
const;
86 point_type top_right()
const;
87 point_type bottom_left()
const;
88 point_type bottom_right()
const;
90 void top(
const value_type& p );
91 void bottom(
const value_type& p );
92 void left(
const value_type& p );
93 void right(
const value_type& p );
99 void shift_x(
const value_type& d );
100 void shift_y(
const value_type& d );
102 value_type width()
const;
103 value_type height()
const;
107 bool operator==(
const self_type& vect)
const;
108 bool operator!=(
const self_type& vect)
const;
109 self_type operator+(
const point_type& vect)
const;
110 self_type operator-(
const point_type& vect)
const;
111 self_type& operator+=(
const point_type& vect);
112 self_type& operator-=(
const point_type& vect);
115 void x_intersection(
const self_type& r, self_type& result )
const;
116 void y_intersection(
const self_type& r, self_type& result )
const;
129 #include <claw/impl/box_2d.tpp> 131 #endif // __CLAW_BOX_2D_HPP__ point_type first_point
The first of the two points, representing one corner.
Coordinates in a two dimensional space.
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.
coordinate_2d< value_type > point_type
The type of the coordinates of the points representing the corners.
T value_type
The type of the values we store.
point_type second_point
The second of the two points, representing an other corner.
A rectangle represented by two points in a 2D space.
This is the main namespace.