QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
qgssinglebandpseudocolorrendererwidget.h
Go to the documentation of this file.
1/***************************************************************************
2 qgssinglebandpseudocolorrendererwidget.h
3 ----------------------------------------
4 begin : February 2012
5 copyright : (C) 2012 by Marco Hugentobler
6 email : marco at sourcepole dot ch
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 QGSSINGLEBANDCOLORRENDERERWIDGET_H
19#define QGSSINGLEBANDCOLORRENDERERWIDGET_H
20
21#include "ui_qgssinglebandpseudocolorrendererwidgetbase.h"
22
23#include "qgis_gui.h"
24#include "qgis_sip.h"
25#include "qgscolorrampshader.h"
26#include "qgsrasterrenderer.h"
28
30
39class GUI_EXPORT QgsSingleBandPseudoColorRendererWidget : public QgsRasterRendererWidget, private Ui::QgsSingleBandPseudoColorRendererWidgetBase
40{
41 Q_OBJECT
42
43 public:
50
52 static QgsRasterRendererWidget *create( QgsRasterLayer *layer, const QgsRectangle &extent ) SIP_FACTORY { return new QgsSingleBandPseudoColorRendererWidget( layer, extent ); }
53
55 void setMapCanvas( QgsMapCanvas *canvas ) override;
56 void doComputations() override;
57 QgsRasterMinMaxWidget *minMaxWidget() override;
58
62 void setFromRenderer( const QgsRasterRenderer *r );
63
64 QString min( int index = 0 ) override
65 {
66 Q_UNUSED( index )
67 return mMinLineEdit->text();
68 }
69 QString max( int index = 0 ) override
70 {
71 Q_UNUSED( index )
72 return mMaxLineEdit->text();
73 }
74 void setMin( const QString &value, int index = 0 ) override;
75 void setMax( const QString &value, int index = 0 ) override;
76 int selectedBand( int index = 0 ) override
77 {
78 Q_UNUSED( index )
79 return mBandComboBox->currentBand();
80 }
81
82 public slots:
84 void loadMinMax( int bandNo, double min, double max );
86 void loadMinMaxFromTree( double min, double max );
87
88 private slots:
89 void bandChanged();
90 void mMinLineEdit_textChanged( const QString & );
91 void mMaxLineEdit_textChanged( const QString & );
92 void mMinLineEdit_textEdited( const QString &text );
93 void mMaxLineEdit_textEdited( const QString &text );
94
95 private:
96 void setLineEditValue( QLineEdit *lineEdit, double value );
97 double lineEditValue( const QLineEdit *lineEdit ) const;
98
99 QgsRasterMinMaxWidget *mMinMaxWidget = nullptr;
100 int mMinMaxOrigin = 0;
101
102 void minMaxModified();
103
104 // Convert min/max to localized display value with maximum precision for the current data type
105 QString displayValueWithMaxPrecision( const double value );
106
108};
109
110#endif // QGSSINGLEBANDCOLORRENDERERWIDGET_H
Map canvas is a class for displaying all GIS data types on a canvas.
Represents a raster layer.
A widget for configuring how the minimum and maximum value of a raster layer is determined.
virtual void setMax(const QString &value, int index=0)
virtual void setMin(const QString &value, int index=0)
QgsRasterRendererWidget(QgsRasterLayer *layer, const QgsRectangle &extent)
Constructor for QgsRasterRendererWidget.
virtual QgsRasterRenderer * renderer()=0
Creates a new renderer, using the properties defined in the widget.
Raster renderer pipe that applies colors to a raster.
A rectangle specified with double values.
static QgsRasterRendererWidget * create(QgsRasterLayer *layer, const QgsRectangle &extent)
Creates new raster renderer widget.
QgsSingleBandPseudoColorRendererWidget(QgsRasterLayer *layer, const QgsRectangle &extent=QgsRectangle())
Constructor for QgsSingleBandPseudoColorRendererWidget.
#define SIP_FACTORY
Definition qgis_sip.h:84