QGIS API Documentation  2.15.0-Master (972fc9f)
qgsrasterminmaxwidget.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsrasterminmaxwidget.h
3  ---------------------------------
4  begin : July 2012
5  copyright : (C) 2012 by Radim Blazek
6  email : radim dot blazek at gmail dot com
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 QGSRASTERMINMAXWIDGET_H
19 #define QGSRASTERMINMAXWIDGET_H
20 
21 #include "ui_qgsrasterminmaxwidgetbase.h"
22 #include "qgsrasterlayer.h"
23 #include "qgsrectangle.h"
24 
25 class GUI_EXPORT QgsRasterMinMaxWidget: public QWidget, private Ui::QgsRasterMinMaxWidgetBase
26 {
27  Q_OBJECT
28  public:
29  QgsRasterMinMaxWidget( QgsRasterLayer* theLayer, QWidget *parent = nullptr );
31 
32  void setExtent( const QgsRectangle & theExtent ) { mExtent = theExtent; }
33 
34  void setBands( const QList<int> & theBands ) { mBands = theBands; }
37  QgsRectangle extent() { return mCurrentExtentRadioButton->isChecked() ? mExtent : QgsRectangle(); }
39  int sampleSize() { return mEstimateRadioButton->isChecked() ? 250000 : 0; }
40 
41  // Load programmaticaly with current values
42  void load() { on_mLoadPushButton_clicked(); }
43 
44  signals:
45  void load( int theBandNo, double theMin, double theMax, int origin );
46 
47  private slots:
48  void on_mLoadPushButton_clicked();
49 
50  private:
51  QgsRasterLayer* mLayer;
52  QList<int> mBands;
53  QgsRectangle mExtent;
54 };
55 
56 #endif // QGSRASTERMINMAXWIDGET_H
A rectangle specified with double values.
Definition: qgsrectangle.h:35
This class provides qgis with the ability to render raster datasets onto the mapcanvas.
void setBands(const QList< int > &theBands)
void setExtent(const QgsRectangle &theExtent)
int sampleSize()
Return the selected sample size.
QgsRectangle extent()
Return the extent selected by the user.