|
QGIS API Documentation
master-6164ace
|
00001 /*************************************************************************** 00002 qgssinglebandgrayrendererwidget.h 00003 --------------------------------- 00004 begin : March 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 QGSSINGLEBANDGRAYRENDERERWIDGET_H 00019 #define QGSSINGLEBANDGRAYRENDERERWIDGET_H 00020 00021 #include "qgsrasterminmaxwidget.h" 00022 #include "qgsrasterrendererwidget.h" 00023 #include "ui_qgssinglebandgrayrendererwidgetbase.h" 00024 00025 class GUI_EXPORT QgsSingleBandGrayRendererWidget: public QgsRasterRendererWidget, private Ui::QgsSingleBandGrayRendererWidgetBase 00026 { 00027 Q_OBJECT 00028 public: 00029 QgsSingleBandGrayRendererWidget( QgsRasterLayer* layer, const QgsRectangle &extent = QgsRectangle() ); 00030 ~QgsSingleBandGrayRendererWidget(); 00031 00032 static QgsRasterRendererWidget* create( QgsRasterLayer* layer, const QgsRectangle &theExtent ) { return new QgsSingleBandGrayRendererWidget( layer, theExtent ); } 00033 00034 QgsRasterRenderer* renderer(); 00035 00036 void setFromRenderer( const QgsRasterRenderer* r ); 00037 00038 QString min( int index = 0 ) { Q_UNUSED( index ); return mMinLineEdit->text(); } 00039 QString max( int index = 0 ) { Q_UNUSED( index ); return mMaxLineEdit->text(); } 00040 void setMin( QString value, int index = 0 ) { Q_UNUSED( index ); mMinLineEdit->setText( value ); } 00041 void setMax( QString value, int index = 0 ) { Q_UNUSED( index ); mMaxLineEdit->setText( value ); } 00042 int selectedBand( int index = 0 ) { Q_UNUSED( index ); return mGrayBandComboBox->currentIndex() + 1; } 00043 00044 public slots: 00045 void loadMinMax( int theBandNo, double theMin, double theMax, int theOrigin ); 00046 00047 private slots: 00048 void on_mGrayBandComboBox_currentIndexChanged( int index ); 00049 00050 private: 00051 QgsRasterMinMaxWidget * mMinMaxWidget; 00052 }; 00053 00054 #endif // QGSSINGLEBANDGRAYRENDERERWIDGET_H