33 #include "CEGUIBase.h"
34 #include "CEGUIVector.h"
35 #include "CEGUISize.h"
54 Rect(
float left,
float top,
float right,
float bottom);
69 float getWidth(
void)
const {
return d_right - d_left;}
76 float getHeight(
void)
const {
return d_bottom - d_top;}
90 void setPosition(
const Point& pt);
97 void setWidth(
float width) {d_right = d_left + width;}
103 void setHeight(
float height) {d_bottom = d_top + height;}
110 void setSize(
const Size& sze) {setWidth(sze.d_width); setHeight(sze.d_height);}
121 Rect getIntersection(
const Rect& rect)
const;
147 bool isPointInRect(
const Point& pt)
const;
160 Rect& constrainSizeMax(
const Size& sz);
173 Rect& constrainSizeMin(
const Size& sz);
189 Rect& constrainSize(
const Size& max_sz,
const Size& min_sz);
197 return ((d_left == rhs.d_left) && (d_right == rhs.d_right) && (d_top == rhs.d_top) && (d_bottom == rhs.d_bottom));
202 Rect& operator=(
const Rect& rhs);
204 Rect operator*(
float scalar)
const {
return Rect(d_left * scalar, d_top * scalar, d_right * scalar, d_bottom * scalar); }
205 const Rect& operator*=(
float scalar) { d_left *= scalar; d_top *= scalar; d_right *= scalar; d_bottom *= scalar;
return *
this; }
207 Rect
operator+(
const Rect& r)
const {
return Rect(d_left + r.d_left, d_top + r.d_top, d_right + r.d_right, d_bottom + r.d_bottom); }
213 float d_left, d_top, d_right, d_bottom;
219 #endif // end of guard _CEGUIRect_h_