basic 2D rectangle class More...
Public Member Functions | |
| Rectangle (T l=0, T t=0, T r=0, T b=0) | |
| Rectangle (const Point2D< T > &tl, const Point2D< T > &br) | |
| Rectangle (const Point2D< T > &tl, const Size2D< T > &sz) | |
| bool | operator== (const Rectangle< T > &) const |
| bool | operator!= (const Rectangle< T > &) const |
| Point2D< T > | topLeft () const |
| Point2D< T > | topRight () const |
| Point2D< T > | bottomLeft () const |
| Point2D< T > | bottomRight () const |
| Point2D< T > | centre () const |
| void | setTopLeft (Point2D< T >) |
| void | setBottomRight (Point2D< T >) |
| void | setTopRight (Point2D< T >) |
| void | setBottomLeft (Point2D< T >) |
| void | setTopBottom (const Interval< T > &) |
| void | setLeftRight (const Interval< T > &) |
| Point2D< T > | moveInside (const Point2D< T > &) const |
| void | include (const Rectangle< T > &) |
| void | limitTo (const Rectangle< T > &) |
| bool | operator> (const Rectangle< T > &) const |
| T | width () const |
| T | height () const |
| T | left () const |
| T | top () const |
| T | right () const |
| T | bottom () const |
| void | setLeft (T val) |
| void | setTop (T val) |
| void | setRight (T val) |
| void | setBottom (T val) |
| void | checkCorners (bool leftislow=true, bool topislow=true) |
| Size2D< T > | size () const |
| void | zero () |
| Rectangle< T > & | operator+= (const Point2D< T > &) |
| Rectangle< T > & | operator-= (const Point2D< T > &) |
| Rectangle< T > & | operator+= (const Size2D< T > &) |
| Rectangle< T > & | operator-= (const Size2D< T > &) |
| void | swapHor () |
| void | swapVer () |
Protected Member Functions | |
| bool | revX () const |
| bool | revY () const |
Protected Attributes | |
| Point2D< T > | topleft_ |
| Point2D< T > | bottomright_ |
basic 2D rectangle class
This class is a bit more complicated than would be expected at first sight. This is caused by the problem of coordinate system sign. For example, in user interfaces, top is a lower number than bottom. But for normal coordinates, this is (of course) not the case. Still, also for floating point types, reverse axes are common.
| Geom::Rectangle< T >::Rectangle | ( | T | l = 0, |
|
| T | t = 0, |
|||
| T | r = 0, |
|||
| T | b = 0 | |||
| ) | [inline] |
| Geom::Rectangle< T >::Rectangle | ( | const Point2D< T > & | tl, | |
| const Point2D< T > & | br | |||
| ) | [inline] |
| Geom::Rectangle< T >::Rectangle | ( | const Point2D< T > & | tl, | |
| const Size2D< T > & | sz | |||
| ) | [inline] |
| T Geom::Rectangle< T >::bottom | ( | ) | const [inline] |
| Point2D< T > Geom::Rectangle< T >::bottomLeft | ( | ) | const [inline] |
| Point2D< T > Geom::Rectangle< T >::bottomRight | ( | ) | const [inline] |
| Point2D< T > Geom::Rectangle< T >::centre | ( | ) | const [inline] |
| void Geom::Rectangle< T >::checkCorners | ( | bool | leftislow = true, |
|
| bool | topislow = true | |||
| ) | [inline] |
| T Geom::Rectangle< T >::height | ( | ) | const [inline] |
| void Geom::Rectangle< T >::include | ( | const Rectangle< T > & | r | ) | [inline] |
| T Geom::Rectangle< T >::left | ( | ) | const [inline] |
| void Geom::Rectangle< T >::limitTo | ( | const Rectangle< T > & | r | ) | [inline] |
| Point2D< T > Geom::Rectangle< T >::moveInside | ( | const Point2D< T > & | pt | ) | const [inline] |
| bool Geom::Rectangle< T >::operator!= | ( | const Rectangle< T > & | r | ) | const [inline] |
| Rectangle< T > & Geom::Rectangle< T >::operator+= | ( | const Size2D< T > & | sz | ) | [inline] |
| Rectangle< T > & Geom::Rectangle< T >::operator+= | ( | const Point2D< T > & | p | ) | [inline] |
| Rectangle< T > & Geom::Rectangle< T >::operator-= | ( | const Point2D< T > & | p | ) | [inline] |
| Rectangle< T > & Geom::Rectangle< T >::operator-= | ( | const Size2D< T > & | sz | ) | [inline] |
| bool Geom::Rectangle< T >::operator== | ( | const Rectangle< T > & | r | ) | const [inline] |
| bool Geom::Rectangle< T >::operator> | ( | const Rectangle< T > & | r | ) | const [inline] |
| bool Geom::Rectangle< T >::revX | ( | ) | const [inline, protected] |
| bool Geom::Rectangle< T >::revY | ( | ) | const [inline, protected] |
| T Geom::Rectangle< T >::right | ( | ) | const [inline] |
| void Geom::Rectangle< T >::setBottom | ( | T | val | ) | [inline] |
| void Geom::Rectangle< T >::setBottomLeft | ( | Point2D< T > | tr | ) | [inline] |
| void Geom::Rectangle< T >::setBottomRight | ( | Point2D< T > | br | ) | [inline] |
| void Geom::Rectangle< T >::setLeft | ( | T | val | ) | [inline] |
| void Geom::Rectangle< T >::setLeftRight | ( | const Interval< T > & | rg | ) | [inline] |
| void Geom::Rectangle< T >::setRight | ( | T | val | ) | [inline] |
| void Geom::Rectangle< T >::setTop | ( | T | val | ) | [inline] |
| void Geom::Rectangle< T >::setTopBottom | ( | const Interval< T > & | rg | ) | [inline] |
| void Geom::Rectangle< T >::setTopLeft | ( | Point2D< T > | tl | ) | [inline] |
| void Geom::Rectangle< T >::setTopRight | ( | Point2D< T > | tr | ) | [inline] |
| Size2D< T > Geom::Rectangle< T >::size | ( | ) | const [inline] |
| void Geom::Rectangle< T >::swapHor | ( | ) | [inline] |
| void Geom::Rectangle< T >::swapVer | ( | ) | [inline] |
| T Geom::Rectangle< T >::top | ( | ) | const [inline] |
| Point2D< T > Geom::Rectangle< T >::topLeft | ( | ) | const [inline] |
| Point2D< T > Geom::Rectangle< T >::topRight | ( | ) | const [inline] |
| T Geom::Rectangle< T >::width | ( | ) | const [inline] |
| void Geom::Rectangle< T >::zero | ( | ) | [inline] |
Point2D<T> Geom::Rectangle< T >::bottomright_ [protected] |
Point2D<T> Geom::Rectangle< T >::topleft_ [protected] |
1.7.1