Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Examples  

QSRectf Class Reference

Rectangle with floating point coordinates. More...

#include <qscoord.h>

Inheritance diagram for QSRectf:

Inheritance graph
List of all members.

Public Methods

 QSRectf ()
 QSRectf (const QRect &r)
 QSRectf (const QSPt2f &p2, const QSPt2f &p1, bool norm)
 QSRectf (const QSPt2f &initPos, const QSPt2f &initSize)
 QSRectf (double x, double y, double w, double h)
 ~QSRectf ()
void setP1 (const QSPt2f &p)
void setP2 (const QSPt2f &p)
QSPt2f p1 () const
QSPt2f p2 () const
void setTopLeft (const QSPt2f &p)
void setBottomRight (const QSPt2f &p)
QSPt2f topLeft () const
QSPt2f bottomRight () const
bool contains (const QSPt2f &pos) const
void unite (const QSRectf &rect)
QSRectf normalize () const
QSRectf normalizeWidth () const
QSRectf normalizeHeight () const
QRect rect () const

Public Attributes

QSPt2f pos
QSPt2f size


bool operator== (const QSRectf &r1, const QSRectf &r2)
bool operator!= (const QSRectf &r1, const QSRectf &r2)

Detailed Description

Rectangle with floating point coordinates.

Constructor & Destructor Documentation

QSRectf::QSRectf   [inline]


QSRectf::QSRectf const QRect &    r [inline, explicit]


QSRectf::QSRectf const QSPt2f   p2,
const QSPt2f   p1,
bool    norm


QSRectf::QSRectf const QSPt2f   initPos,
const QSPt2f   initSize


QSRectf::QSRectf double    x,
double    y,
double    w,
double    h


QSRectf::~QSRectf   [inline]


Member Function Documentation

QSPt2f QSRectf::bottomRight   const

Returns coordinates of bottom-left corner ( the corner furthermost from (0,0) )

bool QSRectf::contains const QSPt2f   pos const

Returns if point is inside the rectangle

QSRectf QSRectf::normalize   const

Normalizes rectangle ( makes size > 0 )

QSRectf QSRectf::normalizeHeight   const

Normalizes height ( makes it > 0 )

QSRectf QSRectf::normalizeWidth   const

Normalizes width ( makes it > 0 )

QSPt2f QSRectf::p1   const [inline]

Returns 'pos'.

QSPt2f QSRectf::p2   const [inline]

Returns 'pos'+'size'

QRect QSRectf::rect   const

Rounds coordinates and converst rectangle to QRect.

void QSRectf::setBottomRight const QSPt2f   p

Sets bottom-right ( with maximum coordinates ) corner of this rectangle to 'p'. Never changes topLeft corner..

void QSRectf::setP1 const QSPt2f   p [inline]

P1 is point at 'pos'. This function changes 'pos' and 'size' of this rectangle but never changes P2

void QSRectf::setP2 const QSPt2f   p [inline]

P2 is the point at 'pos'+'size'. This function changes 'size' of this rectangle, but never changes 'size'.

void QSRectf::setTopLeft const QSPt2f   p

Sets top-left ( with minimal coordinates ) corner of this rectange. Doesnt change bottom-right corner.

QSPt2f QSRectf::topLeft   const

Returns coordinates of the top-left corner ( the corner closest to (0,0) ).

void QSRectf::unite const QSRectf &    rect

Unites the rectangle with other rectangle.

Member Data Documentation

QSPt2f QSRectf::pos

Position of this rectangle.

QSPt2f QSRectf::size

Size of this rectangle.

The documentation for this class was generated from the following file:
Generated on Mon Mar 18 19:16:54 2002 for KMatplot library by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002