Skip to content
Permalink
Browse files

min/max to minimum/maximum renaming

  • Loading branch information
wonder-sk committed Aug 17, 2018
1 parent d91e12d commit 6d1e420c71615307bb2d5e84c187b32a1a363cda
@@ -92,15 +92,15 @@ Returns color ramp shader function
Sets color ramp shader function
%End

double classificationMin() const;
double classificationMinimum() const;
%Docstring
Returns min value used for creation of the color ramp shader
%End
double classificationMax() const;
double classificationMaximum() const;
%Docstring
Returns max value used for creation of the color ramp shader
%End
void setClassificationMinMax( double vMin, double vMax );
void setClassificationMinimumMaximum( double minimum, double maximum );
%Docstring
Sets min/max values used for creation of the color ramp shader
%End
@@ -45,7 +45,7 @@ QgsMeshRendererScalarSettings QgsMeshRendererScalarSettingsWidget::settings() co
{
QgsMeshRendererScalarSettings settings;
settings.setColorRampShader( mScalarColorRampShaderWidget->shader() );
settings.setClassificationMinMax( lineEditValue( mScalarMinLineEdit ), lineEditValue( mScalarMaxLineEdit ) );
settings.setClassificationMinimumMaximum( lineEditValue( mScalarMinLineEdit ), lineEditValue( mScalarMaxLineEdit ) );
return settings;
}

@@ -60,8 +60,8 @@ void QgsMeshRendererScalarSettingsWidget::syncToLayer( )
const QgsMeshRendererSettings rendererSettings = mMeshLayer->rendererSettings();
const QgsMeshRendererScalarSettings settings = rendererSettings.scalarSettings( mActiveDatasetGroup );
const QgsColorRampShader shader = settings.colorRampShader();
whileBlocking( mScalarMinLineEdit )->setText( QString::number( settings.classificationMin() ) );
whileBlocking( mScalarMaxLineEdit )->setText( QString::number( settings.classificationMax() ) );
whileBlocking( mScalarMinLineEdit )->setText( QString::number( settings.classificationMinimum() ) );
whileBlocking( mScalarMaxLineEdit )->setText( QString::number( settings.classificationMaximum() ) );
whileBlocking( mScalarColorRampShaderWidget )->setFromShader( shader );
}

@@ -216,7 +216,7 @@ void QgsMeshLayer::assignDefaultStyleToDatasetGroup( int groupIndex )
fcn.classifyColorRamp( 5, -1, QgsRectangle(), nullptr );

QgsMeshRendererScalarSettings scalarSettings;
scalarSettings.setClassificationMinMax( groupMin, groupMax );
scalarSettings.setClassificationMinimumMaximum( groupMin, groupMax );
scalarSettings.setColorRampShader( fcn );
mRendererSettings.setScalarSettings( groupIndex, scalarSettings );
}
@@ -211,8 +211,8 @@ void QgsMeshLayerRenderer::renderScalarDataset()
sh->setRasterShaderFunction( fcn ); // takes ownership of fcn
QgsMeshLayerInterpolator interpolator( mTriangularMesh, mScalarDatasetValues, mScalarDataOnVertices, mContext, mOutputSize );
QgsSingleBandPseudoColorRenderer renderer( &interpolator, 0, sh ); // takes ownership of sh
renderer.setClassificationMin( scalarSettings.classificationMin() );
renderer.setClassificationMax( scalarSettings.classificationMax() );
renderer.setClassificationMin( scalarSettings.classificationMinimum() );
renderer.setClassificationMax( scalarSettings.classificationMaximum() );

std::unique_ptr<QgsRasterBlock> bl( renderer.block( 0, mContext.extent(), mOutputSize.width(), mOutputSize.height(), mFeedback.get() ) );
QImage img = bl->image();
@@ -78,26 +78,26 @@ void QgsMeshRendererScalarSettings::setColorRampShader( const QgsColorRampShader
mColorRampShader = shader;
}

void QgsMeshRendererScalarSettings::setClassificationMinMax( double vMin, double vMax )
void QgsMeshRendererScalarSettings::setClassificationMinimumMaximum( double minimum, double maximum )
{
mClassificationMin = vMin;
mClassificationMax = vMax;
mClassificationMinimum = minimum;
mClassificationMaximum = maximum;
}

QDomElement QgsMeshRendererScalarSettings::writeXml( QDomDocument &doc ) const
{
QDomElement elem = doc.createElement( "scalar-settings" );
elem.setAttribute( "min-val", mClassificationMin );
elem.setAttribute( "max-val", mClassificationMax );
elem.setAttribute( "min-val", mClassificationMinimum );
elem.setAttribute( "max-val", mClassificationMaximum );
QDomElement elemShader = mColorRampShader.writeXml( doc );
elem.appendChild( elemShader );
return elem;
}

void QgsMeshRendererScalarSettings::readXml( const QDomElement &elem )
{
mClassificationMin = elem.attribute( "min-val" ).toDouble();
mClassificationMax = elem.attribute( "max-val" ).toDouble();
mClassificationMinimum = elem.attribute( "min-val" ).toDouble();
mClassificationMaximum = elem.attribute( "max-val" ).toDouble();
QDomElement elemShader = elem.firstChildElement( QStringLiteral( "colorrampshader" ) );
mColorRampShader.readXml( elemShader );
}
@@ -83,11 +83,11 @@ class CORE_EXPORT QgsMeshRendererScalarSettings
void setColorRampShader( const QgsColorRampShader &shader );

//! Returns min value used for creation of the color ramp shader
double classificationMin() const { return mClassificationMin; }
double classificationMinimum() const { return mClassificationMinimum; }
//! Returns max value used for creation of the color ramp shader
double classificationMax() const { return mClassificationMax; }
double classificationMaximum() const { return mClassificationMaximum; }
//! Sets min/max values used for creation of the color ramp shader
void setClassificationMinMax( double vMin, double vMax );
void setClassificationMinimumMaximum( double minimum, double maximum );

//! Writes configuration to a new DOM element
QDomElement writeXml( QDomDocument &doc ) const;
@@ -96,8 +96,8 @@ class CORE_EXPORT QgsMeshRendererScalarSettings

private:
QgsColorRampShader mColorRampShader;
double mClassificationMin = 0;
double mClassificationMax = 0;
double mClassificationMinimum = 0;
double mClassificationMaximum = 0;
};

/**

0 comments on commit 6d1e420

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