QGIS API Documentation 3.32.0-Lima (311a8cb8a6)
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 "qgshelp.h"
29#include "qgsmaptoolemitpoint.h"
30#include "qgis_gui.h"
31#include "qgsresamplingutils.h"
32#include "qgsrasterpipe.h"
34
35class QgsPointXY;
36class QgsMapLayer;
37class QgsMapCanvas;
38class QgsRasterLayer;
44class QgsWebView;
51class QgsWebView;
52
53
61class GUI_EXPORT QgsRasterLayerProperties : public QgsOptionsDialogBase, private Ui::QgsRasterLayerPropertiesBase, private QgsExpressionContextGenerator
62{
63 Q_OBJECT
64
65 public:
66
70#ifndef SIP_RUN
72 {
74 SLD
75 };
76 Q_ENUM( StyleType )
77#endif
78
86 QgsRasterLayerProperties( QgsMapLayer *lyr, QgsMapCanvas *canvas, QWidget *parent = nullptr, Qt::WindowFlags = QgsGuiUtils::ModalDialogFlags );
87
92 void addPropertiesPageFactory( const QgsMapLayerConfigWidgetFactory *factory );
93
95
96 bool eventFilter( QObject *obj, QEvent *ev ) override;
97
103 void loadDefaultStyle();
104
110 void saveDefaultStyle();
111
117 void loadStyle();
118
124 void saveStyleAs();
125
126 protected slots:
128 void optionsStackedWidget_CurrentChanged( int index ) override SIP_SKIP ;
129
130 private:
131
132 // TODO -- consider moving these to a common raster widget base class
133
140 void initializeDataDefinedButton( QgsPropertyOverrideButton *button, QgsRasterPipe::Property key );
141
146 void updateDataDefinedButtons();
147
152 void updateDataDefinedButton( QgsPropertyOverrideButton *button );
153
155 QgsPropertyCollection mPropertyCollection;
156
157 private slots:
158
159 void updateProperty();
160
162 void apply();
164 void onCancel();
166 void buttonBuildPyramids_clicked();
168 void mCrsSelector_crsChanged( const QgsCoordinateReferenceSystem &crs );
169
170 // Server properties
171 void addMetadataUrl();
172 void removeSelectedMetadataUrl();
173
178 void updateGammaSpinBox( int value );
179
184 void updateGammaSlider( double value );
185
186 void mRenderTypeComboBox_currentIndexChanged( int index );
188 void restoreWindowModality();
189
191 void loadMetadata();
193 void saveMetadataAs();
195 void saveDefaultMetadata();
197 void loadDefaultMetadata();
198
200 void showHelp();
201
203 void mResetColorRenderingBtn_clicked();
204
206 void toggleBuildPyramidsButton();
207
209 void toggleSaturationControls( int grayscaleMode );
210
212 void toggleColorizeControls( bool colorizeEnabled );
213
215 void transparencyCellTextEdited( const QString &text );
216
217 void aboutToShowStyleMenu();
218
220 void syncToLayer();
221
222 void urlClicked( const QUrl &url );
223
224 // Update the preview of the map tip
225 void updateMapTipPreview();
226 // Resize the map tip preview
227 void resizeMapTip();
228
229 private:
230 QPushButton *mBtnStyle = nullptr;
231 QPushButton *mBtnMetadata = nullptr;
232 QAction *mActionLoadMetadata = nullptr;
233 QAction *mActionSaveMetadataAs = nullptr;
234
235 QStandardItemModel *mMetadataUrlModel = nullptr;
236
238 QList<QgsMapLayerConfigWidget *> mLayerPropertiesPages;
239
241 const QString TRSTRING_NOT_SET;
242
244 QString mDefaultContrastEnhancementAlgorithm;
245
247 double mDefaultStandardDeviation;
248
250 int mDefaultRedBand;
251 int mDefaultGreenBand;
252 int mDefaultBlueBand;
253
255 bool mGrayMinimumMaximumEstimated;
256
258 bool mRGBMinimumMaximumEstimated;
259
261 QgsRasterLayer *mRasterLayer = nullptr;
262
263 QgsRasterRendererWidget *mRendererWidget = nullptr;
264 QgsMetadataWidget *mMetadataWidget = nullptr;
265
266 QgsRasterTransparencyWidget *mRasterTransparencyWidget = nullptr;
267
271 QgsRasterLayerTemporalPropertiesWidget *mTemporalWidget = nullptr;
272
273 bool rasterIsMultiBandColor();
274
278 void updateInformationContent();
279
280 void setTransparencyCell( int row, int column, double value );
281 void setTransparencyCellValue( int row, int column, double value );
282 double transparencyCellValue( int row, int column );
283 void setTransparencyToEdited( int row );
284 void adjustTransparencyCellWidth( int row, int column );
285
286 void setRendererWidget( const QString &rendererName );
287
291 void updateRasterAttributeTableOptionsPage();
292
293 //TODO: we should move these gradient generators somewhere more generic
294 //so they can be used generically throughout the app
295 QLinearGradient greenGradient();
296 QLinearGradient redGradient();
297 QLinearGradient blueGradient();
298 QLinearGradient grayGradient();
299 QLinearGradient highlightGradient();
300 qreal mGradientHeight;
301 qreal mGradientWidth;
302
303 QgsMapCanvas *mMapCanvas = nullptr;
304
305 QgsRasterHistogramWidget *mHistogramWidget = nullptr;
306
307 QVector<bool> mTransparencyToEdited;
308
313 QgsMapLayerStyle mOldStyle;
314
315 bool mDisableRenderTypeComboBoxCurrentIndexChanged = false;
316
317 bool mMetadataFilled;
318
320 void sync();
321
322 QgsResamplingUtils mResamplingUtils;
323
324 QgsProviderSourceWidget *mSourceWidget = nullptr;
325
326 QgsWebView *mMetadataViewer = nullptr;
327
328 QgsExpressionContext mContext;
329
330 friend class QgsAppScreenShots;
331
333
334 QgsRasterAttributeTableWidget *mRasterAttributeTableWidget = nullptr;
335
336 void initMapTipPreview();
337
338 QgsWebView *mMapTipPreview = nullptr;
339};
340#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...
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:90
Factory class for creating custom map layer property pages.
A panel widget that can be shown in the map style dock.
Stores style information (renderer, opacity, labeling, diagrams etc.) applicable to a map layer.
Base class for all map layer types.
Definition: qgsmaplayer.h:73
A wizard to edit metadata on a map layer.
A base dialog for options and properties dialogs that offers vertical tabs.
virtual void optionsStackedWidget_CurrentChanged(int index)
Select relevant tab on current page change.
A class to represent a 2D point.
Definition: qgspointxy.h:59
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.
StyleType
enumeration for the different types of style
A widget for configuring the temporal properties for a raster layer.
Represents a raster layer.
Property
Data definable properties.
Definition: qgsrasterpipe.h:58
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_SKIP
Definition: qgis_sip.h:126
const QgsCoordinateReferenceSystem & crs