QGIS API Documentation  2.17.0-Master (f49f7ce)
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 
30 class GUI_EXPORT QgsRasterMinMaxWidget: public QWidget, private Ui::QgsRasterMinMaxWidgetBase
31 {
32  Q_OBJECT
33  public:
34  QgsRasterMinMaxWidget( QgsRasterLayer* theLayer, QWidget *parent = nullptr );
36 
42  void setExtent( const QgsRectangle & theExtent ) { mExtent = theExtent; }
43 
51  void setMapCanvas( QgsMapCanvas* canvas );
52 
58  QgsMapCanvas* mapCanvas();
59 
60  void setBands( const QList<int> & theBands ) { mBands = theBands; }
61 
65  QgsRectangle extent();
66 
68  int sampleSize() { return cboAccuracy->currentIndex() == 0 ? 250000 : 0; }
69 
70  // Load programmaticaly with current values
71  void load() { on_mLoadPushButton_clicked(); }
72 
73  signals:
74  void load( int theBandNo, double theMin, double theMax, int origin );
75 
76  private slots:
77  void on_mLoadPushButton_clicked();
78 
79  private:
80  QgsRasterLayer* mLayer;
81  QList<int> mBands;
82  QgsRectangle mExtent;
83 
84  QgsMapCanvas* mCanvas;
85 };
86 
87 #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.