QGIS API Documentation 4.3.0-Master (3b7b3208a79)
Loading...
Searching...
No Matches
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
23#include "qgis.h"
24#include "qgis_gui.h"
26#include "qgsraster.h"
28#include "qgsrectangle.h"
29
30class QgsMapCanvas;
31class QgsRasterLayer;
32
38class GUI_EXPORT QgsRasterMinMaxWidget : public QWidget, private Ui::QgsRasterMinMaxWidgetBase
39{
40 Q_OBJECT
41 public:
43 QgsRasterMinMaxWidget( QgsRasterLayer *layer, QWidget *parent SIP_TRANSFERTHIS = nullptr );
44
51 void setExtent( const QgsRectangle &extent ) { mExtent = extent; }
52
60 void setMapCanvas( QgsMapCanvas *canvas );
61
66 QgsMapCanvas *mapCanvas();
67
68 void setBands( const QList<int> &bands );
69
74 QgsRectangle extent();
75
77 int sampleSize() { return cboAccuracy->currentIndex() == 0 ? 250000 : 0; }
78
80 void setFromMinMaxOrigin( const QgsRasterMinMaxOrigin & );
81
83 QgsRasterMinMaxOrigin minMaxOrigin();
84
86 void hideUpdatedExtent();
87
89 void doComputations();
90
92 void userHasSetManualMinMaxValues();
93
95 bool isCollapsed() const { return mLoadMinMaxValuesGroupBox->isCollapsed(); }
96
98 void setCollapsed( bool b ) { mLoadMinMaxValuesGroupBox->setCollapsed( b ); }
99
100 signals:
101
107
109 void load( int bandNo, double min, double max );
110
111 private slots:
112
113 void mUserDefinedRadioButton_toggled( bool );
114 void mMinMaxRadioButton_toggled( bool b )
115 {
116 if ( b )
117 {
118 onWidgetChanged();
119 }
120 }
121 void mStdDevRadioButton_toggled( bool b )
122 {
123 if ( b )
124 {
125 onWidgetChanged();
126 }
127 }
128 void mCumulativeCutRadioButton_toggled( bool b )
129 {
130 if ( b )
131 {
132 onWidgetChanged();
133 }
134 }
135 void mStatisticsExtentCombo_currentIndexChanged( int ) { onWidgetChanged(); }
136 void mCumulativeCutLowerDoubleSpinBox_valueChanged( double ) { onWidgetChanged(); }
137 void mCumulativeCutUpperDoubleSpinBox_valueChanged( double ) { onWidgetChanged(); }
138 void mStdDevSpinBox_valueChanged( double ) { onWidgetChanged(); }
139 void cboAccuracy_currentIndexChanged( int ) { onWidgetChanged(); }
140 void onWidgetChanged();
141
142 private:
143 QgsRasterLayer *mLayer = nullptr;
144 QList<int> mBands;
145 QgsRectangle mExtent;
146
147 QgsMapCanvas *mCanvas = nullptr;
148
149 bool mLastRectangleValid = false;
150 QgsRectangle mLastRectangle;
151 QgsRasterMinMaxOrigin mLastMinMaxOrigin;
152
153 bool mBandsChanged = false;
154};
155
156#endif // QGSRASTERMINMAXWIDGET_H
Map canvas is a class for displaying all GIS data types on a canvas.
Represents a raster layer.
Describes the origin of minimum and maximum values in a raster.
void setExtent(const QgsRectangle &extent)
Sets the extent to use for minimum and maximum value calculation.
QgsRectangle extent()
Returns the extent selected by the user.
QgsRasterMinMaxWidget(QgsRasterLayer *layer, QWidget *parent=nullptr)
Constructor for QgsRasterMinMaxWidget.
void setCollapsed(bool b)
Sets collapsed state of widget.
void load(int bandNo, double min, double max)
signal emitted when new min/max values are computed from statistics.
bool isCollapsed() const
Returns if the widget is collaped.
int sampleSize()
Returns the selected sample size.
void widgetChanged()
Emitted when something on the widget has changed.
A rectangle specified with double values.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:52