QGIS API Documentation  2.6.0-Brighton
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
qgsmultibandcolorrendererwidget.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsmultibandcolorrendererwidget.h
3  ---------------------------------
4  begin : February 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 QGSMULTIBANDCOLORRENDERERWIDGET_H
19 #define QGSMULTIBANDCOLORRENDERERWIDGET_H
20 
21 #include "qgsrasterminmaxwidget.h"
23 #include "ui_qgsmultibandcolorrendererwidgetbase.h"
24 
28 class QgsRasterLayer;
29 class QLineEdit;
30 
31 class GUI_EXPORT QgsMultiBandColorRendererWidget: public QgsRasterRendererWidget, private Ui::QgsMultiBandColorRendererWidgetBase
32 {
33  Q_OBJECT
34 
35  public:
37  static QgsRasterRendererWidget* create( QgsRasterLayer* layer, const QgsRectangle &theExtent ) { return new QgsMultiBandColorRendererWidget( layer, theExtent ); }
39 
41 
42  void setFromRenderer( const QgsRasterRenderer* r );
43 
44  QString min( int index = 0 );
45  QString max( int index = 0 );
46  void setMin( QString value, int index = 0 );
47  void setMax( QString value, int index = 0 );
48  int selectedBand( int index = 0 );
49 
50  public slots:
51  void loadMinMax( int theBandNo, double theMin, double theMax, int theOrigin );
52 
53  private slots:
54  //void on_mLoadPushButton_clicked();
55  void onBandChanged( int );
56 
57  private:
58  void createValidators();
59  void setCustomMinMaxValues( QgsMultiBandColorRenderer* r, const QgsRasterDataProvider* provider, int redBand, int GreenBand,
60  int blueBand );
62  void setMinMaxValue( const QgsContrastEnhancement* ce, QLineEdit* minEdit, QLineEdit* maxEdit );
63  QgsRasterMinMaxWidget * mMinMaxWidget;
64 };
65 
66 #endif // QGSMULTIBANDCOLORRENDERERWIDGET_H