Skip to content
Permalink
Browse files

[raster] Fix pseudocolor clip option (setting was lost in the pipeline)

Also disable checkbox for exact and discrete mode, as it isn't used there.
  • Loading branch information
pierstitus authored and nyalldawson committed Apr 15, 2016
1 parent 4fed566 commit 8f667bbdca9739e5e7a8acbd3d2f76479cfac592
@@ -63,7 +63,7 @@ QgsSingleBandPseudoColorRenderer* QgsSingleBandPseudoColorRenderer::clone() cons
QgsColorRampShader * colorRampShader = new QgsColorRampShader( mShader->minimumValue(), mShader->maximumValue() );

colorRampShader->setColorRampType( origColorRampShader->colorRampType() );

colorRampShader->setClip( origColorRampShader->clip() );
colorRampShader->setColorRampItemList( origColorRampShader->colorRampItemList() );
shader->setRasterShaderFunction( colorRampShader );
}
@@ -513,7 +513,7 @@ void QgsSingleBandPseudoColorRendererWidget::on_mClassifyButton_clicked()

// calculate a reasonable number of decimals to display
double maxabs = log10( qMax( qAbs( max ), qAbs( min ) ) );
int nDecimals = qRound( qMax( 3.0 + maxabs - log10( max - min ), maxabs <= 6.0 ? maxabs + 0.49 : 0.0 ) );
int nDecimals = qRound( qMax( 3.0 + maxabs - log10( max - min ), maxabs <= 16.0 ? maxabs + 0.49 : 0.0 ) );

for ( ; value_it != entryValues.end(); ++value_it, ++color_it )
{
@@ -561,7 +561,7 @@ void QgsSingleBandPseudoColorRendererWidget::populateColormapTreeWidget( const Q
for ( ; it != colorRampItems.constEnd(); ++it )
{
QgsTreeWidgetItem* newItem = new QgsTreeWidgetItem( mColormapTreeWidget );
newItem->setText( ValueColumn, QString::number( it->value, 'g' ) );
newItem->setText( ValueColumn, QString::number( it->value, 'g', 16 ) );
newItem->setBackground( ColorColumn, QBrush( it->color ) );
newItem->setText( LabelColumn, it->label );
newItem->setFlags( Qt::ItemIsEnabled | Qt::ItemIsEditable | Qt::ItemIsSelectable );
@@ -830,7 +830,7 @@ void QgsSingleBandPseudoColorRendererWidget::setFromRenderer( const QgsRasterRen
for ( ; it != colorRampItemList.end(); ++it )
{
QgsTreeWidgetItem* newItem = new QgsTreeWidgetItem( mColormapTreeWidget );
newItem->setText( ValueColumn, QString::number( it->value, 'g' ) );
newItem->setText( ValueColumn, QString::number( it->value, 'g', 16 ) );
newItem->setBackground( ColorColumn, QBrush( it->color ) );
newItem->setText( LabelColumn, it->label );
newItem->setFlags( Qt::ItemIsEnabled | Qt::ItemIsEditable | Qt::ItemIsSelectable );
@@ -855,6 +855,13 @@ void QgsSingleBandPseudoColorRendererWidget::on_mBandComboBox_currentIndexChange
mMinMaxWidget->setBands( bands );
}

void QgsSingleBandPseudoColorRendererWidget::on_mColorInterpolationComboBox_currentIndexChanged( int index )
{
Q_UNUSED( index );
mClipCheckBox->setEnabled( mColorInterpolationComboBox->currentText() == tr( "Linear" ) );
autoLabel();
}

void QgsSingleBandPseudoColorRendererWidget::loadMinMax( int theBandNo, double theMin, double theMax, int theOrigin )
{
Q_UNUSED( theBandNo );
@@ -71,7 +71,7 @@ class GUI_EXPORT QgsSingleBandPseudoColorRendererWidget: public QgsRasterRendere
void on_mColormapTreeWidget_itemDoubleClicked( QTreeWidgetItem* item, int column );
void mColormapTreeWidget_itemEdited( QTreeWidgetItem* item, int column );
void on_mBandComboBox_currentIndexChanged( int index );
void on_mColorInterpolationComboBox_currentIndexChanged( int index ) { Q_UNUSED( index ); autoLabel(); }
void on_mColorInterpolationComboBox_currentIndexChanged( int index );
void on_mMinLineEdit_textChanged( const QString & text ) { Q_UNUSED( text ); resetClassifyButton(); }
void on_mMaxLineEdit_textChanged( const QString & text ) { Q_UNUSED( text ); resetClassifyButton(); }
void on_mMinLineEdit_textEdited( const QString & text ) { Q_UNUSED( text ); mMinMaxOrigin = QgsRasterRenderer::MinMaxUser; showMinMaxOrigin(); }
@@ -251,7 +251,7 @@
<string>If checked, any pixels with a value out of range will not be rendered</string>
</property>
<property name="text">
<string>Clip raster values which are out of range</string>
<string>Clip out of range values</string>
</property>
</widget>
</item>

0 comments on commit 8f667bb

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