ICF 3.0.5.47
Technical documentation of ICF Libraries
i2d::CRect Class Reference

Simple rectangle with integer bounds. More...

#include <CRect.h>

Collaboration diagram for i2d::CRect:

Public Member Functions

 CRect ()
 
 CRect (const CRect &rect)
 
 CRect (int left, int top, int right, int bottom)
 
 CRect (const istd::CIndex2d &leftTop, const istd::CIndex2d &rightBottom)
 
 CRect (const istd::CIndex2d &leftTop, const ibase::CSize &size)
 
 CRect (const i2d::CRectangle &rect)
 
 CRect (const ibase::CSize &size)
 
i2d::CRectangle GetRectangle () const
 
istd::CIndex2d GetLeftTop () const
 
void SetLeftTop (istd::CIndex2d position)
 
istd::CIndex2d GetRightTop () const
 
void SetRightTop (istd::CIndex2d position)
 
istd::CIndex2d GetLeftBottom () const
 
void SetLeftBottom (istd::CIndex2d position)
 
istd::CIndex2d GetRightBottom () const
 
void SetRightBottom (istd::CIndex2d position)
 
int GetLeft () const
 
void SetLeft (int left)
 
int GetTop () const
 
void SetTop (int top)
 
int GetRight () const
 
void SetRight (int right)
 
int GetBottom () const
 
void SetBottom (int bottom)
 
int GetWidth () const
 
int GetHeight () const
 
const istd::CIntRangeGetHorizontalRange () const
 
istd::CIntRangeGetHorizontalRangeRef ()
 
void SetHorizontalRange (const istd::CIntRange &range)
 
const istd::CIntRangeGetVerticalRange () const
 
istd::CIntRangeGetVerticalRangeRef ()
 
void SetVerticalRange (const istd::CIntRange &range)
 
istd::CIndex2d GetCenter () const
 
bool IsValid () const
 Check if rectangle is valid.
 
bool IsEmpty () const
 Check if rectangle is empty.
 
bool IsValidNonEmpty () const
 Return true if the rectangle is valid and it is not empty.
 
bool IsNull () const
 Check if all parameters are 0.
 
ibase::CSize GetSize () const
 Get size of rectangle.
 
bool IsInside (const istd::CIndex2d &point) const
 Check if specified point lies inside.
 
bool IsInside (const CRect &rect) const
 Check if specified rectangle lies inside.
 
bool IsOutside (const CRect &rect) const
 Check if specified rectangle lies fully outside.
 
void Reset ()
 Set all members to 0.
 
void Union (const CRect &rect)
 Calculate union of this and second rectangle and stores result in this object.
 
void GetUnion (const CRect &rect, CRect &result) const
 Get union of two rectangles.
 
CRect GetUnion (const CRect &rect) const
 Get union of two rectangles.
 
void Union (istd::CIndex2d point)
 Calculate union of this rectangle and point.
 
CRect GetUnion (istd::CIndex2d point) const
 Get union of this rectangle and point.
 
void Expand (const CRect &rect)
 Expand rectangle using second rectangle.
 
CRect GetExpanded (const CRect &rect) const
 Get expanded rectangle.
 
void Intersection (const CRect &rect)
 Calculate intersection of this and second rectangle and stores result in this object.
 
CRect GetIntersection (const CRect &rect) const
 Get intersection of two rectangles.
 
void Translate (istd::CIndex2d point)
 Move rectangle.
 
CRect GetTranslated (istd::CIndex2d point) const
 Get moved rectangle.
 
CRectoperator= (const CRect &rect)
 
bool operator== (const CRect &rect) const
 
bool operator!= (const CRect &rect) const
 

Static Public Member Functions

static const i2d::CRectGetEmpty ()
 Get empty rectangle with all values set to 0.
 
static const i2d::CRectGetInvalid ()
 Get invalid rectangle.
 

Detailed Description

