18 #ifndef QGSPROCESSINGPARAMETERS_H 19 #define QGSPROCESSINGPARAMETERS_H 21 #include "qgis_core.h" 62 , selectedFeaturesOnly( selectedFeaturesOnly )
70 , selectedFeaturesOnly( selectedFeaturesOnly )
90 return !( *
this == other );
94 operator QVariant()
const 96 return QVariant::fromValue( *
this );
123 , destinationProject( destinationProject )
133 , destinationProject( destinationProject )
167 QVariant toVariant()
const;
175 bool loadVariant(
const QVariantMap &map );
178 operator QVariant()
const 180 return QVariant::fromValue( *
this );
212 sipType = sipType_QgsProcessingParameterBoolean;
214 sipType = sipType_QgsProcessingParameterCrs;
216 sipType = sipType_QgsProcessingParameterMapLayer;
218 sipType = sipType_QgsProcessingParameterExtent;
220 sipType = sipType_QgsProcessingParameterPoint;
222 sipType = sipType_QgsProcessingParameterFile;
224 sipType = sipType_QgsProcessingParameterMatrix;
226 sipType = sipType_QgsProcessingParameterMultipleLayers;
228 sipType = sipType_QgsProcessingParameterNumber;
230 sipType = sipType_QgsProcessingParameterDistance;
232 sipType = sipType_QgsProcessingParameterScale;
234 sipType = sipType_QgsProcessingParameterRange;
236 sipType = sipType_QgsProcessingParameterRasterLayer;
238 sipType = sipType_QgsProcessingParameterMeshLayer;
240 sipType = sipType_QgsProcessingParameterEnum;
242 sipType = sipType_QgsProcessingParameterString;
244 sipType = sipType_QgsProcessingParameterExpression;
246 sipType = sipType_QgsProcessingParameterAuthConfig;
248 sipType = sipType_QgsProcessingParameterVectorLayer;
250 sipType = sipType_QgsProcessingParameterField;
252 sipType = sipType_QgsProcessingParameterFeatureSource;
254 sipType = sipType_QgsProcessingParameterFeatureSink;
256 sipType = sipType_QgsProcessingParameterVectorDestination;
258 sipType = sipType_QgsProcessingParameterRasterDestination;
260 sipType = sipType_QgsProcessingParameterFileDestination;
262 sipType = sipType_QgsProcessingParameterFolderDestination;
264 sipType = sipType_QgsProcessingParameterBand;
266 sipType = sipType_QgsProcessingParameterLayout;
268 sipType = sipType_QgsProcessingParameterLayoutItem;
270 sipType = sipType_QgsProcessingParameterColor;
272 sipType = sipType_QgsProcessingParameterCoordinateOperation;
274 sipType = sipType_QgsProcessingParameterMapTheme;
285 FlagAdvanced = 1 << 1,
287 FlagOptional = 1 << 3,
288 FlagIsModelOutput = 1 << 4,
290 Q_DECLARE_FLAGS( Flags,
Flag )
295 QgsProcessingParameterDefinition(
const QString &name,
const QString &description = QString(),
const QVariant &defaultValue = QVariant(),
296 bool optional =
false );
298 virtual ~QgsProcessingParameterDefinition() =
default;
303 virtual QgsProcessingParameterDefinition *clone()
const = 0
SIP_FACTORY;
308 virtual QString type()
const = 0;
322 QString
name()
const {
return mName; }
329 void setName(
const QString &name ) { mName = name; }
343 void setDescription(
const QString &description ) { mDescription = description; }
362 Flags
flags()
const {
return mFlags; }
377 virtual bool checkValueIsAcceptable(
const QVariant &input,
QgsProcessingContext *context =
nullptr )
const;
383 virtual QString valueAsPythonString(
const QVariant &value,
QgsProcessingContext &context )
const;
389 virtual QString asScriptCode()
const;
407 virtual QVariantMap toVariantMap()
const;
414 virtual bool fromVariantMap(
const QVariantMap &map );
436 void setMetadata(
const QVariantMap &metadata ) { mMetadata = metadata; }
462 virtual QString toolTip()
const;
579 bool mIsDynamic =
false;
595 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsProcessingParameterDefinition::Flags )
627 static bool isDynamic(
const QVariantMap ¶meters,
const QString &name );
632 static QString parameterAsString(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
const QgsProcessingContext &context );
638 static QString parameterAsString(
const QgsProcessingParameterDefinition *definition,
const QVariant &value,
const QgsProcessingContext &context );
643 static QString parameterAsExpression(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
const QgsProcessingContext &context );
649 static QString parameterAsExpression(
const QgsProcessingParameterDefinition *definition,
const QVariant &value,
const QgsProcessingContext &context );
654 static double parameterAsDouble(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
const QgsProcessingContext &context );
660 static double parameterAsDouble(
const QgsProcessingParameterDefinition *definition,
const QVariant &value,
const QgsProcessingContext &context );
665 static int parameterAsInt(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
const QgsProcessingContext &context );
671 static int parameterAsInt(
const QgsProcessingParameterDefinition *definition,
const QVariant &value,
const QgsProcessingContext &context );
677 static QList<int> parameterAsInts(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
const QgsProcessingContext &context );
683 static QList<int> parameterAsInts(
const QgsProcessingParameterDefinition *definition,
const QVariant &value,
const QgsProcessingContext &context );
688 static int parameterAsEnum(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
const QgsProcessingContext &context );
694 static int parameterAsEnum(
const QgsProcessingParameterDefinition *definition,
const QVariant &value,
const QgsProcessingContext &context );
699 static QList<int> parameterAsEnums(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
const QgsProcessingContext &context );
705 static QList<int> parameterAsEnums(
const QgsProcessingParameterDefinition *definition,
const QVariant &value,
const QgsProcessingContext &context );
710 static bool parameterAsBool(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
const QgsProcessingContext &context );
717 static bool parameterAsBoolean(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
const QgsProcessingContext &context );
723 static bool parameterAsBool(
const QgsProcessingParameterDefinition *definition,
const QVariant &value,
const QgsProcessingContext &context );
729 static bool parameterAsBoolean(
const QgsProcessingParameterDefinition *definition,
const QVariant &value,
const QgsProcessingContext &context );
744 static QgsFeatureSink *parameterAsSink(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
763 static QgsFeatureSink *parameterAsSink(
const QgsProcessingParameterDefinition *definition,
const QVariant &value,
804 static QString parameterAsCompatibleSourceLayerPath(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
836 static QString parameterAsCompatibleSourceLayerPathAndLayerName(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
837 QgsProcessingContext &context,
const QStringList &compatibleFormats,
const QString &preferredFormat = QString(
"shp" ),
QgsProcessingFeedback *feedback =
nullptr, QString *layerName SIP_OUT =
nullptr );
846 static QgsMapLayer *parameterAsLayer(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
QgsProcessingContext &context );
882 static QString parameterAsOutputLayer(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
QgsProcessingContext &context );
888 static QString parameterAsOutputLayer(
const QgsProcessingParameterDefinition *definition,
const QVariant &value,
QgsProcessingContext &context );
893 static QString parameterAsFileOutput(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
QgsProcessingContext &context );
899 static QString parameterAsFileOutput(
const QgsProcessingParameterDefinition *definition,
const QVariant &value,
QgsProcessingContext &context );
930 static QgsMeshLayer *parameterAsMeshLayer(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
QgsProcessingContext &context );
992 static QgsGeometry parameterAsExtentGeometry(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
QgsProcessingContext &context,
1009 static QgsPointXY parameterAsPoint(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
QgsProcessingContext &context,
1041 static QString parameterAsFile(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
QgsProcessingContext &context );
1047 static QString parameterAsFile(
const QgsProcessingParameterDefinition *definition,
const QVariant &value,
QgsProcessingContext &context );
1053 static QVariantList parameterAsMatrix(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
QgsProcessingContext &context );
1060 static QVariantList parameterAsMatrix(
const QgsProcessingParameterDefinition *definition,
const QVariant &value,
QgsProcessingContext &context );
1065 static QList< QgsMapLayer *> parameterAsLayerList(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
QgsProcessingContext &context );
1071 static QList< QgsMapLayer *> parameterAsLayerList(
const QgsProcessingParameterDefinition *definition,
const QVariant &value,
QgsProcessingContext &context );
1078 static QStringList parameterAsFileList(
const QgsProcessingParameterDefinition *definition,
const QVariant &value,
QgsProcessingContext &context );
1085 static QStringList parameterAsFileList(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
QgsProcessingContext &context );
1090 static QList<double> parameterAsRange(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
QgsProcessingContext &context );
1096 static QList<double> parameterAsRange(
const QgsProcessingParameterDefinition *definition,
const QVariant &value,
QgsProcessingContext &context );
1101 static QStringList parameterAsFields(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
QgsProcessingContext &context );
1107 static QStringList parameterAsFields(
const QgsProcessingParameterDefinition *definition,
const QVariant &value,
QgsProcessingContext &context );
1154 static QColor parameterAsColor(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
QgsProcessingContext &context );
1161 static QColor parameterAsColor(
const QgsProcessingParameterDefinition *definition,
const QVariant &value,
QgsProcessingContext &context );
1168 static QgsProcessingParameterDefinition *parameterFromVariantMap(
const QVariantMap &map )
SIP_FACTORY;
1173 static QString descriptionFromName(
const QString &name );
1180 static QgsProcessingParameterDefinition *parameterFromScriptCode(
const QString &code )
SIP_FACTORY;
1184 static bool parseScriptCodeParameterOptions(
const QString &code,
bool &isOptional, QString &name, QString &type, QString &definition );
1203 bool optional =
false );
1208 static QString
typeName() {
return QStringLiteral(
"boolean" ); }
1233 QgsProcessingParameterCrs(
const QString &name,
const QString &description = QString(),
const QVariant &defaultValue = QVariant(),
1234 bool optional =
false );
1239 static QString
typeName() {
return QStringLiteral(
"crs" ); }
1266 bool optional =
false );
1271 static QString
typeName() {
return QStringLiteral(
"layer" ); }
1298 bool optional =
false );
1303 static QString
typeName() {
return QStringLiteral(
"extent" ); }
1330 QgsProcessingParameterPoint(
const QString &name,
const QString &description = QString(),
const QVariant &defaultValue = QVariant(),
1331 bool optional =
false );
1336 static QString
typeName() {
return QStringLiteral(
"point" ); }
1373 QgsProcessingParameterFile(
const QString &name,
const QString &description = QString(),
Behavior behavior = File,
const QString &extension = QString(),
const QVariant &defaultValue = QVariant(),
1374 bool optional =
false,
const QString &fileFilter = QString() );
1379 static QString
typeName() {
return QStringLiteral(
"file" ); }
1416 void setExtension(
const QString &extension );
1424 QString fileFilter()
const;
1435 void setFileFilter(
const QString &filter );
1449 QString mFileFilter;
1466 bool hasFixedNumberRows =
false,
const QStringList &headers = QStringList(),
1467 const QVariant &defaultValue = QVariant(),
1468 bool optional =
false );
1473 static QString
typeName() {
return QStringLiteral(
"matrix" ); }
1484 QStringList headers()
const;
1490 void setHeaders(
const QStringList &headers );
1498 int numberRows()
const;
1506 void setNumberRows(
int rows );
1513 bool hasFixedNumberRows()
const;
1520 void setHasFixedNumberRows(
bool hasFixedNumberRows );
1532 QStringList mHeaders;
1533 int mNumberRows = 3;
1534 bool mFixedNumberRows =
false;
1552 const QVariant &defaultValue = QVariant(),
1553 bool optional =
false );
1558 static QString
typeName() {
return QStringLiteral(
"multilayer" ); }
1583 int minimumNumberInputs()
const;
1590 void setMinimumNumberInputs(
int minimum );
1603 int mMinimumNumberInputs = 0;
1640 Type type = Integer,
1641 const QVariant &defaultValue = QVariant(),
1642 bool optional =
false,
1643 double minValue = std::numeric_limits<double>::lowest() + 1,
1644 double maxValue = std::numeric_limits<double>::max()
1650 static QString
typeName() {
return QStringLiteral(
"number" ); }
1655 QString
toolTip()
const override;
1662 double minimum()
const;
1668 void setMinimum(
double minimum );
1674 double maximum()
const;
1680 void setMaximum(
double maximum );
1686 Type dataType()
const;
1692 void setDataType(
Type type );
1704 double mMin = std::numeric_limits<double>::lowest() + 1;
1705 double mMax = std::numeric_limits<double>::max();
1706 Type mDataType = Integer;
1736 const QVariant &defaultValue = QVariant(),
1737 const QString &parentParameterName = QString(),
1738 bool optional =
false,
1739 double minValue = std::numeric_limits<double>::lowest() + 1,
1740 double maxValue = std::numeric_limits<double>::max() );
1745 static QString
typeName() {
return QStringLiteral(
"distance" ); }
1749 QString
type()
const override;
1757 QString parentParameterName()
const;
1763 void setParentParameterName(
const QString &parentParameterName );
1786 QString mParentParameterName;
1809 const QVariant &defaultValue = QVariant(),
1810 bool optional =
false );
1815 static QString
typeName() {
return QStringLiteral(
"scale" ); }
1819 QString
type()
const override;
1844 const QVariant &defaultValue = QVariant(),
1845 bool optional =
false );
1850 static QString
typeName() {
return QStringLiteral(
"range" ); }
1896 bool optional =
false );
1901 static QString
typeName() {
return QStringLiteral(
"raster" ); }
1927 QgsProcessingParameterEnum(
const QString &name,
const QString &description = QString(),
const QStringList &options = QStringList(),
1928 bool allowMultiple =
false,
1929 const QVariant &defaultValue = QVariant(),
1930 bool optional =
false );
1935 static QString
typeName() {
return QStringLiteral(
"enum" ); }
1947 QStringList options()
const;
1953 void setOptions(
const QStringList &options );
1959 bool allowMultiple()
const;
1965 void setAllowMultiple(
bool allowMultiple );
1977 QStringList mOptions;
1978 bool mAllowMultiple =
false;
1996 bool multiLine =
false,
1997 bool optional =
false );
2002 static QString
typeName() {
return QStringLiteral(
"string" ); }
2013 bool multiLine()
const;
2019 void setMultiLine(
bool multiLine );
2031 bool mMultiLine =
false;
2056 bool optional =
false );
2061 static QString
typeName() {
return QStringLiteral(
"authcfg" ); }
2088 const QString &parentLayerParameterName = QString(),
2089 bool optional =
false );
2094 static QString
typeName() {
return QStringLiteral(
"expression" ); }
2105 QString parentLayerParameterName()
const;
2111 void setParentLayerParameterName(
const QString &parentLayerParameterName );
2123 QString mParentLayerParameterName;
2147 QList< int > dataTypes()
const;
2153 void setDataTypes(
const QList< int > &types );
2176 const QString &description = QString(),
2177 const QList< int > &types = QList< int >(),
2178 const QVariant &defaultValue = QVariant(),
2179 bool optional =
false );
2184 static QString
typeName() {
return QStringLiteral(
"vector" ); }
2215 const QString &description = QString(),
2216 const QVariant &defaultValue = QVariant(),
2217 bool optional =
false );
2222 static QString
typeName() {
return QStringLiteral(
"mesh" ); }
2256 QgsProcessingParameterField(
const QString &name,
const QString &description = QString(),
const QVariant &defaultValue = QVariant(),
2257 const QString &parentLayerParameterName = QString(),
2259 bool allowMultiple =
false,
2260 bool optional =
false,
2261 bool defaultToAllFields =
false );
2266 static QString
typeName() {
return QStringLiteral(
"field" ); }
2279 QString parentLayerParameterName()
const;
2285 void setParentLayerParameterName(
const QString &parentLayerParameterName );
2303 bool allowMultiple()
const;
2309 void setAllowMultiple(
bool allowMultiple );
2320 bool defaultToAllFields()
const;
2331 void setDefaultToAllFields(
bool enabled );
2343 QString mParentLayerParameterName;
2345 bool mAllowMultiple =
false;
2346 bool mDefaultToAllFields =
false;
2365 const QList< int > &types = QList< int >(),
2366 const QVariant &defaultValue = QVariant(),
bool optional =
false );
2371 static QString
typeName() {
return QStringLiteral(
"source" ); }
2407 bool optional =
false,
bool createByDefault =
true );
2438 virtual QString defaultFileExtension()
const = 0;
2445 virtual QString generateTemporaryDestination()
const;
2452 bool createByDefault()
const;
2459 void setCreateByDefault(
bool createByDefault );
2484 bool mSupportsNonFileBasedOutputs =
true;
2485 bool mCreateByDefault =
true;
2487 friend class QgsProcessingModelAlgorithm;
2488 friend class TestQgsProcessing;
2511 bool optional =
false,
bool createByDefault =
true );
2516 static QString
typeName() {
return QStringLiteral(
"sink" ); }
2531 virtual QStringList supportedOutputVectorLayerExtensions()
const;
2543 bool hasGeometry()
const;
2587 bool optional =
false,
bool createByDefault =
true );
2592 static QString
typeName() {
return QStringLiteral(
"vectorDestination" ); }
2607 virtual QStringList supportedOutputVectorLayerExtensions()
const;
2619 bool hasGeometry()
const;
2659 const QVariant &defaultValue = QVariant(),
2660 bool optional =
false,
2661 bool createByDefault =
true );
2666 static QString
typeName() {
return QStringLiteral(
"rasterDestination" ); }
2679 virtual QStringList supportedOutputRasterLayerExtensions()
const;
2705 const QString &fileFilter = QString(),
2706 const QVariant &defaultValue = QVariant(),
2707 bool optional =
false,
2708 bool createByDefault =
true );
2713 static QString
typeName() {
return QStringLiteral(
"fileDestination" ); }
2726 QString fileFilter()
const;
2732 void setFileFilter(
const QString &filter );
2745 QString mFileFilter;
2764 const QVariant &defaultValue = QVariant(),
2765 bool optional =
false,
2766 bool createByDefault =
true );
2771 static QString
typeName() {
return QStringLiteral(
"folderDestination" ); }
2798 QgsProcessingParameterBand(
const QString &name,
const QString &description = QString(),
const QVariant &defaultValue = QVariant(),
2799 const QString &parentLayerParameterName = QString(),
2800 bool optional =
false,
2801 bool allowMultiple =
false );
2806 static QString
typeName() {
return QStringLiteral(
"band" ); }
2819 QString parentLayerParameterName()
const;
2825 void setParentLayerParameterName(
const QString &parentLayerParameterName );
2840 bool allowMultiple()
const;
2847 void setAllowMultiple(
bool allowMultiple );
2851 QString mParentLayerParameterName;
2852 bool mAllowMultiple =
false;
2874 bool optional =
false );
2879 static QString
typeName() {
return QStringLiteral(
"layout" ); }
2912 const QString &parentLayoutParameterName = QString(),
2914 bool optional =
false );
2919 static QString
typeName() {
return QStringLiteral(
"layoutitem" ); }
2938 QString parentLayoutParameterName()
const;
2944 void setParentLayoutParameterName(
const QString &name );
2953 int itemType()
const;
2962 void setItemType(
int type );
2965 QString mParentLayoutParameterName;
2987 QgsProcessingParameterColor(
const QString &name,
const QString &description = QString(),
const QVariant &defaultValue = QVariant(),
2988 bool opacityEnabled =
true,
2989 bool optional =
false );
2994 static QString
typeName() {
return QStringLiteral(
"color" ); }
3010 bool opacityEnabled()
const;
3019 void setOpacityEnabled(
bool enabled );
3028 bool mAllowOpacity =
true;
3050 const QString &sourceCrsParameterName = QString(),
const QString &destinationCrsParameterName = QString(),
3051 const QVariant &staticSourceCrs = QVariant(),
const QVariant &staticDestinationCrs = QVariant(),
3052 bool optional =
false );
3057 static QString
typeName() {
return QStringLiteral(
"coordinateoperation" ); }
3130 QString mSourceParameterName;
3131 QString mDestParameterName;
3132 QVariant mSourceCrs;
3155 bool optional =
false );
3160 static QString
typeName() {
return QStringLiteral(
"maptheme" ); }
3183 #endif // QGSPROCESSINGPARAMETERS_H QString type() const override
Unique parameter type name.
QgsProperty sink
Sink/layer definition.
A boolean parameter for processing algorithms.
QList< const QgsProcessingParameterDefinition *> QgsProcessingParameterDefinitions
List of processing parameters.
static QString typeName()
Returns the type name for the parameter class.
QgsPropertyDefinition dynamicPropertyDefinition() const
Returns the property definition for dynamic properties.
An input file or folder parameter for processing algorithms.
A parameter for processing algorithms which accepts multiple map layers.
virtual QString asScriptCode() const
Returns the parameter definition encoded in a string which can be used within a Processing script...
void setAdditionalExpressionContextVariables(const QStringList &variables)
Sets a list of additional expression context variables which are available for use when evaluating th...
A rectangle specified with double values.
Base class for all map layer types.
QString type() const override
Unique parameter type name.
static QString typeName()
Returns the type name for the parameter class.
QVariantMap & metadata()
Returns the parameter's freeform metadata.
Base class for providing feedback from a processing algorithm.
virtual bool fromVariantMap(const QVariantMap &map)
Restores this parameter to a QVariantMap.
Base class for graphical items within a QgsLayout.
Encapsulates settings relating to a feature sink or output raster layer for a processing algorithm...
QgsProcessingFeatureSourceDefinition(const QString &source=QString(), bool selectedFeaturesOnly=false)
Constructor for QgsProcessingFeatureSourceDefinition, accepting a static string source.
QString type() const override
Unique parameter type name.
QString type() const override
Unique parameter type name.
void setIsDynamic(bool dynamic)
Sets whether the parameter is dynamic, and can support data-defined values (i.e.
QString type() const override
Unique parameter type name.
A vector layer or feature source field parameter for processing algorithms.
QString type() const override
Unique parameter type name.
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 asPythonString(QgsProcessing::PythonOutputType outputType=QgsProcessing::PythonQgsProcessingAlgorithmSubclass) const override
Returns the parameter definition as a Python command which can be used within a Python Processing scr...
QString type() const override
Unique parameter type name.
QString mDynamicLayerParameterName
Linked vector layer parameter name for dynamic properties.
static QString typeName()
Returns the type name for the parameter class.
static QString typeName()
Returns the type name for the parameter class.
QVariantMap metadata() const
Returns the parameter's freeform metadata.
static QString typeName()
Returns the type name for the parameter class.
Represents a raster layer.
static QString typeName()
Returns the type name for the parameter class.
QString type() const override
Unique parameter type name.
A print layout parameter, allowing users to select a print layout.
QString type() const override
Unique parameter type name.
A map layer parameter for processing algorithms.
A class to represent a 2D point.
A color parameter for processing algorithms.
An expression parameter for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
void setDestinationCrs(const QVariant &crs)
Sets the static destination crs.
QString type() const override
Unique parameter type name.
virtual QString asPythonString(QgsProcessing::PythonOutputType outputType=QgsProcessing::PythonQgsProcessingAlgorithmSubclass) const
Returns the parameter definition as a Python command which can be used within a Python Processing scr...
bool isDestination() const override
Returns true if this parameter represents a file or layer destination, e.g.
An interface for objects which accept features via addFeature(s) methods.
PythonOutputType
Available Python output types.
QgsProcessingProvider * originalProvider() const
Original (source) provider which this parameter has been derived from.
QString type() const override
Unique parameter type name.
static QString typeName()
Returns the type name for the parameter class.
static QString typeName()
Returns the type name for the parameter class.
QVariantMap mMetadata
Freeform metadata for parameter. Mostly used by widget wrappers to customize their appearance and beh...
QString type() const override
Unique parameter type name.
QgsFeatureSource subclass which proxies methods to an underlying QgsFeatureSource, modifying results according to the settings in a QgsProcessingContext.
Container of fields for a vector layer.
A geometry is the spatial representation of a feature.
static QString typeName()
Returns the type name for the parameter class.
Abstract base class for processing providers.
virtual QVariantMap toVariantMap() const
Saves this parameter to a QVariantMap.
void setFlags(Flags flags)
Sets the flags associated with the parameter.
A raster band parameter for Processing algorithms.
QString type() const override
Unique parameter type name.
QVariantMap toVariantMap() const override
Saves this parameter to a QVariantMap.
QgsUnitTypes::DistanceUnit defaultUnit() const
Returns the default distance unit for the parameter.
virtual QString valueAsPythonString(const QVariant &value, QgsProcessingContext &context) const
Returns a string version of the parameter input value, which is suitable for use as an input paramete...
static QString typeName()
Returns the type name for the parameter class.
QStringList mAdditionalExpressionVariables
Additional expression context variables exposed for use by this parameter.
QString type() const override
Unique parameter type name.
static QString typeName()
Returns the type name for the parameter class.
void setDefaultUnit(QgsUnitTypes::DistanceUnit unit)
Sets the default distance unit for the parameter.
const QgsCoordinateReferenceSystem & crs
QString type() const override
Unique parameter type name.
static QString typeName()
Returns the type name for the parameter class.
Base class for all parameter definitions which represent file or layer destinations, e.g.
Abstract base class for processing algorithms.
A coordinate operation parameter for processing algorithms, for selection between available coordinat...
A feature sink output for processing algorithms.
bool operator==(const QgsProcessingFeatureSourceDefinition &other)
bool selectedFeaturesOnly
true if only selected features in the source should be used by algorithms.
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.
static QString typeName()
Returns the type name for the parameter class.
A numeric range parameter for processing algorithms.
bool operator!=(const QgsProcessingFeatureSourceDefinition &other)
A double numeric parameter for map scale values.
void setDynamicPropertyDefinition(const QgsPropertyDefinition &definition)
Sets the property definition for dynamic properties.
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.
static QString typeName()
Returns the type name for the parameter class.
Can be inherited by parameters which require limits to their acceptable data types.
A raster layer parameter for processing algorithms.
Type
The WKB type describes the number of dimensions a geometry has.
void setDescription(const QString &description)
Sets the description for the parameter.
virtual QString toolTip() const
Returns a formatted tooltip for use with the parameter, which gives helpful information like paramete...
static QgsProcessingParameterNumber * fromScriptCode(const QString &name, const QString &description, bool isOptional, const QString &definition)
Creates a new parameter using the definition from a script code.
static QString typeName()
Returns the type name for the parameter class.
static QString typeName()
Returns the type name for the parameter class.
QgsProperty source
Source definition.
QString type() const override
Unique parameter type name.
An enum based parameter for processing algorithms, allowing for selection from predefined values...
Flags flags() const
Returns any flags associated with the parameter.
static QString typeName()
Returns the type name for the parameter class.
QVariant defaultValue() const
Returns the default value for the parameter.
QVariant sourceCrs() const
Returns the static source CRS, or an invalid value if this is not set.
QString type() const override
Unique parameter type name.
QString type() const override
Unique parameter type name.
static QString typeName()
Returns the type name for the parameter class.
QgsProcessingOutputLayerDefinition(const QgsProperty &sink, QgsProject *destinationProject=nullptr)
Constructor for QgsProcessingOutputLayerDefinition, accepting a QgsProperty sink/layer.
A collection of utilities for working with parameters when running a processing algorithm.
A double numeric parameter for distance values.
void setSourceCrs(const QVariant &crs)
Sets the static source crs.
QString type() const override
Unique parameter type name.
Custom exception class for processing related exceptions.
Q_DECLARE_METATYPE(QgsMeshTimeSettings)
Encapsulates a QGIS project, including sets of map layers and their styles, layouts, annotations, canvases, etc.
void setDefaultValue(const QVariant &value)
Sets the default value for the parameter.
QString type() const override
Unique parameter type name.
A vector layer (with or without geometry) parameter for processing algorithms.
virtual QString defaultFileExtension() const =0
Returns the default file extension for destination file paths associated with this parameter...
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...
A mesh layer parameter for processing algorithms.
A coordinate reference system parameter for processing algorithms.
A store for object properties.
virtual QStringList dependsOnOtherParameters() const
Returns a list of other parameter names on which this parameter is dependent (e.g.
A rectangular map extent parameter for processing algorithms.
QString type() const override
Unique parameter type name.
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
A numeric parameter for processing algorithms.
A generic file based destination parameter, for specifying the destination path for a file (non-map l...
QString dynamicLayerParameterName() const
Returns the name of the parameter for a layer linked to a dynamic parameter, or an empty string if th...
Definition for a property.
bool fromVariantMap(const QVariantMap &map) override
Restores this parameter to a QVariantMap.
QString name() const
Returns the name of the parameter.
QList< int > mDataTypes
List of acceptable data types for the parameter.
Encapsulates settings relating to a feature source input to a processing algorithm.
bool supportsNonFileBasedOutput() const
Returns true if the destination parameter supports non filed-based outputs, such as memory layers or ...
Behavior behavior() const
Returns the parameter behavior (e.g.
QVariant destinationCrs() const
Returns the static destination CRS, or an invalid value if this is not set.
QString type() const override
Unique parameter type name.
virtual bool isDestination() const
Returns true if this parameter represents a file or layer destination, e.g.
DistanceUnit
Units of distance.
QString extension() const
Returns any specified file extension for the parameter.
QString type() const override
Unique parameter type name.
QString type() const override
Unique parameter type name.
Base class for the definition of processing outputs.
static QString typeName()
Returns the type name for the parameter class.
void setName(const QString &name)
Sets the name of the parameter.
A vector layer destination parameter, for specifying the destination path for a vector layer created ...
QString type() const override
Unique parameter type name.
bool isDynamic() const
Returns true if the parameter supports is dynamic, and can support data-defined values (i...
A point parameter for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
void setSourceCrsParameterName(const QString &name)
Sets the name of the source CRS parameter.
An input feature source (such as vector layers) parameter for processing algorithms.
void setMetadata(const QVariantMap &metadata)
Sets the parameter's freeform metadata.
A folder destination parameter, for specifying the destination path for a folder created by the algor...
QString destinationName
Name to use for sink if it's to be loaded into a destination project.
Flags mFlags
Parameter flags.
static QString typeName()
Returns the type name for the parameter class.
This class represents a coordinate reference system (CRS).
QgsProcessingOutputLayerDefinition(const QString &sink=QString(), QgsProject *destinationProject=nullptr)
Constructor for QgsProcessingOutputLayerDefinition, accepting a static sink/layer string...
Base class for the definition of processing parameters.
QStringList additionalExpressionContextVariables() const
Returns a list of additional expression context variables which are available for use when evaluating...
virtual bool checkValueIsAcceptable(const QVariant &input, QgsProcessingContext *context=nullptr) const
Checks whether the specified input value is acceptable for the parameter.
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
QVariantMap toVariantMap() const override
Saves this parameter to a QVariantMap.
QVariant mDefault
Default value for parameter.
SourceType
Data source types enum.
QgsPropertyDefinition mPropertyDefinition
Data defined property definition.
QgsProcessingParameterDefinition * clone() const override
Creates a clone of the parameter definition.
static QString typeName()
Returns the type name for the parameter class.
QString mName
Parameter name.
QgsProcessingFeatureSourceDefinition(const QgsProperty &source, bool selectedFeaturesOnly=false)
Constructor for QgsProcessingFeatureSourceDefinition, accepting a QgsProperty source.
Represents a mesh layer supporting display of data on structured or unstructured meshes.
static QString typeName()
Returns the type name for the parameter class.
Behavior
Parameter behavior.
virtual QString generateTemporaryDestination() const
Generates a temporary destination value for this parameter.
void setSupportsNonFileBasedOutput(bool supportsNonFileBasedOutput)
Sets whether the destination parameter supports non filed-based outputs, such as memory layers or dir...
static QString typeName()
Returns the type name for the parameter class.
DataType
Field data types.
void setDestinationCrsParameterName(const QString &name)
Sets the name of the destination CRS parameter.
QString sourceCrsParameterName() const
Returns the name of the source CRS parameter, or an empty string if this is not set.
A table (matrix) parameter for processing algorithms.
Full Python QgsProcessingAlgorithm subclass.
Print layout, a QgsLayout subclass for static or atlas-based layouts.
QString type() const override
Unique parameter type name.
A string parameter for authentication configuration ID values.
QString mDescription
Parameter description.
QString destinationCrsParameterName() const
Returns the name of the destination CRS parameter, or an empty string if this is not set...
QString asPythonString(QgsProcessing::PythonOutputType outputType=QgsProcessing::PythonQgsProcessingAlgorithmSubclass) const override
Returns the parameter definition as a Python command which can be used within a Python Processing scr...
bool fromVariantMap(const QVariantMap &map) override
Restores this parameter to a QVariantMap.
void setBehavior(Behavior behavior)
Sets the parameter behavior (e.g.
Represents a vector layer which manages a vector based data sets.
A map theme parameter for processing algorithms, allowing users to select an existing map theme from ...
Contains information about the context in which a processing algorithm is executed.
A string parameter for processing algorithms.
QString type() const override
Unique parameter type name.
QString description() const
Returns the description for the parameter.
virtual QgsProcessingParameterDefinition * clone() const =0
Creates a clone of the parameter definition.
virtual QgsProcessingOutputDefinition * toOutputDefinition() const =0
Returns a new QgsProcessingOutputDefinition corresponding to the definition of the destination parame...
Any vector layer with geometry.
QString type() const override
Unique parameter type name.
static QString typeName()
Returns the type name for the parameter class.
QVariantMap createOptions
Map of optional sink/layer creation options, which are passed to the underlying provider when creatin...
QString type() const override
Unique parameter type name.
QString type() const override
Unique parameter type name.
static QString typeName()
Returns the type name for the parameter class.