QGIS API Documentation 3.32.0-Lima (311a8cb8a6)
•All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
qgsprocessingoutputs.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsprocessingoutputs.h
3 -------------------------
4 begin : May 2017
5 copyright : (C) 2017 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSPROCESSINGOUTPUTS_H
19#define QGSPROCESSINGOUTPUTS_H
20
21#include "qgis_core.h"
22#include "qgis.h"
24
25//
26// Output definitions
27//
28
42{
43
44#ifdef SIP_RUN
46 if ( sipCpp->type() == QgsProcessingOutputVectorLayer::typeName() )
47 sipType = sipType_QgsProcessingOutputVectorLayer;
48 else if ( sipCpp->type() == QgsProcessingOutputRasterLayer::typeName() )
49 sipType = sipType_QgsProcessingOutputRasterLayer;
50 else if ( sipCpp->type() == QgsProcessingOutputPointCloudLayer::typeName() )
51 sipType = sipType_QgsProcessingOutputPointCloudLayer;
52 else if ( sipCpp->type() == QgsProcessingOutputVectorTileLayer::typeName() )
53 sipType = sipType_QgsProcessingOutputVectorTileLayer;
54 else if ( sipCpp->type() == QgsProcessingOutputMapLayer::typeName() )
55 sipType = sipType_QgsProcessingOutputMapLayer;
56 else if ( sipCpp->type() == QgsProcessingOutputMultipleLayers::typeName() )
57 sipType = sipType_QgsProcessingOutputMultipleLayers;
58 else if ( sipCpp->type() == QgsProcessingOutputHtml::typeName() )
59 sipType = sipType_QgsProcessingOutputHtml;
60 else if ( sipCpp->type() == QgsProcessingOutputNumber::typeName() )
61 sipType = sipType_QgsProcessingOutputNumber;
62 else if ( sipCpp->type() == QgsProcessingOutputString::typeName() )
63 sipType = sipType_QgsProcessingOutputString;
64 else if ( sipCpp->type() == QgsProcessingOutputBoolean::typeName() )
65 sipType = sipType_QgsProcessingOutputBoolean;
66 else if ( sipCpp->type() == QgsProcessingOutputFolder::typeName() )
67 sipType = sipType_QgsProcessingOutputFolder;
68 else if ( sipCpp->type() == QgsProcessingOutputFile::typeName() )
69 sipType = sipType_QgsProcessingOutputFile;
70 else if ( sipCpp->type() == QgsProcessingOutputConditionalBranch::typeName() )
71 sipType = sipType_QgsProcessingOutputConditionalBranch;
72 else
73 sipType = nullptr;
75#endif
76
77 public:
78
82 QgsProcessingOutputDefinition( const QString &name, const QString &description = QString() );
83
84 virtual ~QgsProcessingOutputDefinition() = default;
85
89 virtual QString type() const = 0;
90
96 QString name() const { return mName; }
97
103 void setName( const QString &name ) { mName = name; }
104
110 QString description() const { return mDescription; }
111
117 void setDescription( const QString &description ) { mDescription = description; }
118
125 void setAutoCreated( bool autoCreated ) { mAutoCreated = autoCreated; }
126
132 bool autoCreated() const { return mAutoCreated; }
133
134 protected:
135
137 QString mName;
138
141
142 bool mAutoCreated = false;
143};
144
146typedef QList< const QgsProcessingOutputDefinition * > QgsProcessingOutputDefinitions;
147
159{
160 public:
161
165 QgsProcessingOutputMapLayer( const QString &name, const QString &description = QString() );
166
170 static QString typeName() { return QStringLiteral( "outputLayer" ); }
171
172 QString type() const override;
173};
174
182{
183 public:
184
188 QgsProcessingOutputVectorLayer( const QString &name, const QString &description = QString(), QgsProcessing::SourceType type = QgsProcessing::TypeVectorAnyGeometry );
189
193 static QString typeName() { return QStringLiteral( "outputVector" ); }
194 QString type() const override { return typeName(); }
195
200 QgsProcessing::SourceType dataType() const;
201
206 void setDataType( QgsProcessing::SourceType type );
207
208 private:
209
211};
212
220{
221 public:
222
226 QgsProcessingOutputRasterLayer( const QString &name, const QString &description = QString() );
227
231 static QString typeName() { return QStringLiteral( "outputRaster" ); }
232 QString type() const override { return typeName(); }
233};
234
242{
243 public:
244
248 QgsProcessingOutputPointCloudLayer( const QString &name, const QString &description = QString() );
249
253 static QString typeName() { return QStringLiteral( "outputPointCloud" ); }
254 QString type() const override { return typeName(); }
255};
256
271{
272 public:
273
277 QgsProcessingOutputMultipleLayers( const QString &name, const QString &description = QString() );
278
282 static QString typeName() { return QStringLiteral( "outputMultilayer" ); }
283 QString type() const override;
284};
285
293{
294 public:
295
299 QgsProcessingOutputHtml( const QString &name, const QString &description = QString() );
300
304 static QString typeName() { return QStringLiteral( "outputHtml" ); }
305 QString type() const override { return typeName(); }
306};
307
315{
316 public:
317
321 QgsProcessingOutputNumber( const QString &name, const QString &description = QString() );
322
326 static QString typeName() { return QStringLiteral( "outputNumber" ); }
327 QString type() const override { return typeName(); }
328};
329
337{
338 public:
339
343 QgsProcessingOutputString( const QString &name, const QString &description = QString() );
344
348 static QString typeName() { return QStringLiteral( "outputString" ); }
349 QString type() const override { return typeName(); }
350};
351
359{
360 public:
361
365 QgsProcessingOutputBoolean( const QString &name, const QString &description = QString() );
366
370 static QString typeName() { return QStringLiteral( "outputBoolean" ); }
371 QString type() const override { return typeName(); }
372};
373
381{
382 public:
383
388 QgsProcessingOutputFolder( const QString &name, const QString &description = QString() );
389
393 static QString typeName() { return QStringLiteral( "outputFolder" ); }
394 QString type() const override { return typeName(); }
395};
396
404{
405 public:
406
410 QgsProcessingOutputFile( const QString &name, const QString &description = QString() );
411
415 static QString typeName() { return QStringLiteral( "outputFile" ); }
416 QString type() const override { return typeName(); }
417};
418
427{
428 public:
429
433 QgsProcessingOutputConditionalBranch( const QString &name, const QString &description = QString() );
434
438 static QString typeName() { return QStringLiteral( "outputBranch" ); }
439 QString type() const override { return typeName(); }
440};
441
449{
450 public:
451
455 QgsProcessingOutputVectorTileLayer( const QString &name, const QString &description = QString() );
456
460 static QString typeName() { return QStringLiteral( "outputVectorTile" ); }
461 QString type() const override { return typeName(); }
462};
463
464#endif // QGSPROCESSINGOUTPUTS_H
A boolean output for processing algorithms.
QString type() const override
Unique output type name.
static QString typeName()
Returns the type name for the output class.
A conditional branch output for processing algorithms, which represents a possible model logic flow w...
static QString typeName()
Returns the type name for the output class.
QString type() const override
Unique output type name.
Base class for the definition of processing outputs.
void setDescription(const QString &description)
Sets the description for the output.
QString name() const
Returns the name of the output.
void setName(const QString &name)
Sets the name of the output.
void setAutoCreated(bool autoCreated)
Sets whether an output was automatically created when adding a parameter.
virtual ~QgsProcessingOutputDefinition()=default
virtual QString type() const =0
Unique output type name.
bool autoCreated() const
Returns true if the output was automatically created when adding a parameter.
QString mDescription
Output description.
QString description() const
Returns the description for the output.
A file output for processing algorithms.
QString type() const override
Unique output type name.
static QString typeName()
Returns the type name for the output class.
A folder output for processing algorithms.
QString type() const override
Unique output type name.
static QString typeName()
Returns the type name for the output class.
A HTML file output for processing algorithms.
QString type() const override
Unique output type name.
static QString typeName()
Returns the type name for the output class.
A map layer output for processing algorithms, where layers may be either vector or raster.
static QString typeName()
Returns the type name for the output class.
A multi-layer output for processing algorithms which create map layers, when the number and nature of...
static QString typeName()
Returns the type name for the output class.
A numeric output for processing algorithms.
QString type() const override
Unique output type name.
static QString typeName()
Returns the type name for the output class.
A pointcloud layer output for processing algorithms.
QString type() const override
Unique output type name.
static QString typeName()
Returns the type name for the output class.
A raster layer output for processing algorithms.
static QString typeName()
Returns the type name for the output class.
QString type() const override
Unique output type name.
A string output for processing algorithms.
QString type() const override
Unique output type name.
static QString typeName()
Returns the type name for the output class.
A vector layer output for processing algorithms.
QString type() const override
Unique output type name.
static QString typeName()
Returns the type name for the output class.
A vector tile layer output for processing algorithms.
static QString typeName()
Returns the type name for the output class.
QString type() const override
Unique output type name.
SourceType
Data source types enum.
Definition: qgsprocessing.h:47
@ TypeVectorAnyGeometry
Any vector layer with geometry.
Definition: qgsprocessing.h:49
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition: qgis_sip.h:186
#define SIP_END
Definition: qgis_sip.h:203
QList< const QgsProcessingOutputDefinition * > QgsProcessingOutputDefinitions
List of processing parameters.
const QString & typeName