Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   Related Pages  

sjgui::CRectTmpl< T > Class Template Reference

This 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.

GetX ()
 Returns x position of the left side.

GetY ()
 Returns y position of the upper side.

GetWidth ()
 Returns width of the rectangle.

GetHeight ()
 Returns height of the rectangle.

GetBottom ()
 Returns y position of the lower side.

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 x = T(),
y = T(),
w = 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 x,
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 x,
y,
w,
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 x1,
y1,
x2,
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 w,
h
[inline]
 

Sets rectangle size.

w,h set width and height of the rectangle.

template<class T>
void sjgui::CRectTmpl< T >::SetX 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 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 x,
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:
sjgui logo
Quick Links:

 News
 Description
 Screen Shots
 Projects
 Downloads
 Source Code
 Help/FAQ
 Want to help?
 Credits
 Disclaimer


Documentation:

 Documentation
 Reference
 Lessons


Useful links:

sjcomp logo
sjcomp

opengl logo

nehe logo

SourceForge.net Logo

Last modified:


Started by Alexander Shyrokov. Generated at Wed Apr 28 12:31:06 2004 for the sjgui by doxygen 1.3.1. SourceForge.net Logo