Simple rectangle with integer bounds.

Definition at line 25 of file CRect.h.

Constructor & Destructor Documentation

◆ CRect() [1/7]

i2d::CRect::CRect ( )
inline

Definition at line 200 of file CRect.h.

References istd::TRange< int >::GetInvalid().

◆ CRect() [2/7]

i2d::CRect::CRect ( const CRect & rect)
inline

Definition at line 210 of file CRect.h.

◆ CRect() [3/7]

i2d::CRect::CRect ( int left,
int top,
int right,
int bottom )
inline

Definition at line 216 of file CRect.h.

References IsValid().

◆ CRect() [4/7]

i2d::CRect::CRect ( const istd::CIndex2d & leftTop,
const istd::CIndex2d & rightBottom )
inline

Definition at line 225 of file CRect.h.

References istd::CIndex2d::GetX(), istd::CIndex2d::GetY(), and IsValid().

◆ CRect() [5/7]

i2d::CRect::CRect ( const istd::CIndex2d & leftTop,
const ibase::CSize & size )
inline

Definition at line 234 of file CRect.h.

References istd::CIndex2d::GetX(), istd::CIndex2d::GetY(), and IsValid().

◆ CRect() [6/7]

i2d::CRect::CRect ( const i2d::CRectangle & rect)
inline

◆ CRect() [7/7]

i2d::CRect::CRect ( const ibase::CSize & size)
inlineexplicit

Definition at line 252 of file CRect.h.

References istd::CIndex2d::GetX(), istd::CIndex2d::GetY(), and IsValid().

Member Function Documentation

◆ Expand()

void i2d::CRect::Expand ( const CRect & rect)
inline

Expand rectangle using second rectangle.

Expanded rectangle is easy sum of coordinates of both rectangles.

Definition at line 573 of file CRect.h.

References istd::TRange< ValueType >::Expand(), and IsValid().

Referenced by GetExpanded().

◆ GetBottom()

int i2d::CRect::GetBottom ( ) const
inline

Definition at line 358 of file CRect.h.

References istd::TRange< ValueType >::GetMaxValue().

Referenced by Union().

◆ GetCenter()

istd::CIndex2d i2d::CRect::GetCenter ( ) const
inline

◆ GetEmpty()

const i2d::CRect & i2d::CRect::GetEmpty ( )
inlinestatic

Get empty rectangle with all values set to 0.

Definition at line 667 of file CRect.h.

◆ GetExpanded()

CRect i2d::CRect::GetExpanded ( const CRect & rect) const
inline

Get expanded rectangle.

Expanded rectangle is easy sum of coordinates of both rectangles.

Definition at line 583 of file CRect.h.

References Expand(), and IsValid().

◆ GetHeight()

int i2d::CRect::GetHeight ( ) const
inline

Definition at line 376 of file CRect.h.

References istd::TRange< ValueType >::GetLength().

◆ GetHorizontalRange()

const istd::CIntRange & i2d::CRect::GetHorizontalRange ( ) const
inline

Definition at line 382 of file CRect.h.

◆ GetHorizontalRangeRef()

istd::CIntRange & i2d::CRect::GetHorizontalRangeRef ( )
inline

Definition at line 388 of file CRect.h.

◆ GetIntersection()

CRect i2d::CRect::GetIntersection ( const CRect & rect) const
inline

Get intersection of two rectangles.

Definition at line 610 of file CRect.h.

References Intersection(), and IsValid().

◆ GetInvalid()

const i2d::CRect & i2d::CRect::GetInvalid ( )
inlinestatic

Get invalid rectangle.

Definition at line 673 of file CRect.h.

◆ GetLeft()

int i2d::CRect::GetLeft ( ) const
inline

◆ GetLeftBottom()

istd::CIndex2d i2d::CRect::GetLeftBottom ( ) const
inline

◆ GetLeftTop()

istd::CIndex2d i2d::CRect::GetLeftTop ( ) const
inline

