Skip to content

Commit ca65717

Browse files
committed
Address Peter's points from review
1 parent 767a7b0 commit ca65717

File tree

5 files changed

+16
-8
lines changed

5 files changed

+16
-8
lines changed

python/core/auto_generated/mesh/qgsmeshrenderersettings.sip.in

-1
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,6 @@ Reads configuration from the given DOM element
274274
};
275275

276276

277-
278277
class QgsMeshRendererSettings
279278
{
280279
%Docstring

src/app/mesh/qgsrenderermeshpropertieswidget.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ void QgsRendererMeshPropertiesWidget::onActiveDatasetGroupChanged()
125125
mMeshRendererVectorSettingsWidget->syncToLayer();
126126

127127
mContoursGroupBox->setChecked( scalarGroup >= 0 );
128+
mContoursGroupBox->setEnabled( scalarGroup >= 0 );
128129
mVectorsGroupBox->setChecked( vectorGroup >= 0 );
129130
mVectorsGroupBox->setEnabled( vectorGroup >= 0 );
130131
}

src/core/mesh/qgsmeshlayerutils.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void QgsMeshLayerUtils::calculateMinimumMaximum( double &min, double &max, const
5151

5252
void QgsMeshLayerUtils::calculateMinMaxForDatasetGroup( double &min, double &max, QgsMeshDataProvider *provider, int groupIndex )
5353
{
54-
if ( groupIndex < 0 || groupIndex >= provider->datasetGroupCount() )
54+
if ( groupIndex < 0 || !provider || groupIndex >= provider->datasetGroupCount() )
5555
{
5656
min = std::numeric_limits<double>::quiet_NaN();
5757
max = std::numeric_limits<double>::quiet_NaN();
@@ -73,7 +73,7 @@ void QgsMeshLayerUtils::calculateMinMaxForDatasetGroup( double &min, double &max
7373

7474
void QgsMeshLayerUtils::calculateMinMaxForDataset( double &min, double &max, QgsMeshDataProvider *provider, QgsMeshDatasetIndex index )
7575
{
76-
if ( !index.isValid() )
76+
if ( !index.isValid() || !provider )
7777
{
7878
min = std::numeric_limits<double>::quiet_NaN();
7979
max = std::numeric_limits<double>::quiet_NaN();

src/core/mesh/qgsmeshlayerutils.h

+12-3
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,22 @@ class CORE_EXPORT QgsMeshLayerUtils
4040
{
4141
public:
4242

43-
//! Calculates min/max values from the given vector of values
43+
/**
44+
* Calculates min/max values from the given vector of values.
45+
* Ignores any NaN values in the input. Returns NaN for min/max on error.
46+
*/
4447
static void calculateMinimumMaximum( double &min, double &max, const QVector<double> &arr );
4548

46-
//! Calculates min/max values for the whole dataset group (considering all datasets within it)
49+
/**
50+
* Calculates min/max values for the whole dataset group (considering all datasets within it).
51+
* Ignores any NaN values in the input. Returns NaN for min/max on error.
52+
*/
4753
static void calculateMinMaxForDatasetGroup( double &min, double &max, QgsMeshDataProvider *provider, int groupIndex );
4854

49-
//! Calculates min/max values for one dataset
55+
/**
56+
* Calculates min/max values for one dataset.
57+
* Ignores any NaN values in the input. Returns NaN for min/max on error.
58+
*/
5059
static void calculateMinMaxForDataset( double &min, double &max, QgsMeshDataProvider *provider, QgsMeshDatasetIndex index );
5160
};
5261

src/core/mesh/qgsmeshrenderersettings.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "qgis_core.h"
2525
#include "qgis.h"
2626
#include "qgscolorrampshader.h"
27+
#include "qgsmeshdataprovider.h"
2728

2829

2930
/**
@@ -252,8 +253,6 @@ class CORE_EXPORT QgsMeshRendererVectorSettings
252253
};
253254

254255

255-
#include "qgsmeshdataprovider.h"
256-
257256
/**
258257
* \ingroup core
259258
*

0 commit comments

Comments
 (0)