30 CRect(
int left,
int top,
int right,
int bottom);
193 static CRect s_empty;
194 static CRect s_invalid;
384 return m_horizontalRange;
390 return m_horizontalRange;
396 m_horizontalRange = range;
402 return m_verticalRange;
408 return m_verticalRange;
414 m_verticalRange = range;
428 return (m_horizontalRange.
IsValid()) && (m_verticalRange.
IsValid());
434 return (m_horizontalRange.
IsEmpty()) || (m_verticalRange.
IsEmpty());
473 return m_horizontalRange.
Contains(rect.m_horizontalRange) && m_verticalRange.
Contains(rect.m_verticalRange);
487 return m_horizontalRange.
IsOutsideOf(rect.m_horizontalRange) || m_verticalRange.
IsOutsideOf(rect.m_verticalRange);
494 m_horizontalRange.
Reset();
495 m_verticalRange.
Reset();
508 m_horizontalRange.
Unite(rect.m_horizontalRange);
509 m_verticalRange.
Unite(rect.m_verticalRange);
525 result.m_horizontalRange.
Unite(rect.m_horizontalRange);
526 result.m_verticalRange.
Unite(rect.m_verticalRange);
565 CRect result = *
this;
578 m_horizontalRange.
Expand(rect.m_horizontalRange);
579 m_verticalRange.
Expand(rect.m_verticalRange);
588 CRect result = *
this;
615 CRect result = *
this;
636 CRect result = *
this;
646 m_horizontalRange = rect.m_horizontalRange;
647 m_verticalRange = rect.m_verticalRange;
655 return (m_horizontalRange == rect.m_horizontalRange) && (m_verticalRange == rect.m_verticalRange);
Simple rectangle with integer bounds.
ibase::CSize GetSize() const
Get size of rectangle.
static const i2d::CRect & GetInvalid()
Get invalid rectangle.
istd::CIndex2d GetLeftTop() const
void SetLeftTop(istd::CIndex2d position)
void SetHorizontalRange(const istd::CIntRange &range)
void Expand(const CRect &rect)
Expand rectangle using second rectangle.
void SetRightTop(istd::CIndex2d position)
istd::CIndex2d GetLeftBottom() const
static const i2d::CRect & GetEmpty()
Get empty rectangle with all values set to 0.
void Intersection(const CRect &rect)
Calculate intersection of this and second rectangle and stores result in this object.
bool IsNull() const
Check if all parameters are 0.
void Translate(istd::CIndex2d point)
Move rectangle.
void SetRightBottom(istd::CIndex2d position)
bool operator==(const CRect &rect) const
void Union(const CRect &rect)
Calculate union of this and second rectangle and stores result in this object.
void SetLeftBottom(istd::CIndex2d position)
void SetBottom(int bottom)
istd::CIndex2d GetCenter() const
CRect GetExpanded(const CRect &rect) const
Get expanded rectangle.
istd::CIntRange & GetHorizontalRangeRef()
bool IsInside(const istd::CIndex2d &point) const
Check if specified point lies inside.
CRect GetTranslated(istd::CIndex2d point) const
Get moved rectangle.
const istd::CIntRange & GetHorizontalRange() const
CRect GetIntersection(const CRect &rect) const
Get intersection of two rectangles.
CRect & operator=(const CRect &rect)
void SetVerticalRange(const istd::CIntRange &range)
istd::CIndex2d GetRightBottom() const
void GetUnion(const CRect &rect, CRect &result) const
Get union of two rectangles.
bool operator!=(const CRect &rect) const
istd::CIntRange & GetVerticalRangeRef()
bool IsEmpty() const
Check if rectangle is empty.
const istd::CIntRange & GetVerticalRange() const
bool IsValid() const
Check if rectangle is valid.
i2d::CRectangle GetRectangle() const
void Reset()
Set all members to 0.
bool IsOutside(const CRect &rect) const
Check if specified rectangle lies fully outside.
istd::CIndex2d GetRightTop() const
bool IsValidNonEmpty() const
Return true if the rectangle is valid and it is not empty.
Definition of rectangle area orthogonal to axis of coordination system.
double GetTop() const
Get value of top boundary.
double GetLeft() const
Get value of left boundary.
double GetBottom() const
Get value of bottom boundary.
double GetRight() const
Get value of right boundary.
Definition of simple 2D size based on integer values.
Index implementation for addressing elements in 2D-space.
bool IsOutsideOf(const TRange &range) const
Check if this range is outside of the given range.
ValueType GetLength() const
Get length of this range.
void Unite(const TRange &range)
Set this range to be union of two ranges.
void Reset()
Set this range to be empty.
void SetMinValue(ValueType minValue)
Set the bottom value.
ValueType GetMaxValue() const
Get the top value.
bool Contains(ValueType value) const
Returns true, if value is in range between top and bottom.
void Expand(const TRange &range)
Set this range to be expanded.
void Intersection(const TRange &range)
Set this range to be intersection of two ranges.
ValueType GetMinValue() const
Get the bottom value.
bool IsEmpty() const
Return true if the bottom value is equal to the top value.
bool IsValidNonEmpty() const
Return true if the range is valid and it is not empty.
bool IsValid() const
Return true if the bottom value is smaller or equal then the top value.
static constexpr TRange & GetInvalid()
void SetMaxValue(ValueType maxValue)
Set the top value.
static constexpr TRange & GetNull()
istd::TRange< int > CIntRange