QGIS API Documentation 3.41.0-Master (af5edcb665c)
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#include "qgis.h"
23#include "qgsrectangle.h"
24
25#include "qgsraster.h"
28#include "qgis_gui.h"
29
30class QgsMapCanvas;
31class QgsRasterLayer;
32
37class GUI_EXPORT QgsRasterMinMaxWidget : public QWidget, private Ui::QgsRasterMinMaxWidgetBase
38{
39 Q_OBJECT
40 public:
42 QgsRasterMinMaxWidget( QgsRasterLayer *layer, QWidget *parent SIP_TRANSFERTHIS = nullptr );
43
50 void setExtent( const QgsRectangle &extent ) { mExtent = extent; }
51
59 void setMapCanvas( QgsMapCanvas *canvas );
60
65 QgsMapCanvas *mapCanvas();
66
67 void setBands( const QList<int> &bands );
68
73 QgsRectangle extent();
74
76 int sampleSize() { return cboAccuracy->currentIndex() == 0 ? 250000 : 0; }
77
79 void setFromMinMaxOrigin( const QgsRasterMinMaxOrigin & );
80
82 QgsRasterMinMaxOrigin minMaxOrigin();
83
85 void hideUpdatedExtent();
86
88 void doComputations();
89
91 void userHasSetManualMinMaxValues();
92
94 bool isCollapsed() const { return mLoadMinMaxValuesGroupBox->isCollapsed(); }
95
97 void setCollapsed( bool b ) { mLoadMinMaxValuesGroupBox->setCollapsed( b ); }
98
99 signals:
100
106
108 void load( int bandNo, double min, double max );
109
110 private slots:
111
112 void mUserDefinedRadioButton_toggled( bool );
113 void mMinMaxRadioButton_toggled( bool b )
114 {
115 if ( b )
116 emit widgetChanged();
117 }
118 void mStdDevRadioButton_toggled( bool b )
119 {
120 if ( b )
121 emit widgetChanged();
122 }
123 void mCumulativeCutRadioButton_toggled( bool b )
124 {
125 if ( b )
126 emit widgetChanged();
127 }
128 void mStatisticsExtentCombo_currentIndexChanged( int ) { emit widgetChanged(); }
129 void mCumulativeCutLowerDoubleSpinBox_valueChanged( double ) { emit widgetChanged(); }
130 void mCumulativeCutUpperDoubleSpinBox_valueChanged( double ) { emit widgetChanged(); }
131 void mStdDevSpinBox_valueChanged( double ) { emit widgetChanged(); }
132 void cboAccuracy_currentIndexChanged( int ) { emit widgetChanged(); }
133
134 private:
135 QgsRasterLayer *mLayer = nullptr;
136 QList<int> mBands;
137 QgsRectangle mExtent;
138
139 QgsMapCanvas *mCanvas = nullptr;
140
141 bool mLastRectangleValid;
142 QgsRectangle mLastRectangle;
143 QgsRasterMinMaxOrigin mLastMinMaxOrigin;
144
145 bool mBandsChanged;
146};
147
148#endif // QGSRASTERMINMAXWIDGET_H
Map canvas is a class for displaying all GIS data types on a canvas.
Represents a raster layer.
This class describes the origin of min/max values.
void setExtent(const QgsRectangle &extent)
Sets the extent to use for minimum and maximum value calculation.
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:53