QGIS API Documentation  2.15.0-Master (5f66276)
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 QgsMapCanvas;
26 
27 class GUI_EXPORT QgsRasterMinMaxWidget: public QWidget, private Ui::QgsRasterMinMaxWidgetBase
28 {
29  Q_OBJECT
30  public:
31  QgsRasterMinMaxWidget( QgsRasterLayer* theLayer, QWidget *parent = nullptr );
33 
39  void setExtent( const QgsRectangle & theExtent ) { mExtent = theExtent; }
40 
48  void setMapCanvas( QgsMapCanvas* canvas );
49 
55  QgsMapCanvas* mapCanvas();
56 
57  void setBands( const QList<int> & theBands ) { mBands = theBands; }
58 
62  QgsRectangle extent();
63 
65  int sampleSize() { return mEstimateRadioButton->isChecked() ? 250000 : 0; }
66 
67  // Load programmaticaly with current values
68  void load() { on_mLoadPushButton_clicked(); }
69 
70  signals:
71  void load( int theBandNo, double theMin, double theMax, int origin );
72 
73  private slots:
74  void on_mLoadPushButton_clicked();
75 
76  private:
77  QgsRasterLayer* mLayer;
78  QList<int> mBands;
79  QgsRectangle mExtent;
80 
81  QgsMapCanvas* mCanvas;
82  QgsRasterLayer* mRasterLayer;
83 };
84 
85 #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)
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:109
void setExtent(const QgsRectangle &theExtent)
Sets the extent to use for minimum and maximum value calculation.
int sampleSize()
Return the selected sample size.