36 UIRect2D(
float x,
float y,
float width,
float height);
39 float getMinX()
const;
40 float getMinY()
const;
41 float getMaxX()
const;
42 float getMaxY()
const;
48 bool contains(
const UIPoint2D& pos)
const;
49 bool contains(
float x,
float y)
const;
50 bool contains(
int x,
int y)
const;
51 bool contains(
const UIRect2D& pos)
const;
52 bool intersects(
const UIRect2D& pos)
const;
55inline UIRect2D::UIRect2D() {}
57inline UIRect2D::UIRect2D(
float x,
float y,
float width,
float height)
59 pos = UIPoint2D(x, y);
60 size = UISize2D(width, height);
69inline float UIRect2D::getMinX(
void)
const
74inline float UIRect2D::getMinY(
void)
const
79inline float UIRect2D::getMaxX(
void)
const
81 return pos.x + size.width;
84inline float UIRect2D::getMaxY(
void)
const
86 return pos.y + size.height;
89inline UIPoint2D UIRect2D::getUpperLeft(
void)
const
91 return UIPoint2D(getMinX(), getMinY());
94inline UIPoint2D UIRect2D::getUpperRight(
void)
const
96 return UIPoint2D(getMaxX(), getMinY());
99inline UIPoint2D UIRect2D::getLowerLeft(
void)
const
101 return UIPoint2D(getMinX(), getMaxY());
104inline UIPoint2D UIRect2D::getLowerRight(
void)
const
106 return UIPoint2D(getMaxX(), getMaxY());
109inline bool UIRect2D::contains(
const UIPoint2D& pos)
const
111 return pos.x >= this->pos.x && pos.x <= this->pos.x + size.width && pos.y >= this->pos.y
112 && pos.y <= this->pos.y + size.height;
115inline bool UIRect2D::contains(
float x,
float y)
const
117 return x >= this->pos.x && x <= this->pos.x + size.width && y >= this->pos.y && y <= this->pos.y + size.height;
120inline bool UIRect2D::contains(
int x,
int y)
const
122 return x >= this->pos.x && x <= this->pos.x + size.width && y >= this->pos.y && y <= this->pos.y + size.height;
125inline bool UIRect2D::contains(
const UIRect2D& pos)
const
127 return pos.pos.x >= this->pos.x && pos.pos.x <= this->pos.x + size.width && pos.pos.y >= this->pos.y
128 && pos.pos.y <= this->pos.y + size.height;
131inline bool UIRect2D::intersects(
const UIRect2D& pos)
const
Definition uipoint2d.h:26