1.0.1 Added insert / offset functions
1.0.2 Added scaling functions
1.0.3 Added intersection functions
1.0.4 Added union function
1.0.5 Made the inline functions cross platform (
1.0.7 Added dimension based functions, including c'tor
1.0.8 Added from string conversion
Definition at line 42 of file CRect.hpp.
Exponent::MathTools::CRect::CRect | ( | const long | left = 0 , |
|
const long | top = 0 , |
|||
const long | width = 0 , |
|||
const long | height = 0 | |||
) |
Construciton
left | The left position | |
top | The top position | |
width | The width of the rectangle | |
height | The height of the rectangle |
Exponent::MathTools::CRect::CRect | ( | const CRect & | rect | ) |
Copy construction
rect | The rect to copy |
Exponent::MathTools::CRect::CRect | ( | const CPoint & | origin, | |
const CDimension & | dimension | |||
) |
Construction
origin | The origin of the control | |
dimension | The dimensions of the rect |
virtual Exponent::MathTools::CRect::~CRect | ( | ) | [virtual] |
Destruction
RECT Exponent::MathTools::CRect::getAsRect | ( | ) |
Get as a windows RECT
RECT | The widnows rect |
long Exponent::MathTools::CRect::getBottom | ( | ) | const [inline] |
Get the bottom
long | The bottom |
Definition at line 175 of file CRect.hpp.
References m_bottom.
Referenced by rectanglesIntersect(), and rectIsInside().
long Exponent::MathTools::CRect::getCentralXPosition | ( | ) | const |
Get the central x position
long | The central x position |
long Exponent::MathTools::CRect::getCentralYPosition | ( | ) | const |
Get the central y position
long | The central y position |
CDimension Exponent::MathTools::CRect::getDimension | ( | ) | const [inline] |
Get the dimension as a point
CDimension | The width and hight |
long Exponent::MathTools::CRect::getHeight | ( | ) | const [inline] |
static void Exponent::MathTools::CRect::getIntersectionArea | ( | const CRect & | rect1, | |
const CRect & | rect2, | |||
CRect & | output | |||
) | [static] |
Get the intersection area of two rectangles
rect1 | Rectangle 1 | |
rect2 | Rectangle 2 | |
output | The intersection area of the two rectangles |
static CRect* Exponent::MathTools::CRect::getIntersectionArea | ( | const CRect & | rect1, | |
const CRect & | rect2 | |||
) | [static] |
Get the intersection area of two rectangles
rect1 | Rectangle 1 | |
rect2 | Rectangle 2 |
CRect* | The intersection area of the two rectangles, you become the owner and responsible for deletion |
long Exponent::MathTools::CRect::getLeft | ( | ) | const [inline] |
Get the left
long | The left |
Definition at line 157 of file CRect.hpp.
References m_left.
Referenced by rectanglesIntersect(), and rectIsInside().
virtual void Exponent::MathTools::CRect::getObjectDescription | ( | char * | string, | |
const long | size | |||
) | const [virtual] |
Get a description of the object
string | On return is filled with the description | |
size | The size of the stirng |
CPoint Exponent::MathTools::CRect::getOrigin | ( | ) | const [inline] |
long Exponent::MathTools::CRect::getRight | ( | ) | const [inline] |
Get the right
long | The right |
Definition at line 163 of file CRect.hpp.
References m_right.
Referenced by rectanglesIntersect(), and rectIsInside().
long Exponent::MathTools::CRect::getTop | ( | ) | const [inline] |
Get the top
long | The top |
Definition at line 169 of file CRect.hpp.
References m_top.
Referenced by rectanglesIntersect(), and rectIsInside().
long Exponent::MathTools::CRect::getWidth | ( | ) | const [inline] |
void Exponent::MathTools::CRect::inset | ( | const long | amount | ) |
Inset the position of the rectangle (adds the values to the left and right, and removes it from the width)
amount | The amount to inset |
__forceinline bool Exponent::MathTools::CRect::isRectangleEmpty | ( | ) | const [inline] |
void Exponent::MathTools::CRect::offset | ( | const CPoint & | point | ) |
Offset the position of the rectangle
point | The amount to move the left and top by |
Assignment operator
rect | The rect to copy |
CRect& | A Reference to this |
virtual bool Exponent::MathTools::CRect::operator== | ( | const CRect & | rect | ) | [virtual] |
Equality operator
rect | The rect to compare to |
bool | True if rects are the same, false toherwise |
__forceinline bool Exponent::MathTools::CRect::pointIsInside | ( | const CPoint & | point | ) | const [inline] |
Is the point inside the rectangle
point | The point to determine if its inside this rectangle |
bool | True if the point is inside this rectangle, false otherwise |
Definition at line 246 of file CRect.hpp.
References Exponent::MathTools::CPoint::getXPosition(), Exponent::MathTools::CPoint::getYPosition(), m_bottom, m_left, m_right, and m_top.
__forceinline bool Exponent::MathTools::CRect::rectanglesIntersect | ( | const CRect & | other | ) | const [inline] |
Does this rectangle interesect another?
other | The other rectangle to check if this intersects with |
bool | True if rectangles intersect, false otherwise |
Definition at line 272 of file CRect.hpp.
References getBottom(), getLeft(), getRight(), getTop(), m_bottom, m_left, m_right, and m_top.
__forceinline bool Exponent::MathTools::CRect::rectIsInside | ( | const CRect & | rect | ) | const [inline] |
Is the rectangle completely inside this rectange
rect | The rectangle to determine if its inside this one |
bool | True if rect is completely inside this rectangle, false otherwise |
Definition at line 259 of file CRect.hpp.
References getBottom(), getLeft(), getRight(), getTop(), m_bottom, m_left, m_right, and m_top.
void Exponent::MathTools::CRect::scale | ( | const double | amount | ) |
Scale the rect (every value * by the value you give
amount | The amount to scale by |
void Exponent::MathTools::CRect::setDimensions | ( | const CDimension & | dimension | ) |
Set the dimension
dimension | The dimensions of the rect |
void Exponent::MathTools::CRect::setFromRect | ( | RECT & | rect | ) |
Set from a window rect
rect | The windows rect to copy |
void Exponent::MathTools::CRect::setHeight | ( | const long | height | ) |
Set the height
height | The height of the rectangle |
void Exponent::MathTools::CRect::setLeft | ( | const long | left | ) |
Set the left
left | The left position |
void Exponent::MathTools::CRect::setOrigin | ( | const CPoint & | point | ) |
Set the origin
point | The origin (left,top) point |
void Exponent::MathTools::CRect::setRect | ( | const CPoint & | origin, | |
const CDimension & | dimension | |||
) |
Set the rectangle
origin | The origin of the control | |
dimension | The dimensions of the rect |
void Exponent::MathTools::CRect::setRect | ( | const long | left, | |
const long | top, | |||
const long | width, | |||
const long | height | |||
) |
Set the entire rectangle
left | The left position | |
top | The top position | |
width | The width of the rectangle | |
height | The height of the rectangle |
void Exponent::MathTools::CRect::setTop | ( | const long | top | ) |
Set the top
top | The top position |
void Exponent::MathTools::CRect::setWidth | ( | const long | width | ) |
void Exponent::MathTools::CRect::unionWith | ( | const CRect & | rect | ) |
Union this rectangle with another (creates rectangle the big enough to hold both)
rect | The rect to create a union with |
long Exponent::MathTools::CRect::m_bottom [protected] |
Bottom position of the rectangle
Definition at line 355 of file CRect.hpp.
Referenced by getBottom(), pointIsInside(), rectanglesIntersect(), and rectIsInside().
long Exponent::MathTools::CRect::m_height [protected] |
Height of the rectangle
Definition at line 350 of file CRect.hpp.
Referenced by getDimension(), getHeight(), and isRectangleEmpty().
long Exponent::MathTools::CRect::m_left [protected] |
Left position of the rectangle
Definition at line 352 of file CRect.hpp.
Referenced by getLeft(), getOrigin(), isRectangleEmpty(), pointIsInside(), rectanglesIntersect(), and rectIsInside().
long Exponent::MathTools::CRect::m_right [protected] |
Right position of the rectangle
Definition at line 353 of file CRect.hpp.
Referenced by getRight(), pointIsInside(), rectanglesIntersect(), and rectIsInside().
long Exponent::MathTools::CRect::m_top [protected] |
Top position of the rectangle
Definition at line 354 of file CRect.hpp.
Referenced by getOrigin(), getTop(), isRectangleEmpty(), pointIsInside(), rectanglesIntersect(), and rectIsInside().
long Exponent::MathTools::CRect::m_width [protected] |
Width of the rectangel
Definition at line 349 of file CRect.hpp.
Referenced by getDimension(), getWidth(), and isRectangleEmpty().