LibreOffice Module basegfx (master) 1
|
A one-dimensional interval over doubles. More...
#include <b1drange.hxx>
Public Member Functions | |
B1DRange () | |
B1DRange (double fStartValue) | |
Create degenerate interval consisting of a single double number. More... | |
B1DRange (double fStartValue1, double fStartValue2) | |
Create proper interval between the two given double values. More... | |
bool | isEmpty () const |
Check if the interval set is empty. More... | |
bool | operator== (const B1DRange &rRange) const |
bool | operator!= (const B1DRange &rRange) const |
double | getMinimum () const |
get lower bound of the set. returns arbitrary values for empty sets. More... | |
double | getMaximum () const |
get upper bound of the set. returns arbitrary values for empty sets. More... | |
double | getRange () const |
return difference between upper and lower value. returns 0 for empty sets. More... | |
double | getCenter () const |
return middle of upper and lower value. returns 0 for empty sets. More... | |
bool | isInside (double fValue) const |
yields true if value is contained in set More... | |
bool | overlaps (const B1DRange &rRange) const |
yields true if rRange at least partly inside set More... | |
bool | overlapsMore (const B1DRange &rRange) const |
yields true if overlaps(rRange) does, and the overlap is larger than infinitesimal More... | |
void | expand (double fValue) |
add fValue to the set, expanding as necessary More... | |
void | expand (const B1DRange &rRange) |
add rRange to the set, expanding as necessary More... | |
void | intersect (const B1DRange &rRange) |
calc set intersection More... | |
double | clamp (double fValue) const |
clamp value on range More... | |
Private Attributes | |
::basegfx::BasicRange< double, DoubleTraits > | maRange |
A one-dimensional interval over doubles.
This is a set of real numbers, bounded by a lower and an upper value. 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 42 of file b1drange.hxx.
|
inline |
Definition at line 47 of file b1drange.hxx.
|
inlineexplicit |
Create degenerate interval consisting of a single double number.
Definition at line 50 of file b1drange.hxx.
|
inline |
Create proper interval between the two given double values.
Definition at line 56 of file b1drange.hxx.
References expand().
|
inline |
clamp value on range
Definition at line 143 of file b1drange.hxx.
References basegfx::BasicRange< T, Traits >::clamp(), and maRange.
|
inline |
add rRange to the set, expanding as necessary
Definition at line 131 of file b1drange.hxx.
References basegfx::BasicRange< T, Traits >::expand(), and maRange.
|
inline |
add fValue to the set, expanding as necessary
Definition at line 125 of file b1drange.hxx.
References basegfx::BasicRange< T, Traits >::expand(), and maRange.
Referenced by B1DRange().
|
inline |
return middle of upper and lower value. returns 0 for empty sets.
Definition at line 101 of file b1drange.hxx.
References basegfx::BasicRange< T, Traits >::getCenter(), and maRange.
|
inline |
get upper bound of the set. returns arbitrary values for empty sets.
Definition at line 89 of file b1drange.hxx.
References basegfx::BasicRange< T, Traits >::getMaximum(), and maRange.
|
inline |
get lower bound of the set. returns arbitrary values for empty sets.
Definition at line 83 of file b1drange.hxx.
References basegfx::BasicRange< T, Traits >::getMinimum(), and maRange.
|
inline |
return difference between upper and lower value. returns 0 for empty sets.
Definition at line 95 of file b1drange.hxx.
References basegfx::BasicRange< T, Traits >::getRange(), and maRange.
|
inline |
calc set intersection
Definition at line 137 of file b1drange.hxx.
References basegfx::BasicRange< T, Traits >::intersect(), and maRange.
|
inline |
Check if the interval set is empty.
Definition at line 67 of file b1drange.hxx.
References basegfx::BasicRange< T, Traits >::isEmpty(), and maRange.
|
inline |
yields true if value is contained in set
Definition at line 107 of file b1drange.hxx.
References basegfx::BasicRange< T, Traits >::isInside(), and maRange.
|
inline |
Definition at line 77 of file b1drange.hxx.
References maRange.
|
inline |
Definition at line 72 of file b1drange.hxx.
References maRange.
|
inline |
yields true if rRange at least partly inside set
Definition at line 113 of file b1drange.hxx.
References maRange, and basegfx::BasicRange< T, Traits >::overlaps().
|
inline |
yields true if overlaps(rRange) does, and the overlap is larger than infinitesimal
Definition at line 119 of file b1drange.hxx.
References maRange, and basegfx::BasicRange< T, Traits >::overlapsMore().
|
private |
Definition at line 44 of file b1drange.hxx.
Referenced by clamp(), expand(), getCenter(), getMaximum(), getMinimum(), getRange(), intersect(), isEmpty(), isInside(), operator!=(), operator==(), overlaps(), and overlapsMore().