QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
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;
43 
44 
52 class GUI_EXPORT QgsRasterLayerProperties : public QgsOptionsDialogBase, private Ui::QgsRasterLayerPropertiesBase
53 {
54  Q_OBJECT
55 
56  public:
57 
61 #ifndef SIP_RUN
62  enum StyleType
63  {
64  QML,
65  SLD
66  };
67  Q_ENUM( StyleType )
68 #endif
69 
77  QgsRasterLayerProperties( QgsMapLayer *lyr, QgsMapCanvas *canvas, QWidget *parent = nullptr, Qt::WindowFlags = QgsGuiUtils::ModalDialogFlags );
78 
79  protected slots:
81  void optionsStackedWidget_CurrentChanged( int index ) override SIP_SKIP ;
82 
83  private slots:
84 
86  void apply();
88  void onCancel();
90  void mLayerOrigNameLineEd_textEdited( const QString &text );
92  void buttonBuildPyramids_clicked();
94  void pbnAddValuesFromDisplay_clicked();
96  void pbnAddValuesManually_clicked();
98  void mCrsSelector_crsChanged( const QgsCoordinateReferenceSystem &crs );
100  void pbnDefaultValues_clicked();
102  void pbnExportTransparentPixelValues_clicked();
104  void pbnImportTransparentPixelValues_clicked();
106  void pbnRemoveSelectedRow_clicked();
107 
109  void setEndAsStartStaticButton_clicked();
110 
112  void passProjectTemporalRange_toggled( bool checked );
113 
115  void staticTemporalRange_toggled( bool checked );
116 
118  void temporalPropertiesChange();
119 
124  //void on_btnResetNull_clicked();
125 
126  void pixelSelected( const QgsPointXY &, const Qt::MouseButton & );
127 
132  void updateGammaSpinBox( int value );
133 
138  void updateGammaSlider( double value );
139 
140  void mRenderTypeComboBox_currentIndexChanged( int index );
142  void loadDefaultStyle_clicked();
144  void saveDefaultStyle_clicked();
146  void loadStyle_clicked();
148  void saveStyleAs_clicked();
150  void restoreWindowModality();
151 
152 
154  void loadMetadata();
156  void saveMetadataAs();
158  void saveDefaultMetadata();
160  void loadDefaultMetadata();
161 
163  void showHelp();
164 
166  void mResetColorRenderingBtn_clicked();
167 
169  void toggleBuildPyramidsButton();
170 
172  void toggleSaturationControls( int grayscaleMode );
173 
175  void toggleColorizeControls( bool colorizeEnabled );
176 
178  void transparencyCellTextEdited( const QString &text );
179 
180  void aboutToShowStyleMenu();
181 
183  void syncToLayer();
184 
185  void urlClicked( const QUrl &url );
186 
187  private:
188  QPushButton *mBtnStyle = nullptr;
189  QPushButton *mBtnMetadata = nullptr;
190  QAction *mActionLoadMetadata = nullptr;
191  QAction *mActionSaveMetadataAs = nullptr;
192 
194  const QString TRSTRING_NOT_SET;
195 
197  QString mDefaultContrastEnhancementAlgorithm;
198 
200  double mDefaultStandardDeviation;
201 
203  int mDefaultRedBand;
204  int mDefaultGreenBand;
205  int mDefaultBlueBand;
206 
208  bool mGrayMinimumMaximumEstimated;
209 
211  bool mRGBMinimumMaximumEstimated;
212 
214  QgsRasterLayer *mRasterLayer = nullptr;
215 
222  //bool mRasterLayerIsInternal;
223 
224  QgsRasterRendererWidget *mRendererWidget = nullptr;
225  QgsMetadataWidget *mMetadataWidget = nullptr;
226 
230  QgsRasterLayerTemporalPropertiesWidget *mTemporalWidget = nullptr;
231 
232  bool rasterIsMultiBandColor();
233 
237  void updateInformationContent();
238 
244  void updateSourceStaticTime();
245 
251  void setSourceStaticTimeState();
252 
253  void setupTransparencyTable( int nBands );
254 
256  void populateTransparencyTable( QgsRasterRenderer *renderer );
257 
258  void setTransparencyCell( int row, int column, double value );
259  void setTransparencyCellValue( int row, int column, double value );
260  double transparencyCellValue( int row, int column );
261  void setTransparencyToEdited( int row );
262  void adjustTransparencyCellWidth( int row, int column );
263 
264  void setRendererWidget( const QString &rendererName );
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  std::unique_ptr<QgsMapToolEmitPoint> mPixelSelectorTool;
278 
279  QgsRasterHistogramWidget *mHistogramWidget = nullptr;
280 
281  QVector<bool> mTransparencyToEdited;
282 
287  QgsMapLayerStyle mOldStyle;
288 
289  bool mDisableRenderTypeComboBoxCurrentIndexChanged = false;
290 
291  bool mMetadataFilled;
292 
294  void sync();
295 
296  QgsResamplingUtils mResamplingUtils;
297 
298  friend class QgsAppScreenShots;
299 };
300 #endif
qgsmaplayerstylemanager.h
QgsOptionsDialogBase
A base dialog for options and properties dialogs that offers vertical tabs.
Definition: qgsoptionsdialogbase.h:63
crs
const QgsCoordinateReferenceSystem & crs
Definition: qgswfsgetfeature.cpp:51
QgsMapCanvas
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:85
QgsRasterLayerProperties::QML
@ QML
Definition: qgsrasterlayerproperties.h:64
qgsoptionsdialogbase.h
SIP_SKIP
#define SIP_SKIP
Definition: qgis_sip.h:126
QgsRasterRenderer
Raster renderer pipe that applies colors to a raster.
Definition: qgsrasterrenderer.h:39
QgsRasterLayerProperties::StyleType
StyleType
enumeration for the different types of style
Definition: qgsrasterlayerproperties.h:63
QgsRasterHistogramWidget
Histogram widget.
Definition: qgsrasterhistogramwidget.h:42
QgsRasterLayer
Represents a raster layer.
Definition: qgsrasterlayer.h:71
QgsCoordinateReferenceSystem
This class represents a coordinate reference system (CRS).
Definition: qgscoordinatereferencesystem.h:206
QgsPointXY
A class to represent a 2D point.
Definition: qgspointxy.h:44
QgsOptionsDialogBase::optionsStackedWidget_CurrentChanged
virtual void optionsStackedWidget_CurrentChanged(int index)
Select relevant tab on current page change.
Definition: qgsoptionsdialogbase.cpp:468
QgsMapLayer
Base class for all map layer types.
Definition: qgsmaplayer.h:83
QgsRasterLayerTemporalPropertiesWidget
A widget for configuring the temporal properties for a raster layer.
Definition: qgsrasterlayertemporalpropertieswidget.h:35
QgsMetadataWidget
A wizard to edit metadata on a map layer.
Definition: qgsmetadatawidget.h:42
QgsRasterRendererWidget
Definition: qgsrasterrendererwidget.h:37
QgsMapLayerStyle
Stores style information (renderer, opacity, labeling, diagrams etc.) applicable to a map layer.
Definition: qgsmaplayerstyle.h:43
qgsguiutils.h
qgsresamplingutils.h
QgsRasterLayerProperties
Property sheet for a raster map layer.
Definition: qgsrasterlayerproperties.h:53
qgshelp.h
qgsmaptoolemitpoint.h
QgsWebView
The QgsWebView class is a collection of stubs to mimic the API of QWebView on systems where the real ...
Definition: qgswebview.h:66