QGIS API Documentation 3.43.0-Master (3ee7834ace6)
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 : tim@linfiniti.com
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
141 void updateGammaSpinBox( int value );
142
147 void updateGammaSlider( double value );
148
149 void mRenderTypeComboBox_currentIndexChanged( int index );
151 void restoreWindowModality();
152
154 void showHelp();
155
157 void mResetColorRenderingBtn_clicked();
158
160 void toggleBuildPyramidsButton();
161
163 void toggleSaturationControls( int grayscaleMode );
164
166 void toggleColorizeControls( bool colorizeEnabled );
167
168 void aboutToShowStyleMenu();
169
171 void syncToLayer() FINAL;
172
173 // Update the preview of the map tip
174 void updateMapTipPreview();
175 // Resize the map tip preview
176 void resizeMapTip();
177
178 private:
179 QAction *mActionLoadMetadata = nullptr;
180 QAction *mActionSaveMetadataAs = nullptr;
181
183 const QString TRSTRING_NOT_SET;
184
186 QString mDefaultContrastEnhancementAlgorithm;
187
189 double mDefaultStandardDeviation;
190
192 int mDefaultRedBand;
193 int mDefaultGreenBand;
194 int mDefaultBlueBand;
195
197 bool mGrayMinimumMaximumEstimated;
198
200 bool mRGBMinimumMaximumEstimated;
201
203 QgsRasterLayer *mRasterLayer = nullptr;
204
205 QgsRasterRendererWidget *mRendererWidget = nullptr;
206 QgsMetadataWidget *mMetadataWidget = nullptr;
207
208 QgsRasterTransparencyWidget *mRasterTransparencyWidget = nullptr;
209
210 QgsRasterLabelingWidget *mLabelingWidget = nullptr;
211
215 QgsRasterLayerTemporalPropertiesWidget *mTemporalWidget = nullptr;
216
217 bool rasterIsMultiBandColor();
218
222 void updateInformationContent();
223
224 void setRendererWidget( const QString &rendererName );
225
229 void updateRasterAttributeTableOptionsPage();
230
231 //TODO: we should move these gradient generators somewhere more generic
232 //so they can be used generically throughout the app
233 QLinearGradient greenGradient();
234 QLinearGradient redGradient();
235 QLinearGradient blueGradient();
236 QLinearGradient grayGradient();
237 QLinearGradient highlightGradient();
238 qreal mGradientHeight;
239 qreal mGradientWidth;
240
241 QgsRasterHistogramWidget *mHistogramWidget = nullptr;
242
243 bool mDisableRenderTypeComboBoxCurrentIndexChanged = false;
244
245 bool mMetadataFilled;
246
248 void sync();
249
250 QgsResamplingUtils mResamplingUtils;
251
252 QgsProviderSourceWidget *mSourceWidget = nullptr;
253
254 QgsWebView *mMetadataViewer = nullptr;
255
256 QgsExpressionContext mContext;
257
258 friend class QgsAppScreenShots;
259
261
262 QgsRasterAttributeTableWidget *mRasterAttributeTableWidget = nullptr;
263
264 void initMapTipPreview();
265
266 QgsWebView *mMapTipPreview = nullptr;
267};
268#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