Definition at line 271 of file CRect.h.

References istd::TRange< ValueType >::GetMinValue().

◆ GetRectangle()

i2d::CRectangle i2d::CRect::GetRectangle ( ) const
inline

◆ GetRight()

int i2d::CRect::GetRight ( ) const
inline

◆ GetRightBottom()

istd::CIndex2d i2d::CRect::GetRightBottom ( ) const
inline

Definition at line 310 of file CRect.h.

References istd::TRange< ValueType >::GetMaxValue().

◆ GetRightTop()

istd::CIndex2d i2d::CRect::GetRightTop ( ) const
inline

◆ GetSize()

ibase::CSize i2d::CRect::GetSize ( ) const
inline

Get size of rectangle.

Definition at line 450 of file CRect.h.

References istd::TRange< ValueType >::GetLength().

Referenced by iimg::CBitmapSlice::GetImageSize().

◆ GetTop()

int i2d::CRect::GetTop ( ) const
inline

Definition at line 334 of file CRect.h.

References istd::TRange< ValueType >::GetMinValue().

Referenced by Union().

◆ GetTranslated()

CRect i2d::CRect::GetTranslated ( istd::CIndex2d point) const
inline

Get moved rectangle.

Definition at line 632 of file CRect.h.

References IsValid(), and Translate().

◆ GetUnion() [1/3]

CRect i2d::CRect::GetUnion ( const CRect & rect) const
inline

Get union of two rectangles.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 534 of file CRect.h.

References GetUnion(), and IsValid().

◆ GetUnion() [2/3]

void i2d::CRect::GetUnion ( const CRect & rect,
CRect & result ) const
inline

Get union of two rectangles.

Definition at line 514 of file CRect.h.

References IsEmpty(), IsValid(), Reset(), and istd::TRange< ValueType >::Unite().

Referenced by GetUnion().

◆ GetUnion() [3/3]

CRect i2d::CRect::GetUnion ( istd::CIndex2d point) const
inline

Get union of this rectangle and point.

Definition at line 561 of file CRect.h.

References IsValid(), and Union().

◆ GetVerticalRange()

const istd::CIntRange & i2d::CRect::GetVerticalRange ( ) const
inline

Definition at line 400 of file CRect.h.

◆ GetVerticalRangeRef()

istd::CIntRange & i2d::CRect::GetVerticalRangeRef ( )
inline

Definition at line 406 of file CRect.h.

◆ GetWidth()

int i2d::CRect::GetWidth ( ) const
inline

Definition at line 370 of file CRect.h.

References istd::TRange< ValueType >::GetLength().

◆ Intersection()

void i2d::CRect::Intersection ( const CRect & rect)
inline

Calculate intersection of this and second rectangle and stores result in this object.

Definition at line 596 of file CRect.h.

References istd::TRange< ValueType >::Intersection(), IsValid(), istd::TRange< ValueType >::IsValid(), and Reset().

Referenced by GetIntersection().

◆ IsEmpty()

bool i2d::CRect::IsEmpty ( ) const
inline

Check if rectangle is empty.

Definition at line 432 of file CRect.h.

References istd::TRange< ValueType >::IsEmpty().

Referenced by GetUnion(), IsInside(), IsOutside(), and Union().

◆ IsInside() [1/2]

bool i2d::CRect::IsInside ( const CRect & rect) const
inline

Check if specified rectangle lies inside.

Definition at line 464 of file CRect.h.

References istd::TRange< ValueType >::Contains(), IsEmpty(), and IsValid().

◆ IsInside() [2/2]

bool i2d::CRect::IsInside ( const istd::CIndex2d & point) const
inline

Check if specified point lies inside.

Definition at line 456 of file CRect.h.

References istd::TRange< ValueType >::Contains(), istd::CIndex2d::GetX(), istd::CIndex2d::GetY(), and IsValid().

◆ IsNull()

