QGIS API Documentation 4.1.0-Master (5bf3c20f3c9)
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
58 QgsRasterLayer *rasterLayer,
59 QgsRasterDataProvider *sourceProvider,
60 const QgsRectangle &currentExtent,
61 const QgsCoordinateReferenceSystem &layerCrs,
62 const QgsCoordinateReferenceSystem &currentCrs,
63 QWidget *parent SIP_TRANSFERTHIS = nullptr,
64 Qt::WindowFlags f = Qt::WindowFlags()
65 );
66
67 Mode mode() const;
68 int nColumns() const;
69 int nRows() const;
70 double xResolution() const;
71 double yResolution() const;
72 int maximumTileSizeX() const;
73 int maximumTileSizeY() const;
74 bool tileMode() const;
75
81 bool addToCanvas() const;
82
89 void setAddToCanvas( bool checked );
90
91 QString outputFileName() const;
92
97 QString outputLayerName() const;
98 QString outputFormat() const;
100
104 Q_DECL_DEPRECATED QStringList createOptions() const;
105
110 QStringList creationOptions() const;
111 QgsRectangle outputRectangle() const;
112 QgsRasterRangeList noData() const;
113
114 QList<int> pyramidsList() const;
115
119 Qgis::RasterBuildPyramidOption buildPyramidsFlag() const;
120
121 QString pyramidsResamplingMethod() const { return mPyramidsOptionsWidget->resamplingMethod(); }
122
126 Qgis::RasterPyramidFormat pyramidsFormat() const { return mPyramidsOptionsWidget->pyramidsFormat(); }
127
128 QStringList pyramidsConfigOptions() const { return mPyramidsOptionsWidget->configOptions(); }
129
130 void hideFormat();
131 void hideOutput();
132
133 public slots:
134 void accept() override;
135
136 private slots:
137 void mRawModeRadioButton_toggled( bool );
138 void mFormatComboBox_currentIndexChanged( const QString &text );
139 void mResolutionRadioButton_toggled( bool ) { toggleResolutionSize(); }
140 void mOriginalResolutionPushButton_clicked() { setOriginalResolution(); }
141 void mXResolutionLineEdit_textEdited( const QString & )
142 {
143 mResolutionState = UserResolution;
144 recalcSize();
145 }
146 void mYResolutionLineEdit_textEdited( const QString & )
147 {
148 mResolutionState = UserResolution;
149 recalcSize();
150 }
151
152 void mOriginalSizePushButton_clicked() { setOriginalSize(); }
153 void mColumnsLineEdit_textEdited( const QString & )
154 {
155 mResolutionState = UserResolution;
156 recalcResolution();
157 }
158 void mRowsLineEdit_textEdited( const QString & )
159 {
160 mResolutionState = UserResolution;
161 recalcResolution();
162 }
163
164 void mAddNoDataManuallyToolButton_clicked();
165 void mLoadTransparentNoDataToolButton_clicked();
166 void mRemoveSelectedNoDataToolButton_clicked();
167 void mRemoveAllNoDataToolButton_clicked();
168 void noDataCellTextEdited( const QString &text );
169 void mTileModeCheckBox_toggled( bool toggled );
170 void mPyramidsGroupBox_toggled( bool toggled );
171 void populatePyramidsLevels();
172 void extentChanged();
173 void crsChanged();
174 void showHelp();
175
176 private:
177 QgsRasterLayer *mRasterLayer = nullptr;
178 QgsRasterDataProvider *mDataProvider = nullptr;
179 QgsRectangle mCurrentExtent;
180 QgsCoordinateReferenceSystem mLayerCrs; // may differ from provider CRS
181 QgsCoordinateReferenceSystem mCurrentCrs;
182 QgsCoordinateReferenceSystem mPreviousCrs;
183 ResolutionState mResolutionState = OriginalResolution;
184 QVector<bool> mNoDataToEdited;
185
186 void setValidators();
187 void toggleResolutionSize();
188 void setResolution( double xRes, double yRes, const QgsCoordinateReferenceSystem &srcCrs );
189 void setOriginalResolution();
190 void setOriginalSize();
191 void recalcSize();
192 void recalcResolution();
193 void updateResolutionStateMsg();
194 void recalcResolutionSize();
195
196 void addNoDataRow( double min, double max );
197 void setNoDataToEdited( int row );
198 double noDataCellValue( int row, int column ) const;
199 void adjustNoDataCellWidth( int row, int column );
200 bool validate() const;
201 // Returns true if the output layer already exists.
202 bool outputLayerExists() const;
203
204 void insertAvailableOutputFormats();
205
207};
208
209
210#endif // QGSRASTERLAYERSAVEASDIALOG_H
RasterPyramidFormat
Raster pyramid formats.
Definition qgis.h:4959
RasterBuildPyramidOption
Raster pyramid building options.
Definition qgis.h:4974
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:52
QList< QgsRasterRange > QgsRasterRangeList