Skip to content
Permalink
Browse files

Address Peter's points from review

  • Loading branch information
wonder-sk committed Aug 15, 2018
1 parent 767a7b0 commit ca657179f91fa229b25e666c246d78cd9dfea044
@@ -274,7 +274,6 @@ Reads configuration from the given DOM element
};



class QgsMeshRendererSettings
{
%Docstring
@@ -125,6 +125,7 @@ void QgsRendererMeshPropertiesWidget::onActiveDatasetGroupChanged()
mMeshRendererVectorSettingsWidget->syncToLayer();

mContoursGroupBox->setChecked( scalarGroup >= 0 );
mContoursGroupBox->setEnabled( scalarGroup >= 0 );
mVectorsGroupBox->setChecked( vectorGroup >= 0 );
mVectorsGroupBox->setEnabled( vectorGroup >= 0 );
}
@@ -51,7 +51,7 @@ void QgsMeshLayerUtils::calculateMinimumMaximum( double &min, double &max, const

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

void QgsMeshLayerUtils::calculateMinMaxForDataset( double &min, double &max, QgsMeshDataProvider *provider, QgsMeshDatasetIndex index )
{
if ( !index.isValid() )
if ( !index.isValid() || !provider )
{
min = std::numeric_limits<double>::quiet_NaN();
max = std::numeric_limits<double>::quiet_NaN();
@@ -40,13 +40,22 @@ class CORE_EXPORT QgsMeshLayerUtils
{
public:

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

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

//! Calculates min/max values for one dataset
/**
* Calculates min/max values for one dataset.
* Ignores any NaN values in the input. Returns NaN for min/max on error.
*/
static void calculateMinMaxForDataset( double &min, double &max, QgsMeshDataProvider *provider, QgsMeshDatasetIndex index );
};

@@ -24,6 +24,7 @@
#include "qgis_core.h"
#include "qgis.h"
#include "qgscolorrampshader.h"
#include "qgsmeshdataprovider.h"


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


#include "qgsmeshdataprovider.h"

/**
* \ingroup core
*

0 comments on commit ca65717

Please sign in to comment.
You can’t perform that action at this time.