QGIS API Documentation  3.25.0-Master (6b426f5f8a)
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"
26 
28 
33 class GUI_EXPORT QgsSingleBandGrayRendererWidget: public QgsRasterRendererWidget, private Ui::QgsSingleBandGrayRendererWidgetBase
34 {
35  Q_OBJECT
36  public:
38 
39  static QgsRasterRendererWidget *create( QgsRasterLayer *layer, const QgsRectangle &extent ) SIP_FACTORY { return new QgsSingleBandGrayRendererWidget( layer, extent ); }
40 
42  void setMapCanvas( QgsMapCanvas *canvas ) override;
43 
47  void setFromRenderer( const QgsRasterRenderer *r );
48 
49  QString min( int index = 0 ) override { Q_UNUSED( index ) return mMinLineEdit->text(); }
50  QString max( int index = 0 ) override { Q_UNUSED( index ) return mMaxLineEdit->text(); }
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 { Q_UNUSED( index ) return mGrayBandComboBox->currentIndex() + 1; }
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 bandChanged();
63  void mMinLineEdit_textChanged( const QString & );
64  void mMaxLineEdit_textChanged( const QString & );
65  void showLegendSettings();
66 
67  private:
68  QgsRasterMinMaxWidget *mMinMaxWidget = nullptr;
69  bool mDisableMinMaxWidgetRefresh;
70  QgsColorRampLegendNodeSettings mLegendSettings;
71 
72  void minMaxModified();
73 };
74 
75 #endif // QGSSINGLEBANDGRAYRENDERERWIDGET_H
Settings for a color ramp legend node.
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:90
Represents a raster layer.
Abstract base class for widgets which configure a QgsRasterRenderer.
virtual void setMax(const QString &value, int index=0)
virtual void setMin(const QString &value, int index=0)
virtual QgsRasterRenderer * renderer()=0
Creates a new renderer, using the properties defined in the widget.
virtual void doComputations()
Load programmatically with current values.
Raster renderer pipe that applies colors to a raster.
A rectangle specified with double values.
Definition: qgsrectangle.h:42
static QgsRasterRendererWidget * create(QgsRasterLayer *layer, const QgsRectangle &extent)
QgsRasterMinMaxWidget * minMaxWidget() override
Returns min/max widget when it exists.
#define SIP_FACTORY
Definition: qgis_sip.h:76