QGIS API Documentation  3.14.0-Pi (9f7028fd23)
qgsmultibandcolorrendererwidget.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsmultibandcolorrendererwidget.h
3  ---------------------------------
4  begin : February 2012
5  copyright : (C) 2012 by Marco Hugentobler
6  email : marco at sourcepole dot ch
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSMULTIBANDCOLORRENDERERWIDGET_H
19 #define QGSMULTIBANDCOLORRENDERERWIDGET_H
20 
22 #include "ui_qgsmultibandcolorrendererwidgetbase.h"
23 #include "qgis_gui.h"
24 
28 class QgsRasterLayer;
29 class QLineEdit;
31 
36 class GUI_EXPORT QgsMultiBandColorRendererWidget: public QgsRasterRendererWidget, private Ui::QgsMultiBandColorRendererWidgetBase
37 {
38  Q_OBJECT
39 
40  public:
42  static QgsRasterRendererWidget *create( QgsRasterLayer *layer, const QgsRectangle &extent ) { return new QgsMultiBandColorRendererWidget( layer, extent ); }
43 
44  QgsRasterRenderer *renderer() override;
45  void setMapCanvas( QgsMapCanvas *canvas ) override;
46 
47  void setFromRenderer( const QgsRasterRenderer *r );
48 
49  QString min( int index = 0 ) override;
50  QString max( int index = 0 ) override;
51  void setMin( const QString &value, int index = 0 ) override;
52  void setMax( const QString &value, int index = 0 ) override;
53  int selectedBand( int index = 0 ) override;
54  void doComputations() override;
55  QgsRasterMinMaxWidget *minMaxWidget() override { return mMinMaxWidget; }
56 
57  public slots:
59  void loadMinMax( int bandNo, double min, double max );
60 
61  private slots:
62  void onBandChanged( int );
63  void mRedMinLineEdit_textChanged( const QString & );
64  void mRedMaxLineEdit_textChanged( const QString & );
65  void mGreenMinLineEdit_textChanged( const QString & );
66  void mGreenMaxLineEdit_textChanged( const QString & );
67  void mBlueMinLineEdit_textChanged( const QString & );
68  void mBlueMaxLineEdit_textChanged( const QString & );
69 
70  private:
71  void createValidators();
72  void setCustomMinMaxValues( QgsMultiBandColorRenderer *r, const QgsRasterDataProvider *provider, int redBand, int GreenBand,
73  int blueBand );
75  void setMinMaxValue( const QgsContrastEnhancement *ce, QLineEdit *minEdit, QLineEdit *maxEdit );
76  QgsRasterMinMaxWidget *mMinMaxWidget = nullptr;
77  bool mDisableMinMaxWidgetRefresh;
78 
79  void minMaxModified();
80 };
81 
82 #endif // QGSMULTIBANDCOLORRENDERERWIDGET_H
QgsMultiBandColorRendererWidget
Definition: qgsmultibandcolorrendererwidget.h:36
QgsMapCanvas
Definition: qgsmapcanvas.h:83
QgsRasterRendererWidget::setMax
virtual void setMax(const QString &value, int index=0)
Definition: qgsrasterrendererwidget.h:72
qgsrasterrendererwidget.h
QgsRectangle
Definition: qgsrectangle.h:41
QgsRasterRendererWidget::setMapCanvas
virtual void setMapCanvas(QgsMapCanvas *canvas)
Sets the map canvas associated with the widget.
Definition: qgsrasterrendererwidget.cpp:23
QgsRasterMinMaxWidget
Definition: qgsrasterminmaxwidget.h:37
QgsRasterRenderer
Definition: qgsrasterrenderer.h:38
QgsRasterRendererWidget::min
virtual QString min(int index=0)
Definition: qgsrasterrendererwidget.h:69
QgsMultiBandColorRenderer
Definition: qgsmultibandcolorrenderer.h:32
QgsRasterLayer
Definition: qgsrasterlayer.h:72
QgsContrastEnhancement
Definition: qgscontrastenhancement.h:42
QgsMultiBandColorRendererWidget::create
static QgsRasterRendererWidget * create(QgsRasterLayer *layer, const QgsRectangle &extent)
Definition: qgsmultibandcolorrendererwidget.h:42
QgsRasterRendererWidget::selectedBand
virtual int selectedBand(int index=0)
Definition: qgsrasterrendererwidget.h:75
QgsRasterRendererWidget::setMin
virtual void setMin(const QString &value, int index=0)
Definition: qgsrasterrendererwidget.h:71
QgsRasterRendererWidget::doComputations
virtual void doComputations()
Load programmatically with current values.
Definition: qgsrasterrendererwidget.h:78
QgsRasterRendererWidget
Definition: qgsrasterrendererwidget.h:36
QgsRasterRendererWidget::renderer
virtual QgsRasterRenderer * renderer()=0
QgsRasterRendererWidget::max
virtual QString max(int index=0)
Definition: qgsrasterrendererwidget.h:70
QgsMultiBandColorRendererWidget::minMaxWidget
QgsRasterMinMaxWidget * minMaxWidget() override
Returns min/max widget when it exists.
Definition: qgsmultibandcolorrendererwidget.h:55
QgsRasterDataProvider
Definition: qgsrasterdataprovider.h:88