QGIS API Documentation 3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
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;
47class QgsRasterAttributeTableWidget;
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
173 void aboutToShowStyleMenu();
174
176 void syncToLayer() FINAL;
177
178 // Update the preview of the map tip
179 void updateMapTipPreview();
180 // Resize the map tip preview
181 void resizeMapTip();
182
183 private:
184
185 QAction *mActionLoadMetadata = nullptr;
186 QAction *mActionSaveMetadataAs = nullptr;
187
188 QStandardItemModel *mMetadataUrlModel = nullptr;
189
191 const QString TRSTRING_NOT_SET;
192
194 QString mDefaultContrastEnhancementAlgorithm;
195
197 double mDefaultStandardDeviation;
198
200 int mDefaultRedBand;
201 int mDefaultGreenBand;
202 int mDefaultBlueBand;
203
205 bool mGrayMinimumMaximumEstimated;
206
208 bool mRGBMinimumMaximumEstimated;
209
211 QgsRasterLayer *mRasterLayer = nullptr;
212
213 QgsRasterRendererWidget *mRendererWidget = nullptr;
214 QgsMetadataWidget *mMetadataWidget = nullptr;
215
216 QgsRasterTransparencyWidget *mRasterTransparencyWidget = nullptr;
217
221 QgsRasterLayerTemporalPropertiesWidget *mTemporalWidget = nullptr;
222
223 bool rasterIsMultiBandColor();
224
228 void updateInformationContent();
229
230 void setRendererWidget( const QString &rendererName );
231
235 void updateRasterAttributeTableOptionsPage();
236
237 //TODO: we should move these gradient generators somewhere more generic
238 //so they can be used generically throughout the app
239 QLinearGradient greenGradient();
240 QLinearGradient redGradient();
241 QLinearGradient blueGradient();
242 QLinearGradient grayGradient();
243 QLinearGradient highlightGradient();
244 qreal mGradientHeight;
245 qreal mGradientWidth;
246
247 QgsRasterHistogramWidget *mHistogramWidget = nullptr;
248
249 bool mDisableRenderTypeComboBoxCurrentIndexChanged = false;
250
251 bool mMetadataFilled;
252
254 void sync();
255
256 QgsResamplingUtils mResamplingUtils;
257
258 QgsProviderSourceWidget *mSourceWidget = nullptr;
259
260 QgsWebView *mMetadataViewer = nullptr;
261
262 QgsExpressionContext mContext;
263
264 friend class QgsAppScreenShots;
265
267
268 QgsRasterAttributeTableWidget *mRasterAttributeTableWidget = nullptr;
269
270 void initMapTipPreview();
271
272 QgsWebView *mMapTipPreview = nullptr;
273};
274#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.
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:76
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.
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.
Contains a pipeline of raster interfaces for sequential raster processing.
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