QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
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
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
20#include "ui_qgsrasterlayerpropertiesbase.h"
21
22#include "qgis_gui.h"
24#include "qgsguiutils.h"
26#include "qgsrasterpipe.h"
27#include "qgsresamplingutils.h"
28
29class QgsPointXY;
30class QgsMapLayer;
31class QgsMapCanvas;
32class QgsRasterLayer;
38class QgsWebView;
44class QgsRasterAttributeTableWidget;
45class QgsWebView;
47
54class GUI_EXPORT QgsRasterLayerProperties : public QgsLayerPropertiesDialog, private Ui::QgsRasterLayerPropertiesBase, private QgsExpressionContextGenerator
55{
56 Q_OBJECT
57
58 public:
62#ifndef SIP_RUN
64 {
67 };
68 Q_ENUM( StyleType )
69#endif
70
78 QgsRasterLayerProperties( QgsMapLayer *lyr, QgsMapCanvas *canvas, QWidget *parent = nullptr, Qt::WindowFlags = QgsGuiUtils::ModalDialogFlags );
79
81
83
84 bool eventFilter( QObject *obj, QEvent *ev ) override;
85
91 Q_DECL_DEPRECATED void saveDefaultStyle() SIP_DEPRECATED;
92
93 protected slots:
94 void optionsStackedWidget_CurrentChanged( int index ) final;
95 void apply() final;
96 void rollback() final;
97
98 private:
99 // TODO -- consider moving these to a common raster widget base class
100
107 void initializeDataDefinedButton( QgsPropertyOverrideButton *button, QgsRasterPipe::Property key );
108
113 void updateDataDefinedButtons();
114
119 void updateDataDefinedButton( QgsPropertyOverrideButton *button );
120
122 QgsPropertyCollection mPropertyCollection;
123
124 private slots:
125
126 void updateProperty();
127
129 void buttonBuildPyramids_clicked();
131 void mCrsSelector_crsChanged( const QgsCoordinateReferenceSystem &crs );
132
137 void updateGammaSpinBox( int value );
138
143 void updateGammaSlider( double value );
144
145 void mRenderTypeComboBox_currentIndexChanged( int index );
147 void restoreWindowModality();
148
150 void showHelp();
151
153 void mResetColorRenderingBtn_clicked();
154
156 void toggleBuildPyramidsButton();
157
159 void toggleSaturationControls( int grayscaleMode );
160
162 void toggleColorizeControls( bool colorizeEnabled );
163
164 void aboutToShowStyleMenu();
165
167 void syncToLayer() final;
168
169 // Update the preview of the map tip
170 void updateMapTipPreview();
171 // Resize the map tip preview
172 void resizeMapTip();
173
174 private:
175 QAction *mActionLoadMetadata = nullptr;
176 QAction *mActionSaveMetadataAs = nullptr;
177
179 const QString TRSTRING_NOT_SET;
180
182 QString mDefaultContrastEnhancementAlgorithm;
183
185 double mDefaultStandardDeviation = 0;
186
188 int mDefaultRedBand = 0;
189 int mDefaultGreenBand = 0;
190 int mDefaultBlueBand = 0;
191
193 bool mGrayMinimumMaximumEstimated;
194
196 bool mRGBMinimumMaximumEstimated;
197
199 QgsRasterLayer *mRasterLayer = nullptr;
200
201 QgsRasterRendererWidget *mRendererWidget = nullptr;
202 QgsMetadataWidget *mMetadataWidget = nullptr;
203
204 QgsRasterTransparencyWidget *mRasterTransparencyWidget = nullptr;
205
206 QgsRasterLabelingWidget *mLabelingWidget = nullptr;
207
211 QgsRasterLayerTemporalPropertiesWidget *mTemporalWidget = nullptr;
212
213 bool rasterIsMultiBandColor();
214
218 void updateInformationContent();
219
220 void setRendererWidget( const QString &rendererName );
221
225 void updateRasterAttributeTableOptionsPage();
226
227 //TODO: we should move these gradient generators somewhere more generic
228 //so they can be used generically throughout the app
229 QLinearGradient greenGradient();
230 QLinearGradient redGradient();
231 QLinearGradient blueGradient();
232 QLinearGradient grayGradient();
233 QLinearGradient highlightGradient();
234 qreal mGradientHeight = 0.0;
235 qreal mGradientWidth = 0.0;
236
237 QgsRasterHistogramWidget *mHistogramWidget = nullptr;
238
239 bool mDisableRenderTypeComboBoxCurrentIndexChanged = false;
240
241 bool mMetadataFilled = false;
242
244 void sync();
245
246 QgsResamplingUtils mResamplingUtils;
247
248 QgsProviderSourceWidget *mSourceWidget = nullptr;
249
250 QgsWebView *mMetadataViewer = nullptr;
251
252 QgsExpressionContext mContext;
253
254 friend class QgsAppScreenShots;
255
257
258 QgsRasterAttributeTableWidget *mRasterAttributeTableWidget = nullptr;
259
260 void initMapTipPreview();
261
262 QgsWebView *mMapTipPreview = nullptr;
263};
264#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...
QgsLayerPropertiesDialog(QgsMapLayer *layer, QgsMapCanvas *canvas, const QString &settingsKey, QWidget *parent=nullptr, Qt::WindowFlags fl=Qt::WindowFlags(), QgsSettings *settings=nullptr)
Constructor for QgsLayerPropertiesDialog.
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:80
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
QgsRasterLayerProperties(QgsMapLayer *lyr, QgsMapCanvas *canvas, QWidget *parent=nullptr, Qt::WindowFlags=QgsGuiUtils::ModalDialogFlags)
Constructor.
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:114