Public Member Functions | |
Constructor / Destructor | |
CP_Rect () | |
Constructor. | |
CP_Rect (float infLeftCoord, float infTopCoord, float infRightCoord, float infBottomCoord) | |
CP_Rect (const CP_Point &inLocation, const CP_Size &inSize) | |
CP_Rect (const CP_Rect &inRect) | |
virtual | ~CP_Rect () |
Destructor. | |
Getters | |
float | Left () const |
float | Top () const |
float | Right () const |
float | Bottom () const |
float | Width () const |
float | Height () const |
float | MinX () const |
float | MaxX () const |
float | MinY () const |
float | MaxY () const |
float | CenterX () const |
float | CenterY () const |
CP_Point | Center () const |
Operators | |
CP_Rect & | operator= (const CP_Rect &inFloatRect) |
Setters | |
void | Set (float infLeft, float infTop, float infRight, float infBottom) |
void | Set (const CP_Point &inTopLeft, const CP_Size &inSize) |
void | SetWidth (float inWidth) |
void | SetHeight (float inHeight) |
void | SetLeft (float inLeft) |
void | SetTop (float inTop) |
void | SetRight (float inRight) |
void | SetBottom (float inBottom) |
Comparers | |
bool | operator== (const CP_Rect &inRect) const |
bool | operator!= (const CP_Rect &inRect) const |
Math | |
CP_Rect & | operator+= (CP_Rect &inRect) |
CP_Rect & | operator-= (CP_Rect &inRect) |
CP_Rect & | operator *= (CP_Rect &inRect) |
CP_Rect & | operator/= (CP_Rect &inRect) |
CP_Rect | operator+ (CP_Rect &inRect) const |
CP_Rect | operator- (CP_Rect &inRect) const |
CP_Rect | operator * (CP_Rect &inRect) const |
CP_Rect | operator/ (CP_Rect &inRect) const |
CP_Rect & | operator+= (CP_Point &inPoint) |
CP_Rect & | operator-= (CP_Point &inPoint) |
CP_Rect & | operator *= (CP_Point &inPoint) |
CP_Rect & | operator/= (CP_Point &inPoint) |
CP_Rect | operator+ (CP_Point &inPoint) const |
CP_Rect | operator- (CP_Point &inPoint) const |
CP_Rect | operator * (CP_Point &inPoint) const |
CP_Rect | operator/ (CP_Point &inPoint) const |
Movement | |
void | Offset (float horAmt, float verAmt) |
void | Offset (const CP_Point &amt) |
Sizers | |
void | Expand (float horAmt, float verAmt) |
void | Expand (const CP_Rect &inAmount) |
void | Expand (const CP_Point &inAmount) |
void | Inset (float horAmt, float verAmt) |
void | Inset (const CP_Rect &inAmount) |
void | Inset (const CP_Point &inAmount) |
Testers | |
bool | IsEmpty () const |
bool | IsValid () const |
bool | Contains (const CP_Rect &inRect) |
bool | Contains (const CP_Point &inPoint) |
Utility | |
void | MakeEmpty () |
void | MakeValid () |
CP_Point | TopLeft () const |
CP_Point | BottomRight () const |
CP_Point | TopRight () const |
CP_Point | BottomLeft () const |
CP_Size | Size () const |
bool | Intersects (const CP_Rect &inRect) |
CP_Rect | Intersect (const CP_Rect &inRect) const |
Constructor / Destructor | |
CP_Rect (Rect inRect) | |
Constructor. | |
Converters | |
operator const Rect () const | |
operator Rect * () | |
operator const Rect * () const | |
CP_Rect & | operator= (Rect inRect) |
void | Set (Rect inRect) |
Constructor / Destructor | |
CP_Rect (RECT *inRect) | |
Constructor. | |
Converters | |
operator RECT * () | |
operator const RECT * () const | |
operator const RECT () const | |
void | Get (RECT &inOutRect) |
void | Set (RECT &inRect) |
Protected Attributes | |
float | fLeft |
float | fTop |
float | fRight |
float | fBottom |
|
Constructor. This creates a rect with all coordinates at 0.
|
|
Constructor. This constructs the rect from the passed in floating point coordinates.
|
|
Constructor. This constructs the rect from the passed in CP_Point and CP_Size.
|
|
Copy constructor. Copies the coordinates from the passed in inFloatRect to this object.
|
|
Destructor. |
|
bottom coordinate. |
|
Windows - Constructor. Constructs this object from the passed in RECT.
|
|
Return the fLeft coordinate.
|
|
Return the fTop coordinate.
|
|
Return the fRight coordinate.
|
|
Return the fBottom coordinate.
|
|
Return the width of this rectangle.
|
|
Return the height of this rectangle.
|
|
Returns the minimum horizontal dimenstion.
|
|
Returns the maximum horizontal dimenstion.
|
|
Returns the minimum vertical dimenstion.
|
|
Returns the maximum vertical dimenstion.
|
|
Returns the horizontal center of this rect.
|
|
Returns the vertical center of this rect.
|
|
Returns the center of this rect as a point.
|
|
Assignment operator. Sets the coordinates of this object to those of the passed in inRect.
|
|
Sets the bounds of this rect from the passed in coordinates.
|
|
Sets the coordinates of this rect from the passed in CP_Point and CP_Size.
|
|
Sets the width of the rect to the passed in width. The left dimension remains the same.
|
|
Sets the height of the rect to the passed in height. The top dimension remains the same.
|
|
Sets the left coordinates from the passed in float.
|
|
Sets the top coordinates from the passed in float.
|
|
Sets the right coordinates from the passed in float.
|
|
Sets the bottom coordinates from the passed in float.
|
|
Equality operator. Return true if all 4 coordinates are the same as the passed in inRect.
|
|
Inequality operator. Return true if any of the 4 coordinates are the not the same as the passed in inRect.
|
|
Plus equal operator. Add the coordinates from the passeed in inRect to these coordinates.
|
|
Minus equal operator. Subtract the coordinates from the passeed in inRect to these coordinates.
|
|
Times equal operator. Multiply the coordinates from the passeed in inRect to these coordinates.
|
|
Divide equal operator. Divide the coordinates from the passeed in inRect to these coordinates.
|
|
Addition operator. Add the coordinates from the passeed in inRect to these coordinates.
|
|
Minus operator. Subtract the coordinates from the passeed in inRect to these coordinates.
|
|
Times operator. Multiply the coordinates from the passeed in inRect to these coordinates.
|
|
Divide operator. Divide the coordinates from the passeed in inRect to these coordinates.
|
|
Plus equal operator. Add the coordinates from the passeed in inPoint to these coordinates.
|
|
Minus equal operator. Subtract the coordinates from the passeed in inPoint to these coordinates.
|
|
Times equal operator. Multiply the coordinates from the passeed in inPoint to these coordinates.
|
|
Divide equal operator. Divide the coordinates from the passeed in inPoint to these coordinates.
|
|
Plus operator. Add the coordinates from the passeed in inPoint to these coordinates.
|
|
Minus operator. Subtract the coordinates from the passeed in inPoint to these coordinates.
|
|
Multiply operator. Multiply the coordinates from the passeed in inPoint to these coordinates.
|
|
Divide operator. Divide the coordinates from the passeed in inPoint to these coordinates.
|
|
Offset this rect by the passed in horinAmount and verinAmount.
|
|
Offset this rect by the passed in inAmount.
|
|
Expand this rectangle by the passed in inHorAmount and inVerAmount.
|
|
Expand this rectangle by the passed in amount contained in the CP_Rect inAmount. If the coordinates are negative, then the rect will be inset.
|
|
Expands this rect by the distance passed in the CP_Point. If the point contains negative numbers, then this rect is shrunk.
|
|
Inset (shrink) this rectangle by the passed in horinAmount and verinAmount.
|
|
Inset (shrink) this rectangle by the passed in amount contained in the CP_Rect.
|
|
Inset (shrink) this rectangle by the passed in amount contained in the CP_Point.
|
|
Return true if this rectangle is empty. All 4 coordinates equal 0.
|
|
Return true if this rectangles coordinates are valid. A valid rectangle is one where the left coordinate is less than or equal to the right. And the top is less than or equal to the bottom.
|
|
Return true if this rectangle completely contains the passed in inRect. If the coordinates are equal, it is considered contained.
|
|
Return true if this rect contains the passed in point. If the coordinates are equal, it is considered contained.
|
|
Make the rectangle empty by setting all coordinates to 0.
|
|
If this rectangle is invalid, then switch the coordinates to make sure it is valid. A valid rect is one where the left edge is less than or equal to the right coordinate. And the top is less than or equal to the bottom.
|
|
Returns the top left points of the rect as a CP_Point.
|
|
Returns the bottom right points of the rect as a CP_Point.
|
|
Returns the top right points of the rect as a CP_Point.
|
|
Returns the bottom left points of the rect as a CP_Point.
|
|
|
|
Set this rectangle to the intersection of these coordinates and the passed in inRect, return true if the result is a valid rectangle.
|
|
Returns a CP_Rect object that is the intersection of this rect and the passed in rect.
|
|
MacOS - operator Rect returns the coordinates of this object as a MacOS Rect. Const version.
|
|
MacOS - operator Rect * returns the coordinates of this object as a MacOS Rect *.
|
|
MacOS - operator Rect * returns the coordinates of this object as a MacOS Rect *. Const version.
|
|
MacOS - Assignment operator. Assigns the values to this object from the pssed in MacOS Rect.
|
|
MacOS - Constructor. Constructs this object from the passed in HIRect.
|
|
Windows - operator RECT * to return a Windows RECT * object that contains the coordinates of this rect.
|
|
Windows - operator RECT * to return a Windows RECT * object that contains the coordinates of this rect.
|
|
Windows - operator RECT to return a Windows RECT object that contains the coordinates of this rect.
|
|
Windows - Returns a Windows RECT in the passed in parameter.
|
|
Windows - Sets the coordines from the passed in Windows RECT.
|
|
|
|
left coordinate. |
|
top coordinate. |
|
right coordinate. |