lib

KoRect Class Reference

#include <KoRect.h>

List of all members.


Detailed Description

A rect whose coordinates are floating-point values ( "double"s ).

The API isn't documented, it's a perfect mirror of QRect.

Definition at line 31 of file KoRect.h.


Public Member Functions

 KoRect ()
 KoRect (const KoPoint &topleft, const KoPoint &bottomright)
 KoRect (const KoPoint &topleft, const KoSize &size)
 KoRect (const double &left, const double &top, const double &width, const double &height)
 ~KoRect ()
bool isNull () const
bool isEmpty () const
bool isValid () const
KoRect normalize () const
double left () const
double top () const
double right () const
double bottom () const
double & rLeft ()
double & rTop ()
double & rRight ()
double & rBottom ()
double x () const
double y () const
void setLeft (const double &left)
void setTop (const double &top)
void setRight (const double &right)
void setBottom (const double &bottom)
void setX (const double &x)
void setY (const double &y)
KoPoint topLeft () const
KoPoint bottomRight () const
KoPoint topRight () const
KoPoint bottomLeft () const
KoPoint center () const
void setTopLeft (const KoPoint &topleft)
void setBottomRight (const KoPoint &bottomright)
void setTopRight (const KoPoint &topright)
void setBottomLeft (const KoPoint &bottomleft)
void moveTopLeft (const KoPoint &topleft)
void moveBottomRight (const KoPoint &bottomright)
void moveTopRight (const KoPoint &topright)
void moveBottomLeft (const KoPoint &bottomleft)
void moveBy (const double &dx, const double &dy)
void setRect (const double &x, const double &y, const double &width, const double &height)
void setRect (const KoRect &rect)
void setCoords (const double &x1, const double &y1, const double &x2, const double &y2)
KoSize size () const
double width () const
double height () const
void setWidth (const double &width)
void setHeight (const double &height)
void setSize (const KoSize &size)
KoRectoperator|= (const KoRect &rhs)
KoRectoperator &= (const KoRect &rhs)
bool contains (const KoPoint &p) const
bool contains (const double &x, const double &y) const
bool contains (const KoRect &r) const
KoRect unite (const KoRect &r) const
KoRect intersect (const KoRect &r) const
bool intersects (const KoRect &r) const
KoRect transform (const QWMatrix &m) const
KoRect translate (double dx, double dy) const
QRect toQRect () const

Static Public Member Functions

static KoRect fromQRect (const QRect &rect)

Member Function Documentation

bool KoRect::contains const KoRect r  )  const
 

Helper function for the above function.

Definition at line 177 of file KoRect.cpp.

bool KoRect::contains const double &  x,
const double &  y
const
 

Helper function for the above function.

Definition at line 173 of file KoRect.cpp.

bool KoRect::contains const KoPoint p  )  const
 

Returns if the point is contained in the rect.

Parameters:
p the point to test Will return true if the point is contained in the 2d area this rect represents, this means that it will return true on everthing from the topleft() to the bottomright(); Note that for KoRect(0, 0, 100, 100) the KoPoint(0, 0) as well as KoPoint(100, 100) are mathmatically contained in the rect, this in contrary to pixel based rectangles.

Definition at line 169 of file KoRect.cpp.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys