Skip to content

Commit 5ccc6cc

Browse files
committedApr 6, 2017
Update api break docs, sipify QgsRasterFileWriter
1 parent 9c832ad commit 5ccc6cc

File tree

7 files changed

+82
-42
lines changed

7 files changed

+82
-42
lines changed
 

‎doc/api_break.dox

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1681,6 +1681,15 @@ QgsRasterDataProvider {#qgis_api_break_3_0_QgsRasterDataProvider}
16811681
- The progress and progressUpdate signals were removed. Methods which previously emitted these
16821682
signals now accept a QgsRasterBlockFeedback argument for reporting progress updates.
16831683

1684+
1685+
QgsRasterFileWriter {#qgis_api_break_3_0_QgsRasterFileWriter}
1686+
------------------
1687+
1688+
- writeRaster now uses a QgsRasterBlockFeedback object instead of a QProgressDialog argument. Any use of the old
1689+
QProgressDialog argument will need to be updated using manually created connections between QgsRasterBlockFeedback's
1690+
signals and the updates to the progress dialog.
1691+
1692+
16841693
QgsRasterInterface {#qgis_api_break_3_0_QgsRasterInterface}
16851694
------------------
16861695

‎python/auto_sip.blacklist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,6 @@ core/raster/qgsrasterblock.sip
252252
core/raster/qgsrasterchecker.sip
253253
core/raster/qgsrasterdataprovider.sip
254254
core/raster/qgsrasterdrawer.sip
255-
core/raster/qgsrasterfilewriter.sip
256255
core/raster/qgsrasterhistogram.sip
257256
core/raster/qgsrasteridentifyresult.sip
258257
core/raster/qgsrasterinterface.sip
Lines changed: 63 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,28 @@
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/core/raster/qgsrasterfilewriter.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
110

2-
/** Raster file writer */
311

4-
/** \ingroup core
5-
* The raster file writer which allows you to save a raster to a new file.
6-
*/
712
class QgsRasterFileWriter
813
{
14+
%Docstring
15+
The raster file writer which allows you to save a raster to a new file.
16+
%End
17+
918
%TypeHeaderCode
10-
#include <qgsrasterfilewriter.h>
11-
#include <qgsrasterdataprovider.h>
19+
#include "qgsrasterfilewriter.h"
1220
%End
1321
public:
1422
enum Mode
1523
{
16-
Raw, // Raw data
17-
Image, // Rendered image
24+
Raw,
25+
Image
1826
};
1927
enum WriterError
2028
{
@@ -23,40 +31,49 @@ class QgsRasterFileWriter
2331
DestProviderError,
2432
CreateDatasourceError,
2533
WriteError,
26-
// Internal error if a value used for 'no data' was found in input
2734
NoDataConflict,
35+
WriteCanceled,
2836
};
2937

30-
QgsRasterFileWriter( const QString& outputUrl );
31-
32-
/** Create a raster file with one band without initializing the pixel data.
33-
* Returned provider may be used to initialize the raster using writeBlock() calls.
34-
* Ownership of the returned provider is passed to the caller.
35-
* @note Does not work with tiled mode enabled.
36-
* @returns Instance of data provider in editing mode (on success) or null on error.
37-
* @note added in QGIS 3.0
38-
*/
39-
QgsRasterDataProvider* createOneBandRaster( Qgis::DataType dataType,
40-
int width, int height,
41-
const QgsRectangle& extent,
42-
const QgsCoordinateReferenceSystem& crs ) /Factory/;
43-
44-
/** Write raster file
45-
@param pipe raster pipe
46-
@param nCols number of output columns
47-
@param nRows number of output rows (or -1 to automatically calculate row number to have square pixels)
48-
@param outputExtent extent to output
49-
@param crs crs to reproject to
50-
@param p dialog to show progress in */
51-
WriterError writeRaster( const QgsRasterPipe* pipe, int nCols, int nRows, const QgsRectangle& outputExtent,
52-
const QgsCoordinateReferenceSystem& crs, QgsRasterBlockFeedback *feedback = nullptr );
38+
QgsRasterFileWriter( const QString &outputUrl );
39+
40+
QgsRasterDataProvider *createOneBandRaster( Qgis::DataType dataType,
41+
int width, int height,
42+
const QgsRectangle &extent,
43+
const QgsCoordinateReferenceSystem &crs ) /Factory/;
44+
%Docstring
45+
Create a raster file with one band without initializing the pixel data.
46+
Returned provider may be used to initialize the raster using writeBlock() calls.
47+
Ownership of the returned provider is passed to the caller.
48+
.. note::
49+
50+
Does not work with tiled mode enabled.
51+
\returns Instance of data provider in editing mode (on success) or null on error.
52+
.. versionadded:: 3.0
53+
%End
54+
55+
WriterError writeRaster( const QgsRasterPipe *pipe, int nCols, int nRows, const QgsRectangle &outputExtent,
56+
const QgsCoordinateReferenceSystem &crs, QgsRasterBlockFeedback *feedback = 0 );
57+
%Docstring
58+
Write raster file
59+
\param pipe raster pipe
60+
\param nCols number of output columns
61+
\param nRows number of output rows (or -1 to automatically calculate row number to have square pixels)
62+
\param outputExtent extent to output
63+
\param crs crs to reproject to
64+
\param feedback optional feedback object for progress reports
65+
%End
5366

5467
QString outputUrl() const;
68+
%Docstring
69+
Returns the output URL for the raster.
70+
.. versionadded:: 3.0
71+
%End
5572

56-
void setOutputFormat( const QString& format );
73+
void setOutputFormat( const QString &format );
5774
QString outputFormat() const;
5875

59-
void setOutputProviderKey( const QString& key );
76+
void setOutputProviderKey( const QString &key );
6077
QString outputProviderKey() const;
6178

6279
void setTiledMode( bool t );
@@ -69,22 +86,29 @@ class QgsRasterFileWriter
6986
void setBuildPyramidsFlag( QgsRaster::RasterBuildPyramids f );
7087

7188
QList< int > pyramidsList() const;
72-
void setPyramidsList( const QList< int > & list );
73-
89+
void setPyramidsList( const QList< int > &list );
7490

7591
QString pyramidsResampling() const;
76-
void setPyramidsResampling( const QString & str );
92+
void setPyramidsResampling( const QString &str );
7793

7894
QgsRaster::RasterPyramidsFormat pyramidsFormat() const;
7995
void setPyramidsFormat( QgsRaster::RasterPyramidsFormat f );
8096

8197
void setMaxTileHeight( int h );
8298
int maxTileHeight() const;
8399

84-
void setCreateOptions( const QStringList& list );
100+
void setCreateOptions( const QStringList &list );
85101
QStringList createOptions() const;
86102

87-
void setPyramidsConfigOptions( const QStringList& list );
103+
void setPyramidsConfigOptions( const QStringList &list );
88104
QStringList pyramidsConfigOptions() const;
89105

90106
};
107+
108+
/************************************************************************
109+
* This file has been generated automatically from *
110+
* *
111+
* src/core/raster/qgsrasterfilewriter.h *
112+
* *
113+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
114+
************************************************************************/

‎scripts/sipify.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ sub processDoxygenLine
328328
}
329329

330330
# remove function bodies
331-
if ( $line =~ m/^(\s*)?(const )?(virtual |static )?((\w+(<.*?>)?\s+(\*|&)?)?(\w+|operator.)\(.*?(\(.*\))*.*\)( (?:const|SIP_[A-Z_]*?))*)\s*(\{.*\})?(?!;)(\s*\/\/.*)?$/ ){
331+
if ( $line =~ m/^(\s*)?(const )?(virtual |static )?(([\w:]+(<.*?>)?\s+(\*|&)?)?(\w+|operator.)\(.*?(\(.*\))*.*\)( (?:const|SIP_[A-Z_]*?))*)\s*(\{.*\})?(?!;)(\s*\/\/.*)?$/ ){
332332
my $newline = "$1$2$3$4;\n";
333333
if ($line !~ m/\{.*?\}$/){
334334
$line = readline $header;

‎src/core/raster/qgsrasterfilewriter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class CORE_EXPORT QgsRasterFileWriter
6565
QgsRasterDataProvider *createOneBandRaster( Qgis::DataType dataType,
6666
int width, int height,
6767
const QgsRectangle &extent,
68-
const QgsCoordinateReferenceSystem &crs );
68+
const QgsCoordinateReferenceSystem &crs ) SIP_FACTORY;
6969

7070
/** Write raster file
7171
\param pipe raster pipe

‎tests/scripts/sipifyheader.expected.sip

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,11 @@ complex default value and type (i.e. containing commas) should be given as a str
155155
void removeProxyFactory( QNetworkProxyFactory *factory /TransferBack/ );
156156

157157
bool removeFunctionBody( const QList<int, QString> &list, QgsVectorLayer *vl );
158+
QgsRaster::RasterBuildPyramids buildPyramidsFlag() const;
159+
%Docstring
160+
Removing function body with namespaced return value
161+
%End
162+
158163

159164
virtual int overriddenProperty();
160165
protected:

‎tests/scripts/sipifyheader.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,9 @@ class CORE_EXPORT QgsSipifyHeader : public QtClass<QVariant>, private Ui::QgsBas
186186

187187
bool removeFunctionBody( const QList<int, QString> &list, QgsVectorLayer *vl ) { doSomething; return true; } // some comments
188188

189+
//! Removing function body with namespaced return value
190+
QgsRaster::RasterBuildPyramids buildPyramidsFlag() const { return mBuildPyramidsFlag; }
191+
189192
bool deletedFunction() = delete; // some comments
190193

191194
virtual int overriddenProperty() override { return 42; } // if in doubt, comment it out

0 commit comments

Comments
 (0)
Please sign in to comment.