QGIS API Documentation  2.6.0-Brighton
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
qgssinglebandpseudocolorrendererwidget.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgssinglebandpseudocolorrendererwidget.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 QGSSINGLEBANDCOLORRENDERERWIDGET_H
19 #define QGSSINGLEBANDCOLORRENDERERWIDGET_H
20 
21 #include "qgsrasterminmaxwidget.h"
23 #include "qgscolorrampshader.h"
24 #include "ui_qgssinglebandpseudocolorrendererwidgetbase.h"
25 
27  private Ui::QgsSingleBandPseudoColorRendererWidgetBase
28 {
29  Q_OBJECT
30  public:
31  enum Mode
32  {
33  Continuous = 1, // Using breaks from color palette
34  EqualInterval = 2
35  };
36 
39 
40  static QgsRasterRendererWidget* create( QgsRasterLayer* layer, const QgsRectangle &theExtent ) { return new QgsSingleBandPseudoColorRendererWidget( layer, theExtent ); }
42 
43  void setFromRenderer( const QgsRasterRenderer* r );
44 
45  public slots:
46  void loadMinMax( int theBandNo, double theMin, double theMax, int theOrigin );
47 
48  private:
49  void populateColormapTreeWidget( const QList<QgsColorRampShader::ColorRampItem>& colorRampItems );
50 
51  private slots:
52  void on_mAddEntryButton_clicked();
53  void on_mDeleteEntryButton_clicked();
54  void on_mSortButton_clicked();
55  void on_mClassifyButton_clicked();
56  void on_mLoadFromBandButton_clicked();
57  void on_mLoadFromFileButton_clicked();
58  void on_mExportToFileButton_clicked();
59  void on_mColormapTreeWidget_itemDoubleClicked( QTreeWidgetItem* item, int column );
60  void on_mBandComboBox_currentIndexChanged( int index );
61  void on_mMinLineEdit_textChanged( const QString & text ) { Q_UNUSED( text ); resetClassifyButton(); }
62  void on_mMaxLineEdit_textChanged( const QString & text ) { Q_UNUSED( text ); resetClassifyButton(); }
63  void on_mMinLineEdit_textEdited( const QString & text ) { Q_UNUSED( text ); mMinMaxOrigin = QgsRasterRenderer::MinMaxUser; showMinMaxOrigin(); }
64  void on_mMaxLineEdit_textEdited( const QString & text ) { Q_UNUSED( text ); mMinMaxOrigin = QgsRasterRenderer::MinMaxUser; showMinMaxOrigin(); }
65  void on_mClassificationModeComboBox_currentIndexChanged( int index );
66  void on_mColorRampComboBox_currentIndexChanged( int index );
67 
68  private:
69  void setLineEditValue( QLineEdit *theLineEdit, double theValue );
70  double lineEditValue( const QLineEdit *theLineEdit ) const;
71  void resetClassifyButton();
72  void showMinMaxOrigin();
73  QgsRasterMinMaxWidget * mMinMaxWidget;
74  int mMinMaxOrigin;
75 };
76 
77 #endif // QGSSINGLEBANDCOLORRENDERERWIDGET_H