QGIS API Documentation  2.99.0-Master (37c43df)
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 
25 
29 class GUI_EXPORT QgsSingleBandGrayRendererWidget: public QgsRasterRendererWidget, private Ui::QgsSingleBandGrayRendererWidgetBase
30 {
31  Q_OBJECT
32  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 { Q_UNUSED( index ); mMinLineEdit->setText( value ); }
46  void setMax( const QString& value, int index = 0 ) override { Q_UNUSED( index ); mMaxLineEdit->setText( value ); }
47  int selectedBand( int index = 0 ) override { Q_UNUSED( index ); return mGrayBandComboBox->currentIndex() + 1; }
48 
49  public slots:
50  void loadMinMax( int theBandNo, double theMin, double theMax, int theOrigin );
51 
52  private slots:
53  void on_mGrayBandComboBox_currentIndexChanged( int index );
54 
55  private:
56  QgsRasterMinMaxWidget * mMinMaxWidget;
57 };
58 
59 #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:106
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.