Public Member Functions | Static Public Member Functions | List of all members
i2d::CRect Class Reference

Simple rectangle with integer bounds. More...

#include <CRect.h>

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. More...
 
bool IsEmpty () const
 Check if rectangle is empty. More...
 
bool IsValidNonEmpty () const
 Return true if the rectangle is valid and it is not empty. More...
 
bool IsNull () const
 Check if all parameters are 0. More...
 
ibase::CSize GetSize () const
 Get size of rectangle. More...
 
bool IsInside (const istd::CIndex2d &point) const
 Check if specified point lies inside. More...
 
bool IsInside (const CRect &rect) const
 Check if specified rectangle lies inside. More...
 
bool IsOutside (const CRect &rect) const
 Check if specified rectangle lies fully outside. More...
 
void Reset ()
 Set all members to 0. More...
 
void Union (const CRect &rect)
 Calculate union of this and second rectangle and stores result in this object. More...
 
void GetUnion (const CRect &rect, CRect &result) const
 Get union of two rectangles. More...
 
CRect GetUnion (const CRect &rect) const
 Get union of two rectangles. More...
 
void Union (istd::CIndex2d point)
 Calculate union of this rectangle and point. More...
 
CRect GetUnion (istd::CIndex2d point) const
 Get union of this rectangle and point. More...
 
void Expand (const CRect &rect)
 Expand rectangle using second rectangle. More...
 
CRect GetExpanded (const CRect &rect) const
 Get expanded rectangle. More...
 
void Intersection (const CRect &rect)
 Calculate intersection of this and second rectangle and stores result in this object. More...
 
CRect GetIntersection (const CRect &rect) const
 Get intersection of two rectangles. More...
 
void Translate (istd::CIndex2d point)
 Move rectangle. More...
 
CRect GetTranslated (istd::CIndex2d point) const
 Get moved rectangle. More...
 
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. More...
 
static const i2d::CRectGetInvalid ()
 Get invalid rectangle. More...
 

Detailed Description

Simple rectangle with integer bounds.

Definition at line 21 of file CRect.h.

Constructor & Destructor Documentation

i2d::CRect::CRect ( )
inline

Definition at line 196 of file CRect.h.

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

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

Definition at line 206 of file CRect.h.

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

Definition at line 212 of file CRect.h.

References IsValid().

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

Definition at line 221 of file CRect.h.

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

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

Definition at line 230 of file CRect.h.

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

i2d::CRect::CRect ( const i2d::CRectangle rect)
inline
i2d::CRect::CRect ( const ibase::CSize size)
inlineexplicit

Definition at line 248 of file CRect.h.

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

Member Function Documentation

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 569 of file CRect.h.

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

Referenced by GetExpanded().

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

Definition at line 354 of file CRect.h.

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

Referenced by Union().

istd::CIndex2d i2d::CRect::GetCenter ( ) const
inline
const i2d::CRect & i2d::CRect::GetEmpty ( )
inlinestatic

Get empty rectangle with all values set to 0.

Definition at line 663 of file CRect.h.

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 579 of file CRect.h.

References Expand(), and IsValid().

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

Definition at line 372 of file CRect.h.

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

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

Definition at line 378 of file CRect.h.

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

Definition at line 384 of file CRect.h.

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

Get intersection of two rectangles.

Definition at line 606 of file CRect.h.

References Intersection(), and IsValid().

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

Get invalid rectangle.

Definition at line 669 of file CRect.h.

int i2d::CRect::GetLeft ( ) const
inline
istd::CIndex2d i2d::CRect::GetLeftBottom ( ) const
inline
istd::CIndex2d i2d::CRect::GetLeftTop ( ) const
inline

Definition at line 267 of file CRect.h.

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

i2d::CRectangle i2d::CRect::GetRectangle ( ) const
inline
int i2d::CRect::GetRight ( ) const
inline
istd::CIndex2d i2d::CRect::GetRightBottom ( ) const
inline

Definition at line 306 of file CRect.h.

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

istd::CIndex2d i2d::CRect::GetRightTop ( ) const
inline
ibase::CSize i2d::CRect::GetSize ( ) const
inline

Get size of rectangle.

Definition at line 446 of file CRect.h.

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

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

Definition at line 330 of file CRect.h.

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

Referenced by Union().

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

Get moved rectangle.

Definition at line 628 of file CRect.h.

References IsValid(), and Translate().

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

Get union of two rectangles.

Definition at line 510 of file CRect.h.

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

Referenced by GetUnion().

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 530 of file CRect.h.

References GetUnion(), and IsValid().

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

Get union of this rectangle and point.

Definition at line 557 of file CRect.h.

References IsValid(), and Union().

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

Definition at line 396 of file CRect.h.

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

Definition at line 402 of file CRect.h.

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

Definition at line 366 of file CRect.h.

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

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

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

Definition at line 592 of file CRect.h.

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

Referenced by GetIntersection().

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

Check if rectangle is empty.

Definition at line 428 of file CRect.h.

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

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

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

Check if specified point lies inside.

Definition at line 452 of file CRect.h.

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

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

Check if specified rectangle lies inside.

Definition at line 460 of file CRect.h.

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

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

Check if all parameters are 0.

Definition at line 440 of file CRect.h.

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

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

Check if specified rectangle lies fully outside.

Definition at line 474 of file CRect.h.

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

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

Check if rectangle is valid.

Definition at line 422 of file CRect.h.

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

Referenced by CRect(), Expand(), GetExpanded(), GetIntersection(), GetTranslated(), GetUnion(), Intersection(), IsInside(), IsOutside(), and Union().

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

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

Definition at line 434 of file CRect.h.

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

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

Definition at line 655 of file CRect.h.

References operator==().

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

Definition at line 640 of file CRect.h.

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

Definition at line 649 of file CRect.h.

Referenced by operator!=().

void i2d::CRect::Reset ( )
inline

Set all members to 0.

Definition at line 488 of file CRect.h.

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

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

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

Definition at line 360 of file CRect.h.

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

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

Definition at line 390 of file CRect.h.

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

Definition at line 324 of file CRect.h.

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

void i2d::CRect::SetLeftBottom ( istd::CIndex2d  position)
inline
void i2d::CRect::SetLeftTop ( istd::CIndex2d  position)
inline
void i2d::CRect::SetRight ( int  right)
inline

Definition at line 348 of file CRect.h.

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

void i2d::CRect::SetRightBottom ( istd::CIndex2d  position)
inline
void i2d::CRect::SetRightTop ( istd::CIndex2d  position)
inline
void i2d::CRect::SetTop ( int  top)
inline

Definition at line 336 of file CRect.h.

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

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

Definition at line 408 of file CRect.h.

void i2d::CRect::Translate ( istd::CIndex2d  point)
inline
void i2d::CRect::Union ( const CRect rect)
inline

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

Definition at line 495 of file CRect.h.

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

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

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

Calculate union of this rectangle and point.

Result is stored in this object.

Definition at line 543 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:

© 2007-2017 Witold Gantzke and Kirill Lepskiy