QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
qgsrasterlayerproperties.h
Go to the documentation of this file.
1
5/* **************************************************************************
6 qgsrasterlayerproperties.h - description
7 -------------------
8 begin : Sun Aug 11 2002
9 copyright : (C) 2002 by Tim Sutton
10 email : [email protected]
11 ***************************************************************************/
12
13/***************************************************************************
14 * *
15 * This program is free software; you can redistribute it and/or modify *
16 * it under the terms of the GNU General Public License as published by *
17 * the Free Software Foundation; either version 2 of the License, or *
18 * (at your option) any later version. *
19 * *
20 ***************************************************************************/
21#ifndef QGSRASTERLAYERPROPERTIES_H
22#define QGSRASTERLAYERPROPERTIES_H
23
25#include "ui_qgsrasterlayerpropertiesbase.h"
26#include "qgsguiutils.h"
27#include "qgis_gui.h"
28#include "qgsresamplingutils.h"
29#include "qgsrasterpipe.h"
31
32class QgsPointXY;
33class QgsMapLayer;
34class QgsMapCanvas;
35class QgsRasterLayer;
41class QgsWebView;
48class QgsWebView;
49
57class GUI_EXPORT QgsRasterLayerProperties : public QgsLayerPropertiesDialog, private Ui::QgsRasterLayerPropertiesBase, private QgsExpressionContextGenerator
58{
59 Q_OBJECT
60
61 public:
62
66#ifndef SIP_RUN
68 {
70 SLD
71 };
72 Q_ENUM( StyleType )
73#endif
74
82 QgsRasterLayerProperties( QgsMapLayer *lyr, QgsMapCanvas *canvas, QWidget *parent = nullptr, Qt::WindowFlags = QgsGuiUtils::ModalDialogFlags );
83
85
87
88 bool eventFilter( QObject *obj, QEvent *ev ) override;
89
95 Q_DECL_DEPRECATED void saveDefaultStyle() SIP_DEPRECATED;
96
97 protected slots:
98 void optionsStackedWidget_CurrentChanged( int index ) FINAL;
99 void apply() FINAL;
100 void rollback() FINAL;
101
102 private:
103
104 // TODO -- consider moving these to a common raster widget base class
105
112 void initializeDataDefinedButton( QgsPropertyOverrideButton *button, QgsRasterPipe::Property key );
113
118 void updateDataDefinedButtons();
119
124 void updateDataDefinedButton( QgsPropertyOverrideButton *button );
125
127 QgsPropertyCollection mPropertyCollection;
128
129 private slots:
130
131 void updateProperty();
132
134 void buttonBuildPyramids_clicked();
136 void mCrsSelector_crsChanged( const QgsCoordinateReferenceSystem &crs );
137
138 // Server properties
139 void addMetadataUrl();
140 void removeSelectedMetadataUrl();
141
146 void updateGammaSpinBox( int value );
147
152 void updateGammaSlider( double value );
153
154 void mRenderTypeComboBox_currentIndexChanged( int index );
156 void restoreWindowModality();
157
159 void showHelp();
160
162 void mResetColorRenderingBtn_clicked();
163
165 void toggleBuildPyramidsButton();
166
168 void toggleSaturationControls( int grayscaleMode );
169
171 void toggleColorizeControls( bool colorizeEnabled );
172
174 void transparencyCellTextEdited( const QString &text );
175
176 void aboutToShowStyleMenu();
177
179 void syncToLayer() FINAL;
180
181 // Update the preview of the map tip
182 void updateMapTipPreview();
183 // Resize the map tip preview
184 void resizeMapTip();
185
186 private:
187
188 QAction *mActionLoadMetadata = nullptr;
189 QAction *mActionSaveMetadataAs = nullptr;
190
191 QStandardItemModel *mMetadataUrlModel = nullptr;
192
194 const QString TRSTRING_NOT_SET;
195
197 QString mDefaultContrastEnhancementAlgorithm;
198
200 double mDefaultStandardDeviation;
201
203 int mDefaultRedBand;
204 int mDefaultGreenBand;
205 int mDefaultBlueBand;
206
208 bool mGrayMinimumMaximumEstimated;
209
211 bool mRGBMinimumMaximumEstimated;
212
214 QgsRasterLayer *mRasterLayer = nullptr;
215
216 QgsRasterRendererWidget *mRendererWidget = nullptr;
217 QgsMetadataWidget *mMetadataWidget = nullptr;
218
219 QgsRasterTransparencyWidget *mRasterTransparencyWidget = nullptr;
220
224 QgsRasterLayerTemporalPropertiesWidget *mTemporalWidget = nullptr;
225
226 bool rasterIsMultiBandColor();
227
231 void updateInformationContent();
232
233 void setTransparencyCell( int row, int column, double value );
234 void setTransparencyCellValue( int row, int column, double value );
235 double transparencyCellValue( int row, int column );
236 void setTransparencyToEdited( int row );
237 void adjustTransparencyCellWidth( int row, int column );
238
239 void setRendererWidget( const QString &rendererName );
240
244 void updateRasterAttributeTableOptionsPage();
245
246 //TODO: we should move these gradient generators somewhere more generic
247 //so they can be used generically throughout the app
248 QLinearGradient greenGradient();
249 QLinearGradient redGradient();
250 QLinearGradient blueGradient();
251 QLinearGradient grayGradient();
252 QLinearGradient highlightGradient();
253 qreal mGradientHeight;
254 qreal mGradientWidth;
255
256 QgsRasterHistogramWidget *mHistogramWidget = nullptr;
257
258 QVector<bool> mTransparencyToEdited;
259
260 bool mDisableRenderTypeComboBoxCurrentIndexChanged = false;
261
262 bool mMetadataFilled;
263
265 void sync();
266
267 QgsResamplingUtils mResamplingUtils;
268
269 QgsProviderSourceWidget *mSourceWidget = nullptr;
270
271 QgsWebView *mMetadataViewer = nullptr;
272
273 QgsExpressionContext mContext;
274
275 friend class QgsAppScreenShots;
276
278
279 QgsRasterAttributeTableWidget *mRasterAttributeTableWidget = nullptr;
280
281 void initMapTipPreview();
282
283 QgsWebView *mMapTipPreview = nullptr;
284};
285#endif
This class represents a coordinate reference system (CRS).
Abstract interface for generating an expression context.
virtual QgsExpressionContext createExpressionContext() const =0
This method needs to be reimplemented in all classes which implement this interface and return an exp...
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Base class for "layer properties" dialogs, containing common utilities for handling functionality in ...
void saveDefaultStyle()
Saves the default style when appropriate button is pressed.
virtual void addPropertiesPageFactory(const QgsMapLayerConfigWidgetFactory *factory)
Adds properties page from a factory.
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:93
Factory class for creating custom map layer property pages.
A panel widget that can be shown in the map style dock.
Base class for all map layer types.
Definition: qgsmaplayer.h:75
A wizard to edit metadata on a map layer.
A class to represent a 2D point.
Definition: qgspointxy.h:60
A grouped map of multiple QgsProperty objects, each referenced by a integer key value.
A button for controlling property overrides which may apply to a widget.
Base class for widgets which allow customization of a provider's source URI.
The QgsRasterAttributeTableWidget class provides an attribute table for rasters and methods to edit t...
Property sheet for a raster map layer.
A widget for configuring the temporal properties for a raster layer.
Represents a raster layer.
Contains a pipeline of raster interfaces for sequential raster processing.
Definition: qgsrasterpipe.h:50
Abstract base class for widgets which configure a QgsRasterRenderer.
Raster renderer pipe that applies colors to a raster.
Widget to control a layers transparency and related options.
The QgsWebView class is a collection of stubs to mimic the API of QWebView on systems where the real ...
Definition: qgswebview.h:66
#define SIP_DEPRECATED
Definition: qgis_sip.h:106
#define FINAL
Definition: qgis_sip.h:242
const QgsCoordinateReferenceSystem & crs