QGIS API Documentation 3.41.0-Master (af5edcb665c)
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;
50
58class GUI_EXPORT QgsRasterLayerProperties : public QgsLayerPropertiesDialog, private Ui::QgsRasterLayerPropertiesBase, private QgsExpressionContextGenerator
59{
60 Q_OBJECT
61
62 public:
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 // TODO -- consider moving these to a common raster widget base class
104
111 void initializeDataDefinedButton( QgsPropertyOverrideButton *button, QgsRasterPipe::Property key );
112
117 void updateDataDefinedButtons();
118
123 void updateDataDefinedButton( QgsPropertyOverrideButton *button );
124
126 QgsPropertyCollection mPropertyCollection;
127
128 private slots:
129
130 void updateProperty();
131
133 void buttonBuildPyramids_clicked();
135 void mCrsSelector_crsChanged( const QgsCoordinateReferenceSystem &crs );
136
137 // Server properties
138 void addMetadataUrl();
139 void removeSelectedMetadataUrl();
140
145 void updateGammaSpinBox( int value );
146
151 void updateGammaSlider( double value );
152
153 void mRenderTypeComboBox_currentIndexChanged( int index );
155 void restoreWindowModality();
156
158 void showHelp();
159
161 void mResetColorRenderingBtn_clicked();
162
164 void toggleBuildPyramidsButton();
165
167 void toggleSaturationControls( int grayscaleMode );
168
170 void toggleColorizeControls( bool colorizeEnabled );
171
172 void aboutToShowStyleMenu();
173
175 void syncToLayer() FINAL;
176
177 // Update the preview of the map tip
178 void updateMapTipPreview();
179 // Resize the map tip preview
180 void resizeMapTip();
181
182 private:
183 QAction *mActionLoadMetadata = nullptr;
184 QAction *mActionSaveMetadataAs = nullptr;
185
186 QStandardItemModel *mMetadataUrlModel = nullptr;
187
189 const QString TRSTRING_NOT_SET;
190
192 QString mDefaultContrastEnhancementAlgorithm;
193
195 double mDefaultStandardDeviation;
196
198 int mDefaultRedBand;
199 int mDefaultGreenBand;
200 int mDefaultBlueBand;
201
203 bool mGrayMinimumMaximumEstimated;
204
206 bool mRGBMinimumMaximumEstimated;
207
209 QgsRasterLayer *mRasterLayer = nullptr;
210
211 QgsRasterRendererWidget *mRendererWidget = nullptr;
212 QgsMetadataWidget *mMetadataWidget = nullptr;
213
214 QgsRasterTransparencyWidget *mRasterTransparencyWidget = nullptr;
215
216 QgsRasterLabelingWidget *mLabelingWidget = 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.
Master widget for configuration of labeling of a raster layer.
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