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_
Class used as a two dimensional vector (aka a Point)
Definition: CEGUIVector.h:45
bool CEGUIEXPORT operator==(const String &str1, const String &str2)
Return true if String str1 is equal to String str2.
float getHeight(void) const
return height of Rect area
Definition: CEGUIRect.h:76
Class that holds the size (width & height) of something.
Definition: CEGUISize.h:43
void setHeight(float height)
set the height of the Rect object
Definition: CEGUIRect.h:103
Point getPosition(void) const
Return top-left postion of Rect as a Point.
Definition: CEGUIRect.h:63
void setSize(const Size &sze)
set the size of the Rect area
Definition: CEGUIRect.h:110
String CEGUIEXPORT operator+(const String &str1, const String &str2)
Return String object that is the concatenation of the given inputs.
bool CEGUIEXPORT operator!=(const String &str1, const String &str2)
Return true if String str1 is not equal to String str2.
Vector2 Point
Point class.
Definition: CEGUIVector.h:123
Size getSize(void) const
return the size of the Rect area
Definition: CEGUIRect.h:83
void setWidth(float width)
set the width of the Rect object
Definition: CEGUIRect.h:97
Class encapsulating operations on a Rectangle.
Definition: CEGUIRect.h:44
float getWidth(void) const
return width of Rect area
Definition: CEGUIRect.h:69