22 #include "qgis_core.h" 181 return ( !
operator==( other ) );
217 double upper = std::numeric_limits< double >::max(),
239 :
QgsRange( std::numeric_limits< double >::lowest(), std::numeric_limits< double >::max(),
true,
true )
249 return lower() == std::numeric_limits< double >::lowest() &&
upper() == std::numeric_limits< double >::max();
253 SIP_PYOBJECT __repr__();
255 QString str = QStringLiteral(
"<QgsDoubleRange: %1%2, %3%4>" ).arg( sipCpp->includeLower() ? QStringLiteral(
"[" ) : QStringLiteral(
"(" ) )
256 .arg( sipCpp->lower() )
257 .arg( sipCpp->upper() )
258 .arg( sipCpp->includeUpper() ? QStringLiteral(
"]" ) : QStringLiteral(
")" ) );
259 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
273 return ( !
operator==( other ) );
302 int upper = std::numeric_limits< int >::max(),
324 :
QgsRange( std::numeric_limits< int >::lowest(), std::numeric_limits< int >::max(),
true,
true )
334 return lower() == std::numeric_limits< int >::lowest() &&
upper() == std::numeric_limits< int >::max();
338 SIP_PYOBJECT __repr__();
340 QString str = QStringLiteral(
"<QgsIntRange: %1%2, %3%4>" ).arg( sipCpp->includeLower() ? QStringLiteral(
"[" ) : QStringLiteral(
"(" ) )
341 .arg( sipCpp->lower() )
342 .arg( sipCpp->upper() )
343 .arg( sipCpp->includeUpper() ? QStringLiteral(
"]" ) : QStringLiteral(
")" ) );
344 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
367 template <
typename T>
378 QgsTemporalRange(
const T &begin = T(),
const T &end = T(),
bool includeBeginning =
true,
bool includeEnd =
true )
385 QgsTemporalRange(
const T &begin,
const T &end,
bool includeBeginning =
true,
bool includeEnd =
true );
462 if ( !other.mLower.isValid() &&
mLower.isValid() )
469 || ( !
mIncludeLower && !other.mIncludeLower && mLower <= other.mLower );
474 if ( !other.mUpper.isValid() &&
mUpper.isValid() )
481 || ( !
mIncludeUpper && !other.mIncludeUpper && mUpper >= other.mUpper );
494 if ( !element.isValid() )
540 if ( mLower == other.mLower && mUpper == other.mUpper )
570 bool changed {
false };
573 if ( ! other.
begin().isValid()
574 || ( begin().isValid() && other.
begin() <
mLower ) )
587 if ( ! other.
end().isValid()
588 || ( end().isValid() && other.
end() >
mUpper ) )
604 return mLower == other.mLower &&
612 return ( !
operator==( other ) );
bool contains(const QgsTemporalRange< T > &other) const
Returns true if this range contains another range.
bool includeEnd() const
Returns true if the end is inclusive, or false if the end is exclusive.
bool isInfinite() const
Returns true if the range consists of all possible values.
bool operator!=(const QgsDoubleRange &other) const
A template based class for storing temporal ranges (beginning to end values).
bool isInfinite() const
Returns true if the range consists of all possible values.
bool operator==(const QgsDoubleRange &other) const
bool overlaps(const QgsRange< T > &other) const
Returns true if this range overlaps another range.
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)
bool extend(const QgsTemporalRange< T > &other)
Extends the range in place by extending this range out to include an other range. ...
T lower() const
Returns the lower bound of the range.
QgsTemporalRange(const T &begin=T(), const T &end=T(), bool includeBeginning=true, bool includeEnd=true)
Constructor for QgsTemporalRange.
bool operator!=(const QgsRange< T > &other) const
bool isEmpty() const
Returns true if the range is empty, ie the lower bound equals (or exceeds) the upper bound and either...
QgsRange which stores a range of double values.
bool contains(const T &element) const
Returns true if this range contains a specified element.
T begin() const
Returns the beginning of the range.
bool isEmpty() const
Returns true if the range is empty, ie the beginning equals (or exceeds) the end and either of the bo...
bool isSingleton() const
Returns true if the range consists only of a single value or instant.
bool contains(const QgsRange< T > &other) const
Returns true if this range contains another range.
bool isInstant() const
Returns true if the range consists only of a single instant.
QgsRange which stores a range of integer values.
bool operator==(const QgsTemporalRange< T > &other) const
bool overlaps(const QgsTemporalRange< T > &other) const
Returns true if this range overlaps another range.
bool includeUpper() const
Returns true if the upper bound is inclusive, or false if the upper bound is exclusive.
bool includeBeginning() const
Returns true if the beginning is inclusive, or false if the beginning is exclusive.
bool includeLower() const
Returns true if the lower bound is inclusive, or false if the lower bound is exclusive.
QgsTemporalRange< QDate > QgsDateRange SIP_DOC_TEMPLATE
QgsRange which stores a range of dates.
T upper() const
Returns the upper bound of the range.
bool isInfinite() const
Returns true if the range consists of all possible values.
QgsRange(T lower, T upper, bool includeLower=true, bool includeUpper=true)
Constructor for QgsRange.
QgsDoubleRange(double lower=std::numeric_limits< double >::lowest(), double upper=std::numeric_limits< double >::max(), bool includeLower=true, bool includeUpper=true)
Constructor for QgsDoubleRange.
A template based class for storing ranges (lower to upper values).
bool contains(T element) const
Returns true if this range contains a specified element.
T end() const
Returns the upper bound of the range.
QgsIntRange(int lower=std::numeric_limits< int >::lowest(), int upper=std::numeric_limits< int >::max(), bool includeLower=true, bool includeUpper=true)
Constructor for QgsIntRange.
bool operator!=(const QgsTemporalRange< T > &other) const
bool operator==(const QgsRange< T > &other) const