lib

#include <KoRect.h>

Public Member Functions

 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)
 
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)
 
KoRect & operator|= (const KoRect &rhs)
 
KoRect & operator&= (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 TQWMatrix &m) const
 
KoRect translate (double dx, double dy) const
 
TQRect toTQRect () const
 

Static Public Member Functions

static KoRect fromTQRect (const TQRect &rect)
 

Detailed Description

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

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

Definition at line 31 of file KoRect.h.

Constructor & Destructor Documentation

◆ KoRect() [1/4]

KoRect::KoRect ( )
inline

Definition at line 34 of file KoRect.h.

◆ KoRect() [2/4]

KoRect::KoRect ( const KoPoint &  topleft,
const KoPoint &  bottomright 
)
inline

Definition at line 36 of file KoRect.h.

◆ KoRect() [3/4]

KoRect::KoRect ( const KoPoint &  topleft,
const KoSize &  size 
)
inline

Definition at line 38 of file KoRect.h.

◆ KoRect() [4/4]

KoRect::KoRect ( const double &  left,
const double &  top,
const double &  width,
const double &  height 
)
inline

Definition at line 40 of file KoRect.h.

◆ ~KoRect()

KoRect::~KoRect ( )
inline

Definition at line 42 of file KoRect.h.

Member Function Documentation

◆ bottom()

double KoRect::bottom ( ) const
inline

Definition at line 54 of file KoRect.h.

◆ bottomLeft()

KoPoint KoRect::bottomLeft ( ) const
inline

Definition at line 75 of file KoRect.h.

◆ bottomRight()

KoPoint KoRect::bottomRight ( ) const
inline

Definition at line 73 of file KoRect.h.

◆ center()

KoPoint KoRect::center ( ) const

Definition at line 64 of file KoRect.cpp.

◆ contains() [1/3]

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

Helper function for the above function.

Definition at line 173 of file KoRect.cpp.

◆ contains() [2/3]

bool KoRect::contains ( const KoPoint &  p) const

Returns if the point is contained in the rect.

Parameters
pthe 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.

◆ contains() [3/3]

bool KoRect::contains ( const KoRect &  r) const

Helper function for the above function.

Definition at line 177 of file KoRect.cpp.

◆ fromTQRect()

KoRect KoRect::fromTQRect ( const TQRect &  rect)
static

Definition at line 271 of file KoRect.cpp.

◆ height()

double KoRect::height ( ) const
inline

Definition at line 96 of file KoRect.h.

◆ intersect()

KoRect KoRect::intersect ( const KoRect &  r) const

Definition at line 186 of file KoRect.cpp.

◆ intersects()

bool KoRect::intersects ( const KoRect &  r) const

Definition at line 190 of file KoRect.cpp.

◆ isEmpty()

bool KoRect::isEmpty ( ) const
inline

Definition at line 46 of file KoRect.h.

◆ isNull()

bool KoRect::isNull ( ) const
inline

Definition at line 44 of file KoRect.h.

◆ isValid()

bool KoRect::isValid ( ) const
inline

Definition at line 48 of file KoRect.h.

◆ left()

double KoRect::left ( ) const
inline

Definition at line 51 of file KoRect.h.

◆ moveBottomLeft()

void KoRect::moveBottomLeft ( const KoPoint &  bottomleft)

Definition at line 91 of file KoRect.cpp.

◆ moveBottomRight()

void KoRect::moveBottomRight ( const KoPoint &  bottomright)

Definition at line 76 of file KoRect.cpp.

◆ moveBy()

void KoRect::moveBy ( const double &  dx,
const double &  dy 
)

Definition at line 99 of file KoRect.cpp.

◆ moveTopLeft()

void KoRect::moveTopLeft ( const KoPoint &  topleft)

Definition at line 69 of file KoRect.cpp.

◆ moveTopRight()

void KoRect::moveTopRight ( const KoPoint &  topright)

Definition at line 83 of file KoRect.cpp.

◆ normalize()

KoRect KoRect::normalize ( ) const

Definition at line 21 of file KoRect.cpp.

◆ operator&=()

KoRect & KoRect::operator&= ( const KoRect &  rhs)

Definition at line 156 of file KoRect.cpp.

