90 CGUIRect(
const eC_Value& vX1,
const eC_Value& vY1,
const eC_Value& vX2,
const eC_Value& vY2);
99 return m_vX1 >= Rect.
GetX2();
109 return m_vX2 <= Rect.
GetX1();
119 return m_vY2 <= Rect.
GetY1();
129 return m_vY1 >= Rect.
GetY2();
142 m_vX1 + eC_Div(m_vX2 - m_vX1, eC_FromInt(2)),
143 m_vY1 + eC_Div(m_vY2 - m_vY1, eC_FromInt(2)));
166 return m_vX2 - m_vX1;
177 return m_vY2 - m_vY1;
185 m_vX2 = m_vX1 + vWidth;
193 m_vY2 = m_vY1 + vHeight;
196 inline eC_Value
GetX1()
const {
return m_vX1; }
197 inline eC_Value
GetY1()
const {
return m_vY1; }
198 inline eC_Value
GetX2()
const {
return m_vX2; }
199 inline eC_Value
GetY2()
const {
return m_vY2; }
200 inline void SetX1(
const eC_Value& vX1) { m_vX1 = vX1; }
201 inline void SetY1(
const eC_Value& vY1) { m_vY1 = vY1; }
202 inline void SetX2(
const eC_Value& vX2) { m_vX2 = vX2; }
203 inline void SetY2(
const eC_Value& vY2) { m_vY2 = vY2; }
216 if (!IsNormalised() && bComprehensive)
218 m_bComprehensive =
true;
223 m_bComprehensive = bComprehensive;
245 return (m_vX1 == rkRect.
GetX1()) &&
246 (m_vY1 == rkRect.
GetY1()) &&
247 (m_vX2 == rkRect.
GetX2()) &&
248 (m_vY2 == rkRect.
GetY2());
279 CGUIRect&
Assign(
const eC_Value& vX1,
const eC_Value& vY1,
const eC_Value& vX2,
const eC_Value& vY2);
323 inline eC_Bool
IsInside(
const eC_Value& vX,
const eC_Value& vY)
const
325 if (m_bComprehensive)
327 return ((vX >= m_vX1) && (vX < m_vX2) && (vY >= m_vY1) && (vY < m_vY2));
372 m_vX1 = m_vX1 - vDif;
373 m_vX2 = m_vX2 + vDif;
378 m_vY1 = m_vY1 - vDif;
379 m_vY2 = m_vY2 + vDif;
382 if ((vDif < eC_FromInt(0)) && (!IsNormalised()))
387 m_bComprehensive =
false;
420 m_vX1 = m_vX1 + eC_Mul(vInterpolationFactor, (kTargetRect.
GetX1() - m_vX1));
421 m_vY1 = m_vY1 + eC_Mul(vInterpolationFactor, (kTargetRect.
GetY1() - m_vY1));
422 m_vX2 = m_vX2 + eC_Mul(vInterpolationFactor, (kTargetRect.
GetX2() - m_vX2));
423 m_vY2 = m_vY2 + eC_Mul(vInterpolationFactor, (kTargetRect.
GetY2() - m_vY2));
424 if (vInterpolationFactor < eC_FromInt(0) && !IsNormalised())
429 m_bComprehensive =
false;
442#ifdef GUILIANI_STREAM_GUI
447#ifdef GUILIANI_WRITE_GUI
457 inline eC_Bool IsNormalised()
const
460 return !((m_vX1 >= m_vX2) || (m_vY1 >= m_vY2));
464 eC_Bool m_bComprehensive;
465 eC_Value m_vX1, m_vY1, m_vX2, m_vY2;
CGUIPoint class to hold two values (x, y) like a vector.
Definition: GUIPoint.h:18
eC_Value m_vY
Y-Value.
Definition: GUIPoint.h:55
eC_Value m_vX
X-Value.
Definition: GUIPoint.h:54
Helper class to supply a platform independent rectangle implementation.
Definition: GUIRect.h:63
CGUIRect & Interpolate(const CGUIRect &kTargetRect, const eC_Value vInterpolationFactor)
Definition: GUIRect.h:418
CGUIRect & InterSect(const CGUIRect &Rect)
eC_Value GetY2() const
Definition: GUIRect.h:199
ExpandDirection_t
enum of expansion types
Definition: GUIRect.h:357
@ EXPAND_VERTICAL
vertical only
Definition: GUIRect.h:359
@ EXPAND_HORIZONTAL
horizontal only
Definition: GUIRect.h:358
@ EXPAND_ALL
both horizontal and vertical (default)
Definition: GUIRect.h:360
eC_Bool IsInside(const eC_Value &vX, const eC_Value &vY) const
Definition: GUIRect.h:323
eC_Value GetX2() const
Definition: GUIRect.h:198
CGUIRect & Assign(const eC_Value &vX1, const eC_Value &vY1, const eC_Value &vX2, const eC_Value &vY2)
eC_Bool IsRightOf(const CGUIRect &Rect) const
Definition: GUIRect.h:97
eC_Bool IsTopOf(const CGUIRect &Rect) const
Definition: GUIRect.h:117
eC_Bool IsInside(const CGUIRect &kRect) const
Definition: GUIRect.h:350
eC_Value GetX1() const
Definition: GUIRect.h:196
CGUIRect & MoveTo(const eC_Value vAbsX, const eC_Value vAbsY)
void SetX2(const eC_Value &vX2)
Definition: GUIRect.h:202
CGUIPoint GetBottomRight() const
Definition: GUIRect.h:153
CGUIRect & Expand(const eC_Value vDif, const ExpandDirection_t enDirection=EXPAND_ALL)
Definition: GUIRect.h:368
eC_Value GetY1() const
Definition: GUIRect.h:197
CGUIPoint GetTopLeft() const
Definition: GUIRect.h:147
eC_Bool Overlaps(const CGUIRect &Rect) const
eC_Bool operator!=(const CGUIRect &rkRect) const
Definition: GUIRect.h:256
eC_Value GetWidth() const
Definition: GUIRect.h:164
void SetComprehensive(const eC_Bool &bComprehensive)
Definition: GUIRect.h:214
CGUIRect(const CGUIRect &srcRect)
void SetHeight(const eC_Value vHeight)
Definition: GUIRect.h:191
CGUIPoint GetCenter() const
Definition: GUIRect.h:139
eC_Bool IsInside(const CGUIPoint &kPt) const
Definition: GUIRect.h:340
void SetX1(const eC_Value &vX1)
Definition: GUIRect.h:200
CGUIRect & Union(const CGUIRect &Rect)
CGUIRect & operator=(const CGUIRect &srcRect)
void SetWidth(const eC_Value vWidth)
Definition: GUIRect.h:183
void SetY1(const eC_Value &vY1)
Definition: GUIRect.h:201
void ReadFromStream()
Helper method to stream CGUIRect attributes.
eC_Bool IsLeftOf(const CGUIRect &Rect) const
Definition: GUIRect.h:107
eC_Bool IsComprehensive() const
Definition: GUIRect.h:208
CGUIRect(const eC_Value &vX1, const eC_Value &vY1, const eC_Value &vX2, const eC_Value &vY2)
CGUIRect GetOriginRect() const
Definition: GUIRect.h:133
void WriteToStream()
Helper method to write CGUIRect attributes.
CGUIRect & Assign(const CGUIPoint &kOriginPt, const eC_Value &vWidth, const eC_Value &vHeight)
eC_Bool operator==(const CGUIRect &rkRect) const
Definition: GUIRect.h:243
eC_Bool IsBottomOf(const CGUIRect &Rect) const
Definition: GUIRect.h:127
CGUIRect(const CGUIPoint &kLeftUpperPt, const CGUIPoint &kRightLowerPt)
CGUIRect & Move(const eC_Value vDeltaX, const eC_Value vDeltaY)
CGUIRect(const CGUIPoint &kOriginPt, const eC_Value &vWidth, const eC_Value &vHeight)
CGUIRect & Move(const CGUIPoint &kOffsetPt)
void SetY2(const eC_Value &vY2)
Definition: GUIRect.h:203
eC_Value GetHeight() const
Definition: GUIRect.h:175