QGIS API Documentation  2.2.0-Valmiera
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
25 class GUI_EXPORT QgsSingleBandGrayRendererWidget: public QgsRasterRendererWidget, private Ui::QgsSingleBandGrayRendererWidgetBase
26 {
27  Q_OBJECT
28  public:
31 
32  static QgsRasterRendererWidget* create( QgsRasterLayer* layer, const QgsRectangle &theExtent ) { return new QgsSingleBandGrayRendererWidget( layer, theExtent ); }
33 
35 
36  void setFromRenderer( const QgsRasterRenderer* r );
37 
38  QString min( int index = 0 ) { Q_UNUSED( index ); return mMinLineEdit->text(); }
39  QString max( int index = 0 ) { Q_UNUSED( index ); return mMaxLineEdit->text(); }
40  void setMin( QString value, int index = 0 ) { Q_UNUSED( index ); mMinLineEdit->setText( value ); }
41  void setMax( QString value, int index = 0 ) { Q_UNUSED( index ); mMaxLineEdit->setText( value ); }
42  int selectedBand( int index = 0 ) { Q_UNUSED( index ); return mGrayBandComboBox->currentIndex() + 1; }
43 
44  public slots:
45  void loadMinMax( int theBandNo, double theMin, double theMax, int theOrigin );
46 
47  private slots:
48  void on_mGrayBandComboBox_currentIndexChanged( int index );
49 
50  private:
52 };
53 
54 #endif // QGSSINGLEBANDGRAYRENDERERWIDGET_H