Main Page Namespace List Class Hierarchy Compound List File List Namespace Members Compound Members Related Pages
sjgui::CRectTmpl< T > Class Template ReferenceThis is a template of a class describing a rectangle primitive.
More...
#include <wnd.h>
List of all members.
|
Public Member Functions |
| CRectTmpl (T x=T(), T y=T(), T w=T(), T h=T()) |
| Default constructor.
|
| CRectTmpl (T *rec) |
| Initialize using array of 4 values.
|
bool | PtInRect (T X, T Y) |
| Returns true if point x,y is within the rectangle.
|
T | GetX () |
| Returns x position of the left side.
|
T | GetY () |
| Returns y position of the upper side.
|
T | GetWidth () |
| Returns width of the rectangle.
|
T | GetHeight () |
| Returns height of the rectangle.
|
T | GetBottom () |
| Returns y position of the lower side.
|
T | GetRight () |
| Returns x position of the right side.
|
CPointTmpl< T > | GetPos () |
| Returns position of the rectangle.
|
void | SetX (T x) |
| Sets x position.
|
void | SetY (T y) |
| Sets y position.
|
void | SetWidth (T w) |
| Sets width of the rectangle.
|
void | SetHeight (T h) |
| Sets height of the rectangle.
|
void | SetBottom (T b) |
| Set bottom.
|
void | SetRight (T r) |
| Set right.
|
void | SetRect (T x, T y, T w, T h) |
| Sets the rectangle area using width and height.
|
void | SetRectByPt (T x1, T y1, T x2, T y2) |
| Sets the rectangle area using coordinates.
|
void | SetPos (T x, T y) |
| Sets rectangle position.
|
void | SetPos (CPointTmpl< T > pt) |
| Sets rectangle position.
|
void | SetSize (T w, T h) |
| Sets rectangle size.
|
void | Translate (T x, T y) |
| Move rectangle position.
|
void | Intersection (const CRectTmpl< T > &rect) |
| Modifyes itself to be an intersection with rect.
|
bool | IsEmpty () |
| Returns true if width, height or both are 0.
|
void | Deflate (T i) |
| Makes rect smaller, till 0 size.
|
void | Inflate (T i) |
| Makes rect biger, till 0 size.
|
Detailed Description
template<class T>
class sjgui::CRectTmpl< T >
This is a template of a class describing a rectangle primitive.
Rectangle is described by x,y position of the upper-left corner and size of the sides (width and height).
- Author:
- Alexander Shyrokov
- Version:
- Revision
- 1.1.1.1
Constructor & Destructor Documentation
template<class T> |
sjgui::CRectTmpl< T >::CRectTmpl |
( |
T |
x = T(), |
|
|
T |
y = T(), |
|
|
T |
w = T(), |
|
|
T |
h = T() |
|
) |
[inline] |
|
|
Default constructor.
x,y initialize the upper-left point of the rectangle w,h initialize width and height of the rectangle. |
template<class T> |
sjgui::CRectTmpl< T >::CRectTmpl |
( |
T * |
rec |
) |
[inline] |
|
|
Initialize using array of 4 values.
x,y initialize the upper-left point of the rectangle w,h initialize width and height of the rectangle. |
Member Function Documentation
template<class T> |
void sjgui::CRectTmpl< T >::SetPos |
( |
T |
x, |
|
|
T |
y |
|
) |
[inline] |
|
|
Sets rectangle position.
x,y set upper-left point of the rectangle, without changing the size. |
template<class T> |
void sjgui::CRectTmpl< T >::SetRect |
( |
T |
x, |
|
|
T |
y, |
|
|
T |
w, |
|
|
T |
h |
|
) |
[inline] |
|
|
Sets the rectangle area using width and height.
x,y set upper-left point of the rectangle w,h set width and height of the rectangle. |
template<class T> |
void sjgui::CRectTmpl< T >::SetRectByPt |
( |
T |
x1, |
|
|
T |
y1, |
|
|
T |
x2, |
|
|
T |
y2 |
|
) |
[inline] |
|
|
Sets the rectangle area using coordinates.
x1,y1 set upper-left point of the rectangle x2,y2 set lower-right point of the rectangle |
template<class T> |
void sjgui::CRectTmpl< T >::SetSize |
( |
T |
w, |
|
|
T |
h |
|
) |
[inline] |
|
|
Sets rectangle size.
w,h set width and height of the rectangle. |
template<class T> |
void sjgui::CRectTmpl< T >::SetX |
( |
T |
x |
) |
[inline] |
|
|
Sets x position.
Sets x position of the upper-left corner of the rectangle, without changing its size. |
template<class T> |
void sjgui::CRectTmpl< T >::SetY |
( |
T |
y |
) |
[inline] |
|
|
Sets y position.
Sets y position of the upper-left corner of the rectangle, without changing its size. |
template<class T> |
void sjgui::CRectTmpl< T >::Translate |
( |
T |
x, |
|
|
T |
y |
|
) |
[inline] |
|
|
Move rectangle position.
Adds x and y to the upper-left corner positions, without changing the size of the rectangle. |
The documentation for this class was generated from the following file:
|
|