QGIS API Documentation 3.43.0-Master (b60ef06885e)
qgsrasterlayerproperties.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsrasterlayerproperties.h - description
3 -------------------
4 begin : Sun Aug 11 2002
5 copyright : (C) 2002 by Tim Sutton
6 email : tim@linfiniti.com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17#ifndef QGSRASTERLAYERPROPERTIES_H
18#define QGSRASTERLAYERPROPERTIES_H
19
21#include "ui_qgsrasterlayerpropertiesbase.h"
22#include "qgsguiutils.h"
23#include "qgis_gui.h"
24#include "qgsresamplingutils.h"
25#include "qgsrasterpipe.h"
27
28class QgsPointXY;
29class QgsMapLayer;
30class QgsMapCanvas;
31class QgsRasterLayer;
37class QgsWebView;
43class QgsRasterAttributeTableWidget;
44class QgsWebView;
46
53class GUI_EXPORT QgsRasterLayerProperties : public QgsLayerPropertiesDialog, private Ui::QgsRasterLayerPropertiesBase, private QgsExpressionContextGenerator
54{
55 Q_OBJECT
56
57 public:
61#ifndef SIP_RUN
63 {
65 SLD
66 };
67 Q_ENUM( StyleType )
68#endif
69
77 QgsRasterLayerProperties( QgsMapLayer *lyr, QgsMapCanvas *canvas, QWidget *parent = nullptr, Qt::WindowFlags = QgsGuiUtils::ModalDialogFlags );
78
80
82
83 bool eventFilter( QObject *obj, QEvent *ev ) override;
84
90 Q_DECL_DEPRECATED void saveDefaultStyle() SIP_DEPRECATED;
91
92 protected slots:
93 void optionsStackedWidget_CurrentChanged( int index ) FINAL;
94 void apply() FINAL;
95 void rollback() FINAL;
96
97 private:
98 // TODO -- consider moving these to a common raster widget base class
99
106 void initializeDataDefinedButton( QgsPropertyOverrideButton *button, QgsRasterPipe::Property key );
107
112 void updateDataDefinedButtons();
113
118 void updateDataDefinedButton( QgsPropertyOverrideButton *button );
119
121 QgsPropertyCollection mPropertyCollection;
122
123 private slots:
124
125 void updateProperty();
126
128 void buttonBuildPyramids_clicked();
130 void mCrsSelector_crsChanged( const QgsCoordinateReferenceSystem &crs );
131
136 void updateGammaSpinBox( int value );
137
142 void updateGammaSlider( double value );
143
144 void mRenderTypeComboBox_currentIndexChanged( int index );
146 void restoreWindowModality();
147
149 void showHelp();
150
152 void mResetColorRenderingBtn_clicked();
153
155 void toggleBuildPyramidsButton();
156
158 void toggleSaturationControls( int grayscaleMode );
159
161 void toggleColorizeControls( bool colorizeEnabled );
162
163 void aboutToShowStyleMenu();
164
166 void syncToLayer() FINAL;
167
168 // Update the preview of the map tip
169 void updateMapTipPreview();
170 // Resize the map tip preview
171 void resizeMapTip();
172
173 private:
174 QAction *mActionLoadMetadata = nullptr;
175 QAction *mActionSaveMetadataAs = nullptr;
176
178 const QString TRSTRING_NOT_SET;
179
181 QString mDefaultContrastEnhancementAlgorithm;
182
184 double mDefaultStandardDeviation;
185
187 int mDefaultRedBand;
188 int mDefaultGreenBand;
189 int mDefaultBlueBand;
190
192 bool mGrayMinimumMaximumEstimated;
193
195 bool mRGBMinimumMaximumEstimated;
196
198 QgsRasterLayer *mRasterLayer = nullptr;
199
200 QgsRasterRendererWidget *mRendererWidget = nullptr;
201 QgsMetadataWidget *mMetadataWidget = nullptr;
202
203 QgsRasterTransparencyWidget *mRasterTransparencyWidget = nullptr;
204
205 QgsRasterLabelingWidget *mLabelingWidget = nullptr;
206
210 QgsRasterLayerTemporalPropertiesWidget *mTemporalWidget = nullptr;
211
212 bool rasterIsMultiBandColor();
213
217 void updateInformationContent();
218
219 void setRendererWidget( const QString &rendererName );
220
224 void updateRasterAttributeTableOptionsPage();
225
226 //TODO: we should move these gradient generators somewhere more generic
227 //so they can be used generically throughout the app
228 QLinearGradient greenGradient();
229 QLinearGradient redGradient();
230 QLinearGradient blueGradient();
231 QLinearGradient grayGradient();
232 QLinearGradient highlightGradient();
233 qreal mGradientHeight;
234 qreal mGradientWidth;
235
236 QgsRasterHistogramWidget *mHistogramWidget = nullptr;
237
238 bool mDisableRenderTypeComboBoxCurrentIndexChanged = false;
239
240 bool mMetadataFilled;
241
243 void sync();
244
245 QgsResamplingUtils mResamplingUtils;
246
247 QgsProviderSourceWidget *mSourceWidget = nullptr;
248
249 QgsWebView *mMetadataViewer = nullptr;
250
251 QgsExpressionContext mContext;
252
253 friend class QgsAppScreenShots;
254
256
257 QgsRasterAttributeTableWidget *mRasterAttributeTableWidget = nullptr;
258
259 void initMapTipPreview();
260
261 QgsWebView *mMapTipPreview = nullptr;
262};
263#endif
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:77
A wizard to edit metadata on a map layer.
Represents a 2D point.
Definition qgspointxy.h:60
A grouped map of multiple QgsProperty objects, each referenced by an 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.
A widget for display and configuring a raster layer histogram.
Master widget for configuration of labeling of a raster layer.
A dialog for raster layer properties.
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.
A widget for controlling a raster layer's transparency and related options.
A collection of stubs to mimic the API of QWebView on systems where the real library is not available...
Definition qgswebview.h:66
#define SIP_DEPRECATED
Definition qgis_sip.h:106
#define FINAL
Definition qgis_sip.h:242
const QgsCoordinateReferenceSystem & crs