QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
qgsrasterlayersaveasdialog.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsrasterlayersaveasdialog.h
3 ---------------------
4 begin : May 2012
5 copyright : (C) 2012 by Marco Hugentobler
6 email : marco dot hugentobler at sourcepole dot ch
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15#ifndef QGSRASTERLAYERSAVEASDIALOG_H
16#define QGSRASTERLAYERSAVEASDIALOG_H
17
18#include "ui_qgsrasterlayersaveasdialogbase.h"
19
20#include "qgis_gui.h"
22#include "qgshelp.h"
23#include "qgsrasterrange.h"
24#include "qgsrectangle.h"
25
26class QgsRasterLayer;
28class QgsRasterFormatOptionsWidget;
29
35class GUI_EXPORT QgsRasterLayerSaveAsDialog : public QDialog, private Ui::QgsRasterLayerSaveAsDialogBase
36{
37 Q_OBJECT
38 public:
55
57 QgsRasterLayerSaveAsDialog( QgsRasterLayer *rasterLayer, QgsRasterDataProvider *sourceProvider, const QgsRectangle &currentExtent, const QgsCoordinateReferenceSystem &layerCrs, const QgsCoordinateReferenceSystem &currentCrs, QWidget *parent SIP_TRANSFERTHIS = nullptr, Qt::WindowFlags f = Qt::WindowFlags() );
58
59 Mode mode() const;
60 int nColumns() const;
61 int nRows() const;
62 double xResolution() const;
63 double yResolution() const;
64 int maximumTileSizeX() const;
65 int maximumTileSizeY() const;
66 bool tileMode() const;
67
73 bool addToCanvas() const;
74
81 void setAddToCanvas( bool checked );
82
83 QString outputFileName() const;
84
89 QString outputLayerName() const;
90 QString outputFormat() const;
92
96 Q_DECL_DEPRECATED QStringList createOptions() const;
97
102 QStringList creationOptions() const;
103 QgsRectangle outputRectangle() const;
104 QgsRasterRangeList noData() const;
105
106 QList<int> pyramidsList() const;
107
111 Qgis::RasterBuildPyramidOption buildPyramidsFlag() const;
112
113 QString pyramidsResamplingMethod() const { return mPyramidsOptionsWidget->resamplingMethod(); }
114
118 Qgis::RasterPyramidFormat pyramidsFormat() const { return mPyramidsOptionsWidget->pyramidsFormat(); }
119
120 QStringList pyramidsConfigOptions() const { return mPyramidsOptionsWidget->configOptions(); }
121
122 void hideFormat();
123 void hideOutput();
124
125 public slots:
126 void accept() override;
127
128 private slots:
129 void mRawModeRadioButton_toggled( bool );
130 void mFormatComboBox_currentIndexChanged( const QString &text );
131 void mResolutionRadioButton_toggled( bool ) { toggleResolutionSize(); }
132 void mOriginalResolutionPushButton_clicked() { setOriginalResolution(); }
133 void mXResolutionLineEdit_textEdited( const QString & )
134 {
135 mResolutionState = UserResolution;
136 recalcSize();
137 }
138 void mYResolutionLineEdit_textEdited( const QString & )
139 {
140 mResolutionState = UserResolution;
141 recalcSize();
142 }
143
144 void mOriginalSizePushButton_clicked() { setOriginalSize(); }
145 void mColumnsLineEdit_textEdited( const QString & )
146 {
147 mResolutionState = UserResolution;
148 recalcResolution();
149 }
150 void mRowsLineEdit_textEdited( const QString & )
151 {
152 mResolutionState = UserResolution;
153 recalcResolution();
154 }
155
156 void mAddNoDataManuallyToolButton_clicked();
157 void mLoadTransparentNoDataToolButton_clicked();
158 void mRemoveSelectedNoDataToolButton_clicked();
159 void mRemoveAllNoDataToolButton_clicked();
160 void noDataCellTextEdited( const QString &text );
161 void mTileModeCheckBox_toggled( bool toggled );
162 void mPyramidsGroupBox_toggled( bool toggled );
163 void populatePyramidsLevels();
164 void extentChanged();
165 void crsChanged();
166 void showHelp();
167
168 private:
169 QgsRasterLayer *mRasterLayer = nullptr;
170 QgsRasterDataProvider *mDataProvider = nullptr;
171 QgsRectangle mCurrentExtent;
172 QgsCoordinateReferenceSystem mLayerCrs; // may differ from provider CRS
173 QgsCoordinateReferenceSystem mCurrentCrs;
174 QgsCoordinateReferenceSystem mPreviousCrs;
175 ResolutionState mResolutionState;
176 QVector<bool> mNoDataToEdited;
177
178 void setValidators();
179 void toggleResolutionSize();
180 void setResolution( double xRes, double yRes, const QgsCoordinateReferenceSystem &srcCrs );
181 void setOriginalResolution();
182 void setOriginalSize();
183 void recalcSize();
184 void recalcResolution();
185 void updateResolutionStateMsg();
186 void recalcResolutionSize();
187
188 void addNoDataRow( double min, double max );
189 void setNoDataToEdited( int row );
190 double noDataCellValue( int row, int column ) const;
191 void adjustNoDataCellWidth( int row, int column );
192 bool validate() const;
193 // Returns true if the output layer already exists.
194 bool outputLayerExists() const;
195
196 void insertAvailableOutputFormats();
197
199};
200
201
202#endif // QGSRASTERLAYERSAVEASDIALOG_H
RasterPyramidFormat
Raster pyramid formats.
Definition qgis.h:4802
RasterBuildPyramidOption
Raster pyramid building options.
Definition qgis.h:4817
Represents a coordinate reference system (CRS).
Base class for raster data providers.
A dialog for configuring raster layer export parameters.
QgsRasterLayerSaveAsDialog(QgsRasterLayer *rasterLayer, QgsRasterDataProvider *sourceProvider, const QgsRectangle &currentExtent, const QgsCoordinateReferenceSystem &layerCrs, const QgsCoordinateReferenceSystem &currentCrs, QWidget *parent SIP_TRANSFERTHIS=nullptr, Qt::WindowFlags f=Qt::WindowFlags())
Constructor for QgsRasterLayerSaveAsDialog.
Qgis::RasterPyramidFormat pyramidsFormat() const
Returns the selected pyramid format.
Represents a raster layer.
A rectangle specified with double values.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53
QList< QgsRasterRange > QgsRasterRangeList