QGIS API Documentation  3.8.0-Zanzibar (11aff65)
qgssinglebandgrayrendererwidget.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgssinglebandgrayrendererwidget.h
3  ---------------------------------
4  begin : March 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 QGSSINGLEBANDGRAYRENDERERWIDGET_H
19 #define QGSSINGLEBANDGRAYRENDERERWIDGET_H
20 
22 #include "qgis_sip.h"
23 #include "ui_qgssinglebandgrayrendererwidgetbase.h"
24 #include "qgis_gui.h"
25 
27 
32 class GUI_EXPORT QgsSingleBandGrayRendererWidget: public QgsRasterRendererWidget, private Ui::QgsSingleBandGrayRendererWidgetBase
33 {
34  Q_OBJECT
35  public:
37 
38  static QgsRasterRendererWidget *create( QgsRasterLayer *layer, const QgsRectangle &extent ) SIP_FACTORY { return new QgsSingleBandGrayRendererWidget( layer, extent ); }
39 
40  QgsRasterRenderer *renderer() override;
41  void setMapCanvas( QgsMapCanvas *canvas ) override;
42 
43  void setFromRenderer( const QgsRasterRenderer *r );
44 
45  QString min( int index = 0 ) override { Q_UNUSED( index ) return mMinLineEdit->text(); }
46  QString max( int index = 0 ) override { Q_UNUSED( index ) return mMaxLineEdit->text(); }
47  void setMin( const QString &value, int index = 0 ) override;
48  void setMax( const QString &value, int index = 0 ) override;
49  int selectedBand( int index = 0 ) override { Q_UNUSED( index ) return mGrayBandComboBox->currentIndex() + 1; }
50  void doComputations() override;
51  QgsRasterMinMaxWidget *minMaxWidget() override { return mMinMaxWidget; }
52 
53  public slots:
55  void loadMinMax( int bandNo, double min, double max );
56 
57  private slots:
58  void bandChanged();
59  void mMinLineEdit_textChanged( const QString & );
60  void mMaxLineEdit_textChanged( const QString & );
61 
62  private:
63  QgsRasterMinMaxWidget *mMinMaxWidget = nullptr;
64  bool mDisableMinMaxWidgetRefresh;
65 
66  void minMaxModified();
67 };
68 
69 #endif // QGSSINGLEBANDGRAYRENDERERWIDGET_H
A rectangle specified with double values.
Definition: qgsrectangle.h:41
This class provides qgis with the ability to render raster datasets onto the mapcanvas.
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:73
virtual void setMapCanvas(QgsMapCanvas *canvas)
Sets the map canvas associated with the widget.
virtual void setMax(const QString &value, int index=0)
#define SIP_FACTORY
Definition: qgis_sip.h:69
static QgsRasterRendererWidget * create(QgsRasterLayer *layer, const QgsRectangle &extent)
virtual void doComputations()
Load programmatically with current values.
QgsRasterMinMaxWidget * minMaxWidget() override
Returns min/max widget when it exists.
virtual void setMin(const QString &value, int index=0)
virtual QgsRasterRenderer * renderer()=0
Raster renderer pipe that applies colors to a raster.