QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
18 #ifndef QGSRASTERRANGE_H
19 #define QGSRASTERRANGE_H
21 #include "qgis_core.h"
59 QgsRasterRange(
double min,
double max, BoundsType bounds = IncludeMinAndMax );
65 double min()
const {
return mMin; }
71 double max()
const {
return mMax; }
86 double setMin(
double min ) {
return mMin = min; }
92 double setMax(
double max ) {
return mMax = max; }
105 return ( ( std::isnan( mMin ) && std::isnan( o.mMin ) ) ||
qgsDoubleNear( mMin, o.mMin ) )
106 && ( ( std::isnan( mMax ) && std::isnan( o.mMax ) ) ||
qgsDoubleNear( mMax, o.mMax ) )
116 return ( value > mMin
117 || ( !std::isnan( mMin ) &&
qgsDoubleNear( value, mMin ) && ( mType == IncludeMinAndMax || mType == IncludeMin ) )
118 || std::isnan( mMin ) )
121 || ( !std::isnan( mMax ) &&
qgsDoubleNear( value, mMax ) && ( mType == IncludeMinAndMax || mType == IncludeMax ) )
122 || std::isnan( mMax ) );
135 if ( range.contains( value ) )
153 QString asText()
const;
156 double mMin = std::numeric_limits<double>::quiet_NaN();
157 double mMax = std::numeric_limits<double>::quiet_NaN();
158 BoundsType mType = IncludeMinAndMax;
void setBounds(BoundsType type)
Sets the bounds type for the range, which specifies whether or not the min and max values themselves ...
@ IncludeMax
Include the max value, but not the min value, e.g. min < value <= max.
bool operator==(const QgsRasterRange &o) const
BoundsType bounds() const
Returns the bounds type for the range, which specifies whether or not the min and max values themselv...
@ IncludeMin
Include the min value, but not the max value, e.g. min <= value < max.
double setMin(double min)
Sets the minimum value for the range.
double min() const
Returns the minimum value for the range.
static bool contains(double value, const QgsRasterRangeList &rangeList)
Tests if a value is within the list of ranges.
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)
QList< QgsRasterRange > QgsRasterRangeList
bool contains(double value) const
Returns true if this range contains the specified value.
BoundsType
Handling for min and max bounds.
Raster values range container. Represents range of values between min and max including min and max v...
@ Exclusive
Don't include either the min or max value, e.g. min < value < max.
double max() const
Returns the maximum value for the range.
double setMax(double max)
Sets the maximum value for the range.