QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
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
QgsSingleBandGrayRendererWidget
Definition: qgssinglebandgrayrendererwidget.h:33
QgsMapCanvas
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:85
QgsSingleBandGrayRendererWidget::max
QString max(int index=0) override
Definition: qgssinglebandgrayrendererwidget.h:46
QgsRasterRendererWidget::setMax
virtual void setMax(const QString &value, int index=0)
Definition: qgsrasterrendererwidget.h:72
qgsrasterrendererwidget.h
QgsRectangle
A rectangle specified with double values.
Definition: qgsrectangle.h:42
QgsSingleBandGrayRendererWidget::create
static QgsRasterRendererWidget * create(QgsRasterLayer *layer, const QgsRectangle &extent)
Definition: qgssinglebandgrayrendererwidget.h:38
SIP_FACTORY
#define SIP_FACTORY
Definition: qgis_sip.h:76
QgsRasterRendererWidget::setMapCanvas
virtual void setMapCanvas(QgsMapCanvas *canvas)
Sets the map canvas associated with the widget.
Definition: qgsrasterrendererwidget.cpp:23
QgsRasterMinMaxWidget
Definition: qgsrasterminmaxwidget.h:38
QgsSingleBandGrayRendererWidget::selectedBand
int selectedBand(int index=0) override
Definition: qgssinglebandgrayrendererwidget.h:49
QgsRasterRenderer
Raster renderer pipe that applies colors to a raster.
Definition: qgsrasterrenderer.h:39
qgis_sip.h
QgsRasterLayer
Represents a raster layer.
Definition: qgsrasterlayer.h:71
QgsSingleBandGrayRendererWidget::minMaxWidget
QgsRasterMinMaxWidget * minMaxWidget() override
Returns min/max widget when it exists.
Definition: qgssinglebandgrayrendererwidget.h:51
QgsSingleBandGrayRendererWidget::min
QString min(int index=0) override
Definition: qgssinglebandgrayrendererwidget.h:45
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:37
QgsRasterRendererWidget::renderer
virtual QgsRasterRenderer * renderer()=0