◆ operator|=()

KoRect & KoRect::operator|= ( const KoRect &  rhs)

Definition at line 136 of file KoRect.cpp.

◆ rBottom()

double & KoRect::rBottom ( )
inline

Definition at line 59 of file KoRect.h.

◆ right()

double KoRect::right ( ) const
inline

Definition at line 53 of file KoRect.h.

◆ rLeft()

double & KoRect::rLeft ( )
inline

Definition at line 56 of file KoRect.h.

◆ rRight()

double & KoRect::rRight ( )
inline

Definition at line 58 of file KoRect.h.

◆ rTop()

double & KoRect::rTop ( )
inline

Definition at line 57 of file KoRect.h.

◆ setBottom()

void KoRect::setBottom ( const double &  bottom)
inline

Definition at line 67 of file KoRect.h.

◆ setBottomLeft()

void KoRect::setBottomLeft ( const KoPoint &  bottomleft)

Definition at line 57 of file KoRect.cpp.

◆ setBottomRight()

void KoRect::setBottomRight ( const KoPoint &  bottomright)

Definition at line 46 of file KoRect.cpp.

◆ setCoords()

void KoRect::setCoords ( const double &  x1,
const double &  y1,
const double &  x2,
const double &  y2 
)

Definition at line 119 of file KoRect.cpp.

◆ setHeight()

void KoRect::setHeight ( const double &  height)
inline

Definition at line 98 of file KoRect.h.

◆ setLeft()

void KoRect::setLeft ( const double &  left)
inline

Definition at line 64 of file KoRect.h.

◆ setRect() [1/2]

void KoRect::setRect ( const double &  x,
const double &  y,
const double &  width,
const double &  height 
)

Definition at line 107 of file KoRect.cpp.

◆ setRect() [2/2]

void KoRect::setRect ( const KoRect &  rect)

Definition at line 113 of file KoRect.cpp.

◆ setRight()

void KoRect::setRight ( const double &  right)
inline

Definition at line 66 of file KoRect.h.

◆ setSize()

void KoRect::setSize ( const KoSize &  size)

Definition at line 125 of file KoRect.cpp.

◆ setTop()

void KoRect::setTop ( const double &  top)
inline

Definition at line 65 of file KoRect.h.

◆ setTopLeft()

void KoRect::setTopLeft ( const KoPoint &  topleft)

Definition at line 41 of file KoRect.cpp.

◆ setTopRight()

void KoRect::setTopRight ( const KoPoint &  topright)

Definition at line 51 of file KoRect.cpp.

◆ setWidth()

void KoRect::setWidth ( const double &  width)
inline

Definition at line 97 of file KoRect.h.

◆ setX()

void KoRect::setX ( const double &  x)
inline

Definition at line 69 of file KoRect.h.

◆ setY()

void KoRect::setY ( const double &  y)
inline

Definition at line 70 of file KoRect.h.

◆ size()

KoSize KoRect::size ( ) const

Definition at line 131 of file KoRect.cpp.

◆ top()

double KoRect::top ( ) const
inline

Definition at line 52 of file KoRect.h.

◆ topLeft()

KoPoint KoRect::topLeft ( ) const
inline

Definition at line 72 of file KoRect.h.

◆ topRight()

KoPoint KoRect::topRight ( ) const
inline

Definition at line 74 of file KoRect.h.

◆ toTQRect()

TQRect KoRect::toTQRect ( ) const

Definition at line 265 of file KoRect.cpp.

◆ transform()

KoRect KoRect::transform ( const TQWMatrix &  m) const

Definition at line 229 of file KoRect.cpp.

◆ translate()

KoRect KoRect::translate ( double  dx,
double  dy 
) const

Definition at line 260 of file KoRect.cpp.

◆ unite()

KoRect KoRect::unite ( const KoRect &  r) const

Definition at line 182 of file KoRect.cpp.

◆ width()

double KoRect::width ( ) const
inline

Definition at line 95 of file KoRect.h.

◆ x()

double KoRect::x ( ) const
inline

Definition at line 61 of file KoRect.h.

◆ y()

double KoRect::y ( ) const
inline

Definition at line 62 of file KoRect.h.


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