bool i2d::CRect::IsNull ( ) const
inline

Check if all parameters are 0.

Definition at line 444 of file CRect.h.

References istd::TRange< int >::GetNull().

◆ IsOutside()

bool i2d::CRect::IsOutside ( const CRect & rect) const
inline

Check if specified rectangle lies fully outside.

Definition at line 478 of file CRect.h.

References IsEmpty(), istd::TRange< ValueType >::IsOutsideOf(), and IsValid().

◆ IsValid()

bool i2d::CRect::IsValid ( ) const
inline

◆ IsValidNonEmpty()

bool i2d::CRect::IsValidNonEmpty ( ) const
inline

Return true if the rectangle is valid and it is not empty.

Definition at line 438 of file CRect.h.

References istd::TRange< ValueType >::IsValidNonEmpty().

◆ operator!=()

bool i2d::CRect::operator!= ( const CRect & rect) const
inline

Definition at line 659 of file CRect.h.

References operator==().

◆ operator=()

CRect & i2d::CRect::operator= ( const CRect & rect)
inline

Definition at line 644 of file CRect.h.

◆ operator==()

bool i2d::CRect::operator== ( const CRect & rect) const
inline

Definition at line 653 of file CRect.h.

Referenced by operator!=().

◆ Reset()

void i2d::CRect::Reset ( )
inline

Set all members to 0.

Definition at line 492 of file CRect.h.

References istd::TRange< ValueType >::Reset().

Referenced by GetUnion(), Intersection(), and iview::CViewBase::ResetInvalidatedBox().

◆ SetBottom()

void i2d::CRect::SetBottom ( int bottom)
inline

Definition at line 364 of file CRect.h.

References istd::TRange< ValueType >::SetMaxValue().

◆ SetHorizontalRange()

void i2d::CRect::SetHorizontalRange ( const istd::CIntRange & range)
inline

Definition at line 394 of file CRect.h.

◆ SetLeft()

void i2d::CRect::SetLeft ( int left)
inline

Definition at line 328 of file CRect.h.

References istd::TRange< ValueType >::SetMinValue().

◆ SetLeftBottom()

void i2d::CRect::SetLeftBottom ( istd::CIndex2d position)
inline

◆ SetLeftTop()

void i2d::CRect::SetLeftTop ( istd::CIndex2d position)
inline

◆ SetRight()

void i2d::CRect::SetRight ( int right)
inline

Definition at line 352 of file CRect.h.

References istd::TRange< ValueType >::SetMaxValue().

◆ SetRightBottom()

void i2d::CRect::SetRightBottom ( istd::CIndex2d position)
inline

◆ SetRightTop()

void i2d::CRect::SetRightTop ( istd::CIndex2d position)
inline

◆ SetTop()

void i2d::CRect::SetTop ( int top)
inline

Definition at line 340 of file CRect.h.

References istd::TRange< ValueType >::SetMinValue().

◆ SetVerticalRange()

void i2d::CRect::SetVerticalRange ( const istd::CIntRange & range)
inline

Definition at line 412 of file CRect.h.

◆ Translate()

◆ Union() [1/2]

void i2d::CRect::Union ( const CRect & rect)
inline

Calculate union of this and second rectangle and stores result in this object.

Definition at line 499 of file CRect.h.

References IsEmpty(), IsValid(), and istd::TRange< ValueType >::Unite().

Referenced by GetUnion(), and iview::CViewBase::InvalidateBox().

◆ Union() [2/2]

void i2d::CRect::Union ( istd::CIndex2d point)
inline

Calculate union of this rectangle and point.

Result is stored in this object.

Definition at line 547 of file CRect.h.

References GetBottom(), GetLeft(), GetRight(), GetTop(), istd::CIndex2d::GetX(), istd::CIndex2d::GetY(), and IsValid().


The documentation for this class was generated from the following file:

© Witold Gantzke and Kirill Lepskiy