QGIS API Documentation  3.18.1-Zürich (202f1bf7e5)
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 
24 #include "qgsoptionsdialogbase.h"
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 
33 class QgsPointXY;
34 class QgsMapLayer;
35 class QgsMapCanvas;
36 class QgsRasterLayer;
37 class QgsMetadataWidget;
38 class QgsRasterRenderer;
42 class QgsWebView;
46 
47 
55 class GUI_EXPORT QgsRasterLayerProperties : public QgsOptionsDialogBase, private Ui::QgsRasterLayerPropertiesBase
56 {
57  Q_OBJECT
58 
59  public:
60 
64 #ifndef SIP_RUN
65  enum StyleType
66  {
67  QML,
68  SLD
69  };
70  Q_ENUM( StyleType )
71 #endif
72 
80  QgsRasterLayerProperties( QgsMapLayer *lyr, QgsMapCanvas *canvas, QWidget *parent = nullptr, Qt::WindowFlags = QgsGuiUtils::ModalDialogFlags );
81 
86  void addPropertiesPageFactory( QgsMapLayerConfigWidgetFactory *factory );
87 
88  protected slots:
90  void optionsStackedWidget_CurrentChanged( int index ) override SIP_SKIP ;
91 
92  private slots:
93 
95  void apply();
97  void onCancel();
99  void mLayerOrigNameLineEd_textEdited( const QString &text );
101  void buttonBuildPyramids_clicked();
103  void pbnAddValuesFromDisplay_clicked();
105  void pbnAddValuesManually_clicked();
107  void mCrsSelector_crsChanged( const QgsCoordinateReferenceSystem &crs );
109  void pbnDefaultValues_clicked();
111  void pbnExportTransparentPixelValues_clicked();
113  void pbnImportTransparentPixelValues_clicked();
115  void pbnRemoveSelectedRow_clicked();
116 
118  void setEndAsStartStaticButton_clicked();
119 
121  void passProjectTemporalRange_toggled( bool checked );
122 
124  void staticTemporalRange_toggled( bool checked );
125 
127  void temporalPropertiesChange();
128 
133  //void on_btnResetNull_clicked();
134 
135  void pixelSelected( const QgsPointXY &, const Qt::MouseButton & );
136 
141  void updateGammaSpinBox( int value );
142 
147  void updateGammaSlider( double value );
148 
149  void mRenderTypeComboBox_currentIndexChanged( int index );
151  void loadDefaultStyle_clicked();
153  void saveDefaultStyle_clicked();
155  void loadStyle_clicked();
157  void saveStyleAs_clicked();
159  void restoreWindowModality();
160 
161 
163  void loadMetadata();
165  void saveMetadataAs();
167  void saveDefaultMetadata();
169  void loadDefaultMetadata();
170 
172  void showHelp();
173 
175  void mResetColorRenderingBtn_clicked();
176 
178  void toggleBuildPyramidsButton();
179 
181  void toggleSaturationControls( int grayscaleMode );
182 
184  void toggleColorizeControls( bool colorizeEnabled );
185 
187  void transparencyCellTextEdited( const QString &text );
188 
189  void aboutToShowStyleMenu();
190 
192  void syncToLayer();
193 
194  void urlClicked( const QUrl &url );
195 
196  private:
197  QPushButton *mBtnStyle = nullptr;
198  QPushButton *mBtnMetadata = nullptr;
199  QAction *mActionLoadMetadata = nullptr;
200  QAction *mActionSaveMetadataAs = nullptr;
201 
203  QList<QgsMapLayerConfigWidget *> mLayerPropertiesPages;
204 
206  const QString TRSTRING_NOT_SET;
207 
209  QString mDefaultContrastEnhancementAlgorithm;
210 
212  double mDefaultStandardDeviation;
213 
215  int mDefaultRedBand;
216  int mDefaultGreenBand;
217  int mDefaultBlueBand;
218 
220  bool mGrayMinimumMaximumEstimated;
221 
223  bool mRGBMinimumMaximumEstimated;
224 
226  QgsRasterLayer *mRasterLayer = nullptr;
227 
234  //bool mRasterLayerIsInternal;
235 
236  QgsRasterRendererWidget *mRendererWidget = nullptr;
237  QgsMetadataWidget *mMetadataWidget = nullptr;
238 
242  QgsRasterLayerTemporalPropertiesWidget *mTemporalWidget = nullptr;
243 
244  bool rasterIsMultiBandColor();
245 
249  void updateInformationContent();
250 
256  void updateSourceStaticTime();
257 
263  void setSourceStaticTimeState();
264 
265  void setupTransparencyTable( int nBands );
266 
268  void populateTransparencyTable( QgsRasterRenderer *renderer );
269 
270  void setTransparencyCell( int row, int column, double value );
271  void setTransparencyCellValue( int row, int column, double value );
272  double transparencyCellValue( int row, int column );
273  void setTransparencyToEdited( int row );
274  void adjustTransparencyCellWidth( int row, int column );
275 
276  void setRendererWidget( const QString &rendererName );
277 
278  //TODO: we should move these gradient generators somewhere more generic
279  //so they can be used generically throughout the app
280  QLinearGradient greenGradient();
281  QLinearGradient redGradient();
282  QLinearGradient blueGradient();
283  QLinearGradient grayGradient();
284  QLinearGradient highlightGradient();
285  qreal mGradientHeight;
286  qreal mGradientWidth;
287 
288  QgsMapCanvas *mMapCanvas = nullptr;
289  std::unique_ptr<QgsMapToolEmitPoint> mPixelSelectorTool;
290 
291  QgsRasterHistogramWidget *mHistogramWidget = nullptr;
292 
293  QVector<bool> mTransparencyToEdited;
294 
299  QgsMapLayerStyle mOldStyle;
300 
301  bool mDisableRenderTypeComboBoxCurrentIndexChanged = false;
302 
303  bool mMetadataFilled;
304 
306  void sync();
307 
308  QgsResamplingUtils mResamplingUtils;
309 
310  QgsProviderSourceWidget *mSourceWidget = nullptr;
311 
312  friend class QgsAppScreenShots;
313 };
314 #endif
This class represents a coordinate reference system (CRS).
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:86
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:85
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:44
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.
Raster renderer pipe that applies colors to a raster.
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