Represents an interval.
More...
#include <Interval.h>
|
| | Interval () |
| | default constructor (empty interval)
|
| | Interval (const double &value) |
| | collapsed interval constructor
|
| | Interval (const double &value1, const double &value2) |
| | constructor with two values
|
| | Interval (const Interval &other) |
| | copy constructor
|
| auto | operator= (const Interval &other) -> Interval & |
| | assign operator
|
| bool | isEmpty () const |
| | indicates if the interval is empty
|
| const double & | lower () const |
| | return the lower value
|
| const double & | upper () const |
| | return the upper value
|
| double | width () const |
| | return the width of the interval
|
| void | expandBy (const double &expandAmount) |
| | expand the interval
|
| void | expandToInclude (const Interval &other) |
| | expand the interval to include an other interval.
|
| void | expandToInclude (const double &value) |
| | expand the interval to include a value
|
| bool | intersects (const Interval &other) const |
| | test if this intersects other
|
| bool | operator== (const Interval &other) const |
| | compare two intervals
|
| bool | operator!= (const Interval &other) const |
| | compare two intervals
|
◆ Interval() [1/4]
| SFCGAL::detail::Interval::Interval |
( |
| ) |
|
default constructor (empty interval)
◆ Interval() [2/4]
| SFCGAL::detail::Interval::Interval |
( |
const double & | value | ) |
|
collapsed interval constructor
- Parameters
-
| value | The single value for collapsed interval |
◆ Interval() [3/4]
| SFCGAL::detail::Interval::Interval |
( |
const double & | value1, |
|
|
const double & | value2 ) |
constructor with two values
- Parameters
-
| value1 | First boundary value |
| value2 | Second boundary value |
◆ Interval() [4/4]
| SFCGAL::detail::Interval::Interval |
( |
const Interval & | other | ) |
|
|
default |
copy constructor
- Parameters
-
| other | The interval to copy from |
◆ expandBy()
| void SFCGAL::detail::Interval::expandBy |
( |
const double & | expandAmount | ) |
|
expand the interval
- Warning
- no effect if isEmpty()
- Parameters
-
| expandAmount | The amount to expand by |
◆ expandToInclude() [1/2]
| void SFCGAL::detail::Interval::expandToInclude |
( |
const double & | value | ) |
|
expand the interval to include a value
- Warning
- no effect if value is NaN
- Parameters
-
| value | The value to include |
◆ expandToInclude() [2/2]
| void SFCGAL::detail::Interval::expandToInclude |
( |
const Interval & | other | ) |
|
expand the interval to include an other interval.
- Warning
- no effect if other.isEmpty()
- Parameters
-
| other | The interval to include |
◆ intersects()
| auto SFCGAL::detail::Interval::intersects |
( |
const Interval & | other | ) |
const |
test if this intersects other
- Parameters
-
| other | The interval to test intersection with |
- Returns
- True if intervals intersect
◆ isEmpty()
| auto SFCGAL::detail::Interval::isEmpty |
( |
| ) |
const |
indicates if the interval is empty
- Returns
- True if the interval is empty
◆ lower()
| const double & SFCGAL::detail::Interval::lower |
( |
| ) |
const |
|
inline |
return the lower value
- Returns
- The lower boundary of the interval
◆ operator!=()
| auto SFCGAL::detail::Interval::operator!= |
( |
const Interval & | other | ) |
const |
compare two intervals
- Warning
- false for empty intervals
- Parameters
-
| other | The interval to compare with |
- Returns
- True if intervals are not equal
◆ operator=()
| auto SFCGAL::detail::Interval::operator= |
( |
const Interval & | other | ) |
-> Interval & |
|
default |
assign operator
- Parameters
-
| other | The interval to assign from |
- Returns
- Reference to this interval
◆ operator==()
| auto SFCGAL::detail::Interval::operator== |
( |
const Interval & | other | ) |
const |
compare two intervals
- Warning
- true for empty intervals
- Parameters
-
| other | The interval to compare with |
- Returns
- True if intervals are equal
◆ upper()
| const double & SFCGAL::detail::Interval::upper |
( |
| ) |
const |
|
inline |
return the upper value
- Returns
- The upper boundary of the interval
◆ width()
| double SFCGAL::detail::Interval::width |
( |
| ) |
const |
|
inline |
return the width of the interval
- Returns
- The width (upper - lower) of the interval