QGIS API Documentation  3.23.0-Master (b5237dafc3)
qgsprocessingparameters.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsprocessingparameters.h
3  -------------------------
4  begin : April 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 QGSPROCESSINGPARAMETERS_H
19 #define QGSPROCESSINGPARAMETERS_H
20 
21 #include "qgis_core.h"
22 #include "qgis.h"
23 #include "qgsprocessing.h"
24 #include "qgsproperty.h"
26 #include "qgsfeaturesource.h"
27 #include "qgsprocessingutils.h"
28 #include "qgsfilefiltergenerator.h"
30 #include <QMap>
31 #include <limits>
32 
35 class QgsRasterLayer;
36 class QgsMeshLayer;
37 class QgsVectorLayer;
38 class QgsFeatureSink;
43 class QgsPrintLayout;
44 class QgsLayoutItem;
45 class QgsPointCloudLayer;
46 class QgsAnnotationLayer;
47 
58 {
59  public:
60 
65  enum Flag
66  {
67  FlagOverrideDefaultGeometryCheck = 1 << 0,
68  FlagCreateIndividualOutputPerInputFeature = 1 << 1,
69  };
70  Q_DECLARE_FLAGS( Flags, Flag )
71 
72 
85  QgsProcessingFeatureSourceDefinition( const QString &source = QString(), bool selectedFeaturesOnly = false, long long featureLimit = -1,
86  QgsProcessingFeatureSourceDefinition::Flags flags = QgsProcessingFeatureSourceDefinition::Flags(), QgsFeatureRequest::InvalidGeometryCheck geometryCheck = QgsFeatureRequest::GeometryAbortOnInvalid )
87  : source( QgsProperty::fromValue( source ) )
88  , selectedFeaturesOnly( selectedFeaturesOnly )
89  , featureLimit( featureLimit )
90  , flags( flags )
91  , geometryCheck( geometryCheck )
92  {}
93 
107  QgsProcessingFeatureSourceDefinition( const QgsProperty &source, bool selectedFeaturesOnly = false, long long featureLimit = -1,
108  QgsProcessingFeatureSourceDefinition::Flags flags = QgsProcessingFeatureSourceDefinition::Flags(), QgsFeatureRequest::InvalidGeometryCheck geometryCheck = QgsFeatureRequest::GeometryAbortOnInvalid )
109  : source( source )
110  , selectedFeaturesOnly( selectedFeaturesOnly )
111  , featureLimit( featureLimit )
112  , flags( flags )
113  , geometryCheck( geometryCheck )
114  {}
115 
120 
125 
132  long long featureLimit = -1;
133 
139  Flags flags = Flags();
140 
150 
157  QVariant toVariant() const;
158 
165  bool loadVariant( const QVariantMap &map );
166 
167  // TODO c++20 - replace with = default
169  {
170  return source == other.source
171  && selectedFeaturesOnly == other.selectedFeaturesOnly
172  && featureLimit == other.featureLimit
173  && flags == other.flags
174  && geometryCheck == other.geometryCheck;
175  }
176 
178  {
179  return !( *this == other );
180  }
181 
183  operator QVariant() const
184  {
185  return QVariant::fromValue( *this );
186  }
187 
188 };
189 
191 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsProcessingFeatureSourceDefinition::Flags )
192 
193 
203 {
204  public:
205 
211  QgsProcessingOutputLayerDefinition( const QString &sink = QString(), QgsProject *destinationProject = nullptr )
212  : sink( QgsProperty::fromValue( sink ) )
213  , destinationProject( destinationProject )
214  {}
215 
221  QgsProcessingOutputLayerDefinition( const QgsProperty &sink, QgsProject *destinationProject = nullptr )
222  : sink( sink )
223  , destinationProject( destinationProject )
224  {}
225 
230 
236  QgsProject *destinationProject = nullptr;
237 
242 
249  QVariantMap createOptions;
250 
257  bool useRemapping() const { return mUseRemapping; }
258 
266  QgsRemappingSinkDefinition remappingDefinition() const { return mRemappingDefinition; }
267 
278  void setRemappingDefinition( const QgsRemappingSinkDefinition &definition );
279 
286  QVariant toVariant() const;
287 
294  bool loadVariant( const QVariantMap &map );
295 
297  operator QVariant() const
298  {
299  return QVariant::fromValue( *this );
300  }
301 
302  // TODO c++20 - replace with = default
303  bool operator==( const QgsProcessingOutputLayerDefinition &other ) const;
304  bool operator!=( const QgsProcessingOutputLayerDefinition &other ) const;
305 
306  private:
307 
308  bool mUseRemapping = false;
309  QgsRemappingSinkDefinition mRemappingDefinition;
310 
311 };
312 
314 
315 
316 
317 
318 //
319 // Parameter definitions
320 //
321 
322 
335 {
336 
337 #ifdef SIP_RUN
338  % TypeHeaderCode
345  % End
347  if ( sipCpp->type() == QgsProcessingParameterBoolean::typeName() )
348  sipType = sipType_QgsProcessingParameterBoolean;
349  else if ( sipCpp->type() == QgsProcessingParameterCrs::typeName() )
350  sipType = sipType_QgsProcessingParameterCrs;
351  else if ( sipCpp->type() == QgsProcessingParameterMapLayer::typeName() )
352  sipType = sipType_QgsProcessingParameterMapLayer;
353  else if ( sipCpp->type() == QgsProcessingParameterExtent::typeName() )
354  sipType = sipType_QgsProcessingParameterExtent;
355  else if ( sipCpp->type() == QgsProcessingParameterPoint::typeName() )
356  sipType = sipType_QgsProcessingParameterPoint;
357  else if ( sipCpp->type() == QgsProcessingParameterGeometry::typeName() )
358  sipType = sipType_QgsProcessingParameterGeometry;
359  else if ( sipCpp->type() == QgsProcessingParameterFile::typeName() )
360  sipType = sipType_QgsProcessingParameterFile;
361  else if ( sipCpp->type() == QgsProcessingParameterMatrix::typeName() )
362  sipType = sipType_QgsProcessingParameterMatrix;
363  else if ( sipCpp->type() == QgsProcessingParameterMultipleLayers::typeName() )
364  sipType = sipType_QgsProcessingParameterMultipleLayers;
365  else if ( sipCpp->type() == QgsProcessingParameterNumber::typeName() )
366  sipType = sipType_QgsProcessingParameterNumber;
367  else if ( sipCpp->type() == QgsProcessingParameterDistance::typeName() )
368  sipType = sipType_QgsProcessingParameterDistance;
369  else if ( sipCpp->type() == QgsProcessingParameterDuration::typeName() )
370  sipType = sipType_QgsProcessingParameterDuration;
371  else if ( sipCpp->type() == QgsProcessingParameterScale::typeName() )
372  sipType = sipType_QgsProcessingParameterScale;
373  else if ( sipCpp->type() == QgsProcessingParameterRange::typeName() )
374  sipType = sipType_QgsProcessingParameterRange;
375  else if ( sipCpp->type() == QgsProcessingParameterRasterLayer::typeName() )
376  sipType = sipType_QgsProcessingParameterRasterLayer;
377  else if ( sipCpp->type() == QgsProcessingParameterMeshLayer::typeName() )
378  sipType = sipType_QgsProcessingParameterMeshLayer;
379  else if ( sipCpp->type() == QgsProcessingParameterEnum::typeName() )
380  sipType = sipType_QgsProcessingParameterEnum;
381  else if ( sipCpp->type() == QgsProcessingParameterString::typeName() )
382  sipType = sipType_QgsProcessingParameterString;
383  else if ( sipCpp->type() == QgsProcessingParameterExpression::typeName() )
384  sipType = sipType_QgsProcessingParameterExpression;
385  else if ( sipCpp->type() == QgsProcessingParameterAuthConfig::typeName() )
386  sipType = sipType_QgsProcessingParameterAuthConfig;
387  else if ( sipCpp->type() == QgsProcessingParameterVectorLayer::typeName() )
388  sipType = sipType_QgsProcessingParameterVectorLayer;
389  else if ( sipCpp->type() == QgsProcessingParameterField::typeName() )
390  sipType = sipType_QgsProcessingParameterField;
391  else if ( sipCpp->type() == QgsProcessingParameterFeatureSource::typeName() )
392  sipType = sipType_QgsProcessingParameterFeatureSource;
393  else if ( sipCpp->type() == QgsProcessingParameterFeatureSink::typeName() )
394  sipType = sipType_QgsProcessingParameterFeatureSink;
395  else if ( sipCpp->type() == QgsProcessingParameterVectorDestination::typeName() )
396  sipType = sipType_QgsProcessingParameterVectorDestination;
397  else if ( sipCpp->type() == QgsProcessingParameterRasterDestination::typeName() )
398  sipType = sipType_QgsProcessingParameterRasterDestination;
399  else if ( sipCpp->type() == QgsProcessingParameterPointCloudDestination::typeName() )
400  sipType = sipType_QgsProcessingParameterPointCloudDestination;
401  else if ( sipCpp->type() == QgsProcessingParameterFileDestination::typeName() )
402  sipType = sipType_QgsProcessingParameterFileDestination;
403  else if ( sipCpp->type() == QgsProcessingParameterFolderDestination::typeName() )
404  sipType = sipType_QgsProcessingParameterFolderDestination;
405  else if ( sipCpp->type() == QgsProcessingParameterBand::typeName() )
406  sipType = sipType_QgsProcessingParameterBand;
407  else if ( sipCpp->type() == QgsProcessingParameterLayout::typeName() )
408  sipType = sipType_QgsProcessingParameterLayout;
409  else if ( sipCpp->type() == QgsProcessingParameterLayoutItem::typeName() )
410  sipType = sipType_QgsProcessingParameterLayoutItem;
411  else if ( sipCpp->type() == QgsProcessingParameterColor::typeName() )
412  sipType = sipType_QgsProcessingParameterColor;
413  else if ( sipCpp->type() == QgsProcessingParameterCoordinateOperation::typeName() )
414  sipType = sipType_QgsProcessingParameterCoordinateOperation;
415  else if ( sipCpp->type() == QgsProcessingParameterMapTheme::typeName() )
416  sipType = sipType_QgsProcessingParameterMapTheme;
417  else if ( sipCpp->type() == QgsProcessingParameterDateTime::typeName() )
418  sipType = sipType_QgsProcessingParameterDateTime;
419  else if ( sipCpp->type() == QgsProcessingParameterProviderConnection::typeName() )
420  sipType = sipType_QgsProcessingParameterProviderConnection;
421  else if ( sipCpp->type() == QgsProcessingParameterDatabaseSchema::typeName() )
422  sipType = sipType_QgsProcessingParameterDatabaseSchema;
423  else if ( sipCpp->type() == QgsProcessingParameterDatabaseTable::typeName() )
424  sipType = sipType_QgsProcessingParameterDatabaseTable;
425  else if ( sipCpp->type() == QgsProcessingParameterFieldMapping::typeName() )
426  sipType = sipType_QgsProcessingParameterFieldMapping;
427  else if ( sipCpp->type() == QgsProcessingParameterTinInputLayers::typeName() )
428  sipType = sipType_QgsProcessingParameterTinInputLayers;
429  else if ( sipCpp->type() == QgsProcessingParameterVectorTileWriterLayers::typeName() )
430  sipType = sipType_QgsProcessingParameterVectorTileWriterLayers;
431  else if ( sipCpp->type() == QgsProcessingParameterDxfLayers::typeName() )
432  sipType = sipType_QgsProcessingParameterDxfLayers;
433  else if ( sipCpp->type() == QgsProcessingParameterMeshDatasetGroups::typeName() )
434  sipType = sipType_QgsProcessingParameterMeshDatasetGroups;
435  else if ( sipCpp->type() == QgsProcessingParameterMeshDatasetTime::typeName() )
436  sipType = sipType_QgsProcessingParameterMeshDatasetTime;
437  else if ( sipCpp->type() == QgsProcessingParameterPointCloudLayer::typeName() )
438  sipType = sipType_QgsProcessingParameterPointCloudLayer;
439  else if ( sipCpp->type() == QgsProcessingParameterAnnotationLayer::typeName() )
440  sipType = sipType_QgsProcessingParameterAnnotationLayer;
441  else
442  sipType = nullptr;
443  SIP_END
444 #endif
445 
446  public:
447 
449  enum Flag
450  {
451  FlagAdvanced = 1 << 1,
452  FlagHidden = 1 << 2,
453  FlagOptional = 1 << 3,
454  FlagIsModelOutput = 1 << 4,
455  };
456  Q_DECLARE_FLAGS( Flags, Flag )
457 
458 
461  QgsProcessingParameterDefinition( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
462  bool optional = false, const QString &help = QString() );
463 
465 
470 
474  virtual QString type() const = 0;
475 
481  virtual bool isDestination() const { return false; }
482 
488  QString name() const { return mName; }
489 
495  void setName( const QString &name ) { mName = name; }
496 
502  QString description() const { return mDescription; }
503 
509  void setDescription( const QString &description ) { mDescription = description; }
510 
520  QString help() const { return mHelp; }
521 
531  void setHelp( const QString &help ) { mHelp = help; }
532 
539  QVariant defaultValue() const { return mDefault; }
540 
547  void setDefaultValue( const QVariant &value ) { mDefault = value; }
548 
561  QVariant guiDefaultValueOverride() const { return mGuiDefault; }
562 
578  void setGuiDefaultValueOverride( const QVariant &value ) { mGuiDefault = value; }
579 
588  QVariant defaultValueForGui() const { return mGuiDefault.isValid() ? mGuiDefault : mDefault; }
589 
594  Flags flags() const { return mFlags; }
595 
600  void setFlags( Flags flags ) { mFlags = flags; }
601 
609  virtual bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const;
610 
618  virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
619 
631  virtual QVariant valueAsJsonObject( const QVariant &value, QgsProcessingContext &context ) const;
632 
646  virtual QString valueAsString( const QVariant &value, QgsProcessingContext &context, bool &ok SIP_OUT ) const;
647 
661  virtual QStringList valueAsStringList( const QVariant &value, QgsProcessingContext &context, bool &ok SIP_OUT ) const;
662 
668  virtual QString valueAsPythonComment( const QVariant &value, QgsProcessingContext &context ) const;
669 
674  virtual QString asScriptCode() const;
675 
685  virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
686 
692  virtual QVariantMap toVariantMap() const;
693 
699  virtual bool fromVariantMap( const QVariantMap &map );
700 
707  SIP_SKIP QVariantMap metadata() const { return mMetadata; }
708 
714  QVariantMap &metadata() { return mMetadata; }
715 
721  void setMetadata( const QVariantMap &metadata ) { mMetadata = metadata; }
722 
727  virtual QStringList dependsOnOtherParameters() const { return QStringList(); }
728 
735 
741  QgsProcessingProvider *provider() const;
742 
747  virtual QString toolTip() const;
748 
756  bool isDynamic() const { return mIsDynamic; }
757 
765  void setIsDynamic( bool dynamic ) { mIsDynamic = dynamic; }
766 
773  QgsPropertyDefinition dynamicPropertyDefinition() const { return mPropertyDefinition; }
774 
781  void setDynamicPropertyDefinition( const QgsPropertyDefinition &definition ) { mPropertyDefinition = definition; }
782 
794  QString dynamicLayerParameterName() const { return mDynamicLayerParameterName; }
795 
807  void setDynamicLayerParameterName( const QString &name ) { mDynamicLayerParameterName = name; }
808 
822  QStringList additionalExpressionContextVariables() const { return mAdditionalExpressionVariables; }
823 
841  void setAdditionalExpressionContextVariables( const QStringList &variables ) { mAdditionalExpressionVariables = variables; }
842 
843  protected:
844 
846  QString mName;
847 
849  QString mDescription;
850 
852  QString mHelp;
853 
855  QVariant mDefault;
856 
858  QVariant mGuiDefault;
859 
861  Flags mFlags;
862 
864  QVariantMap mMetadata;
865 
867  QgsProcessingAlgorithm *mAlgorithm = nullptr;
868 
870  bool mIsDynamic = false;
871 
874 
877 
880 
881  // To allow access to mAlgorithm. We don't want a public setter for this!
883 
884 };
885 
886 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsProcessingParameterDefinition::Flags )
887 
888 typedef QList< const QgsProcessingParameterDefinition * > QgsProcessingParameterDefinitions;
890 
909 class CORE_EXPORT QgsProcessingParameters
910 {
911 
912  public:
913 
918  static bool isDynamic( const QVariantMap &parameters, const QString &name );
919 
923  static QString parameterAsString( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
924 
929  static QString parameterAsString( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
930 
934  static QString parameterAsExpression( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
935 
940  static QString parameterAsExpression( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
941 
945  static double parameterAsDouble( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
946 
951  static double parameterAsDouble( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
952 
956  static int parameterAsInt( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
957 
962  static int parameterAsInt( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
963 
968  static QList<int> parameterAsInts( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
969 
974  static QList<int> parameterAsInts( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
975 
984  static QDateTime parameterAsDateTime( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
985 
994  static QDateTime parameterAsDateTime( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
995 
1004  static QDate parameterAsDate( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
1005 
1014  static QDate parameterAsDate( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
1015 
1024  static QTime parameterAsTime( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
1025 
1034  static QTime parameterAsTime( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
1035 
1039  static int parameterAsEnum( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
1040 
1045  static int parameterAsEnum( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
1046 
1050  static QList<int> parameterAsEnums( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
1051 
1056  static QList<int> parameterAsEnums( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
1057 
1062  static QString parameterAsEnumString( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
1063 
1068  static QString parameterAsEnumString( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
1069 
1074  static QStringList parameterAsEnumStrings( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
1075 
1080  static QStringList parameterAsEnumStrings( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
1081 
1085  static bool parameterAsBool( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
1086 
1092  static bool parameterAsBoolean( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
1093 
1098  static bool parameterAsBool( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
1099 
1104  static bool parameterAsBoolean( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
1105 
1123  static QgsFeatureSink *parameterAsSink( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters,
1124  const QgsFields &fields, QgsWkbTypes::Type geometryType, const QgsCoordinateReferenceSystem &crs,
1125  QgsProcessingContext &context, QString &destinationIdentifier SIP_OUT, QgsFeatureSink::SinkFlags sinkFlags = QgsFeatureSink::SinkFlags(), const QVariantMap &createOptions = QVariantMap(), const QStringList &datasourceOptions = QStringList(), const QStringList &layerOptions = QStringList() ) SIP_FACTORY;
1126 
1146  static QgsFeatureSink *parameterAsSink( const QgsProcessingParameterDefinition *definition, const QVariant &value,
1147  const QgsFields &fields, QgsWkbTypes::Type geometryType, const QgsCoordinateReferenceSystem &crs,
1148  QgsProcessingContext &context, QString &destinationIdentifier SIP_OUT, QgsFeatureSink::SinkFlags sinkFlags = QgsFeatureSink::SinkFlags(), const QVariantMap &createOptions = QVariantMap(), const QStringList &datasourceOptions = QStringList(), const QStringList &layerOptions = QStringList() ) SIP_THROW( QgsProcessingException ) SIP_FACTORY;
1149 
1158  static QgsProcessingFeatureSource *parameterAsSource( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context ) SIP_FACTORY;
1159 
1170  static QgsProcessingFeatureSource *parameterAsSource( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context ) SIP_FACTORY;
1171 
1187  static QString parameterAsCompatibleSourceLayerPath( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters,
1188  QgsProcessingContext &context, const QStringList &compatibleFormats, const QString &preferredFormat = QString( "shp" ), QgsProcessingFeedback *feedback = nullptr );
1189 
1219  static QString parameterAsCompatibleSourceLayerPathAndLayerName( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters,
1220  QgsProcessingContext &context, const QStringList &compatibleFormats, const QString &preferredFormat = QString( "shp" ), QgsProcessingFeedback *feedback = nullptr, QString *layerName SIP_OUT = nullptr );
1221 
1229  static QgsMapLayer *parameterAsLayer( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingUtils::LayerHint layerHint = QgsProcessingUtils::LayerHint::UnknownType );
1230 
1240  static QgsMapLayer *parameterAsLayer( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context, QgsProcessingUtils::LayerHint layerHint = QgsProcessingUtils::LayerHint::UnknownType );
1241 
1249  static QgsRasterLayer *parameterAsRasterLayer( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1250 
1260  static QgsRasterLayer *parameterAsRasterLayer( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1261 
1265  static QString parameterAsOutputLayer( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1266 
1271  static QString parameterAsOutputLayer( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1272 
1276  static QString parameterAsFileOutput( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1277 
1282  static QString parameterAsFileOutput( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1283 
1291  static QgsVectorLayer *parameterAsVectorLayer( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1292 
1302  static QgsVectorLayer *parameterAsVectorLayer( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1303 
1313  static QgsMeshLayer *parameterAsMeshLayer( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1314 
1324  static QgsMeshLayer *parameterAsMeshLayer( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1325 
1329  static QgsCoordinateReferenceSystem parameterAsCrs( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1330 
1335  static QgsCoordinateReferenceSystem parameterAsCrs( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1336 
1346  static QgsRectangle parameterAsExtent( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context,
1348 
1360  static QgsRectangle parameterAsExtent( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context,
1362 
1374  static QgsGeometry parameterAsExtentGeometry( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context,
1376 
1382  static QgsCoordinateReferenceSystem parameterAsExtentCrs( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1383 
1389  static QgsCoordinateReferenceSystem parameterAsExtentCrs( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1390 
1391 
1399  static QgsPointXY parameterAsPoint( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context,
1401 
1410  static QgsPointXY parameterAsPoint( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context,
1412 
1418  static QgsCoordinateReferenceSystem parameterAsPointCrs( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1419 
1426  static QgsCoordinateReferenceSystem parameterAsPointCrs( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1427 
1433  static QgsGeometry parameterAsGeometry( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context, const QgsCoordinateReferenceSystem &crs = QgsCoordinateReferenceSystem() );
1434 
1440  static QgsGeometry parameterAsGeometry( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context, const QgsCoordinateReferenceSystem &crs = QgsCoordinateReferenceSystem() );
1441 
1448  static QgsCoordinateReferenceSystem parameterAsGeometryCrs( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1449 
1456  static QgsCoordinateReferenceSystem parameterAsGeometryCrs( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1457 
1461  static QString parameterAsFile( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1462 
1467  static QString parameterAsFile( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1468 
1473  static QVariantList parameterAsMatrix( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1474 
1480  static QVariantList parameterAsMatrix( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1481 
1485  static QList< QgsMapLayer *> parameterAsLayerList( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1486 
1491  static QList< QgsMapLayer *> parameterAsLayerList( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1492 
1498  static QStringList parameterAsFileList( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1499 
1505  static QStringList parameterAsFileList( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1506 
1510  static QList<double> parameterAsRange( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1511 
1516  static QList<double> parameterAsRange( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1517 
1521  static QStringList parameterAsFields( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1522 
1527  static QStringList parameterAsFields( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1528 
1537  static QgsPrintLayout *parameterAsLayout( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1538 
1547  static QgsPrintLayout *parameterAsLayout( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1548 
1557  static QgsLayoutItem *parameterAsLayoutItem( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context, QgsPrintLayout *layout );
1558 
1567  static QgsLayoutItem *parameterAsLayoutItem( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context, QgsPrintLayout *layout );
1568 
1574  static QColor parameterAsColor( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1575 
1581  static QColor parameterAsColor( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1582 
1588  static QString parameterAsConnectionName( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
1589 
1595  static QString parameterAsConnectionName( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
1596 
1602  static QString parameterAsSchema( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
1603 
1609  static QString parameterAsSchema( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
1610 
1616  static QString parameterAsDatabaseTableName( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
1617 
1623  static QString parameterAsDatabaseTableName( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
1624 
1634  static QgsPointCloudLayer *parameterAsPointCloudLayer( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1635 
1645  static QgsPointCloudLayer *parameterAsPointCloudLayer( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1646 
1660  static QgsAnnotationLayer *parameterAsAnnotationLayer( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1661 
1675  static QgsAnnotationLayer *parameterAsAnnotationLayer( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1676 
1682  static QgsProcessingParameterDefinition *parameterFromVariantMap( const QVariantMap &map ) SIP_FACTORY;
1683 
1687  static QString descriptionFromName( const QString &name );
1688 
1694  static QgsProcessingParameterDefinition *parameterFromScriptCode( const QString &code ) SIP_FACTORY;
1695 
1696  private:
1697 
1698  static bool parseScriptCodeParameterOptions( const QString &code, bool &isOptional, QString &name, QString &type, QString &definition );
1699 };
1700 
1701 
1702 
1710 {
1711  public:
1712 
1716  QgsProcessingParameterBoolean( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
1717  bool optional = false );
1718 
1722  static QString typeName() { return QStringLiteral( "boolean" ); }
1723  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
1724  QString type() const override { return typeName(); }
1725  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
1726  QString asScriptCode() const override;
1727 
1731  static QgsProcessingParameterBoolean *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
1732 };
1733 
1741 {
1742  public:
1743 
1747  QgsProcessingParameterCrs( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
1748  bool optional = false );
1749 
1753  static QString typeName() { return QStringLiteral( "crs" ); }
1754  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
1755  QString type() const override { return typeName(); }
1756  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
1757  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
1758 
1762  static QgsProcessingParameterCrs *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
1763 
1764 };
1765 
1773 {
1774  public:
1775 
1779  QgsProcessingParameterExtent( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
1780  bool optional = false );
1781 
1785  static QString typeName() { return QStringLiteral( "extent" ); }
1786  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
1787  QString type() const override { return typeName(); }
1788  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
1789  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
1790 
1794  static QgsProcessingParameterExtent *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
1795 
1796 };
1797 
1798 
1806 {
1807  public:
1808 
1812  QgsProcessingParameterPoint( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
1813  bool optional = false );
1814 
1818  static QString typeName() { return QStringLiteral( "point" ); }
1819  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
1820  QString type() const override { return typeName(); }
1821  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
1822  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
1823 
1827  static QgsProcessingParameterPoint *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
1828 
1829 };
1830 
1838 {
1839  public:
1840 
1848  QgsProcessingParameterGeometry( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(), bool optional = false, const QList< int > &geometryTypes = QList< int >(), bool allowMultipart = true );
1849 
1853  static QString typeName() { return QStringLiteral( "geometry" ); }
1854  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
1855  QString type() const override { return typeName(); }
1856  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
1857  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
1858  QString asScriptCode() const override;
1859  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
1860  QVariantMap toVariantMap() const override;
1861  bool fromVariantMap( const QVariantMap &map ) override;
1862 
1867  QList<int> geometryTypes() const { return mGeomTypes; }
1868 
1873  void setGeometryTypes( const QList<int> &geometryTypes ) { mGeomTypes = geometryTypes; }
1874 
1879  bool allowMultipart() const { return mAllowMultipart; }
1880 
1885  void setAllowMultipart( bool allowMultipart ) { mAllowMultipart = allowMultipart; }
1886 
1887 
1888 
1892  static QgsProcessingParameterGeometry *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
1893 
1894  private:
1895 
1896  QList<int> mGeomTypes;
1897  bool mAllowMultipart;
1898 
1899 };
1900 
1908 {
1909  public:
1910 
1913  {
1914  File = 0,
1916  };
1917 
1925  QgsProcessingParameterFile( const QString &name, const QString &description = QString(), Behavior behavior = File, const QString &extension = QString(), const QVariant &defaultValue = QVariant(),
1926  bool optional = false, const QString &fileFilter = QString() );
1927 
1931  static QString typeName() { return QStringLiteral( "file" ); }
1932  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
1933  QString type() const override { return typeName(); }
1934  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
1935  QString asScriptCode() const override;
1936  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
1937  QString createFileFilter() const override;
1938 
1943  Behavior behavior() const { return mBehavior; }
1944 
1949  void setBehavior( Behavior behavior ) { mBehavior = behavior; }
1950 
1958  QString extension() const { return mExtension; }
1959 
1969  void setExtension( const QString &extension );
1970 
1977  QString fileFilter() const;
1978 
1988  void setFileFilter( const QString &filter );
1989 
1990  QVariantMap toVariantMap() const override;
1991  bool fromVariantMap( const QVariantMap &map ) override;
1992 
1996  static QgsProcessingParameterFile *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition, Behavior behavior = File ) SIP_FACTORY;
1997 
1998  private:
1999 
2000  Behavior mBehavior = File;
2001  QString mExtension;
2002  QString mFileFilter;
2003 };
2004 
2012 {
2013  public:
2014 
2018  QgsProcessingParameterMatrix( const QString &name, const QString &description = QString(), int numberRows = 3,
2019  bool hasFixedNumberRows = false, const QStringList &headers = QStringList(),
2020  const QVariant &defaultValue = QVariant(),
2021  bool optional = false );
2022 
2026  static QString typeName() { return QStringLiteral( "matrix" ); }
2027  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
2028  QString type() const override { return typeName(); }
2029  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
2030  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
2031  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
2032 
2037  QStringList headers() const;
2038 
2043  void setHeaders( const QStringList &headers );
2044 
2051  int numberRows() const;
2052 
2059  void setNumberRows( int rows );
2060 
2066  bool hasFixedNumberRows() const;
2067 
2073  void setHasFixedNumberRows( bool hasFixedNumberRows );
2074 
2075  QVariantMap toVariantMap() const override;
2076  bool fromVariantMap( const QVariantMap &map ) override;
2077 
2081  static QgsProcessingParameterMatrix *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2082 
2083  private:
2084 
2085  QStringList mHeaders;
2086  int mNumberRows = 3;
2087  bool mFixedNumberRows = false;
2088 
2089 };
2090 
2098 {
2099  public:
2100 
2104  QgsProcessingParameterMultipleLayers( const QString &name, const QString &description = QString(), QgsProcessing::SourceType layerType = QgsProcessing::TypeVectorAnyGeometry,
2105  const QVariant &defaultValue = QVariant(),
2106  bool optional = false );
2107 
2111  static QString typeName() { return QStringLiteral( "multilayer" ); }
2112  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
2113  QString type() const override { return typeName(); }
2114  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
2115  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
2116  QString asScriptCode() const override;
2117  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
2118  QString createFileFilter() const override;
2119 
2124  QgsProcessing::SourceType layerType() const;
2125 
2130  void setLayerType( QgsProcessing::SourceType type );
2131 
2137  int minimumNumberInputs() const;
2138 
2144  void setMinimumNumberInputs( int minimum );
2145 
2146  QVariantMap toVariantMap() const override;
2147  bool fromVariantMap( const QVariantMap &map ) override;
2148 
2152  static QgsProcessingParameterMultipleLayers *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2153 
2154  private:
2155 
2157  int mMinimumNumberInputs = 0;
2158 
2159 };
2160 
2180 {
2181  public:
2182 
2184  enum Type
2185  {
2188  };
2189 
2193  explicit QgsProcessingParameterNumber( const QString &name, const QString &description = QString(),
2194  Type type = Integer,
2195  const QVariant &defaultValue = QVariant(),
2196  bool optional = false,
2197  double minValue = std::numeric_limits<double>::lowest() + 1,
2198  double maxValue = std::numeric_limits<double>::max()
2199  );
2200 
2204  static QString typeName() { return QStringLiteral( "number" ); }
2205  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
2206  QString type() const override { return typeName(); }
2207  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
2208  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
2209  QString toolTip() const override;
2210  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
2211 
2216  double minimum() const;
2217 
2222  void setMinimum( double minimum );
2223 
2228  double maximum() const;
2229 
2234  void setMaximum( double maximum );
2235 
2240  Type dataType() const;
2241 
2246  void setDataType( Type type );
2247 
2248  QVariantMap toVariantMap() const override;
2249  bool fromVariantMap( const QVariantMap &map ) override;
2250 
2254  static QgsProcessingParameterNumber *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2255 
2256  private:
2257 
2258  double mMin = std::numeric_limits<double>::lowest() + 1;
2259  double mMax = std::numeric_limits<double>::max();
2260  Type mDataType = Integer;
2261 };
2262 
2283 {
2284  public:
2285 
2289  explicit QgsProcessingParameterDistance( const QString &name, const QString &description = QString(),
2290  const QVariant &defaultValue = QVariant(),
2291  const QString &parentParameterName = QString(),
2292  bool optional = false,
2293  double minValue = std::numeric_limits<double>::lowest() + 1,
2294  double maxValue = std::numeric_limits<double>::max() );
2295 
2299  static QString typeName() { return QStringLiteral( "distance" ); }
2300 
2301  QgsProcessingParameterDistance *clone() const override SIP_FACTORY;
2302 
2303  QString type() const override;
2304  QStringList dependsOnOtherParameters() const override;
2305  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
2306 
2311  QString parentParameterName() const;
2312 
2317  void setParentParameterName( const QString &parentParameterName );
2318 
2325  QgsUnitTypes::DistanceUnit defaultUnit() const { return mDefaultUnit; }
2326 
2333  void setDefaultUnit( QgsUnitTypes::DistanceUnit unit ) { mDefaultUnit = unit; }
2334 
2335  QVariantMap toVariantMap() const override;
2336  bool fromVariantMap( const QVariantMap &map ) override;
2337 
2338  private:
2339 
2340  QString mParentParameterName;
2342 
2343 };
2344 
2353 {
2354  public:
2355 
2359  explicit QgsProcessingParameterDuration( const QString &name, const QString &description = QString(),
2360  const QVariant &defaultValue = QVariant(),
2361  bool optional = false,
2362  double minValue = std::numeric_limits<double>::lowest() + 1,
2363  double maxValue = std::numeric_limits<double>::max() );
2364 
2368  static QString typeName() { return QStringLiteral( "duration" ); }
2369 
2370  QgsProcessingParameterDuration *clone() const override SIP_FACTORY;
2371 
2372  QString type() const override;
2373  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
2374 
2380  QgsUnitTypes::TemporalUnit defaultUnit() const { return mDefaultUnit; }
2381 
2387  void setDefaultUnit( QgsUnitTypes::TemporalUnit unit ) { mDefaultUnit = unit; }
2388 
2389  QVariantMap toVariantMap() const override;
2390  bool fromVariantMap( const QVariantMap &map ) override;
2391 
2392  private:
2393 
2395 
2396 };
2397 
2409 {
2410  public:
2411 
2415  explicit QgsProcessingParameterScale( const QString &name, const QString &description = QString(),
2416  const QVariant &defaultValue = QVariant(),
2417  bool optional = false );
2418 
2422  static QString typeName() { return QStringLiteral( "scale" ); }
2423 
2424  QgsProcessingParameterScale *clone() const override SIP_FACTORY;
2425 
2426  QString type() const override;
2427  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
2428 
2432  static QgsProcessingParameterScale *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2433 
2434 };
2435 
2443 {
2444  public:
2445 
2449  QgsProcessingParameterRange( const QString &name, const QString &description = QString(),
2451  const QVariant &defaultValue = QVariant(),
2452  bool optional = false );
2453 
2457  static QString typeName() { return QStringLiteral( "range" ); }
2458  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
2459  QString type() const override { return typeName(); }
2460  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
2461  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
2462  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
2463 
2468  QgsProcessingParameterNumber::Type dataType() const;
2469 
2474  void setDataType( QgsProcessingParameterNumber::Type dataType );
2475 
2476  QVariantMap toVariantMap() const override;
2477  bool fromVariantMap( const QVariantMap &map ) override;
2478 
2482  static QgsProcessingParameterRange *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2483 
2484  private:
2485 
2487 };
2488 
2496 {
2497  public:
2498 
2502  QgsProcessingParameterRasterLayer( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
2503  bool optional = false );
2504 
2508  static QString typeName() { return QStringLiteral( "raster" ); }
2509  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
2510  QString type() const override { return typeName(); }
2511  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
2512  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
2513  QString createFileFilter() const override;
2514 
2518  static QgsProcessingParameterRasterLayer *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2519 
2520 };
2521 
2529 {
2530  public:
2531 
2535  QgsProcessingParameterEnum( const QString &name, const QString &description = QString(), const QStringList &options = QStringList(),
2536  bool allowMultiple = false,
2537  const QVariant &defaultValue = QVariant(),
2538  bool optional = false,
2539  bool usesStaticStrings = false );
2540 
2544  static QString typeName() { return QStringLiteral( "enum" ); }
2545  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
2546  QString type() const override { return typeName(); }
2547  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
2548  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
2549  QString valueAsPythonComment( const QVariant &value, QgsProcessingContext &context ) const override;
2550  QString asScriptCode() const override;
2551  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
2552 
2557  QStringList options() const;
2558 
2563  void setOptions( const QStringList &options );
2564 
2569  bool allowMultiple() const;
2570 
2575  void setAllowMultiple( bool allowMultiple );
2576 
2583  bool usesStaticStrings() const;
2584 
2591  void setUsesStaticStrings( bool usesStaticStrings );
2592 
2593  QVariantMap toVariantMap() const override;
2594  bool fromVariantMap( const QVariantMap &map ) override;
2595 
2599  static QgsProcessingParameterEnum *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2600 
2601  private:
2602 
2603  QStringList mOptions;
2604  bool mAllowMultiple = false;
2605  bool mUsesStaticStrings = false;
2606 };
2607 
2636 {
2637  public:
2638 
2642  QgsProcessingParameterString( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
2643  bool multiLine = false,
2644  bool optional = false );
2645 
2649  static QString typeName() { return QStringLiteral( "string" ); }
2650  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
2651  QString type() const override { return typeName(); }
2652  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
2653  QString asScriptCode() const override;
2654  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
2655 
2660  bool multiLine() const;
2661 
2666  void setMultiLine( bool multiLine );
2667 
2668  QVariantMap toVariantMap() const override;
2669  bool fromVariantMap( const QVariantMap &map ) override;
2670 
2674  static QgsProcessingParameterString *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2675 
2676  private:
2677 
2678  bool mMultiLine = false;
2679 
2680 };
2681 
2682 
2696 {
2697  public:
2698 
2702  QgsProcessingParameterAuthConfig( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
2703  bool optional = false );
2704 
2708  static QString typeName() { return QStringLiteral( "authcfg" ); }
2709  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
2710  QString type() const override { return typeName(); }
2711  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
2712  QString asScriptCode() const override;
2713 
2717  static QgsProcessingParameterAuthConfig *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2718 
2719 };
2720 
2728 {
2729  public:
2730 
2734  QgsProcessingParameterExpression( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
2735  const QString &parentLayerParameterName = QString(),
2736  bool optional = false );
2737 
2741  static QString typeName() { return QStringLiteral( "expression" ); }
2742  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
2743  QString type() const override { return typeName(); }
2744  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
2745  QStringList dependsOnOtherParameters() const override;
2746  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
2747 
2752  QString parentLayerParameterName() const;
2753 
2758  void setParentLayerParameterName( const QString &parentLayerParameterName );
2759 
2760  QVariantMap toVariantMap() const override;
2761  bool fromVariantMap( const QVariantMap &map ) override;
2762 
2766  static QgsProcessingParameterExpression *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2767 
2768  private:
2769 
2770  QString mParentLayerParameterName;
2771 
2772 };
2773 
2774 
2782 {
2783  public:
2784 
2788  QgsProcessingParameterLimitedDataTypes( const QList< int > &types = QList< int >() );
2789 
2794  QList< int > dataTypes() const;
2795 
2800  void setDataTypes( const QList< int > &types );
2801 
2802  protected:
2803 
2805  QList< int > mDataTypes;
2806 };
2807 
2816 {
2817  public:
2818 
2822  QgsProcessingParameterVectorLayer( const QString &name,
2823  const QString &description = QString(),
2824  const QList< int > &types = QList< int >(),
2825  const QVariant &defaultValue = QVariant(),
2826  bool optional = false );
2827 
2831  static QString typeName() { return QStringLiteral( "vector" ); }
2832  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
2833  QString type() const override { return typeName(); }
2834  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
2835  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
2836  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
2837  QString createFileFilter() const override;
2838 
2839  QVariantMap toVariantMap() const override;
2840  bool fromVariantMap( const QVariantMap &map ) override;
2841 
2845  static QgsProcessingParameterVectorLayer *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2846 
2847 };
2848 
2856 {
2857  public:
2858 
2862  QgsProcessingParameterMeshLayer( const QString &name,
2863  const QString &description = QString(),
2864  const QVariant &defaultValue = QVariant(),
2865  bool optional = false );
2866 
2870  static QString typeName() { return QStringLiteral( "mesh" ); }
2871  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
2872  QString type() const override { return typeName(); }
2873  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
2874  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
2875  QString createFileFilter() const override;
2876 
2880  static QgsProcessingParameterMeshLayer *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2881 };
2882 
2890 {
2891  public:
2892 
2896  QgsProcessingParameterMapLayer( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
2897  bool optional = false,
2898  const QList< int > &types = QList< int >() );
2899 
2903  static QString typeName() { return QStringLiteral( "layer" ); }
2904  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
2905  QString type() const override { return typeName(); }
2906  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
2907  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
2908  QString asScriptCode() const override;
2909  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
2910  QString createFileFilter() const override;
2911 
2912  QVariantMap toVariantMap() const override;
2913  bool fromVariantMap( const QVariantMap &map ) override;
2914 
2918  static QgsProcessingParameterMapLayer *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2919 
2920 };
2921 
2929 {
2930  public:
2931 
2934  {
2935  Any = -1,
2936  Numeric = 0,
2937  String = 1,
2938  DateTime = 2
2939  };
2940 
2944  QgsProcessingParameterField( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
2945  const QString &parentLayerParameterName = QString(),
2946  DataType type = Any,
2947  bool allowMultiple = false,
2948  bool optional = false,
2949  bool defaultToAllFields = false );
2950 
2954  static QString typeName() { return QStringLiteral( "field" ); }
2955  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
2956  QString type() const override { return typeName(); }
2957  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
2958  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
2959  QString asScriptCode() const override;
2960  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
2961  QStringList dependsOnOtherParameters() const override;
2962 
2967  QString parentLayerParameterName() const;
2968 
2973  void setParentLayerParameterName( const QString &parentLayerParameterName );
2974 
2979  DataType dataType() const;
2980 
2985  void setDataType( DataType type );
2986 
2991  bool allowMultiple() const;
2992 
2997  void setAllowMultiple( bool allowMultiple );
2998 
3008  bool defaultToAllFields() const;
3009 
3019  void setDefaultToAllFields( bool enabled );
3020 
3021  QVariantMap toVariantMap() const override;
3022  bool fromVariantMap( const QVariantMap &map ) override;
3023 
3027  static QgsProcessingParameterField *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
3028 
3029  private:
3030 
3031  QString mParentLayerParameterName;
3032  DataType mDataType = Any;
3033  bool mAllowMultiple = false;
3034  bool mDefaultToAllFields = false;
3035 
3036 };
3037 
3038 
3046 {
3047  public:
3048 
3052  QgsProcessingParameterFeatureSource( const QString &name, const QString &description = QString(),
3053  const QList< int > &types = QList< int >(),
3054  const QVariant &defaultValue = QVariant(), bool optional = false );
3055 
3059  static QString typeName() { return QStringLiteral( "source" ); }
3060  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
3061  QString type() const override { return typeName(); }
3062  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
3063  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
3064  QString asScriptCode() const override;
3065  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
3066  QString createFileFilter() const override;
3067 
3068  QVariantMap toVariantMap() const override;
3069  bool fromVariantMap( const QVariantMap &map ) override;
3070 
3074  static QgsProcessingParameterFeatureSource *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
3075 
3076 };
3077 
3086 {
3087  public:
3088 
3095  QgsProcessingDestinationParameter( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
3096  bool optional = false, bool createByDefault = true );
3097 
3098  bool isDestination() const override { return true; }
3099  QVariantMap toVariantMap() const override;
3100  bool fromVariantMap( const QVariantMap &map ) override;
3101  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
3102  QString createFileFilter() const override;
3103 
3109 
3115  bool supportsNonFileBasedOutput() const { return mSupportsNonFileBasedOutputs; }
3116 
3122  void setSupportsNonFileBasedOutput( bool supportsNonFileBasedOutput ) { mSupportsNonFileBasedOutputs = supportsNonFileBasedOutput; }
3123 
3128  virtual QString defaultFileExtension() const = 0;
3129 
3135  virtual QString generateTemporaryDestination() const;
3136 
3151  virtual bool isSupportedOutputValue( const QVariant &value, QgsProcessingContext &context, QString &error SIP_OUT ) const;
3152 
3158  bool createByDefault() const;
3159 
3165  void setCreateByDefault( bool createByDefault );
3166 
3167  protected:
3168 
3177  QgsProcessingProvider *originalProvider() const { return mOriginalProvider; }
3178 
3179  private:
3180 
3188  QgsProcessingProvider *mOriginalProvider = nullptr;
3189 
3190  bool mSupportsNonFileBasedOutputs = true;
3191  bool mCreateByDefault = true;
3192 
3193  friend class QgsProcessingModelAlgorithm;
3194  friend class TestQgsProcessing;
3195 };
3196 
3197 
3207 {
3208  public:
3209 
3216  QgsProcessingParameterFeatureSink( const QString &name, const QString &description = QString(), QgsProcessing::SourceType type = QgsProcessing::TypeVectorAnyGeometry, const QVariant &defaultValue = QVariant(),
3217  bool optional = false, bool createByDefault = true, bool supportsAppend = false );
3218 
3222  static QString typeName() { return QStringLiteral( "sink" ); }
3223  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
3224  QString type() const override { return typeName(); }
3225  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
3226  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
3227  QString asScriptCode() const override;
3228  QgsProcessingOutputDefinition *toOutputDefinition() const override SIP_FACTORY;
3229  QString defaultFileExtension() const override;
3230  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
3231  QString createFileFilter() const override;
3232 
3238  virtual QStringList supportedOutputVectorLayerExtensions() const;
3239 
3244  QgsProcessing::SourceType dataType() const;
3245 
3250  bool hasGeometry() const;
3251 
3256  void setDataType( QgsProcessing::SourceType type );
3257 
3266  bool supportsAppend() const;
3267 
3276  void setSupportsAppend( bool supportsAppend );
3277 
3278  QVariantMap toVariantMap() const override;
3279  bool fromVariantMap( const QVariantMap &map ) override;
3280  QString generateTemporaryDestination() const override;
3281 
3285  static QgsProcessingParameterFeatureSink *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
3286 
3287  private:
3288 
3289  QgsProcessing::SourceType mDataType = QgsProcessing::TypeVectorAnyGeometry;
3290  bool mSupportsAppend = false;
3291 };
3292 
3293 
3305 {
3306  public:
3307 
3314  QgsProcessingParameterVectorDestination( const QString &name, const QString &description = QString(), QgsProcessing::SourceType type = QgsProcessing::TypeVectorAnyGeometry, const QVariant &defaultValue = QVariant(),
3315  bool optional = false, bool createByDefault = true );
3316 
3320  static QString typeName() { return QStringLiteral( "vectorDestination" ); }
3321  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
3322  QString type() const override { return typeName(); }
3323  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
3324  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
3325  QString asScriptCode() const override;
3326  QgsProcessingOutputDefinition *toOutputDefinition() const override SIP_FACTORY;
3327  QString defaultFileExtension() const override;
3328  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
3329  QString createFileFilter() const override;
3330 
3336  virtual QStringList supportedOutputVectorLayerExtensions() const;
3337 
3342  QgsProcessing::SourceType dataType() const;
3343 
3348  bool hasGeometry() const;
3349 
3354  void setDataType( QgsProcessing::SourceType type );
3355 
3356  QVariantMap toVariantMap() const override;
3357  bool fromVariantMap( const QVariantMap &map ) override;
3358 
3362  static QgsProcessingParameterVectorDestination *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
3363 
3364 
3365  private:
3366 
3367  QgsProcessing::SourceType mDataType = QgsProcessing::TypeVectorAnyGeometry;
3368 };
3369 
3378 {
3379  public:
3380 
3387  QgsProcessingParameterRasterDestination( const QString &name, const QString &description = QString(),
3388  const QVariant &defaultValue = QVariant(),
3389  bool optional = false,
3390  bool createByDefault = true );
3391 
3395  static QString typeName() { return QStringLiteral( "rasterDestination" ); }
3396  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
3397  QString type() const override { return typeName(); }
3398  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
3399  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
3400  QgsProcessingOutputDefinition *toOutputDefinition() const override SIP_FACTORY;
3401  QString defaultFileExtension() const override;
3402  QString createFileFilter() const override;
3403 
3409  virtual QStringList supportedOutputRasterLayerExtensions() const;
3410 
3414  static QgsProcessingParameterRasterDestination *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
3415 };
3416 
3439 {
3440  public:
3441 
3448  QgsProcessingParameterFileDestination( const QString &name, const QString &description = QString(),
3449  const QString &fileFilter = QString(),
3450  const QVariant &defaultValue = QVariant(),
3451  bool optional = false,
3452  bool createByDefault = true );
3453 
3457  static QString typeName() { return QStringLiteral( "fileDestination" ); }
3458  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
3459  QString type() const override { return typeName(); }
3460  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
3461  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
3462  QgsProcessingOutputDefinition *toOutputDefinition() const override SIP_FACTORY;
3463  QString defaultFileExtension() const override;
3464  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
3465  QString createFileFilter() const override;
3466 
3471  QString fileFilter() const;
3472 
3477  void setFileFilter( const QString &filter );
3478 
3479  QVariantMap toVariantMap() const override;
3480  bool fromVariantMap( const QVariantMap &map ) override;
3481 
3485  static QgsProcessingParameterFileDestination *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
3486 
3487 
3488  private:
3489 
3490  QString mFileFilter;
3491 };
3492 
3501 {
3502  public:
3503 
3507  QgsProcessingParameterFolderDestination( const QString &name, const QString &description = QString(),
3508  const QVariant &defaultValue = QVariant(),
3509  bool optional = false,
3510  bool createByDefault = true );
3511 
3515  static QString typeName() { return QStringLiteral( "folderDestination" ); }
3516  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
3517  QString type() const override { return typeName(); }
3518  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
3519  QgsProcessingOutputDefinition *toOutputDefinition() const override SIP_FACTORY;
3520  QString defaultFileExtension() const override;
3521 
3525  static QgsProcessingParameterFolderDestination *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
3526 
3527 };
3528 
3536 {
3537  public:
3538 
3542  QgsProcessingParameterBand( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
3543  const QString &parentLayerParameterName = QString(),
3544  bool optional = false,
3545  bool allowMultiple = false );
3546 
3550  static QString typeName() { return QStringLiteral( "band" ); }
3551  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
3552  QString type() const override { return typeName(); }
3553  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
3554  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
3555  QString asScriptCode() const override;
3556  QStringList dependsOnOtherParameters() const override;
3557  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
3558 
3563  QString parentLayerParameterName() const;
3564 
3569  void setParentLayerParameterName( const QString &parentLayerParameterName );
3570 
3571  QVariantMap toVariantMap() const override;
3572  bool fromVariantMap( const QVariantMap &map ) override;
3573 
3577  static QgsProcessingParameterBand *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
3578 
3584  bool allowMultiple() const;
3585 
3591  void setAllowMultiple( bool allowMultiple );
3592 
3593  private:
3594 
3595  QString mParentLayerParameterName;
3596  bool mAllowMultiple = false;
3597 };
3598 
3611 {
3612  public:
3613 
3617  QgsProcessingParameterLayout( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
3618  bool optional = false );
3619 
3623  static QString typeName() { return QStringLiteral( "layout" ); }
3624  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
3625  QString type() const override { return typeName(); }
3626  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
3627  QString asScriptCode() const override;
3628  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
3629 
3633  static QgsProcessingParameterLayout *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
3634 
3635 };
3636 
3649 {
3650  public:
3651 
3655  QgsProcessingParameterLayoutItem( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
3656  const QString &parentLayoutParameterName = QString(),
3657  int itemType = -1,
3658  bool optional = false );
3659 
3663  static QString typeName() { return QStringLiteral( "layoutitem" ); }
3664  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
3665  QString type() const override { return typeName(); }
3666  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
3667  QString asScriptCode() const override;
3668  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
3669  QVariantMap toVariantMap() const override;
3670  bool fromVariantMap( const QVariantMap &map ) override;
3671  QStringList dependsOnOtherParameters() const override;
3672 
3676  static QgsProcessingParameterLayoutItem *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
3677 
3682  QString parentLayoutParameterName() const;
3683 
3688  void setParentLayoutParameterName( const QString &name );
3689 
3697  int itemType() const;
3698 
3706  void setItemType( int type );
3707 
3708  private:
3709  QString mParentLayoutParameterName;
3710  int mItemType = -1;
3711 };
3712 
3723 {
3724  public:
3725 
3731  QgsProcessingParameterColor( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
3732  bool opacityEnabled = true,
3733  bool optional = false );
3734 
3738  static QString typeName() { return QStringLiteral( "color" ); }
3739  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
3740  QString type() const override { return typeName(); }
3741  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
3742  QString asScriptCode() const override;
3743  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
3744  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
3745  QVariantMap toVariantMap() const override;
3746  bool fromVariantMap( const QVariantMap &map ) override;
3747 
3754  bool opacityEnabled() const;
3755 
3763  void setOpacityEnabled( bool enabled );
3764 
3768  static QgsProcessingParameterColor *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
3769 
3770  private:
3771 
3772  bool mAllowOpacity = true;
3773 
3774 };
3775 
3776 
3787 {
3788  public:
3789 
3793  QgsProcessingParameterCoordinateOperation( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
3794  const QString &sourceCrsParameterName = QString(), const QString &destinationCrsParameterName = QString(),
3795  const QVariant &staticSourceCrs = QVariant(), const QVariant &staticDestinationCrs = QVariant(),
3796  bool optional = false );
3797 
3801  static QString typeName() { return QStringLiteral( "coordinateoperation" ); }
3802  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
3803  QString type() const override { return typeName(); }
3804  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
3805  QString asScriptCode() const override;
3806  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
3807  QStringList dependsOnOtherParameters() const override;
3808 
3809  QVariantMap toVariantMap() const override;
3810  bool fromVariantMap( const QVariantMap &map ) override;
3811 
3815  static QgsProcessingParameterCoordinateOperation *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
3816 
3822  QString sourceCrsParameterName() const { return mSourceParameterName; }
3823 
3829  void setSourceCrsParameterName( const QString &name ) { mSourceParameterName = name; }
3830 
3836  QString destinationCrsParameterName() const { return mDestParameterName; }
3837 
3843  void setDestinationCrsParameterName( const QString &name ) { mDestParameterName = name; }
3844 
3850  QVariant sourceCrs() const { return mSourceCrs; }
3851 
3857  void setSourceCrs( const QVariant &crs ) { mSourceCrs = crs; }
3858 
3864  QVariant destinationCrs() const { return mDestCrs; }
3865 
3871  void setDestinationCrs( const QVariant &crs ) { mDestCrs = crs; }
3872 
3873  private:
3874 
3875  QString mSourceParameterName;
3876  QString mDestParameterName;
3877  QVariant mSourceCrs;
3878  QVariant mDestCrs;
3879 
3880 };
3881 
3882 
3893 {
3894  public:
3895 
3899  QgsProcessingParameterMapTheme( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
3900  bool optional = false );
3901 
3905  static QString typeName() { return QStringLiteral( "maptheme" ); }
3906  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
3907  QString type() const override { return typeName(); }
3908  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
3909  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
3910  QString asScriptCode() const override;
3911  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
3912  QVariantMap toVariantMap() const override;
3913  bool fromVariantMap( const QVariantMap &map ) override;
3914 
3918  static QgsProcessingParameterMapTheme *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
3919 
3920  private:
3921 
3922 };
3923 
3924 
3936 {
3937  public:
3938 
3940  enum Type
3941  {
3945  };
3946 
3950  explicit QgsProcessingParameterDateTime( const QString &name, const QString &description = QString(),
3951  Type type = DateTime,
3952  const QVariant &defaultValue = QVariant(),
3953  bool optional = false,
3954  const QDateTime &minValue = QDateTime(),
3955  const QDateTime &maxValue = QDateTime()
3956  );
3957 
3961  static QString typeName() { return QStringLiteral( "datetime" ); }
3962  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
3963  QString type() const override { return typeName(); }
3964  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
3965  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
3966  QString toolTip() const override;
3967  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
3968 
3976  QDateTime minimum() const;
3977 
3989  void setMinimum( const QDateTime &minimum );
3990 
3998  QDateTime maximum() const;
3999 
4011  void setMaximum( const QDateTime &maximum );
4012 
4017  Type dataType() const;
4018 
4023  void setDataType( Type type );
4024 
4025  QVariantMap toVariantMap() const override;
4026  bool fromVariantMap( const QVariantMap &map ) override;
4027 
4031  static QgsProcessingParameterDateTime *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
4032 
4033  private:
4034 
4035  QDateTime mMin;
4036  QDateTime mMax;
4037  Type mDataType = DateTime;
4038 };
4039 
4040 
4052 {
4053  public:
4054 
4061  QgsProcessingParameterProviderConnection( const QString &name, const QString &description, const QString &provider, const QVariant &defaultValue = QVariant(),
4062  bool optional = false );
4063 
4067  static QString typeName() { return QStringLiteral( "providerconnection" ); }
4068  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
4069  QString type() const override { return typeName(); }
4070  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
4071  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
4072  QString asScriptCode() const override;
4073  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
4074  QVariantMap toVariantMap() const override;
4075  bool fromVariantMap( const QVariantMap &map ) override;
4076 
4081  QString providerId() const { return mProviderId; }
4082 
4087  void setProviderId( const QString &provider ) { mProviderId = provider; }
4088 
4092  static QgsProcessingParameterProviderConnection *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
4093 
4094  private:
4095 
4096  QString mProviderId;
4097 };
4098 
4099 
4111 {
4112  public:
4113 
4122  QgsProcessingParameterDatabaseSchema( const QString &name, const QString &description, const QString &connectionParameterName = QString(), const QVariant &defaultValue = QVariant(),
4123  bool optional = false );
4124 
4128  static QString typeName() { return QStringLiteral( "databaseschema" ); }
4129  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
4130  QString type() const override { return typeName(); }
4131  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
4132  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
4133  QString asScriptCode() const override;
4134  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
4135  QVariantMap toVariantMap() const override;
4136  bool fromVariantMap( const QVariantMap &map ) override;
4137  QStringList dependsOnOtherParameters() const override;
4138 
4143  QString parentConnectionParameterName() const;
4144 
4149  void setParentConnectionParameterName( const QString &name );
4150 
4154  static QgsProcessingParameterDatabaseSchema *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
4155 
4156  private:
4157 
4158  QString mParentConnectionParameterName;
4159 };
4160 
4161 
4173 {
4174  public:
4175 
4185  QgsProcessingParameterDatabaseTable( const QString &name, const QString &description,
4186  const QString &connectionParameterName = QString(),
4187  const QString &schemaParameterName = QString(),
4188  const QVariant &defaultValue = QVariant(),
4189  bool optional = false,
4190  bool allowNewTableNames = false );
4191 
4195  static QString typeName() { return QStringLiteral( "databasetable" ); }
4196  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
4197  QString type() const override { return typeName(); }
4198  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
4199  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
4200  QString asScriptCode() const override;
4201  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
4202  QVariantMap toVariantMap() const override;
4203  bool fromVariantMap( const QVariantMap &map ) override;
4204  QStringList dependsOnOtherParameters() const override;
4205 
4210  QString parentConnectionParameterName() const;
4211 
4216  void setParentConnectionParameterName( const QString &name );
4217 
4222  QString parentSchemaParameterName() const;
4223 
4228  void setParentSchemaParameterName( const QString &name );
4229 
4233  static QgsProcessingParameterDatabaseTable *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
4234 
4241  bool allowNewTableNames() const;
4242 
4249  void setAllowNewTableNames( bool allowed );
4250 
4251  private:
4252 
4253  QString mParentConnectionParameterName;
4254  QString mParentSchemaParameterName;
4255  bool mAllowNewTableNames = false;
4256 };
4257 
4258 
4266 {
4267  public:
4268 
4272  QgsProcessingParameterPointCloudLayer( const QString &name, const QString &description = QString(),
4273  const QVariant &defaultValue = QVariant(), bool optional = false );
4274 
4278  static QString typeName() { return QStringLiteral( "pointcloud" ); }
4279  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
4280  QString type() const override { return typeName(); }
4281  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
4282  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
4283  QString createFileFilter() const override;
4284 
4288  static QgsProcessingParameterPointCloudLayer *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
4289 };
4290 
4291 
4299 {
4300  public:
4301 
4305  QgsProcessingParameterAnnotationLayer( const QString &name, const QString &description = QString(),
4306  const QVariant &defaultValue = QVariant(), bool optional = false );
4307 
4311  static QString typeName() { return QStringLiteral( "annotation" ); }
4312  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
4313  QString type() const override { return typeName(); }
4314  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
4315  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
4316 
4320  static QgsProcessingParameterAnnotationLayer *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
4321 };
4322 
4331 {
4332  public:
4333 
4340  QgsProcessingParameterPointCloudDestination( const QString &name, const QString &description = QString(),
4341  const QVariant &defaultValue = QVariant(),
4342  bool optional = false,
4343  bool createByDefault = true );
4344 
4348  static QString typeName() { return QStringLiteral( "pointCloudDestination" ); }
4349  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
4350  QString type() const override { return typeName(); }
4351  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
4352  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
4353  QgsProcessingOutputDefinition *toOutputDefinition() const override SIP_FACTORY;
4354  QString defaultFileExtension() const override;
4355  QString createFileFilter() const override;
4356 
4361  virtual QStringList supportedOutputPointCloudLayerExtensions() const;
4362 
4366  static QgsProcessingParameterPointCloudDestination *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
4367 };
4368 
4369 // clazy:excludeall=qstring-allocations
4370 
4371 #endif // QGSPROCESSINGPARAMETERS_H
4372 
4373 
Represents a map layer containing a set of georeferenced annotations, e.g.
This class represents a coordinate reference system (CRS).
This class wraps a request for features to a vector layer (or directly its vector data provider).
InvalidGeometryCheck
Handling of features with invalid geometries.
@ GeometryAbortOnInvalid
Close iterator on encountering any features with invalid geometry. This requires a slow geometry vali...
An interface for objects which accept features via addFeature(s) methods.
Container of fields for a vector layer.
Definition: qgsfields.h:45
Abstract interface for classes which generate a file filter string.
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:125
Base class for graphical items within a QgsLayout.
Base class for all map layer types.
Definition: qgsmaplayer.h:73
Represents a mesh layer supporting display of data on structured or unstructured meshes.
Definition: qgsmeshlayer.h:97
Represents a map layer supporting display of point clouds.
A class to represent a 2D point.
Definition: qgspointxy.h:59
Print layout, a QgsLayout subclass for static or atlas-based layouts.
Abstract base class for processing algorithms.
Contains information about the context in which a processing algorithm is executed.
Base class for all parameter definitions which represent file or layer destinations,...
virtual QString defaultFileExtension() const =0
Returns the default file extension for destination file paths associated with this parameter.
bool supportsNonFileBasedOutput() const
Returns true if the destination parameter supports non filed-based outputs, such as memory layers or ...
virtual QgsProcessingOutputDefinition * toOutputDefinition() const =0
Returns a new QgsProcessingOutputDefinition corresponding to the definition of the destination parame...
bool isDestination() const override
Returns true if this parameter represents a file or layer destination, e.g.
QgsProcessingProvider * originalProvider() const
Original (source) provider which this parameter has been derived from.
void setSupportsNonFileBasedOutput(bool supportsNonFileBasedOutput)
Sets whether the destination parameter supports non filed-based outputs, such as memory layers or dir...
Custom exception class for processing related exceptions.
Definition: qgsexception.h:83
Encapsulates settings relating to a feature source input to a processing algorithm.
Flags flags
Flags which dictate source behavior.
bool operator!=(const QgsProcessingFeatureSourceDefinition &other) const
bool selectedFeaturesOnly
true if only selected features in the source should be used by algorithms.
QgsFeatureRequest::InvalidGeometryCheck geometryCheck
Geometry check method to apply to this source.
bool operator==(const QgsProcessingFeatureSourceDefinition &other) const
long long featureLimit
If set to a value > 0, places a limit on the maximum number of features which will be read from the s...
Flag
Flags which control source behavior.
QgsProcessingFeatureSourceDefinition(const QgsProperty &source, bool selectedFeaturesOnly=false, long long featureLimit=-1, QgsProcessingFeatureSourceDefinition::Flags flags=QgsProcessingFeatureSourceDefinition::Flags(), QgsFeatureRequest::InvalidGeometryCheck geometryCheck=QgsFeatureRequest::GeometryAbortOnInvalid)
Constructor for QgsProcessingFeatureSourceDefinition, accepting a QgsProperty source.
QgsFeatureSource subclass which proxies methods to an underlying QgsFeatureSource,...
Base class for providing feedback from a processing algorithm.
Base class for the definition of processing outputs.
Encapsulates settings relating to a feature sink or output raster layer for a processing algorithm.
QgsProcessingOutputLayerDefinition(const QgsProperty &sink, QgsProject *destinationProject=nullptr)
Constructor for QgsProcessingOutputLayerDefinition, accepting a QgsProperty sink/layer.
QgsProperty sink
Sink/layer definition.
bool useRemapping() const
Returns true if the output uses a remapping definition.
QgsProcessingOutputLayerDefinition(const QString &sink=QString(), QgsProject *destinationProject=nullptr)
Constructor for QgsProcessingOutputLayerDefinition, accepting a static sink/layer string.
QgsRemappingSinkDefinition remappingDefinition() const
Returns the output remapping definition, if useRemapping() is true.
QString destinationName
Name to use for sink if it's to be loaded into a destination project.
QVariantMap createOptions
Map of optional sink/layer creation options, which are passed to the underlying provider when creatin...
An annotation layer parameter for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
A string parameter for authentication configuration ID values.
static QString typeName()
Returns the type name for the parameter class.
A raster band parameter for Processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
A boolean parameter for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
A color parameter for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
A coordinate operation parameter for processing algorithms, for selection between available coordinat...
static QString typeName()
Returns the type name for the parameter class.
QVariant sourceCrs() const
Returns the static source CRS, or an invalid value if this is not set.
QString destinationCrsParameterName() const
Returns the name of the destination CRS parameter, or an empty string if this is not set.
void setDestinationCrsParameterName(const QString &name)
Sets the name of the destination CRS parameter.
void setSourceCrs(const QVariant &crs)
Sets the static source crs.
QVariant destinationCrs() const
Returns the static destination CRS, or an invalid value if this is not set.
void setDestinationCrs(const QVariant &crs)
Sets the static destination crs.
void setSourceCrsParameterName(const QString &name)
Sets the name of the source CRS parameter.
QString sourceCrsParameterName() const
Returns the name of the source CRS parameter, or an empty string if this is not set.
A coordinate reference system parameter for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
A database schema parameter for processing algorithms, allowing users to select from existing schemas...
static QString typeName()
Returns the type name for the parameter class.
A database table name parameter for processing algorithms, allowing users to select from existing dat...
static QString typeName()
Returns the type name for the parameter class.
A datetime (or pure date or time) parameter for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
Base class for the definition of processing parameters.
QVariant defaultValue() const
Returns the default value for the parameter.
void setDefaultValue(const QVariant &value)
Sets the default value for the parameter.
QVariant guiDefaultValueOverride() const
Returns the default value to use in the GUI for the parameter.
QStringList additionalExpressionContextVariables() const
Returns a list of additional expression context variables which are available for use when evaluating...
QStringList mAdditionalExpressionVariables
Additional expression context variables exposed for use by this parameter.
QString help() const
Returns the help for the parameter.
void setMetadata(const QVariantMap &metadata)
Sets the parameter's freeform metadata.
virtual QgsProcessingParameterDefinition * clone() const =0
Creates a clone of the parameter definition.
void setGuiDefaultValueOverride(const QVariant &value)
Sets the default value to use for the parameter in GUI widgets.
QVariantMap metadata() const
Returns the parameter's freeform metadata.
QString description() const
Returns the description for the parameter.
QString mDynamicLayerParameterName
Linked vector layer parameter name for dynamic properties.
QVariant defaultValueForGui() const
Returns the default value to use for the parameter in a GUI.
virtual bool isDestination() const
Returns true if this parameter represents a file or layer destination, e.g.
void setDescription(const QString &description)
Sets the description for the parameter.
void setDynamicLayerParameterName(const QString &name)
Sets the name for the parameter for a layer linked to a dynamic parameter, or an empty string if this...
QString dynamicLayerParameterName() const
Returns the name of the parameter for a layer linked to a dynamic parameter, or an empty string if th...
void setAdditionalExpressionContextVariables(const QStringList &variables)
Sets a list of additional expression context variables which are available for use when evaluating th...
QVariantMap mMetadata
Freeform metadata for parameter. Mostly used by widget wrappers to customize their appearance and beh...
void setName(const QString &name)
Sets the name of the parameter.
QString mDescription
Parameter description.
virtual QString type() const =0
Unique parameter type name.
void setDynamicPropertyDefinition(const QgsPropertyDefinition &definition)
Sets the property definition for dynamic properties.
Flags flags() const
Returns any flags associated with the parameter.
void setHelp(const QString &help)
Sets the help for the parameter.
QString name() const
Returns the name of the parameter.
QVariant mDefault
Default value for parameter.
virtual QStringList dependsOnOtherParameters() const
Returns a list of other parameter names on which this parameter is dependent (e.g.
void setIsDynamic(bool dynamic)
Sets whether the parameter is dynamic, and can support data-defined values (i.e.
QVariantMap & metadata()
Returns the parameter's freeform metadata.
QVariant mGuiDefault
Default value for parameter in GUI.
QgsPropertyDefinition mPropertyDefinition
Data defined property definition.
bool isDynamic() const
Returns true if the parameter supports is dynamic, and can support data-defined values (i....
void setFlags(Flags flags)
Sets the flags associated with the parameter.
virtual ~QgsProcessingParameterDefinition()=default
QgsPropertyDefinition dynamicPropertyDefinition() const
Returns the property definition for dynamic properties.
A double numeric parameter for distance values.
void setDefaultUnit(QgsUnitTypes::DistanceUnit unit)
Sets the default distance unit for the parameter.
static QString typeName()
Returns the type name for the parameter class.
A double numeric parameter for duration values.
void setDefaultUnit(QgsUnitTypes::TemporalUnit unit)
Sets the default duration unit for the parameter.
static QString typeName()
Returns the type name for the parameter class.
static QString typeName()
Returns the type name for the parameter class.
An enum based parameter for processing algorithms, allowing for selection from predefined values.
static QString typeName()
Returns the type name for the parameter class.
An expression parameter for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
A rectangular map extent parameter for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
A feature sink output for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
An input feature source (such as vector layers) parameter for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
static QString typeName()
Returns the type name for the parameter class.
A vector layer or feature source field parameter for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
A generic file based destination parameter, for specifying the destination path for a file (non-map l...
static QString typeName()
Returns the type name for the parameter class.
An input file or folder parameter for processing algorithms.
QString extension() const
Returns any specified file extension for the parameter.
static QString typeName()
Returns the type name for the parameter class.
void setBehavior(Behavior behavior)
Sets the parameter behavior (e.g.
Behavior behavior() const
Returns the parameter behavior (e.g.
A folder destination parameter, for specifying the destination path for a folder created by the algor...
static QString typeName()
Returns the type name for the parameter class.
A geometry parameter for processing algorithms.
void setGeometryTypes(const QList< int > &geometryTypes)
Sets the allowed geometryTypes, as a list of QgsWkbTypes::GeometryType values.
bool allowMultipart() const
Returns the parameter allow multipart geometries.
QList< int > geometryTypes() const
Returns the parameter allowed geometries, as a list of QgsWkbTypes::GeometryType values.
void setAllowMultipart(bool allowMultipart)
Sets the allow multipart geometries.
static QString typeName()
Returns the type name for the parameter class.
A print layout item parameter, allowing users to select a particular item from a print layout.
static QString typeName()
Returns the type name for the parameter class.
A print layout parameter, allowing users to select a print layout.
static QString typeName()
Returns the type name for the parameter class.
Can be inherited by parameters which require limits to their acceptable data types.
QList< int > mDataTypes
List of acceptable data types for the parameter.
A map layer parameter for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
A map theme parameter for processing algorithms, allowing users to select an existing map theme from ...
static QString typeName()
Returns the type name for the parameter class.
A table (matrix) parameter for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
static QString typeName()
Returns the type name for the parameter class.
static QString typeName()
Returns the type name for the parameter class.
A mesh layer parameter for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
A parameter for processing algorithms which accepts multiple map layers.
static QString typeName()
Returns the type name for the parameter class.
A numeric parameter for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
A point cloud layer destination parameter, for specifying the destination path for a point cloud laye...
static QString typeName()
Returns the type name for the parameter class.
A point cloud layer parameter for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
A point parameter for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
A data provider connection parameter for processing algorithms, allowing users to select from availab...
static QString typeName()
Returns the type name for the parameter class.
void setProviderId(const QString &provider)
Sets the ID of the provider associated with the connections.
QString providerId() const
Returns the ID of the provider associated with the connections.
A numeric range parameter for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
A raster layer destination parameter, for specifying the destination path for a raster layer created ...
static QString typeName()
Returns the type name for the parameter class.
A raster layer parameter for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
A double numeric parameter for map scale values.
static QString typeName()
Returns the type name for the parameter class.
A string parameter for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
static QString typeName()
Returns the type name for the parameter class.
A vector layer destination parameter, for specifying the destination path for a vector layer created ...
static QString typeName()
Returns the type name for the parameter class.
A vector layer (with or without geometry) parameter for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
static QString typeName()
Returns the type name for the parameter class.
A collection of utilities for working with parameters when running a processing algorithm.
Abstract base class for processing providers.
LayerHint
Layer type hints.
@ UnknownType
Unknown layer type.
Contains enumerations and other constants for use in processing algorithms and parameters.
Definition: qgsprocessing.h:40
PythonOutputType
Available Python output types.
Definition: qgsprocessing.h:63
@ PythonQgsProcessingAlgorithmSubclass
Full Python QgsProcessingAlgorithm subclass.
Definition: qgsprocessing.h:64
SourceType
Data source types enum.
Definition: qgsprocessing.h:46
@ TypeVectorAnyGeometry
Any vector layer with geometry.
Definition: qgsprocessing.h:48
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition: qgsproject.h:101
Definition for a property.
Definition: qgsproperty.h:47
A store for object properties.
Definition: qgsproperty.h:231
Represents a raster layer.
A rectangle specified with double values.
Definition: qgsrectangle.h:42
Defines the parameters used to remap features when creating a QgsRemappingProxyFeatureSink.
Helper functions for various unit types.
Definition: qgsunittypes.h:39
DistanceUnit
Units of distance.
Definition: qgsunittypes.h:68
@ DistanceUnknownUnit
Unknown distance unit.
Definition: qgsunittypes.h:78
TemporalUnit
Temporal units.
Definition: qgsunittypes.h:150
@ TemporalMilliseconds
Milliseconds.
Definition: qgsunittypes.h:151
Represents a vector layer which manages a vector based data sets.
Type
The WKB type describes the number of dimensions a geometry has.
Definition: qgswkbtypes.h:70
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into allowing algorithms to be written in pure substantial changes are required in order to port existing x Processing algorithms for QGIS x The most significant changes are outlined not GeoAlgorithm For algorithms which operate on features one by consider subclassing the QgsProcessingFeatureBasedAlgorithm class This class allows much of the boilerplate code for looping over features from a vector layer to be bypassed and instead requires implementation of a processFeature method Ensure that your algorithm(or algorithm 's parent class) implements the new pure virtual createInstance(self) call
#define SIP_THROW(name)
Definition: qgis_sip.h:189
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition: qgis_sip.h:177
#define SIP_SKIP
Definition: qgis_sip.h:126
#define SIP_OUT
Definition: qgis_sip.h:58
#define SIP_FACTORY
Definition: qgis_sip.h:76
#define SIP_END
Definition: qgis_sip.h:194
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsField::ConfigurationFlags) CORE_EXPORT QDataStream &operator<<(QDataStream &out
Writes the field to stream out. QGIS version compatibility is not guaranteed.
Q_DECLARE_METATYPE(QgsMeshTimeSettings)
QList< const QgsProcessingParameterDefinition * > QgsProcessingParameterDefinitions
List of processing parameters.
const QgsCoordinateReferenceSystem & crs
const QString & typeName