QGIS API Documentation  3.14.0-Pi (9f7028fd23)
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 
32 class QgsPointXY;
33 class QgsMapLayer;
34 class QgsMapCanvas;
35 class QgsRasterLayer;
36 class QgsMetadataWidget;
37 class QgsRasterRenderer;
41 class QgsWebView;
42 
43 
51 class GUI_EXPORT QgsRasterLayerProperties : public QgsOptionsDialogBase, private Ui::QgsRasterLayerPropertiesBase
52 {
53  Q_OBJECT
54 
55  public:
56 
60 #ifndef SIP_RUN
61  enum StyleType
62  {
63  QML,
64  SLD
65  };
66  Q_ENUM( StyleType )
67 #endif
68 
76  QgsRasterLayerProperties( QgsMapLayer *lyr, QgsMapCanvas *canvas, QWidget *parent = nullptr, Qt::WindowFlags = QgsGuiUtils::ModalDialogFlags );
77 
78  protected slots:
80  void optionsStackedWidget_CurrentChanged( int index ) override SIP_SKIP ;
81 
82  private slots:
83 
85  void apply();
87  void onCancel();
89  void mLayerOrigNameLineEd_textEdited( const QString &text );
91  void buttonBuildPyramids_clicked();
93  void pbnAddValuesFromDisplay_clicked();
95  void pbnAddValuesManually_clicked();
97  void mCrsSelector_crsChanged( const QgsCoordinateReferenceSystem &crs );
99  void pbnDefaultValues_clicked();
101  void pbnExportTransparentPixelValues_clicked();
103  void pbnImportTransparentPixelValues_clicked();
105  void pbnRemoveSelectedRow_clicked();
106 
108  void setEndAsStartStaticButton_clicked();
109 
111  void passProjectTemporalRange_toggled( bool checked );
112 
114  void staticTemporalRange_toggled( bool checked );
115 
117  void temporalPropertiesChange();
118 
123  //void on_btnResetNull_clicked();
124 
125  void pixelSelected( const QgsPointXY &, const Qt::MouseButton & );
126 
127 
128 
129  void mRenderTypeComboBox_currentIndexChanged( int index );
131  void loadDefaultStyle_clicked();
133  void saveDefaultStyle_clicked();
135  void loadStyle_clicked();
137  void saveStyleAs_clicked();
139  void restoreWindowModality();
140 
141 
143  void loadMetadata();
145  void saveMetadataAs();
147  void saveDefaultMetadata();
149  void loadDefaultMetadata();
150 
152  void showHelp();
153 
155  void mResetColorRenderingBtn_clicked();
156 
158  void toggleBuildPyramidsButton();
159 
161  void toggleSaturationControls( int grayscaleMode );
162 
164  void toggleColorizeControls( bool colorizeEnabled );
165 
167  void transparencyCellTextEdited( const QString &text );
168 
169  void aboutToShowStyleMenu();
170 
172  void syncToLayer();
173 
174  void urlClicked( const QUrl &url );
175 
176  private:
177  QPushButton *mBtnStyle = nullptr;
178  QPushButton *mBtnMetadata = nullptr;
179  QAction *mActionLoadMetadata = nullptr;
180  QAction *mActionSaveMetadataAs = nullptr;
181 
183  const QString TRSTRING_NOT_SET;
184 
186  QString mDefaultContrastEnhancementAlgorithm;
187 
189  double mDefaultStandardDeviation;
190 
192  int mDefaultRedBand;
193  int mDefaultGreenBand;
194  int mDefaultBlueBand;
195 
197  bool mGrayMinimumMaximumEstimated;
198 
200  bool mRGBMinimumMaximumEstimated;
201 
203  QgsRasterLayer *mRasterLayer = nullptr;
204 
211  //bool mRasterLayerIsInternal;
212 
213  QgsRasterRendererWidget *mRendererWidget = nullptr;
214  QgsMetadataWidget *mMetadataWidget = nullptr;
215 
219  QgsRasterLayerTemporalPropertiesWidget *mTemporalWidget = nullptr;
220 
221  bool rasterIsMultiBandColor();
222 
226  void updateInformationContent();
227 
233  void updateSourceStaticTime();
234 
240  void setSourceStaticTimeState();
241 
242  void setupTransparencyTable( int nBands );
243 
245  void populateTransparencyTable( QgsRasterRenderer *renderer );
246 
247  void setTransparencyCell( int row, int column, double value );
248  void setTransparencyCellValue( int row, int column, double value );
249  double transparencyCellValue( int row, int column );
250  void setTransparencyToEdited( int row );
251  void adjustTransparencyCellWidth( int row, int column );
252 
253  void setRendererWidget( const QString &rendererName );
254 
255  //TODO: we should move these gradient generators somewhere more generic
256  //so they can be used generically throughout the app
257  QLinearGradient greenGradient();
258  QLinearGradient redGradient();
259  QLinearGradient blueGradient();
260  QLinearGradient grayGradient();
261  QLinearGradient highlightGradient();
262  qreal mGradientHeight;
263  qreal mGradientWidth;
264 
265  QgsMapCanvas *mMapCanvas = nullptr;
266  std::unique_ptr<QgsMapToolEmitPoint> mPixelSelectorTool;
267 
268  QgsRasterHistogramWidget *mHistogramWidget = nullptr;
269 
270  QVector<bool> mTransparencyToEdited;
271 
275  QgsMapLayerStyle mOldStyle;
276 
277  bool mDisableRenderTypeComboBoxCurrentIndexChanged = false;
278 
279  bool mMetadataFilled;
280 
282  void sync();
283 
284  friend class QgsAppScreenShots;
285 };
286 #endif
qgsmaplayerstylemanager.h
QgsOptionsDialogBase
Definition: qgsoptionsdialogbase.h:62
crs
const QgsCoordinateReferenceSystem & crs
Definition: qgswfsgetfeature.cpp:105
QgsMapCanvas
Definition: qgsmapcanvas.h:83
QgsRasterLayerProperties::QML
@ QML
Definition: qgsrasterlayerproperties.h:63
qgsoptionsdialogbase.h
SIP_SKIP
#define SIP_SKIP
Definition: qgis_sip.h:126
QgsRasterRenderer
Definition: qgsrasterrenderer.h:38
QgsRasterLayerProperties::StyleType
StyleType
enumeration for the different types of style
Definition: qgsrasterlayerproperties.h:61
QgsRasterHistogramWidget
Definition: qgsrasterhistogramwidget.h:41
QgsRasterLayer
Definition: qgsrasterlayer.h:72
QgsCoordinateReferenceSystem
Definition: qgscoordinatereferencesystem.h:206
QgsPointXY
Definition: qgspointxy.h:43
QgsOptionsDialogBase::optionsStackedWidget_CurrentChanged
virtual void optionsStackedWidget_CurrentChanged(int index)
Select relevant tab on current page change.
Definition: qgsoptionsdialogbase.cpp:459
QgsMapLayer
Definition: qgsmaplayer.h:81
QgsRasterLayerTemporalPropertiesWidget
Definition: qgsrasterlayertemporalpropertieswidget.h:34
QgsMetadataWidget
A wizard to edit metadata on a map layer.
Definition: qgsmetadatawidget.h:41
QgsRasterRendererWidget
Definition: qgsrasterrendererwidget.h:36
QgsMapLayerStyle
Definition: qgsmaplayerstyle.h:42
qgsguiutils.h
QgsRasterLayerProperties
Definition: qgsrasterlayerproperties.h:51
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:65