|
LibreOffice Module basegfx (master) 1
|
A two-dimensional interval over doubles. More...
#include <b2drange.hxx>
Public Member Functions | |
| B2DRange () | |
| B2DRange (const Tuple2D< ValueType > &rTuple) | |
| Create degenerate interval consisting of a single point. More... | |
| B2DRange (const Tuple2D< ValueType > &rTuple1, const Tuple2D< ValueType > &rTuple2) | |
| Create proper interval between the two given points. More... | |
| B2DRange (ValueType x1, ValueType y1, ValueType x2, ValueType y2) | |
| BASEGFX_DLLPUBLIC | B2DRange (const B2IRange &rRange) |
| B2DPoint | getMinimum () const |
| get lower bound of the set. returns arbitrary values for empty sets. More... | |
| B2DPoint | getMaximum () const |
| get upper bound of the set. returns arbitrary values for empty sets. More... | |
| B2DVector | getRange () const |
| return difference between upper and lower point. returns (0,0) for empty sets. More... | |
| B2DPoint | getCenter () const |
| return center point of set. returns (0,0) for empty sets. More... | |
| BASEGFX_DLLPUBLIC void | transform (const B2DHomMatrix &rMatrix) |
| Transform Range by given transformation matrix. More... | |
| BASEGFX_DLLPUBLIC B2DRange & | operator*= (const ::basegfx::B2DHomMatrix &rMat) |
| Transform Range by given transformation matrix. More... | |
Public Member Functions inherited from basegfx::Range2D< double, DoubleTraits > | |
| Range2D ()=default | |
| Range2D (const Tuple2D< double > &rTuple) | |
| Create degenerate interval consisting of a single point. More... | |
| Range2D (const Tuple2D< double > &rTuple1, const Tuple2D< double > &rTuple2) | |
| Create proper interval between the two given points. More... | |
| Range2D (double x1, double y1, double x2, double y2) | |
| Create proper interval between the two given pairs. More... | |
| bool | isEmpty () const |
| Check if the interval set is empty. More... | |
| void | reset () |
| reset the object to empty state again, clearing all values More... | |
| bool | operator== (const Range2D &rRange) const |
| bool | operator!= (const Range2D &rRange) const |
| bool | equal (const Range2D &rRange) const |
| double | getMinX () const |
| get lower bound of the set. returns arbitrary values for empty sets. More... | |
| double | getMinY () const |
| get lower bound of the set. returns arbitrary values for empty sets. More... | |
| double | getMaxX () const |
| get upper bound of the set. returns arbitrary values for empty sets. More... | |
| double | getMaxY () const |
| get upper bound of the set. returns arbitrary values for empty sets. More... | |
| double | getWidth () const |
| return difference between upper and lower X value. returns 0 for empty sets. More... | |
| double | getHeight () const |
| return difference between upper and lower Y value. returns 0 for empty sets. More... | |
| double | getCenterX () const |
| return center X value of set. returns 0 for empty sets. More... | |
| double | getCenterY () const |
| return center Y value of set. returns 0 for empty sets. More... | |
| bool | isInside (const Tuple2D< double > &rTuple) const |
| yields true if given point is contained in set More... | |
| bool | isInside (const Range2D &rRange) const |
| yields true if rRange is inside, or equal to set More... | |
| bool | overlaps (const Range2D &rRange) const |
| yields true if rRange at least partly inside set More... | |
| bool | overlapsMore (const Range2D &rRange) const |
| yields true if overlaps(rRange) does, and the overlap is larger than infinitesimal More... | |
| void | expand (const Tuple2D< double > &rTuple) |
| add point to the set, expanding as necessary More... | |
| void | expand (const Range2D &rRange) |
| add rRange to the set, expanding as necessary More... | |
| void | intersect (const Range2D &rRange) |
| calc set intersection More... | |
| void | grow (double fValue) |
| grow set by fValue on all sides More... | |
| void | grow (const Tuple2D< double > &rTuple) |
| grow set by axis aware values from rTuple More... | |
| Tuple2D< double > | clamp (const Tuple2D< double > &rTuple) const |
| clamp value on range More... | |
Static Public Member Functions | |
| static BASEGFX_DLLPUBLIC const B2DRange & | getUnitB2DRange () |
| Get a range filled with (0.0, 0.0, 1.0, 1.0) More... | |
Additional Inherited Members | |
Public Types inherited from basegfx::Range2D< double, DoubleTraits > | |
| typedef double | ValueType |
| typedef DoubleTraits | TraitsType |
Protected Attributes inherited from basegfx::Range2D< double, DoubleTraits > | |
| basegfx::BasicRange< double, DoubleTraits > | maRangeX |
| basegfx::BasicRange< double, DoubleTraits > | maRangeY |
A two-dimensional interval over doubles.
This is a set of real numbers, bounded by a lower and an upper pair. All inbetween values are included in the set (see also http://en.wikipedia.org/wiki/Interval_%28mathematics%29).
The set is closed, i.e. the upper and the lower bound are included (if you're used to the notation - we're talking about [a,b] here, compared to half-open [a,b) or open intervals (a,b)).
That means, isInside(val) will return true also for values of val=a or val=b.
Definition at line 53 of file b2drange.hxx.
|
inline |
Definition at line 56 of file b2drange.hxx.
Create degenerate interval consisting of a single point.
Definition at line 61 of file b2drange.hxx.
|
inline |
Create proper interval between the two given points.
Definition at line 67 of file b2drange.hxx.
Definition at line 73 of file b2drange.hxx.
|
explicit |
Definition at line 26 of file b2drange.cxx.
References basegfx::BasicRange< T, Traits >::expand(), basegfx::Range2D< TYPE, TRAITS >::getMaxX(), basegfx::Range2D< TYPE, TRAITS >::getMaxY(), basegfx::Range2D< TYPE, TRAITS >::getMinX(), basegfx::Range2D< TYPE, TRAITS >::getMinY(), basegfx::Range2D< TYPE, TRAITS >::isEmpty(), basegfx::Range2D< double, DoubleTraits >::maRangeX, and basegfx::Range2D< double, DoubleTraits >::maRangeY.
|
inline |
return center point of set. returns (0,0) for empty sets.
Definition at line 107 of file b2drange.hxx.
Referenced by basegfx::utils::createAreaGeometryForLineStartEnd(), and basegfx::utils::createPolygonFromRect().
|
inline |
get upper bound of the set. returns arbitrary values for empty sets.
Definition at line 89 of file b2drange.hxx.
Referenced by basegfx::utils::createAreaGeometryForLineStartEnd(), and basegfx::fround().
|
inline |
get lower bound of the set. returns arbitrary values for empty sets.
Definition at line 80 of file b2drange.hxx.
Referenced by basegfx::unotools::UnoPolyPolygon::addPolyPolygon(), basegfx::utils::createAreaGeometryForLineStartEnd(), basegfx::utils::createRotateAroundCenterKeepAspectRatioStayInsideRange(), and basegfx::fround().
|
inline |
return difference between upper and lower point. returns (0,0) for empty sets.
Definition at line 98 of file b2drange.hxx.
Referenced by basegfx::utils::createRotateAroundCenterKeepAspectRatioStayInsideRange().
|
static |
Get a range filled with (0.0, 0.0, 1.0, 1.0)
Definition at line 57 of file b2drange.cxx.
| B2DRange & basegfx::B2DRange::operator*= | ( | const ::basegfx::B2DHomMatrix & | rMat | ) |
Transform Range by given transformation matrix.
This operation transforms the Range by transforming all four possible extrema points (corners) of the given range and building a new one. This means that the range will grow evtl. when a shear and/or rotation is part of the transformation.
Definition at line 51 of file b2drange.cxx.
References transform().
| void basegfx::B2DRange::transform | ( | const B2DHomMatrix & | rMatrix | ) |
Transform Range by given transformation matrix.
Definition at line 38 of file b2drange.cxx.
References basegfx::Range2D< double, DoubleTraits >::expand(), basegfx::Range2D< TYPE, TRAITS >::getMaxX(), basegfx::Range2D< TYPE, TRAITS >::getMaxY(), basegfx::Range2D< TYPE, TRAITS >::getMinX(), basegfx::Range2D< TYPE, TRAITS >::getMinY(), basegfx::Range2D< double, DoubleTraits >::isEmpty(), basegfx::B2DHomMatrix::isIdentity(), and basegfx::Range2D< double, DoubleTraits >::reset().
Referenced by basegfx::utils::createRotateAroundCenterKeepAspectRatioStayInsideRange(), operator*=(), and basegfx::ImplB2DPolyRange::transform().