Skip to content

Commit 0ab6327

Browse files
committed
Documentation for QgsRasterRange
1 parent ef81f3c commit 0ab6327

File tree

3 files changed

+49
-21
lines changed

3 files changed

+49
-21
lines changed

python/core/auto_generated/raster/qgsrasterrange.sip.in

+24-5
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,41 @@ including min and max value.
2626

2727
QgsRasterRange();
2828
%Docstring
29-
Constructor.
29+
Default constructor, both min and max value for the range will be set to NaN.
3030
%End
3131

3232
QgsRasterRange( double min, double max );
3333
%Docstring
34-
Constructor
35-
36-
:param min: minimum value
37-
:param max: max value
34+
Constructor for a range with the given ``min`` and ``max`` values.
3835
%End
3936

4037
double min() const;
38+
%Docstring
39+
Returns the minimum value for the range.
40+
41+
.. seealso:: :py:func:`setMin`
42+
%End
43+
4144
double max() const;
45+
%Docstring
46+
Returns the maximum value for the range.
47+
48+
.. seealso:: :py:func:`setMax`
49+
%End
4250

4351
double setMin( double min );
52+
%Docstring
53+
Sets the minimum value for the range.
54+
55+
.. seealso:: :py:func:`min`
56+
%End
57+
4458
double setMax( double max );
59+
%Docstring
60+
Sets the maximum value for the range.
61+
62+
.. seealso:: :py:func:`max`
63+
%End
4564

4665
bool operator==( QgsRasterRange o ) const;
4766

src/core/raster/qgsrasterrange.cpp

-8
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,8 @@
1515
* *
1616
***************************************************************************/
1717

18-
#include <limits>
19-
#include "qgis.h"
2018
#include "qgsrasterrange.h"
2119

22-
QgsRasterRange::QgsRasterRange()
23-
: mMin( std::numeric_limits<double>::quiet_NaN() )
24-
, mMax( std::numeric_limits<double>::quiet_NaN() )
25-
{
26-
}
27-
2820
QgsRasterRange::QgsRasterRange( double min, double max )
2921
: mMin( min )
3022
, mMax( max )

src/core/raster/qgsrasterrange.h

+25-8
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
#include "qgis_core.h"
2222
#include "qgis_sip.h"
23+
#include "qgis.h"
2324
#include <QList>
2425

2526
class QgsRasterRange;
@@ -36,21 +37,37 @@ class CORE_EXPORT QgsRasterRange
3637
public:
3738

3839
/**
39-
* \brief Constructor.
40+
* Default constructor, both min and max value for the range will be set to NaN.
4041
*/
41-
QgsRasterRange();
42+
QgsRasterRange() = default;
4243

4344
/**
44-
* \brief Constructor
45-
* \param min minimum value
46-
* \param max max value
45+
* Constructor for a range with the given \a min and \a max values.
4746
*/
4847
QgsRasterRange( double min, double max );
4948

49+
/**
50+
* Returns the minimum value for the range.
51+
* \see setMin()
52+
*/
5053
double min() const { return mMin; }
54+
55+
/**
56+
* Returns the maximum value for the range.
57+
* \see setMax()
58+
*/
5159
double max() const { return mMax; }
5260

61+
/**
62+
* Sets the minimum value for the range.
63+
* \see min()
64+
*/
5365
double setMin( double min ) { return mMin = min; }
66+
67+
/**
68+
* Sets the maximum value for the range.
69+
* \see max()
70+
*/
5471
double setMax( double max ) { return mMax = max; }
5572

5673
inline bool operator==( QgsRasterRange o ) const
@@ -59,7 +76,7 @@ class CORE_EXPORT QgsRasterRange
5976
}
6077

6178
/**
62-
* \brief Test if value is within the list of ranges
79+
* \brief Tests if a \a value is within the list of ranges
6380
* \param value value
6481
* \param rangeList list of ranges
6582
* \returns true if value is in at least one of ranges
@@ -68,8 +85,8 @@ class CORE_EXPORT QgsRasterRange
6885
static bool contains( double value, const QgsRasterRangeList &rangeList ) SIP_SKIP;
6986

7087
private:
71-
double mMin;
72-
double mMax;
88+
double mMin = std::numeric_limits<double>::quiet_NaN();
89+
double mMax = std::numeric_limits<double>::quiet_NaN();
7390
};
7491

7592
#endif

0 commit comments

Comments
 (0)