sptk2 logo
SPTK Home Page
Public Member Functions | List of all members
sptk::CRect Class Reference

#include <CRect.h>

Public Member Functions

 CRect (int x=0, int y=0, int w=0, int h=0)
 
int x () const
 
int y () const
 
int w () const
 
int h () const
 
void move (int x, int y)
 
void size (int w, int h)
 
void shift (int dx, int dy)
 
void shrink (int dw, int dh)
 
void expand (int dw, int dh)
 

Detailed Description

General class to work with rectangles

Constructor & Destructor Documentation

◆ CRect()

sptk::CRect::CRect ( int  x = 0,
int  y = 0,
int  w = 0,
int  h = 0 
)
inline

Default constructor

Parameters
xint, rectangle X-coordinate
yint, rectangle Y-coordinate
wint, rectangle width
hint, rectangle height

Member Function Documentation

◆ expand()

void sptk::CRect::expand ( int  dw,
int  dh 
)
inline

expands rectangle width and height

Parameters
dwint, rectangle width change
dhint, rectangle height change

◆ h()

int sptk::CRect::h ( ) const
inline

returns rectangle height

Referenced by size().

◆ move()

void sptk::CRect::move ( int  x,
int  y 
)
inline

sets rectangle X and Y coordinates

Parameters
xint, rectangle X-coordinate
yint, rectangle Y-coordinate

References x(), and y().

◆ shift()

void sptk::CRect::shift ( int  dx,
int  dy 
)
inline

shifts rectangle X and Y coordinates

Parameters
dxint, rectangle X-coordinate shift
dyint, rectangle Y-coordinate shift

◆ shrink()

void sptk::CRect::shrink ( int  dw,
int  dh 
)
inline

shrinks rectangle width and height

Parameters
dwint, rectangle width change
dhint, rectangle height change

◆ size()

void sptk::CRect::size ( int  w,
int  h 
)
inline

sets rectangle's width and height

Parameters
wint, rectangle width
hint, rectangle height

References h(), and w().

◆ w()

int sptk::CRect::w ( ) const
inline

returns rectangle width

Referenced by size().

◆ x()

int sptk::CRect::x ( ) const
inline

returns rectangle X-coordinate

Referenced by move().

◆ y()

int sptk::CRect::y ( ) const
inline

returns rectangle Y-coordinate

Referenced by move().


The documentation for this class was generated from the following file:

Fri Oct 14 2022 09:58:39: SPTK 5.4.1