QGIS API Documentation  master-28efcda
src/gui/raster/qgsmultibandcolorrendererwidget.h
Go to the documentation of this file.
00001 /***************************************************************************
00002                          qgsmultibandcolorrendererwidget.h
00003                          ---------------------------------
00004     begin                : February 2012
00005     copyright            : (C) 2012 by Marco Hugentobler
00006     email                : marco at sourcepole dot ch
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef QGSMULTIBANDCOLORRENDERERWIDGET_H
00019 #define QGSMULTIBANDCOLORRENDERERWIDGET_H
00020 
00021 #include "qgsrasterminmaxwidget.h"
00022 #include "qgsrasterrendererwidget.h"
00023 #include "ui_qgsmultibandcolorrendererwidgetbase.h"
00024 
00025 class QgsContrastEnhancement;
00026 class QgsMultiBandColorRenderer;
00027 class QgsRasterDataProvider;
00028 class QgsRasterLayer;
00029 class QLineEdit;
00030 
00031 class GUI_EXPORT QgsMultiBandColorRendererWidget: public QgsRasterRendererWidget, private Ui::QgsMultiBandColorRendererWidgetBase
00032 {
00033     Q_OBJECT
00034 
00035   public:
00036     QgsMultiBandColorRendererWidget( QgsRasterLayer* layer, const QgsRectangle &extent = QgsRectangle() );
00037     static QgsRasterRendererWidget* create( QgsRasterLayer* layer, const QgsRectangle &theExtent ) { return new QgsMultiBandColorRendererWidget( layer, theExtent ); }
00038     ~QgsMultiBandColorRendererWidget();
00039 
00040     QgsRasterRenderer* renderer();
00041 
00042     void setFromRenderer( const QgsRasterRenderer* r );
00043 
00044     QString min( int index = 0 );
00045     QString max( int index = 0 );
00046     void setMin( QString value, int index = 0 );
00047     void setMax( QString value, int index = 0 );
00048     int selectedBand( int index = 0 );
00049 
00050   public slots:
00051     void loadMinMax( int theBandNo, double theMin, double theMax, int theOrigin );
00052 
00053   private slots:
00054     //void on_mLoadPushButton_clicked();
00055     void onBandChanged( int );
00056 
00057   private:
00058     void createValidators();
00059     void setCustomMinMaxValues( QgsMultiBandColorRenderer* r, const QgsRasterDataProvider* provider, int redBand, int GreenBand,
00060                                 int blueBand );
00062     void setMinMaxValue( const QgsContrastEnhancement* ce, QLineEdit* minEdit, QLineEdit* maxEdit );
00063     QgsRasterMinMaxWidget * mMinMaxWidget;
00064 };
00065 
00066 #endif // QGSMULTIBANDCOLORRENDERERWIDGET_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines