diff --git a/python/gui/raster/qgssinglebandgrayrendererwidget.sip b/python/gui/raster/qgssinglebandgrayrendererwidget.sip index 36e3d4269bb..a86ce7fa306 100644 --- a/python/gui/raster/qgssinglebandgrayrendererwidget.sip +++ b/python/gui/raster/qgssinglebandgrayrendererwidget.sip @@ -20,5 +20,5 @@ class QgsSingleBandGrayRendererWidget: QgsRasterRendererWidget int selectedBand( int index = 0 ); public slots: - void loadMinMax( int theBandNo, double theMin, double theMax ); + void loadMinMax( int theBandNo, double theMin, double theMax, int theOrigin ); }; diff --git a/src/core/raster/qgsrasterrenderer.cpp b/src/core/raster/qgsrasterrenderer.cpp index 2e5baf131be..ebb0001284e 100644 --- a/src/core/raster/qgsrasterrenderer.cpp +++ b/src/core/raster/qgsrasterrenderer.cpp @@ -26,11 +26,14 @@ #include "qgsbilinearrasterresampler.h" #include "qgscubicrasterresampler.h" +#include #include #include #include #include +#define tr( sourceText ) QCoreApplication::translate ( "QgsRasterRenderer", sourceText ) + QgsRasterRenderer::QgsRasterRenderer( QgsRasterInterface* input, const QString& type ) : QgsRasterInterface( input ) , mType( type ), mOpacity( 1.0 ), mRasterTransparency( 0 ) @@ -140,3 +143,146 @@ void QgsRasterRenderer::readXML( const QDomElement& rendererElem ) mRasterTransparency->readXML( rasterTransparencyElem ); } } + +QString QgsRasterRenderer::minMaxOriginName( int theOrigin ) +{ + if ( theOrigin == MinMaxUnknown ) + { + return "Unknown"; + } + else if ( theOrigin == MinMaxUser ) + { + return "User"; + } + + QString name; + if ( theOrigin & MinMaxMinMax ) + { + name += "MinMax"; + } + else if ( theOrigin & MinMaxCumulativeCut ) + { + name += "CumulativeCut"; + } + else if ( theOrigin & MinMaxStdDev ) + { + name += "StdDev"; + } + + if ( theOrigin & MinMaxFullExtent ) + { + name += "FullExtent"; + } + else if ( theOrigin & MinMaxSubExtent ) + { + name += "SubExtent"; + } + + if ( theOrigin & MinMaxEstimated ) + { + name += "Estimated"; + } + else if ( theOrigin & MinMaxExact ) + { + name += "Exact"; + } + return name; +} + +QString QgsRasterRenderer::minMaxOriginLabel( int theOrigin ) +{ + if ( theOrigin == MinMaxUnknown ) + { + return tr( "Unknown" ); + } + else if ( theOrigin == MinMaxUser ) + { + return tr( "User defined" ); + } + + QString name; + if ( theOrigin & MinMaxEstimated ) + { + name += tr( "Estimated" ); + } + else if ( theOrigin & MinMaxExact ) + { + name += tr( "Exact" ); + } + + name += " "; + + if ( theOrigin & MinMaxMinMax ) + { + name += tr( "min / max" ); + } + else if ( theOrigin & MinMaxCumulativeCut ) + { + name += "cumulative cut"; + } + else if ( theOrigin & MinMaxStdDev ) + { + name += "standard deviation"; + } + + name += " " + tr( " of " ) + " "; + + if ( theOrigin & MinMaxFullExtent ) + { + name += "full extent"; + } + else if ( theOrigin & MinMaxSubExtent ) + { + name += "sub extent"; + } + + name += "."; + + return name; +} + +int QgsRasterRenderer::minMaxOriginFromName( QString theName ) +{ + if ( theName.contains( "Unknown" ) ) + { + return MinMaxUnknown; + } + else if ( theName.contains( "User" ) ) + { + return MinMaxUser; + } + + int origin = 0; + + if ( theName.contains( "MinMax" ) ) + { + origin |= MinMaxMinMax; + } + else if ( theName.contains( "CumulativeCut" ) ) + { + origin |= MinMaxCumulativeCut; + } + else if ( theName.contains( "StdDev" ) ) + { + origin |= MinMaxStdDev; + } + + if ( theName.contains( "FullExtent" ) ) + { + origin |= MinMaxFullExtent; + } + else if ( theName.contains( "SubExtent" ) ) + { + origin |= MinMaxSubExtent; + } + + if ( theName.contains( "Estimated" ) ) + { + origin |= MinMaxEstimated; + } + else if ( theName.contains( "Exact" ) ) + { + origin |= MinMaxExact; + } + return origin; +} diff --git a/src/core/raster/qgsrasterrenderer.h b/src/core/raster/qgsrasterrenderer.h index 3bc3d3c835a..98499571c41 100644 --- a/src/core/raster/qgsrasterrenderer.h +++ b/src/core/raster/qgsrasterrenderer.h @@ -39,6 +39,23 @@ class QDomElement; class CORE_EXPORT QgsRasterRenderer : public QgsRasterInterface { public: + // Origin of min / max values + enum MinMaxOrigin + { + MinMaxUnknown = 0, + MinMaxUser = 1, // entered by user + // method + MinMaxMinMax = 1 << 1, + MinMaxCumulativeCut = 1 << 2, + MinMaxStdDev = 1 << 3, + // Extent + MinMaxFullExtent = 1 << 4, + MinMaxSubExtent = 1 << 5, + // Precision + MinMaxEstimated = 1 << 6, + MinMaxExact = 1 << 7 + }; + QgsRasterRenderer( QgsRasterInterface* input = 0, const QString& type = "" ); virtual ~QgsRasterRenderer(); @@ -82,6 +99,10 @@ class CORE_EXPORT QgsRasterRenderer : public QgsRasterInterface /**Returns a list of band numbers used by the renderer*/ virtual QList usesBands() const { return QList(); } + static QString minMaxOriginName( int theOrigin ); + static QString minMaxOriginLabel( int theOrigin ); + static int minMaxOriginFromName( QString theName ); + protected: /**Write upper class info into rasterrenderer element (called by writeXML method of subclasses)*/ diff --git a/src/core/raster/qgssinglebandpseudocolorrenderer.cpp b/src/core/raster/qgssinglebandpseudocolorrenderer.cpp index 2712df62038..02279f4f101 100644 --- a/src/core/raster/qgssinglebandpseudocolorrenderer.cpp +++ b/src/core/raster/qgssinglebandpseudocolorrenderer.cpp @@ -24,7 +24,12 @@ #include QgsSingleBandPseudoColorRenderer::QgsSingleBandPseudoColorRenderer( QgsRasterInterface* input, int band, QgsRasterShader* shader ): - QgsRasterRenderer( input, "singlebandpseudocolor" ), mShader( shader ), mBand( band ) + QgsRasterRenderer( input, "singlebandpseudocolor" ) + , mShader( shader ) + , mBand( band ) + , mClassificationMin( std::numeric_limits::quiet_NaN() ) + , mClassificationMax( std::numeric_limits::quiet_NaN() ) + , mClassificationMinMaxOrigin( QgsRasterRenderer::MinMaxUnknown ) { } @@ -85,8 +90,16 @@ QgsRasterRenderer* QgsSingleBandPseudoColorRenderer::create( const QDomElement& shader = new QgsRasterShader(); shader->readXML( rasterShaderElem ); } - QgsRasterRenderer* r = new QgsSingleBandPseudoColorRenderer( input, band, shader ); + + //QgsRasterRenderer* r = new QgsSingleBandPseudoColorRenderer( input, band, shader ); + QgsSingleBandPseudoColorRenderer* r = new QgsSingleBandPseudoColorRenderer( input, band, shader ); r->readXML( elem ); + + // TODO: add _readXML in superclass? + r->setClassificationMin( elem.attribute( "classificationMin", "NaN" ).toDouble() ); + r->setClassificationMax( elem.attribute( "classificationMax", "NaN" ).toDouble() ); + r->setClassificationMinMaxOrigin( QgsRasterRenderer::minMaxOriginFromName( elem.attribute( "classificationMinMaxOrigin", "Unknown" ) ) ); + return r; } @@ -210,6 +223,10 @@ void QgsSingleBandPseudoColorRenderer::writeXML( QDomDocument& doc, QDomElement& { mShader->writeXML( doc, rasterRendererElem ); //todo: include color ramp items directly in this renderer } + rasterRendererElem.setAttribute( "classificationMin", QString::number( mClassificationMin ) ); + rasterRendererElem.setAttribute( "classificationMax", QString::number( mClassificationMax ) ); + rasterRendererElem.setAttribute( "classificationMinMaxOrigin", QgsRasterRenderer::minMaxOriginName( mClassificationMinMaxOrigin ) ); + parentElem.appendChild( rasterRendererElem ); } diff --git a/src/core/raster/qgssinglebandpseudocolorrenderer.h b/src/core/raster/qgssinglebandpseudocolorrenderer.h index 57d1a789de6..c92aaf1c8ef 100644 --- a/src/core/raster/qgssinglebandpseudocolorrenderer.h +++ b/src/core/raster/qgssinglebandpseudocolorrenderer.h @@ -49,9 +49,23 @@ class CORE_EXPORT QgsSingleBandPseudoColorRenderer: public QgsRasterRenderer QList usesBands() const; + double classificationMin() const { return mClassificationMin; } + double classificationMax() const { return mClassificationMax; } + void setClassificationMin( double min ) { mClassificationMin = min; } + void setClassificationMax( double max ) { mClassificationMax = max; } + int classificationMinMaxOrigin() const { return mClassificationMinMaxOrigin; } + void setClassificationMinMaxOrigin( int origin ) { mClassificationMinMaxOrigin = origin; } + private: QgsRasterShader* mShader; int mBand; + + // Minimum and maximum values used for automatic classification, these + // values are not used by renderer in rendering process + double mClassificationMin; + double mClassificationMax; + + int mClassificationMinMaxOrigin; }; #endif // QGSSINGLEBANDPSEUDOCOLORRENDERER_H diff --git a/src/gui/raster/qgsrasterminmaxwidget.cpp b/src/gui/raster/qgsrasterminmaxwidget.cpp index 0b1c93fb90a..db48786406c 100644 --- a/src/gui/raster/qgsrasterminmaxwidget.cpp +++ b/src/gui/raster/qgsrasterminmaxwidget.cpp @@ -44,6 +44,7 @@ void QgsRasterMinMaxWidget::on_mLoadPushButton_clicked() foreach ( int myBand, mBands ) { + int origin = QgsRasterRenderer::MinMaxUnknown; QgsDebugMsg( QString( "myBand = %1" ).arg( myBand ) ); if ( myBand < 1 || myBand > mLayer->dataProvider()->bandCount() ) { @@ -56,6 +57,11 @@ void QgsRasterMinMaxWidget::on_mLoadPushButton_clicked() if ( mCurrentExtentRadioButton->isChecked() ) { myExtent = mExtent; // current + origin |= QgsRasterRenderer::MinMaxSubExtent; + } + else + { + origin |= QgsRasterRenderer::MinMaxFullExtent; } QgsDebugMsg( QString( "myExtent.isEmpty() = %1" ).arg( myExtent.isEmpty() ) ); @@ -63,6 +69,11 @@ void QgsRasterMinMaxWidget::on_mLoadPushButton_clicked() if ( mEstimateRadioButton->isChecked() ) { mySampleSize = 250000; + origin |= QgsRasterRenderer::MinMaxEstimated; + } + else + { + origin |= QgsRasterRenderer::MinMaxExact; } if ( mCumulativeCutRadioButton->isChecked() ) @@ -70,6 +81,7 @@ void QgsRasterMinMaxWidget::on_mLoadPushButton_clicked() double myLower = mCumulativeCutLowerDoubleSpinBox->value() / 100.0; double myUpper = mCumulativeCutUpperDoubleSpinBox->value() / 100.0; mLayer->dataProvider()->cumulativeCut( myBand, myLower, myUpper, myMin, myMax, myExtent, mySampleSize ); + origin |= QgsRasterRenderer::MinMaxCumulativeCut; } else if ( mMinMaxRadioButton->isChecked() ) { @@ -77,6 +89,7 @@ void QgsRasterMinMaxWidget::on_mLoadPushButton_clicked() QgsRasterBandStats myRasterBandStats = mLayer->dataProvider()->bandStatistics( myBand, QgsRasterBandStats::Min | QgsRasterBandStats::Max, myExtent, mySampleSize ); myMin = myRasterBandStats.minimumValue; myMax = myRasterBandStats.maximumValue; + origin |= QgsRasterRenderer::MinMaxMinMax; } else if ( mStdDevRadioButton->isChecked() ) { @@ -84,9 +97,9 @@ void QgsRasterMinMaxWidget::on_mLoadPushButton_clicked() double myStdDev = mStdDevSpinBox->value(); myMin = myRasterBandStats.mean - ( myStdDev * myRasterBandStats.stdDev ); myMax = myRasterBandStats.mean + ( myStdDev * myRasterBandStats.stdDev ); - + origin |= QgsRasterRenderer::MinMaxStdDev; } - emit load( myBand, myMin, myMax ); + emit load( myBand, myMin, myMax, origin ); } } diff --git a/src/gui/raster/qgsrasterminmaxwidget.h b/src/gui/raster/qgsrasterminmaxwidget.h index 9878f1566ee..ab7e67a5146 100644 --- a/src/gui/raster/qgsrasterminmaxwidget.h +++ b/src/gui/raster/qgsrasterminmaxwidget.h @@ -34,7 +34,7 @@ class GUI_EXPORT QgsRasterMinMaxWidget: public QWidget, private Ui::QgsRasterMin void setBands( const QList & theBands ) { mBands = theBands; } signals: - void load( int theBandNo, double theMin, double theMax ); + void load( int theBandNo, double theMin, double theMax, int origin ); private slots: void on_mLoadPushButton_clicked(); diff --git a/src/gui/raster/qgssinglebandgrayrendererwidget.cpp b/src/gui/raster/qgssinglebandgrayrendererwidget.cpp index ce7b6673bc4..c6cdb317328 100644 --- a/src/gui/raster/qgssinglebandgrayrendererwidget.cpp +++ b/src/gui/raster/qgssinglebandgrayrendererwidget.cpp @@ -87,8 +87,9 @@ QgsRasterRenderer* QgsSingleBandGrayRendererWidget::renderer() return renderer; } -void QgsSingleBandGrayRendererWidget::loadMinMax( int theBandNo, double theMin, double theMax ) +void QgsSingleBandGrayRendererWidget::loadMinMax( int theBandNo, double theMin, double theMax, int theOrigin ) { + Q_UNUSED( theOrigin ); QgsDebugMsg( QString( "theBandNo = %1 theMin = %2 theMax = %3" ).arg( theBandNo ).arg( theMin ).arg( theMax ) ); if ( qIsNaN( theMin ) ) diff --git a/src/gui/raster/qgssinglebandgrayrendererwidget.h b/src/gui/raster/qgssinglebandgrayrendererwidget.h index a1e371c677d..f3f247390e3 100644 --- a/src/gui/raster/qgssinglebandgrayrendererwidget.h +++ b/src/gui/raster/qgssinglebandgrayrendererwidget.h @@ -42,7 +42,7 @@ class GUI_EXPORT QgsSingleBandGrayRendererWidget: public QgsRasterRendererWidget int selectedBand( int index = 0 ) { Q_UNUSED( index ); return mGrayBandComboBox->currentIndex() + 1; } public slots: - void loadMinMax( int theBandNo, double theMin, double theMax ); + void loadMinMax( int theBandNo, double theMin, double theMax, int theOrigin ); private slots: void on_mGrayBandComboBox_currentIndexChanged( int index ); diff --git a/src/gui/raster/qgssinglebandpseudocolorrendererwidget.cpp b/src/gui/raster/qgssinglebandpseudocolorrendererwidget.cpp index 66281ab8f4b..57167a16a6c 100644 --- a/src/gui/raster/qgssinglebandpseudocolorrendererwidget.cpp +++ b/src/gui/raster/qgssinglebandpseudocolorrendererwidget.cpp @@ -34,6 +34,8 @@ QgsSingleBandPseudoColorRendererWidget::QgsSingleBandPseudoColorRendererWidget( { setupUi( this ); + mColormapTreeWidget->setColumnWidth( 1, 50 ); + mColorRampComboBox->populate( QgsStyleV2::defaultStyle() ); if ( !mRasterLayer ) @@ -47,6 +49,20 @@ QgsSingleBandPseudoColorRendererWidget::QgsSingleBandPseudoColorRendererWidget( return; } + // Must be before adding items to mBandComboBox (signal) + mMinLineEdit->setValidator( new QDoubleValidator( mMinLineEdit ) ); + mMaxLineEdit->setValidator( new QDoubleValidator( mMaxLineEdit ) ); + + mMinMaxWidget = new QgsRasterMinMaxWidget( layer, this ); + mMinMaxWidget->setExtent( extent ); + QHBoxLayout *layout = new QHBoxLayout(); + layout->setContentsMargins( 0, 0, 0, 0 ); + mMinMaxContainerWidget->setLayout( layout ); + layout->addWidget( mMinMaxWidget ); + connect( mMinMaxWidget, SIGNAL( load( int, double, double, int ) ), + this, SLOT( loadMinMax( int, double, double, int ) ) ); + + //fill available bands into combo box int nBands = provider->bandCount(); for ( int i = 1; i <= nBands; ++i ) //band numbering seem to start at 1 @@ -61,6 +77,8 @@ QgsSingleBandPseudoColorRendererWidget::QgsSingleBandPseudoColorRendererWidget( mClassificationModeComboBox->addItem( tr( "Equal interval" ) ); //quantile would be nice as well + mNumberOfEntriesSpinBox->setValue( 5 ); // some default + setFromRenderer( layer->renderer() ); } @@ -109,7 +127,12 @@ QgsRasterRenderer* QgsSingleBandPseudoColorRendererWidget::renderer() rasterShader->setRasterShaderFunction( colorRampShader ); int bandNumber = mBandComboBox->itemData( mBandComboBox->currentIndex() ).toInt(); - return new QgsSingleBandPseudoColorRenderer( mRasterLayer->dataProvider(), bandNumber, rasterShader ); + QgsSingleBandPseudoColorRenderer *renderer = new QgsSingleBandPseudoColorRenderer( mRasterLayer->dataProvider(), bandNumber, rasterShader ); + + renderer->setClassificationMin( lineEditValue( mMinLineEdit ) ); + renderer->setClassificationMax( lineEditValue( mMaxLineEdit ) ); + renderer->setClassificationMinMaxOrigin( mMinMaxOrigin ); + return renderer; } void QgsSingleBandPseudoColorRendererWidget::on_mAddEntryButton_clicked() @@ -190,27 +213,32 @@ void QgsSingleBandPseudoColorRendererWidget::on_mClassifyButton_clicked() return; } - int bandNr = mBandComboBox->itemData( bandComboIndex ).toInt(); - QgsRasterBandStats myRasterBandStats = mRasterLayer->dataProvider()->bandStatistics( bandNr ); + //int bandNr = mBandComboBox->itemData( bandComboIndex ).toInt(); + //QgsRasterBandStats myRasterBandStats = mRasterLayer->dataProvider()->bandStatistics( bandNr ); int numberOfEntries = mNumberOfEntriesSpinBox->value(); QList entryValues; QList entryColors; + double min = lineEditValue( mMinLineEdit ); + double max = lineEditValue( mMaxLineEdit ); + if ( mClassificationModeComboBox->currentText() == tr( "Equal interval" ) ) { - double currentValue = myRasterBandStats.minimumValue; + //double currentValue = myRasterBandStats.minimumValue; + double currentValue = min; double intervalDiff; if ( numberOfEntries > 1 ) { //because the highest value is also an entry, there are (numberOfEntries - 1) //intervals - intervalDiff = ( myRasterBandStats.maximumValue - myRasterBandStats.minimumValue ) / - ( numberOfEntries - 1 ); + //intervalDiff = ( myRasterBandStats.maximumValue - myRasterBandStats.minimumValue ) / + intervalDiff = ( max - min ) / ( numberOfEntries - 1 ); } else { - intervalDiff = myRasterBandStats.maximumValue - myRasterBandStats.minimumValue; + //intervalDiff = myRasterBandStats.maximumValue - myRasterBandStats.minimumValue; + intervalDiff = max - min; } for ( int i = 0; i < numberOfEntries; ++i ) @@ -515,5 +543,78 @@ void QgsSingleBandPseudoColorRendererWidget::setFromRenderer( const QgsRasterRen } } } + setLineEditValue( mMinLineEdit, pr->classificationMin() ); + setLineEditValue( mMaxLineEdit, pr->classificationMax() ); + mMinMaxOrigin = pr->classificationMinMaxOrigin(); + showMinMaxOrigin(); + } +} + +void QgsSingleBandPseudoColorRendererWidget::on_mBandComboBox_currentIndexChanged( int index ) +{ + QList myBands; + myBands.append( mBandComboBox->itemData( index ).toInt() ); + mMinMaxWidget->setBands( myBands ); +} + +void QgsSingleBandPseudoColorRendererWidget::loadMinMax( int theBandNo, double theMin, double theMax, int theOrigin ) +{ + QgsDebugMsg( QString( "theBandNo = %1 theMin = %2 theMax = %3" ).arg( theBandNo ).arg( theMin ).arg( theMax ) ); + + if ( qIsNaN( theMin ) ) + { + mMinLineEdit->clear(); + } + else + { + mMinLineEdit->setText( QString::number( theMin ) ); + } + + if ( qIsNaN( theMax ) ) + { + mMaxLineEdit->clear(); + } + else + { + mMaxLineEdit->setText( QString::number( theMax ) ); + } + + mMinMaxOrigin = theOrigin; + showMinMaxOrigin(); +} + +void QgsSingleBandPseudoColorRendererWidget::showMinMaxOrigin() +{ + mMinMaxOriginLabel->setText( QgsRasterRenderer::minMaxOriginLabel( mMinMaxOrigin ) ); +} + +void QgsSingleBandPseudoColorRendererWidget::setLineEditValue( QLineEdit * theLineEdit, double theValue ) +{ + QString s; + if ( !qIsNaN( theValue ) ) + { + s = QString::number( theValue ); + } + theLineEdit->setText( s ); +} + +double QgsSingleBandPseudoColorRendererWidget::lineEditValue( const QLineEdit * theLineEdit ) const +{ + if ( theLineEdit->text().isEmpty() ) + { + return std::numeric_limits::quiet_NaN(); + } + + return theLineEdit->text().toDouble(); +} + +void QgsSingleBandPseudoColorRendererWidget::resetClassifyButton() +{ + mClassifyButton->setEnabled( true ); + double min = lineEditValue( mMinLineEdit ); + double max = lineEditValue( mMaxLineEdit ); + if ( qIsNaN( min ) || qIsNaN( max ) || min >= max ) + { + mClassifyButton->setEnabled( false ); } } diff --git a/src/gui/raster/qgssinglebandpseudocolorrendererwidget.h b/src/gui/raster/qgssinglebandpseudocolorrendererwidget.h index fa5e478cc07..ad388a73eeb 100644 --- a/src/gui/raster/qgssinglebandpseudocolorrendererwidget.h +++ b/src/gui/raster/qgssinglebandpseudocolorrendererwidget.h @@ -18,6 +18,7 @@ #ifndef QGSSINGLEBANDCOLORRENDERERWIDGET_H #define QGSSINGLEBANDCOLORRENDERERWIDGET_H +#include "qgsrasterminmaxwidget.h" #include "qgsrasterrendererwidget.h" #include "qgscolorrampshader.h" #include "ui_qgssinglebandpseudocolorrendererwidgetbase.h" @@ -38,6 +39,9 @@ class GUI_EXPORT QgsSingleBandPseudoColorRendererWidget: public QgsRasterRendere private: void populateColormapTreeWidget( const QList& colorRampItems ); + public slots: + void loadMinMax( int theBandNo, double theMin, double theMax, int theOrigin ); + private slots: void on_mAddEntryButton_clicked(); void on_mDeleteEntryButton_clicked(); @@ -47,6 +51,19 @@ class GUI_EXPORT QgsSingleBandPseudoColorRendererWidget: public QgsRasterRendere void on_mLoadFromFileButton_clicked(); void on_mExportToFileButton_clicked(); void on_mColormapTreeWidget_itemDoubleClicked( QTreeWidgetItem* item, int column ); + void on_mBandComboBox_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(); } + void on_mMaxLineEdit_textEdited( const QString & text ) { Q_UNUSED( text ); mMinMaxOrigin = QgsRasterRenderer::MinMaxUser; showMinMaxOrigin(); } + + private: + void setLineEditValue( QLineEdit *theLineEdit, double theValue ); + double lineEditValue( const QLineEdit *theLineEdit ) const; + void resetClassifyButton(); + void showMinMaxOrigin(); + QgsRasterMinMaxWidget * mMinMaxWidget; + int mMinMaxOrigin; }; #endif // QGSSINGLEBANDCOLORRENDERERWIDGET_H diff --git a/src/ui/qgsrasterlayerpropertiesbase.ui b/src/ui/qgsrasterlayerpropertiesbase.ui index 00cdae05036..9cf45bf949e 100644 --- a/src/ui/qgsrasterlayerpropertiesbase.ui +++ b/src/ui/qgsrasterlayerpropertiesbase.ui @@ -6,8 +6,8 @@ 0 0 - 722 - 663 + 652 + 515 @@ -101,7 +101,27 @@ - 318 + 150 + 20 + + + + + + + + Invert color map + + + + + + + Qt::Horizontal + + + + 40 20 @@ -112,52 +132,71 @@ - + Resampling - - + + Zoomed in - + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + Zoomed out - + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + - Maximum oversampling + Oversampling - - - - - - - + - - - - Invert color map - - - @@ -589,7 +628,7 @@ Qt::RightToLeft - Less than: + Less than: @@ -599,15 +638,15 @@ Qt::RightToLeft - More than or equal to: + More than or equal to: - + - + @@ -899,7 +938,7 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'DejaVu Sans'; font-size:10pt; font-weight:400; font-style:normal;"> +</style></head><body style=" font-family:'DejaVu Sans'; font-size:9pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Cantarell'; font-size:11pt;"><br /></span></p></body></html> @@ -1046,6 +1085,13 @@ p, li { white-space: pre-wrap; } + + + QgsScaleComboBox + QWidget +
qgsscalecombobox.h
+
+
tabBar buttonBox diff --git a/src/ui/qgsrasterminmaxwidgetbase.ui b/src/ui/qgsrasterminmaxwidgetbase.ui index 753b4ed055c..b6b9565d167 100644 --- a/src/ui/qgsrasterminmaxwidgetbase.ui +++ b/src/ui/qgsrasterminmaxwidgetbase.ui @@ -6,271 +6,282 @@ 0 0 - 433 - 293 + 371 + 264 Form - - + + Load min/max values + + 0 + - - - - - - Cumulative pixel count cut - - - true - - - - - - - - - - 1 - - - - - - - - - - - - - - - 1 - - - - - - - % - - - - - - - Qt::Horizontal - - - - 123 - 20 - - - - - - - - - - - Min / max - - - - - - - Qt::Horizontal - - - - 268 - 20 - - - - - - - - Mean +/- standard deviation × - - - - - - - - 0 - 0 - - - - 1.000000000000000 - - - - - - - Qt::Horizontal - - - - 148 - 20 - - - - - - + + + + + Cumulative count cut + + + true + + + + + + + 1 + + + + + + + - + + + + + + + 1 + + + + + + + % + + + + + + + Qt::Horizontal + + + + 123 + 20 + + + + + - - - - - - Extent - - - - - - Full - - - true - - - - - - - Qt::Horizontal - - - - 60 - 20 - - - - - - - - Current - - - - - - - Qt::Horizontal - - - - 60 - 20 - - - - - - - - - - - Accuracy - - - - - - Qt::Horizontal - - - - 65 - 20 - - - - - - - - Actual (slower) - - - - - - - Qt::Horizontal - - - - 65 - 20 - - - - - - - - Estimate (faster) - - - true - - - - - - - - + + + + + Min / max + + + + + + + Qt::Horizontal + + + + 268 + 20 + + + + + - - - - - - Qt::Horizontal - - - - 313 - 21 - - - - - - - - Load - - - - - + + + + + Mean +/- standard deviation × + + + + + + + + 0 + 0 + + + + 1.000000000000000 + + + + + + + Qt::Horizontal + + + + 318 + 17 + + + + + + + + + + + + + 0 + 0 + + + + Extent + + + + + + Full + + + true + + + + + + + Qt::Horizontal + + + + 60 + 20 + + + + + + + + Current + + + + + + + Qt::Horizontal + + + + 60 + 20 + + + + + + + + + + + + 0 + 0 + + + + Accuracy + + + + + + Qt::Horizontal + + + + 65 + 20 + + + + + + + + Actual (slower) + + + + + + + Qt::Horizontal + + + + 65 + 20 + + + + + + + + Estimate (faster) + + + true + + + + + + + + + + + + + + Qt::Horizontal + + + + 313 + 21 + + + + + + + + Load + + + + diff --git a/src/ui/qgssinglebandpseudocolorrendererwidgetbase.ui b/src/ui/qgssinglebandpseudocolorrendererwidgetbase.ui index 076a3c779fd..07f815b53af 100644 --- a/src/ui/qgssinglebandpseudocolorrendererwidgetbase.ui +++ b/src/ui/qgssinglebandpseudocolorrendererwidgetbase.ui @@ -6,231 +6,360 @@ 0 0 - 584 - 400 + 637 + 207 Form - - - - - - - Band - - - - - - - - - - Color interpolation - - - - - - - - - - + + + - - - Add entry - - + + + + + Band + + + + + + + + + + + + + Color interpolation + + + + - - - Delete entry - - + + + + + Add values manually + + + ... + + + + :/images/themes/default/mActionNewAttribute.png:/images/themes/default/mActionNewAttribute.png + + + + + + + Remove selected row + + + ... + + + + :/images/themes/default/mActionDeleteAttribute.png:/images/themes/default/mActionDeleteAttribute.png + + + + + + + ... + + + + ../../../../../../usr/share/icons/oxygen/16x16/actions/view-sort-ascending.png../../../../../../usr/share/icons/oxygen/16x16/actions/view-sort-ascending.png + + + + + + + Load color map from band + + + ... + + + + :/images/themes/default/mActionDraw.png:/images/themes/default/mActionDraw.png + + + + + + + Load color map from file + + + ... + + + + :/images/themes/default/mActionFileOpen.png:/images/themes/default/mActionFileOpen.png + + + + + + + Export color map to file + + + ... + + + + :/images/themes/default/mActionFileSaveAs.png:/images/themes/default/mActionFileSaveAs.png + + + + + + + Qt::Horizontal + + + + 48 + 28 + + + + + - - - Sort - - - - - - - Qt::Horizontal - - - - 148 - 20 - - - - - - - - Load color map from band - - - ... - - - - :/images/themes/default/mActionNewAttribute.png:/images/themes/default/mActionNewAttribute.png - - - - - - - Load color map from file - - - ... - - - - :/images/themes/default/mActionFileOpen.png:/images/themes/default/mActionFileOpen.png - - - - - - - Export color map to file - - - ... - - - - :/images/themes/default/mActionFileSaveAs.png:/images/themes/default/mActionFileSaveAs.png + + + + 0 + 0 + + + 70 + + + 10 + + + true + + + 70 + + + 10 + + + true + + + + Value + + + + + Color + + + + + Label + + - - - - - Value - - - - - Color - - - - - Label - - - - - - - - Generate new color map - - - - - - Classes - - - - - - - - 0 - 0 - - - - 255 - - - - - - - Mode - - - - - - - - - - Classify - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Color ramp - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - + + + + + + Generate new color map + + + + + + + + Classes + + + + + + + + 0 + 0 + + + + 255 + + + 0 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Colors + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Classify + + + + + + + + + + + Min + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Max + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Mode + + + + + + + + + + + + + + Min / max origin: + + + + + + + + 0 + 0 + + + + Min / Max origin + + + + + + + + + + + + + 0 + 0 + + + grpGenerateColorMap + + +