QGIS API Documentation 3.41.0-Master (cea29feecf2)
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:
65#ifndef SIP_RUN
67 {
69 SLD
70 };
71 Q_ENUM( StyleType )
72#endif
73
81 QgsRasterLayerProperties( QgsMapLayer *lyr, QgsMapCanvas *canvas, QWidget *parent = nullptr, Qt::WindowFlags = QgsGuiUtils::ModalDialogFlags );
82
84
86
87 bool eventFilter( QObject *obj, QEvent *ev ) override;
88
94 Q_DECL_DEPRECATED void saveDefaultStyle() SIP_DEPRECATED;
95
96 protected slots:
97 void optionsStackedWidget_CurrentChanged( int index ) FINAL;
98 void apply() FINAL;
99 void rollback() FINAL;
100
101 private:
102 // TODO -- consider moving these to a common raster widget base class
103
110 void initializeDataDefinedButton( QgsPropertyOverrideButton *button, QgsRasterPipe::Property key );
111
116 void updateDataDefinedButtons();
117
122 void updateDataDefinedButton( QgsPropertyOverrideButton *button );
123
125 QgsPropertyCollection mPropertyCollection;
126
127 private slots:
128
129 void updateProperty();
130
132 void buttonBuildPyramids_clicked();
134 void mCrsSelector_crsChanged( const QgsCoordinateReferenceSystem &crs );
135
136 // Server properties
137 void addMetadataUrl();
138 void removeSelectedMetadataUrl();
139
144 void updateGammaSpinBox( int value );
145
150 void updateGammaSlider( double value );
151
152 void mRenderTypeComboBox_currentIndexChanged( int index );
154 void restoreWindowModality();
155
157 void showHelp();
158
160 void mResetColorRenderingBtn_clicked();
161
163 void toggleBuildPyramidsButton();
164
166 void toggleSaturationControls( int grayscaleMode );
167
169 void toggleColorizeControls( bool colorizeEnabled );
170
171 void aboutToShowStyleMenu();
172
174 void syncToLayer() FINAL;
175
176 // Update the preview of the map tip
177 void updateMapTipPreview();
178 // Resize the map tip preview
179 void resizeMapTip();
180
181 private:
182 QAction *mActionLoadMetadata = nullptr;
183 QAction *mActionSaveMetadataAs = nullptr;
184
185 QStandardItemModel *mMetadataUrlModel = nullptr;
186
188 const QString TRSTRING_NOT_SET;
189
191 QString mDefaultContrastEnhancementAlgorithm;
192
194 double mDefaultStandardDeviation;
195
197 int mDefaultRedBand;
198 int mDefaultGreenBand;
199 int mDefaultBlueBand;
200
202 bool mGrayMinimumMaximumEstimated;
203
205 bool mRGBMinimumMaximumEstimated;
206
208 QgsRasterLayer *mRasterLayer = nullptr;
209
210 QgsRasterRendererWidget *mRendererWidget = nullptr;
211 QgsMetadataWidget *mMetadataWidget = nullptr;
212
213 QgsRasterTransparencyWidget *mRasterTransparencyWidget = nullptr;
214
218 QgsRasterLayerTemporalPropertiesWidget *mTemporalWidget = nullptr;
219
220 bool rasterIsMultiBandColor();
221
225 void updateInformationContent();
226
227 void setRendererWidget( const QString &rendererName );
228
232 void updateRasterAttributeTableOptionsPage();
233
234 //TODO: we should move these gradient generators somewhere more generic
235 //so they can be used generically throughout the app
236 QLinearGradient greenGradient();
237 QLinearGradient redGradient();
238 QLinearGradient blueGradient();
239 QLinearGradient grayGradient();
240 QLinearGradient highlightGradient();
241 qreal mGradientHeight;
242 qreal mGradientWidth;
243
244 QgsRasterHistogramWidget *mHistogramWidget = nullptr;
245
246 bool mDisableRenderTypeComboBoxCurrentIndexChanged = false;
247
248 bool mMetadataFilled;
249
251 void sync();
252
253 QgsResamplingUtils mResamplingUtils;
254
255 QgsProviderSourceWidget *mSourceWidget = nullptr;
256
257 QgsWebView *mMetadataViewer = nullptr;
258
259 QgsExpressionContext mContext;
260
261 friend class QgsAppScreenShots;
262
264
265 QgsRasterAttributeTableWidget *mRasterAttributeTableWidget = nullptr;
266
267 void initMapTipPreview();
268
269 QgsWebView *mMapTipPreview = nullptr;
270};
271#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