QGIS API Documentation  2.99.0-Master (0a63d1f)
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 "ui_qgssinglebandgrayrendererwidgetbase.h"
23 #include "qgis_gui.h"
24 
26 
30 class GUI_EXPORT QgsSingleBandGrayRendererWidget: public QgsRasterRendererWidget, private Ui::QgsSingleBandGrayRendererWidgetBase
31 {
32  Q_OBJECT
33  public:
35 
36  static QgsRasterRendererWidget* create( QgsRasterLayer* layer, const QgsRectangle &theExtent ) { return new QgsSingleBandGrayRendererWidget( layer, theExtent ); }
37 
38  QgsRasterRenderer* renderer() override;
39  void setMapCanvas( QgsMapCanvas* canvas ) override;
40 
41  void setFromRenderer( const QgsRasterRenderer* r );
42 
43  QString min( int index = 0 ) override { Q_UNUSED( index ); return mMinLineEdit->text(); }
44  QString max( int index = 0 ) override { Q_UNUSED( index ); return mMaxLineEdit->text(); }
45  void setMin( const QString& value, int index = 0 ) override;
46  void setMax( const QString& value, int index = 0 ) override;
47  int selectedBand( int index = 0 ) override { Q_UNUSED( index ); return mGrayBandComboBox->currentIndex() + 1; }
48  void doComputations() override;
49  QgsRasterMinMaxWidget* minMaxWidget() override { return mMinMaxWidget; }
50 
51  public slots:
53  void loadMinMax( int theBandNo, double theMin, double theMax );
54 
55  private slots:
56  void on_mGrayBandComboBox_currentIndexChanged( int index );
57  void on_mMinLineEdit_textChanged( const QString & );
58  void on_mMaxLineEdit_textChanged( const QString & );
59 
60  private:
61  QgsRasterMinMaxWidget * mMinMaxWidget;
62  bool mDisableMinMaxWidgetRefresh;
63 
64  void minMaxModified();
65 };
66 
67 #endif // QGSSINGLEBANDGRAYRENDERERWIDGET_H
static unsigned index
A rectangle specified with double values.
Definition: qgsrectangle.h:36
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:74
virtual void setMapCanvas(QgsMapCanvas *canvas)
Sets the map canvas associated with the widget.
static QgsRasterRendererWidget * create(QgsRasterLayer *layer, const QgsRectangle &theExtent)
virtual void setMax(const QString &value, int index=0)
virtual void doComputations()
Load programmatically with current values.
QgsRasterMinMaxWidget * minMaxWidget() override
Return 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.