QGIS API Documentation 3.29.0-Master (8c80f25a4f)
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 "qgshelp.h"
29#include "qgsmaptoolemitpoint.h"
30#include "qgis_gui.h"
31#include "qgsresamplingutils.h"
32#include "qgsrasterpipe.h"
34
35class QgsPointXY;
36class QgsMapLayer;
37class QgsMapCanvas;
38class QgsRasterLayer;
44class QgsWebView;
51
52
60class GUI_EXPORT QgsRasterLayerProperties : public QgsOptionsDialogBase, private Ui::QgsRasterLayerPropertiesBase, private QgsExpressionContextGenerator
61{
62 Q_OBJECT
63
64 public:
65
69#ifndef SIP_RUN
71 {
73 SLD
74 };
75 Q_ENUM( StyleType )
76#endif
77
85 QgsRasterLayerProperties( QgsMapLayer *lyr, QgsMapCanvas *canvas, QWidget *parent = nullptr, Qt::WindowFlags = QgsGuiUtils::ModalDialogFlags );
86
91 void addPropertiesPageFactory( const QgsMapLayerConfigWidgetFactory *factory );
92
94
95 protected slots:
97 void optionsStackedWidget_CurrentChanged( int index ) override SIP_SKIP ;
98
99 private:
100
101 // TODO -- consider moving these to a common raster widget base class
102
109 void initializeDataDefinedButton( QgsPropertyOverrideButton *button, QgsRasterPipe::Property key );
110
115 void updateDataDefinedButtons();
116
121 void updateDataDefinedButton( QgsPropertyOverrideButton *button );
122
124 QgsPropertyCollection mPropertyCollection;
125
126 private slots:
127
128 void updateProperty();
129
131 void apply();
133 void onCancel();
135 void buttonBuildPyramids_clicked();
137 void mCrsSelector_crsChanged( const QgsCoordinateReferenceSystem &crs );
138
139 // Server properties
140 void addMetadataUrl();
141 void removeSelectedMetadataUrl();
142
147 void updateGammaSpinBox( int value );
148
153 void updateGammaSlider( double value );
154
155 void mRenderTypeComboBox_currentIndexChanged( int index );
157 void loadDefaultStyle_clicked();
159 void saveDefaultStyle_clicked();
161 void loadStyle_clicked();
163 void saveStyleAs_clicked();
165 void restoreWindowModality();
166
167
169 void loadMetadata();
171 void saveMetadataAs();
173 void saveDefaultMetadata();
175 void loadDefaultMetadata();
176
178 void showHelp();
179
181 void mResetColorRenderingBtn_clicked();
182
184 void toggleBuildPyramidsButton();
185
187 void toggleSaturationControls( int grayscaleMode );
188
190 void toggleColorizeControls( bool colorizeEnabled );
191
193 void transparencyCellTextEdited( const QString &text );
194
195 void aboutToShowStyleMenu();
196
198 void syncToLayer();
199
200 void urlClicked( const QUrl &url );
201
202 private:
203 QPushButton *mBtnStyle = nullptr;
204 QPushButton *mBtnMetadata = nullptr;
205 QAction *mActionLoadMetadata = nullptr;
206 QAction *mActionSaveMetadataAs = nullptr;
207
208 QStandardItemModel *mMetadataUrlModel = nullptr;
209
211 QList<QgsMapLayerConfigWidget *> mLayerPropertiesPages;
212
214 const QString TRSTRING_NOT_SET;
215
217 QString mDefaultContrastEnhancementAlgorithm;
218
220 double mDefaultStandardDeviation;
221
223 int mDefaultRedBand;
224 int mDefaultGreenBand;
225 int mDefaultBlueBand;
226
228 bool mGrayMinimumMaximumEstimated;
229
231 bool mRGBMinimumMaximumEstimated;
232
234 QgsRasterLayer *mRasterLayer = nullptr;
235
236 QgsRasterRendererWidget *mRendererWidget = nullptr;
237 QgsMetadataWidget *mMetadataWidget = nullptr;
238
239 QgsRasterTransparencyWidget *mRasterTransparencyWidget = nullptr;
240
244 QgsRasterLayerTemporalPropertiesWidget *mTemporalWidget = nullptr;
245
246 bool rasterIsMultiBandColor();
247
251 void updateInformationContent();
252
253 void setTransparencyCell( int row, int column, double value );
254 void setTransparencyCellValue( int row, int column, double value );
255 double transparencyCellValue( int row, int column );
256 void setTransparencyToEdited( int row );
257 void adjustTransparencyCellWidth( int row, int column );
258
259 void setRendererWidget( const QString &rendererName );
260
264 void updateRasterAttributeTableOptionsPage();
265
266 //TODO: we should move these gradient generators somewhere more generic
267 //so they can be used generically throughout the app
268 QLinearGradient greenGradient();
269 QLinearGradient redGradient();
270 QLinearGradient blueGradient();
271 QLinearGradient grayGradient();
272 QLinearGradient highlightGradient();
273 qreal mGradientHeight;
274 qreal mGradientWidth;
275
276 QgsMapCanvas *mMapCanvas = nullptr;
277
278 QgsRasterHistogramWidget *mHistogramWidget = nullptr;
279
280 QVector<bool> mTransparencyToEdited;
281
286 QgsMapLayerStyle mOldStyle;
287
288 bool mDisableRenderTypeComboBoxCurrentIndexChanged = false;
289
290 bool mMetadataFilled;
291
293 void sync();
294
295 QgsResamplingUtils mResamplingUtils;
296
297 QgsProviderSourceWidget *mSourceWidget = nullptr;
298
299 QgsWebView *mMetadataViewer = nullptr;
300
301 QgsExpressionContext mContext;
302
303 friend class QgsAppScreenShots;
304
306
307 QgsRasterAttributeTableWidget *mRasterAttributeTableWidget = nullptr;
308};
309#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...
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:90
Factory class for creating custom map layer property pages.
A panel widget that can be shown in the map style dock.
Stores style information (renderer, opacity, labeling, diagrams etc.) applicable to a map layer.
Base class for all map layer types.
Definition: qgsmaplayer.h:73
A wizard to edit metadata on a map layer.
A base dialog for options and properties dialogs that offers vertical tabs.
virtual void optionsStackedWidget_CurrentChanged(int index)
Select relevant tab on current page change.
A class to represent a 2D point.
Definition: qgspointxy.h:59
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.
The QgsRasterAttributeTableWidget class provides an attribute table for rasters and methods to edit t...
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.
Property
Data definable properties.
Definition: qgsrasterpipe.h:58
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_SKIP
Definition: qgis_sip.h:126
const QgsCoordinateReferenceSystem & crs