LibreOffice Module basegfx (master) 1
|
#include <Range2D.hxx>
Public Types | |
typedef TYPE | ValueType |
typedef TRAITS | TraitsType |
Public Member Functions | |
Range2D ()=default | |
Range2D (const Tuple2D< TYPE > &rTuple) | |
Create degenerate interval consisting of a single point. More... | |
Range2D (const Tuple2D< TYPE > &rTuple1, const Tuple2D< TYPE > &rTuple2) | |
Create proper interval between the two given points. More... | |
Range2D (TYPE x1, TYPE y1, TYPE x2, TYPE 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 |
TYPE | getMinX () const |
get lower bound of the set. returns arbitrary values for empty sets. More... | |
TYPE | getMinY () const |
get lower bound of the set. returns arbitrary values for empty sets. More... | |
TYPE | getMaxX () const |
get upper bound of the set. returns arbitrary values for empty sets. More... | |
TYPE | getMaxY () const |
get upper bound of the set. returns arbitrary values for empty sets. More... | |
TYPE | getWidth () const |
return difference between upper and lower X value. returns 0 for empty sets. More... | |
TYPE | 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< TYPE > &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< TYPE > &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 (TYPE fValue) |
grow set by fValue on all sides More... | |
void | grow (const Tuple2D< TYPE > &rTuple) |
grow set by axis aware values from rTuple More... | |
Tuple2D< TYPE > | clamp (const Tuple2D< TYPE > &rTuple) const |
clamp value on range More... | |
Protected Attributes | |
basegfx::BasicRange< TYPE, TRAITS > | maRangeX |
basegfx::BasicRange< TYPE, TRAITS > | maRangeY |
Definition at line 28 of file Range2D.hxx.
typedef TRAITS basegfx::Range2D< TYPE, TRAITS >::TraitsType |
Definition at line 36 of file Range2D.hxx.
typedef TYPE basegfx::Range2D< TYPE, TRAITS >::ValueType |
Definition at line 35 of file Range2D.hxx.
|
default |
|
inlineexplicit |
Create degenerate interval consisting of a single point.
Definition at line 41 of file Range2D.hxx.
|
inline |
Create proper interval between the two given points.
Definition at line 48 of file Range2D.hxx.
References basegfx::Range2D< TYPE, TRAITS >::expand().
|
inline |
Create proper interval between the two given pairs.
Definition at line 56 of file Range2D.hxx.
References basegfx::BasicRange< T, Traits >::expand(), basegfx::Range2D< TYPE, TRAITS >::maRangeX, and basegfx::Range2D< TYPE, TRAITS >::maRangeY.
|
inline |
clamp value on range
Definition at line 177 of file Range2D.hxx.
References basegfx::BasicRange< T, Traits >::clamp(), basegfx::Tuple2D< TYPE >::getX(), basegfx::Tuple2D< TYPE >::getY(), basegfx::Range2D< TYPE, TRAITS >::maRangeX, and basegfx::Range2D< TYPE, TRAITS >::maRangeY.
|
inline |
Definition at line 88 of file Range2D.hxx.
References basegfx::BasicRange< T, Traits >::equal(), basegfx::Range2D< TYPE, TRAITS >::maRangeX, and basegfx::Range2D< TYPE, TRAITS >::maRangeY.
Referenced by basegfx::utils::clipPolyPolygonOnPolyPolygon().
|
inline |
add rRange to the set, expanding as necessary
Definition at line 149 of file Range2D.hxx.
References basegfx::BasicRange< T, Traits >::expand(), basegfx::Range2D< TYPE, TRAITS >::maRangeX, and basegfx::Range2D< TYPE, TRAITS >::maRangeY.
|
inline |
add point to the set, expanding as necessary
Definition at line 142 of file Range2D.hxx.
References basegfx::BasicRange< T, Traits >::expand(), basegfx::Tuple2D< TYPE >::getX(), basegfx::Tuple2D< TYPE >::getY(), basegfx::Range2D< TYPE, TRAITS >::maRangeX, and basegfx::Range2D< TYPE, TRAITS >::maRangeY.
Referenced by basegfx::utils::addPointsAtCuts(), basegfx::B2DConnectedRanges< UserData >::addRange(), basegfx::ImplB2DPolyRange::appendElement(), basegfx::B2DPolyPolygon::getB2DRange(), basegfx::B2DCubicBezier::getRange(), basegfx::utils::getRange(), and basegfx::Range2D< TYPE, TRAITS >::Range2D().
|
inline |
return center X value of set. returns 0 for empty sets.
Definition at line 112 of file Range2D.hxx.
References basegfx::BasicRange< T, Traits >::getCenter(), and basegfx::Range2D< TYPE, TRAITS >::maRangeX.
Referenced by basegfx::utils::createRotateAroundCenterKeepAspectRatioStayInsideRange().
|
inline |
return center Y value of set. returns 0 for empty sets.
Definition at line 115 of file Range2D.hxx.
References basegfx::BasicRange< T, Traits >::getCenter(), and basegfx::Range2D< TYPE, TRAITS >::maRangeY.
Referenced by basegfx::utils::createRotateAroundCenterKeepAspectRatioStayInsideRange().
|
inline |
return difference between upper and lower Y value. returns 0 for empty sets.
Definition at line 109 of file Range2D.hxx.
References basegfx::BasicRange< T, Traits >::getRange(), basegfx::Range2D< TYPE, TRAITS >::maRangeY, and TYPE.
Referenced by basegfx::utils::clipPolygonOnParallelAxis(), basegfx::utils::createPolygonFromRect(), basegfx::utils::createRotateAroundCenterKeepAspectRatioStayInsideRange(), basegfx::utils::createSourceRangeTargetRangeTransform(), basegfx::createWaveLinePolygon(), basegfx::utils::distort(), basegfx::init1DGradientInfo(), basegfx::initEllipticalGradientInfo(), and basegfx::initRectGradientInfo().
|
inline |
get upper bound of the set. returns arbitrary values for empty sets.
Definition at line 100 of file Range2D.hxx.
References basegfx::BasicRange< T, Traits >::getMaximum(), basegfx::Range2D< TYPE, TRAITS >::maRangeX, and TYPE.
Referenced by basegfx::B2DRange::B2DRange(), basegfx::utils::clipPolygonOnParallelAxis(), basegfx::utils::clipPolygonOnRange(), basegfx::utils::clipTriangleListOnRange(), basegfx::utils::createPolygonFromRect(), and basegfx::B2DRange::transform().
|
inline |
get upper bound of the set. returns arbitrary values for empty sets.
Definition at line 103 of file Range2D.hxx.
References basegfx::BasicRange< T, Traits >::getMaximum(), basegfx::Range2D< TYPE, TRAITS >::maRangeY, and TYPE.
Referenced by basegfx::B2DRange::B2DRange(), basegfx::utils::clipPolygonOnParallelAxis(), basegfx::utils::clipPolygonOnRange(), basegfx::utils::clipTriangleListOnRange(), basegfx::utils::createPolygonFromRect(), and basegfx::B2DRange::transform().
|
inline |
get lower bound of the set. returns arbitrary values for empty sets.
Definition at line 94 of file Range2D.hxx.
References basegfx::BasicRange< T, Traits >::getMinimum(), basegfx::Range2D< TYPE, TRAITS >::maRangeX, and TYPE.
Referenced by basegfx::B2DRange::B2DRange(), basegfx::utils::clipPolygonOnParallelAxis(), basegfx::utils::clipPolygonOnRange(), basegfx::utils::clipTriangleListOnRange(), basegfx::utils::createPolygonFromRect(), basegfx::utils::createRotateAroundCenterKeepAspectRatioStayInsideRange(), basegfx::utils::createSourceRangeTargetRangeTransform(), basegfx::createWaveLinePolygon(), basegfx::utils::distort(), basegfx::init1DGradientInfo(), basegfx::initEllipticalGradientInfo(), basegfx::initRectGradientInfo(), and basegfx::B2DRange::transform().
|
inline |
get lower bound of the set. returns arbitrary values for empty sets.
Definition at line 97 of file Range2D.hxx.
References basegfx::BasicRange< T, Traits >::getMinimum(), basegfx::Range2D< TYPE, TRAITS >::maRangeY, and TYPE.
Referenced by basegfx::B2DRange::B2DRange(), basegfx::utils::clipPolygonOnParallelAxis(), basegfx::utils::clipPolygonOnRange(), basegfx::utils::clipTriangleListOnRange(), basegfx::utils::createPolygonFromRect(), basegfx::utils::createRotateAroundCenterKeepAspectRatioStayInsideRange(), basegfx::utils::createSourceRangeTargetRangeTransform(), basegfx::createWaveLinePolygon(), basegfx::utils::distort(), basegfx::init1DGradientInfo(), basegfx::initEllipticalGradientInfo(), basegfx::initRectGradientInfo(), and basegfx::B2DRange::transform().
|
inline |
return difference between upper and lower X value. returns 0 for empty sets.
Definition at line 106 of file Range2D.hxx.
References basegfx::BasicRange< T, Traits >::getRange(), basegfx::Range2D< TYPE, TRAITS >::maRangeX, and TYPE.
Referenced by basegfx::utils::clipPolygonOnParallelAxis(), basegfx::utils::createAreaGeometryForLineStartEnd(), basegfx::utils::createPolygonFromRect(), basegfx::utils::createRotateAroundCenterKeepAspectRatioStayInsideRange(), basegfx::utils::createSourceRangeTargetRangeTransform(), basegfx::createWaveLinePolygon(), basegfx::utils::distort(), basegfx::init1DGradientInfo(), basegfx::initEllipticalGradientInfo(), and basegfx::initRectGradientInfo().
|
inline |
grow set by axis aware values from rTuple
Definition at line 170 of file Range2D.hxx.
References basegfx::Tuple2D< TYPE >::getX(), basegfx::Tuple2D< TYPE >::getY(), basegfx::BasicRange< T, Traits >::grow(), basegfx::Range2D< TYPE, TRAITS >::maRangeX, and basegfx::Range2D< TYPE, TRAITS >::maRangeY.
|
inline |
grow set by fValue on all sides
Definition at line 163 of file Range2D.hxx.
References basegfx::BasicRange< T, Traits >::grow(), basegfx::Range2D< TYPE, TRAITS >::maRangeX, and basegfx::Range2D< TYPE, TRAITS >::maRangeY.
|
inline |
calc set intersection
Definition at line 156 of file Range2D.hxx.
References basegfx::BasicRange< T, Traits >::intersect(), basegfx::Range2D< TYPE, TRAITS >::maRangeX, and basegfx::Range2D< TYPE, TRAITS >::maRangeY.
Referenced by basegfx::utils::clipPolyPolygonOnPolyPolygon(), and basegfx::utils::solvePolygonOperationAnd().
|
inline |
Check if the interval set is empty.
Definition at line 69 of file Range2D.hxx.
References basegfx::BasicRange< T, Traits >::isEmpty(), basegfx::Range2D< TYPE, TRAITS >::maRangeX, and basegfx::Range2D< TYPE, TRAITS >::maRangeY.
Referenced by basegfx::B2DConnectedRanges< UserData >::addRange(), basegfx::utils::ImplB2DClipState::addRange(), basegfx::B2DRange::B2DRange(), basegfx::utils::clipPolygonOnRange(), basegfx::utils::clipPolyPolygonOnPolyPolygon(), basegfx::utils::clipPolyPolygonOnRange(), basegfx::fround(), and basegfx::utils::solvePolygonOperationAnd().
|
inline |
yields true if rRange is inside, or equal to set
Definition at line 124 of file Range2D.hxx.
References basegfx::BasicRange< T, Traits >::isInside(), basegfx::Range2D< TYPE, TRAITS >::maRangeX, and basegfx::Range2D< TYPE, TRAITS >::maRangeY.
|
inline |
yields true if given point is contained in set
Definition at line 118 of file Range2D.hxx.
References basegfx::Tuple2D< TYPE >::getX(), basegfx::Tuple2D< TYPE >::getY(), basegfx::BasicRange< T, Traits >::isInside(), basegfx::Range2D< TYPE, TRAITS >::maRangeX, and basegfx::Range2D< TYPE, TRAITS >::maRangeY.
Referenced by basegfx::utils::clipPolygonOnRange(), basegfx::utils::clipTriangleListOnRange(), and basegfx::utils::solvePolygonOperationAnd().
|
inline |
Definition at line 83 of file Range2D.hxx.
References basegfx::Range2D< TYPE, TRAITS >::maRangeX, and basegfx::Range2D< TYPE, TRAITS >::maRangeY.
|
inline |
Definition at line 78 of file Range2D.hxx.
References basegfx::Range2D< TYPE, TRAITS >::maRangeX, and basegfx::Range2D< TYPE, TRAITS >::maRangeY.
|
inline |
yields true if rRange at least partly inside set
Definition at line 130 of file Range2D.hxx.
References basegfx::Range2D< TYPE, TRAITS >::maRangeX, basegfx::Range2D< TYPE, TRAITS >::maRangeY, and basegfx::BasicRange< T, Traits >::overlaps().
Referenced by basegfx::utils::addPointsAtCuts(), basegfx::B2DConnectedRanges< UserData >::addRange(), basegfx::utils::mergeToSinglePolyPolygon(), and basegfx::ImplB2DPolyRange::overlaps().
|
inline |
yields true if overlaps(rRange) does, and the overlap is larger than infinitesimal
Definition at line 136 of file Range2D.hxx.
References basegfx::Range2D< TYPE, TRAITS >::maRangeX, basegfx::Range2D< TYPE, TRAITS >::maRangeY, and basegfx::BasicRange< T, Traits >::overlapsMore().
|
inline |
reset the object to empty state again, clearing all values
Definition at line 72 of file Range2D.hxx.
References basegfx::Range2D< TYPE, TRAITS >::maRangeX, basegfx::Range2D< TYPE, TRAITS >::maRangeY, and basegfx::BasicRange< T, Traits >::reset().
Referenced by basegfx::ImplB2DPolyRange::clear().
|
protected |
Definition at line 31 of file Range2D.hxx.
Referenced by basegfx::Range2D< TYPE, TRAITS >::clamp(), basegfx::Range2D< TYPE, TRAITS >::equal(), basegfx::Range2D< TYPE, TRAITS >::expand(), basegfx::Range2D< TYPE, TRAITS >::getCenterX(), basegfx::Range2D< TYPE, TRAITS >::getMaxX(), basegfx::Range2D< TYPE, TRAITS >::getMinX(), basegfx::Range2D< TYPE, TRAITS >::getWidth(), basegfx::Range2D< TYPE, TRAITS >::grow(), basegfx::Range2D< TYPE, TRAITS >::intersect(), basegfx::Range2D< TYPE, TRAITS >::isEmpty(), basegfx::Range2D< TYPE, TRAITS >::isInside(), basegfx::Range2D< TYPE, TRAITS >::operator!=(), basegfx::Range2D< TYPE, TRAITS >::operator==(), basegfx::Range2D< TYPE, TRAITS >::overlaps(), basegfx::Range2D< TYPE, TRAITS >::overlapsMore(), basegfx::Range2D< TYPE, TRAITS >::Range2D(), and basegfx::Range2D< TYPE, TRAITS >::reset().
|
protected |
Definition at line 32 of file Range2D.hxx.
Referenced by basegfx::Range2D< TYPE, TRAITS >::clamp(), basegfx::Range2D< TYPE, TRAITS >::equal(), basegfx::Range2D< TYPE, TRAITS >::expand(), basegfx::Range2D< TYPE, TRAITS >::getCenterY(), basegfx::Range2D< TYPE, TRAITS >::getHeight(), basegfx::Range2D< TYPE, TRAITS >::getMaxY(), basegfx::Range2D< TYPE, TRAITS >::getMinY(), basegfx::Range2D< TYPE, TRAITS >::grow(), basegfx::Range2D< TYPE, TRAITS >::intersect(), basegfx::Range2D< TYPE, TRAITS >::isEmpty(), basegfx::Range2D< TYPE, TRAITS >::isInside(), basegfx::Range2D< TYPE, TRAITS >::operator!=(), basegfx::Range2D< TYPE, TRAITS >::operator==(), basegfx::Range2D< TYPE, TRAITS >::overlaps(), basegfx::Range2D< TYPE, TRAITS >::overlapsMore(), basegfx::Range2D< TYPE, TRAITS >::Range2D(), and basegfx::Range2D< TYPE, TRAITS >::reset().