QGIS API Documentation 3.34.0-Prizren (ffbdd678812)
Loading...
Searching...
No Matches
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"
23#include "qgsprocessing.h"
24//
25// Output definitions
26//
27
41{
42
43#ifdef SIP_RUN
45 if ( sipCpp->type() == QgsProcessingOutputVectorLayer::typeName() )
46 sipType = sipType_QgsProcessingOutputVectorLayer;
47 else if ( sipCpp->type() == QgsProcessingOutputRasterLayer::typeName() )
48 sipType = sipType_QgsProcessingOutputRasterLayer;
49 else if ( sipCpp->type() == QgsProcessingOutputPointCloudLayer::typeName() )
50 sipType = sipType_QgsProcessingOutputPointCloudLayer;
51 else if ( sipCpp->type() == QgsProcessingOutputVectorTileLayer::typeName() )
52 sipType = sipType_QgsProcessingOutputVectorTileLayer;
53 else if ( sipCpp->type() == QgsProcessingOutputMapLayer::typeName() )
54 sipType = sipType_QgsProcessingOutputMapLayer;
55 else if ( sipCpp->type() == QgsProcessingOutputMultipleLayers::typeName() )
56 sipType = sipType_QgsProcessingOutputMultipleLayers;
57 else if ( sipCpp->type() == QgsProcessingOutputHtml::typeName() )
58 sipType = sipType_QgsProcessingOutputHtml;
59 else if ( sipCpp->type() == QgsProcessingOutputNumber::typeName() )
60 sipType = sipType_QgsProcessingOutputNumber;
61 else if ( sipCpp->type() == QgsProcessingOutputString::typeName() )
62 sipType = sipType_QgsProcessingOutputString;
63 else if ( sipCpp->type() == QgsProcessingOutputBoolean::typeName() )
64 sipType = sipType_QgsProcessingOutputBoolean;
65 else if ( sipCpp->type() == QgsProcessingOutputFolder::typeName() )
66 sipType = sipType_QgsProcessingOutputFolder;
67 else if ( sipCpp->type() == QgsProcessingOutputFile::typeName() )
68 sipType = sipType_QgsProcessingOutputFile;
69 else if ( sipCpp->type() == QgsProcessingOutputConditionalBranch::typeName() )
70 sipType = sipType_QgsProcessingOutputConditionalBranch;
71 else if ( sipCpp->type() == QgsProcessingOutputVariant::typeName() )
72 sipType = sipType_QgsProcessingOutputVariant;
73 else
74 sipType = nullptr;
76#endif
77
78 public:
79
83 QgsProcessingOutputDefinition( const QString &name, const QString &description = QString() );
84
85 virtual ~QgsProcessingOutputDefinition() = default;
86
90 virtual QString type() const = 0;
91
97 QString name() const { return mName; }
98
104 void setName( const QString &name ) { mName = name; }
105
111 QString description() const { return mDescription; }
112
118 void setDescription( const QString &description ) { mDescription = description; }
119
126 void setAutoCreated( bool autoCreated ) { mAutoCreated = autoCreated; }
127
133 bool autoCreated() const { return mAutoCreated; }
134
135 protected:
136
138 QString mName;
139
142
143 bool mAutoCreated = false;
144};
145
147typedef QList< const QgsProcessingOutputDefinition * > QgsProcessingOutputDefinitions;
148
160{
161 public:
162
166 QgsProcessingOutputMapLayer( const QString &name, const QString &description = QString() );
167
171 static QString typeName() { return QStringLiteral( "outputLayer" ); }
172
173 QString type() const override;
174};
175
183{
184 public:
185
189 QgsProcessingOutputVectorLayer( const QString &name, const QString &description = QString(), QgsProcessing::SourceType type = QgsProcessing::TypeVectorAnyGeometry );
190
194 static QString typeName() { return QStringLiteral( "outputVector" ); }
195 QString type() const override { return typeName(); }
196
201 QgsProcessing::SourceType dataType() const;
202
207 void setDataType( QgsProcessing::SourceType type );
208
209 private:
210
212};
213
221{
222 public:
223
227 QgsProcessingOutputRasterLayer( const QString &name, const QString &description = QString() );
228
232 static QString typeName() { return QStringLiteral( "outputRaster" ); }
233 QString type() const override { return typeName(); }
234};
235
243{
244 public:
245
249 QgsProcessingOutputPointCloudLayer( const QString &name, const QString &description = QString() );
250
254 static QString typeName() { return QStringLiteral( "outputPointCloud" ); }
255 QString type() const override { return typeName(); }
256};
257
272{
273 public:
274
278 QgsProcessingOutputMultipleLayers( const QString &name, const QString &description = QString() );
279
283 static QString typeName() { return QStringLiteral( "outputMultilayer" ); }
284 QString type() const override;
285};
286
294{
295 public:
296
300 QgsProcessingOutputHtml( const QString &name, const QString &description = QString() );
301
305 static QString typeName() { return QStringLiteral( "outputHtml" ); }
306 QString type() const override { return typeName(); }
307};
308
309
317{
318 public:
319
323 QgsProcessingOutputVariant( const QString &name, const QString &description = QString() );
324
328 static QString typeName() { return QStringLiteral( "outputVariant" ); }
329 QString type() const override;
330};
331
339{
340 public:
341
345 QgsProcessingOutputNumber( const QString &name, const QString &description = QString() );
346
350 static QString typeName() { return QStringLiteral( "outputNumber" ); }
351 QString type() const override { return typeName(); }
352};
353
361{
362 public:
363
367 QgsProcessingOutputString( const QString &name, const QString &description = QString() );
368
372 static QString typeName() { return QStringLiteral( "outputString" ); }
373 QString type() const override { return typeName(); }
374};
375
383{
384 public:
385
389 QgsProcessingOutputBoolean( const QString &name, const QString &description = QString() );
390
394 static QString typeName() { return QStringLiteral( "outputBoolean" ); }
395 QString type() const override { return typeName(); }
396};
397
405{
406 public:
407
412 QgsProcessingOutputFolder( const QString &name, const QString &description = QString() );
413
417 static QString typeName() { return QStringLiteral( "outputFolder" ); }
418 QString type() const override { return typeName(); }
419};
420
428{
429 public:
430
434 QgsProcessingOutputFile( const QString &name, const QString &description = QString() );
435
439 static QString typeName() { return QStringLiteral( "outputFile" ); }
440 QString type() const override { return typeName(); }
441};
442
451{
452 public:
453
457 QgsProcessingOutputConditionalBranch( const QString &name, const QString &description = QString() );
458
462 static QString typeName() { return QStringLiteral( "outputBranch" ); }
463 QString type() const override { return typeName(); }
464};
465
473{
474 public:
475
479 QgsProcessingOutputVectorTileLayer( const QString &name, const QString &description = QString() );
480
484 static QString typeName() { return QStringLiteral( "outputVectorTile" ); }
485 QString type() const override { return typeName(); }
486};
487
488#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 variant output for processing algorithms, capable of storing any QVariant value.
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.
@ TypeVectorAnyGeometry
Any vector layer with geometry.
#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