QGIS API Documentation  2.17.0-Master (8784312)
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 
21 #include "qgsrasterminmaxwidget.h"
23 #include "ui_qgssinglebandgrayrendererwidgetbase.h"
24 
28 class GUI_EXPORT QgsSingleBandGrayRendererWidget: public QgsRasterRendererWidget, private Ui::QgsSingleBandGrayRendererWidgetBase
29 {
30  Q_OBJECT
31  public:
34 
35  static QgsRasterRendererWidget* create( QgsRasterLayer* layer, const QgsRectangle &theExtent ) { return new QgsSingleBandGrayRendererWidget( layer, theExtent ); }
36 
37  QgsRasterRenderer* renderer() override;
38  void setMapCanvas( QgsMapCanvas* canvas ) override;
39 
40  void setFromRenderer( const QgsRasterRenderer* r );
41 
42  QString min( int index = 0 ) override { Q_UNUSED( index ); return mMinLineEdit->text(); }
43  QString max( int index = 0 ) override { Q_UNUSED( index ); return mMaxLineEdit->text(); }
44  void setMin( const QString& value, int index = 0 ) override { Q_UNUSED( index ); mMinLineEdit->setText( value ); }
45  void setMax( const QString& value, int index = 0 ) override { Q_UNUSED( index ); mMaxLineEdit->setText( value ); }
46  int selectedBand( int index = 0 ) override { Q_UNUSED( index ); return mGrayBandComboBox->currentIndex() + 1; }
47 
48  public slots:
49  void loadMinMax( int theBandNo, double theMin, double theMax, int theOrigin );
50 
51  private slots:
52  void on_mGrayBandComboBox_currentIndexChanged( int index );
53 
54  private:
55  QgsRasterMinMaxWidget * mMinMaxWidget;
56 };
57 
58 #endif // QGSSINGLEBANDGRAYRENDERERWIDGET_H
static unsigned index
A rectangle specified with double values.
Definition: qgsrectangle.h:35
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:109
virtual void setMapCanvas(QgsMapCanvas *canvas)
Sets the map canvas associated with the widget.
static QgsRasterRendererWidget * create(QgsRasterLayer *layer, const QgsRectangle &theExtent)
void setMax(const QString &value, int index=0) override
void setMin(const QString &value, int index=0) override
virtual QgsRasterRenderer * renderer()=0
Raster renderer pipe that applies colors to a raster.