QGIS/python/core/auto_generated/processing/qgsprocessingparameters.sip.in

2588 lines
83 KiB
Plaintext
Raw Normal View History

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/processing/qgsprocessingparameters.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsProcessingFeatureSourceDefinition
{
%Docstring
2017-12-15 10:36:55 -04:00
Encapsulates settings relating to a feature source input to a processing algorithm.
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsprocessingparameters.h"
%End
public:
QgsProcessingFeatureSourceDefinition( const QString &source = QString(), bool selectedFeaturesOnly = false );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsProcessingFeatureSourceDefinition, accepting a static string source.
%End
QgsProcessingFeatureSourceDefinition( const QgsProperty &source, bool selectedFeaturesOnly = false );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsProcessingFeatureSourceDefinition, accepting a QgsProperty source.
%End
QgsProperty source;
bool selectedFeaturesOnly;
bool operator==( const QgsProcessingFeatureSourceDefinition &other );
bool operator!=( const QgsProcessingFeatureSourceDefinition &other );
operator QVariant() const;
};
class QgsProcessingOutputLayerDefinition
{
%Docstring
2017-12-15 10:36:55 -04:00
Encapsulates settings relating to a feature sink or output raster layer for a processing algorithm.
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsprocessingparameters.h"
%End
public:
QgsProcessingOutputLayerDefinition( const QString &sink = QString(), QgsProject *destinationProject = 0 );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsProcessingOutputLayerDefinition, accepting a static sink/layer string.
The ``destinationProject`` parameter can be set to a QgsProject instance in which
to automatically load the resulting sink/layer after completing processing.
%End
QgsProcessingOutputLayerDefinition( const QgsProperty &sink, QgsProject *destinationProject = 0 );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsProcessingOutputLayerDefinition, accepting a QgsProperty sink/layer.
The ``destinationProject`` parameter can be set to a QgsProject instance in which
to automatically load the resulting sink/layer after completing processing.
%End
QgsProperty sink;
QgsProject *destinationProject;
QString destinationName;
QVariantMap createOptions;
QVariant toVariant() const;
%Docstring
Saves this output layer definition to a QVariantMap, wrapped in a QVariant.
You can use QgsXmlUtils.writeVariant to save it to an XML document.
.. seealso:: :py:func:`loadVariant`
.. versionadded:: 3.2
%End
bool loadVariant( const QVariantMap &map );
%Docstring
Loads this output layer definition from a QVariantMap, wrapped in a QVariant.
You can use QgsXmlUtils.readVariant to load it from an XML document.
.. seealso:: :py:func:`toVariant`
.. versionadded:: 3.2
%End
operator QVariant() const;
};
class QgsProcessingParameterDefinition
{
%Docstring
2017-12-15 10:36:55 -04:00
Base class for the definition of processing parameters.
2017-12-15 10:36:55 -04:00
Parameter definitions encapsulate properties regarding the behavior of parameters,
their acceptable ranges, defaults, etc.
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsprocessingparameters.h"
%End
%ConvertToSubClassCode
2017-07-03 19:42:29 +10:00
if ( sipCpp->type() == QgsProcessingParameterBoolean::typeName() )
sipType = sipType_QgsProcessingParameterBoolean;
2017-07-03 19:42:29 +10:00
else if ( sipCpp->type() == QgsProcessingParameterCrs::typeName() )
sipType = sipType_QgsProcessingParameterCrs;
2017-07-03 19:42:29 +10:00
else if ( sipCpp->type() == QgsProcessingParameterMapLayer::typeName() )
sipType = sipType_QgsProcessingParameterMapLayer;
2017-07-03 19:42:29 +10:00
else if ( sipCpp->type() == QgsProcessingParameterExtent::typeName() )
sipType = sipType_QgsProcessingParameterExtent;
2017-07-03 19:42:29 +10:00
else if ( sipCpp->type() == QgsProcessingParameterPoint::typeName() )
sipType = sipType_QgsProcessingParameterPoint;
2017-07-03 19:42:29 +10:00
else if ( sipCpp->type() == QgsProcessingParameterFile::typeName() )
sipType = sipType_QgsProcessingParameterFile;
2017-07-03 19:42:29 +10:00
else if ( sipCpp->type() == QgsProcessingParameterMatrix::typeName() )
sipType = sipType_QgsProcessingParameterMatrix;
2017-07-03 19:42:29 +10:00
else if ( sipCpp->type() == QgsProcessingParameterMultipleLayers::typeName() )
sipType = sipType_QgsProcessingParameterMultipleLayers;
2017-07-03 19:42:29 +10:00
else if ( sipCpp->type() == QgsProcessingParameterNumber::typeName() )
sipType = sipType_QgsProcessingParameterNumber;
else if ( sipCpp->type() == QgsProcessingParameterDistance::typeName() )
sipType = sipType_QgsProcessingParameterDistance;
2017-07-03 19:42:29 +10:00
else if ( sipCpp->type() == QgsProcessingParameterRange::typeName() )
sipType = sipType_QgsProcessingParameterRange;
2017-07-03 19:42:29 +10:00
else if ( sipCpp->type() == QgsProcessingParameterRasterLayer::typeName() )
sipType = sipType_QgsProcessingParameterRasterLayer;
2017-07-03 19:42:29 +10:00
else if ( sipCpp->type() == QgsProcessingParameterEnum::typeName() )
sipType = sipType_QgsProcessingParameterEnum;
2017-07-03 19:42:29 +10:00
else if ( sipCpp->type() == QgsProcessingParameterString::typeName() )
sipType = sipType_QgsProcessingParameterString;
2017-07-03 19:42:29 +10:00
else if ( sipCpp->type() == QgsProcessingParameterExpression::typeName() )
sipType = sipType_QgsProcessingParameterExpression;
2017-07-03 19:42:29 +10:00
else if ( sipCpp->type() == QgsProcessingParameterVectorLayer::typeName() )
sipType = sipType_QgsProcessingParameterVectorLayer;
2017-07-03 19:42:29 +10:00
else if ( sipCpp->type() == QgsProcessingParameterField::typeName() )
sipType = sipType_QgsProcessingParameterField;
2017-07-03 19:42:29 +10:00
else if ( sipCpp->type() == QgsProcessingParameterFeatureSource::typeName() )
sipType = sipType_QgsProcessingParameterFeatureSource;
2017-07-03 19:42:29 +10:00
else if ( sipCpp->type() == QgsProcessingParameterFeatureSink::typeName() )
sipType = sipType_QgsProcessingParameterFeatureSink;
else if ( sipCpp->type() == QgsProcessingParameterVectorDestination::typeName() )
sipType = sipType_QgsProcessingParameterVectorDestination;
else if ( sipCpp->type() == QgsProcessingParameterRasterDestination::typeName() )
sipType = sipType_QgsProcessingParameterRasterDestination;
else if ( sipCpp->type() == QgsProcessingParameterFileDestination::typeName() )
sipType = sipType_QgsProcessingParameterFileDestination;
else if ( sipCpp->type() == QgsProcessingParameterFolderDestination::typeName() )
sipType = sipType_QgsProcessingParameterFolderDestination;
else if ( sipCpp->type() == QgsProcessingParameterBand::typeName() )
sipType = sipType_QgsProcessingParameterBand;
else
sipType = nullptr;
%End
public:
enum Flag
{
FlagAdvanced,
FlagHidden,
FlagOptional,
FlagIsModelOutput,
};
typedef QFlags<QgsProcessingParameterDefinition::Flag> Flags;
QgsProcessingParameterDefinition( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
bool optional = false );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsProcessingParameterDefinition.
%End
virtual ~QgsProcessingParameterDefinition();
virtual QgsProcessingParameterDefinition *clone() const = 0 /Factory/;
%Docstring
2017-12-15 10:36:55 -04:00
Creates a clone of the parameter definition.
%End
virtual QString type() const = 0;
%Docstring
2017-12-15 10:36:55 -04:00
Unique parameter type name.
%End
virtual bool isDestination() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns true if this parameter represents a file or layer destination, e.g. parameters
which are used for the destination for layers output by an algorithm will return
true.
%End
QString name() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the name of the parameter. This is the internal identifier by which
algorithms access this parameter.
.. seealso:: :py:func:`setName`
%End
void setName( const QString &name );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the ``name`` of the parameter. This is the internal identifier by which
algorithms access this parameter.
.. seealso:: :py:func:`name`
%End
QString description() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the description for the parameter. This is the user-visible string
used to identify this parameter.
.. seealso:: :py:func:`setDescription`
%End
void setDescription( const QString &description );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the ``description`` for the parameter. This is the user-visible string
used to identify this parameter.
.. seealso:: :py:func:`description`
%End
QVariant defaultValue() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the default value for the parameter.
.. seealso:: :py:func:`setDefaultValue`
%End
void setDefaultValue( const QVariant &value );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the default ``value`` for the parameter. Caller takes responsibility
to ensure that ``value`` is a valid input for the parameter subclass.
.. seealso:: :py:func:`defaultValue`
%End
Flags flags() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns any flags associated with the parameter.
.. seealso:: :py:func:`setFlags`
%End
void setFlags( Flags flags );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the ``flags`` associated with the parameter.
.. seealso:: :py:func:`flags`
%End
virtual bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = 0 ) const;
2017-05-16 15:21:41 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Checks whether the specified ``input`` value is acceptable for the
parameter. Returns true if the value can be accepted.
The optional ``context`` parameter can be specified to allow a more stringent
check to be performed, capable of checking for the presence of required
layers and other factors within the context.
2017-05-16 15:21:41 +10:00
%End
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns a string version of the parameter input ``value``, which is suitable for use as an input
parameter value when running an algorithm directly from a Python command.
The returned value must be correctly escaped - e.g. string values must be wrapped in ' 's.
%End
virtual QString asScriptCode() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the parameter definition encoded in a string which can be used within a
Python processing script.
%End
virtual QVariantMap toVariantMap() const;
%Docstring
2017-12-15 10:36:55 -04:00
Saves this parameter to a QVariantMap. Subclasses should ensure that they call the base class
method and then extend the result with additional properties.
.. seealso:: :py:func:`fromVariantMap`
%End
virtual bool fromVariantMap( const QVariantMap &map );
%Docstring
2017-12-15 10:36:55 -04:00
Restores this parameter to a QVariantMap. Subclasses should ensure that they call the base class
method.
.. seealso:: :py:func:`toVariantMap`
%End
QVariantMap &metadata();
%Docstring
2017-12-15 10:36:55 -04:00
Returns the parameter's freeform metadata. This is mostly used by parameter widget wrappers
in order to customize their appearance and behavior.
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setMetadata`
%End
void setMetadata( const QVariantMap &metadata );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the parameter's freeform ``metadata``. This is mostly used by parameter widget wrappers
in order to customize their appearance and behavior.
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`metadata`
%End
virtual QStringList dependsOnOtherParameters() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns a list of other parameter names on which this parameter is dependent (e.g.
field parameters which depend on a parent layer parameter).
%End
QgsProcessingAlgorithm *algorithm() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns a pointer to the algorithm which owns this parameter. May be None
for non-owned parameters.
.. seealso:: :py:func:`provider`
%End
QgsProcessingProvider *provider() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns a pointer to the provider for the algorithm which owns this parameter. May be None
for non-owned parameters or algorithms.
.. seealso:: :py:func:`algorithm`
%End
virtual QString toolTip() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns a formatted tooltip for use with the parameter, which gives helpful information
like parameter description, ID, and extra content like default values (depending on parameter type).
%End
bool isDynamic() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns true if the parameter supports is dynamic, and can support data-defined values
(i.e. QgsProperty based values).
.. seealso:: :py:func:`setIsDynamic`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`dynamicPropertyDefinition`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`dynamicLayerParameterName`
%End
void setIsDynamic( bool dynamic );
%Docstring
2017-12-15 10:36:55 -04:00
Sets whether the parameter is ``dynamic``, and can support data-defined values
(i.e. QgsProperty based values).
.. seealso:: :py:func:`isDynamic`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setDynamicPropertyDefinition`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setDynamicLayerParameterName`
%End
QgsPropertyDefinition dynamicPropertyDefinition() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the property definition for dynamic properties.
.. seealso:: :py:func:`isDynamic`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setDynamicPropertyDefinition`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`dynamicLayerParameterName`
%End
void setDynamicPropertyDefinition( const QgsPropertyDefinition &definition );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the property ``definition`` for dynamic properties.
.. seealso:: :py:func:`isDynamic`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`dynamicPropertyDefinition`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setDynamicLayerParameterName`
%End
QString dynamicLayerParameterName() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the name of the parameter for a layer linked to a dynamic parameter, or an empty string if this is not set.
Dynamic parameters (see isDynamic()) can have an optional vector layer parameter linked to them,
which indicates which layer the fields and values will be available from when evaluating
the dynamic parameter.
.. seealso:: :py:func:`setDynamicLayerParameterName`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`isDynamic`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`dynamicPropertyDefinition`
%End
void setDynamicLayerParameterName( const QString &name );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the ``name`` for the parameter for a layer linked to a dynamic parameter, or an empty string if this is not set.
2017-12-15 10:36:55 -04:00
Dynamic parameters (see isDynamic()) can have an optional vector layer parameter linked to them,
which indicates which layer the fields and values will be available from when evaluating
the dynamic parameter.
.. seealso:: :py:func:`dynamicLayerParameterName`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`isDynamic`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setDynamicPropertyDefinition`
%End
protected:
};
QFlags<QgsProcessingParameterDefinition::Flag> operator|(QgsProcessingParameterDefinition::Flag f1, QFlags<QgsProcessingParameterDefinition::Flag> f2);
typedef QList< const QgsProcessingParameterDefinition * > QgsProcessingParameterDefinitions;
class QgsProcessingParameters
{
%Docstring
2017-12-15 10:36:55 -04:00
A collection of utilities for working with parameters when running a processing algorithm.
2017-12-15 10:36:55 -04:00
Parameters are stored in a QVariantMap and referenced by a unique string key.
The QVariants in parameters are not usually accessed
2017-12-19 11:43:52 -04:00
directly, and instead the high level API provided through :py:class:`QgsProcessingParameters`
2017-12-15 10:36:55 -04:00
parameterAsString(), parameterAsDouble() are used instead.
2017-12-19 11:43:52 -04:00
Parameters are evaluated using a provided :py:class:`QgsProcessingContext`, allowing
2017-12-15 10:36:55 -04:00
the evaluation to understand available map layers and expression contexts
(for expression based parameters).
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsprocessingparameters.h"
%End
public:
static bool isDynamic( const QVariantMap &parameters, const QString &name );
%Docstring
2017-12-15 10:36:55 -04:00
Returns true if the parameter with matching ``name`` is a dynamic parameter, and must
be evaluated once for every input feature processed.
%End
static QString parameterAsString( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
%Docstring
2017-12-15 10:36:55 -04:00
Evaluates the parameter with matching ``definition`` to a static string value.
%End
static QString parameterAsString( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
%Docstring
Evaluates the parameter with matching ``definition`` and ``value`` to a static string value.
.. versionadded:: 3.4
%End
static QString parameterAsExpression( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
%Docstring
2017-12-15 10:36:55 -04:00
Evaluates the parameter with matching ``definition`` to an expression.
%End
static QString parameterAsExpression( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
%Docstring
Evaluates the parameter with matching ``definitionand`` ``value`` to an expression.
.. versionadded:: 3.4
%End
static double parameterAsDouble( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
%Docstring
2017-12-15 10:36:55 -04:00
Evaluates the parameter with matching ``definition`` to a static double value.
%End
static double parameterAsDouble( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
%Docstring
Evaluates the parameter with matching ``definition`` and ``value`` to a static double value.
.. versionadded:: 3.4
%End
static int parameterAsInt( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
%Docstring
2017-12-15 10:36:55 -04:00
Evaluates the parameter with matching ``definition`` to a static integer value.
%End
static int parameterAsInt( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
%Docstring
Evaluates the parameter with matching ``definition`` and ``value`` to a static integer value.
.. versionadded:: 3.4
%End
static QList<int> parameterAsInts( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
%Docstring
Evaluates the parameter with matching ``definition`` to a list of integer values.
.. versionadded:: 3.4
%End
static QList<int> parameterAsInts( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
%Docstring
Evaluates the parameter with matching ``definition`` and ``value`` to a list of integer values.
.. versionadded:: 3.4
%End
static int parameterAsEnum( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
%Docstring
2017-12-15 10:36:55 -04:00
Evaluates the parameter with matching ``definition`` to a enum value.
%End
static int parameterAsEnum( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
%Docstring
Evaluates the parameter with matching ``definition`` and ``value`` to a enum value.
.. versionadded:: 3.4
%End
static QList<int> parameterAsEnums( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
%Docstring
2017-12-15 10:36:55 -04:00
Evaluates the parameter with matching ``definition`` to list of enum values.
%End
static QList<int> parameterAsEnums( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
%Docstring
Evaluates the parameter with matching ``definition`` and ``value`` to list of enum values.
.. versionadded:: 3.4
%End
static bool parameterAsBool( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
%Docstring
2017-12-15 10:36:55 -04:00
Evaluates the parameter with matching ``definition`` to a static boolean value.
%End
static bool parameterAsBool( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
%Docstring
Evaluates the parameter with matching ``definition`` and ``value`` to a static boolean value.
.. versionadded:: 3.4
%End
static QgsFeatureSink *parameterAsSink( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters,
const QgsFields &fields, QgsWkbTypes::Type geometryType, const QgsCoordinateReferenceSystem &crs,
2018-10-30 16:20:58 +01:00
QgsProcessingContext &context, QString &destinationIdentifier /Out/, QgsFeatureSink::SinkFlags sinkFlags = 0 ) /Factory/;
%Docstring
2017-12-15 10:36:55 -04:00
Evaluates the parameter with matching ``definition`` to a feature sink.
The ``fields``, ``geometryType`` and ``crs`` parameters dictate the properties
of the resulting feature sink.
2017-12-15 10:36:55 -04:00
Sinks will either be taken from ``context``'s active project, or created from external
providers and stored temporarily in the ``context``. The ``destinationIdentifier``
argument will be set to a string which can be used to retrieve the layer corresponding
2017-12-19 11:43:52 -04:00
to the sink, e.g. via calling :py:func:`QgsProcessingUtils.mapLayerFromString()`
2017-12-15 10:36:55 -04:00
This function creates a new object and the caller takes responsibility for deleting the returned object.
%End
static QgsFeatureSink *parameterAsSink( const QgsProcessingParameterDefinition *definition, const QVariant &value,
const QgsFields &fields, QgsWkbTypes::Type geometryType, const QgsCoordinateReferenceSystem &crs,
2018-10-30 07:47:56 +01:00
QgsProcessingContext &context, QString &destinationIdentifier /Out/, QgsFeatureSink::SinkFlags sinkFlags = 0 ) /Factory/;
%Docstring
Evaluates the parameter with matching ``definition`` and ``value`` to a feature sink.
The ``fields``, ``geometryType`` and ``crs`` parameters dictate the properties
of the resulting feature sink.
Sinks will either be taken from ``context``'s active project, or created from external
providers and stored temporarily in the ``context``. The ``destinationIdentifier``
argument will be set to a string which can be used to retrieve the layer corresponding
to the sink, e.g. via calling :py:func:`QgsProcessingUtils.mapLayerFromString()`
This function creates a new object and the caller takes responsibility for deleting the returned object.
.. versionadded:: 3.4
%End
static QgsProcessingFeatureSource *parameterAsSource( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context ) /Factory/;
%Docstring
2017-12-15 10:36:55 -04:00
Evaluates the parameter with matching ``definition`` to a feature source.
2017-12-15 10:36:55 -04:00
Sources will either be taken from ``context``'s active project, or loaded from external
sources and stored temporarily in the ``context``.
2017-12-15 10:36:55 -04:00
This function creates a new object and the caller takes responsibility for deleting the returned object.
%End
static QgsProcessingFeatureSource *parameterAsSource( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context ) /Factory/;
%Docstring
Evaluates the parameter with matching ``definition`` and ``value`` to a feature source.
Sources will either be taken from ``context``'s active project, or loaded from external
sources and stored temporarily in the ``context``.
This function creates a new object and the caller takes responsibility for deleting the returned object.
.. versionadded:: 3.4
%End
static QString parameterAsCompatibleSourceLayerPath( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters,
QgsProcessingContext &context, const QStringList &compatibleFormats, const QString &preferredFormat = QString( "shp" ), QgsProcessingFeedback *feedback = 0 );
%Docstring
2017-12-15 10:36:55 -04:00
Evaluates the parameter with matching ``definition`` to a source vector layer file path of compatible format.
If the parameter is evaluated to an existing layer, and that layer is not of the format listed in the
``compatibleFormats`` argument, then the layer will first be exported to a compatible format
in a temporary location. The function will then return the path to that temporary file.
2017-12-15 10:36:55 -04:00
``compatibleFormats`` should consist entirely of lowercase file extensions, e.g. 'shp'.
2017-12-15 10:36:55 -04:00
The ``preferredFormat`` argument is used to specify to desired file extension to use when a temporary
layer export is required. This defaults to shapefiles, because shapefiles are the future (don't believe the geopackage hype!).
%End
static QgsMapLayer *parameterAsLayer( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
%Docstring
2017-12-15 10:36:55 -04:00
Evaluates the parameter with matching ``definition`` to a map layer.
2017-12-15 10:36:55 -04:00
Layers will either be taken from ``context``'s active project, or loaded from external
sources and stored temporarily in the ``context``. In either case, callers do not
need to handle deletion of the returned layer.
%End
static QgsMapLayer *parameterAsLayer( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
%Docstring
Evaluates the parameter with matching ``definition`` and ``value`` to a map layer.
Layers will either be taken from ``context``'s active project, or loaded from external
sources and stored temporarily in the ``context``. In either case, callers do not
need to handle deletion of the returned layer.
.. versionadded:: 3.4
%End
static QgsRasterLayer *parameterAsRasterLayer( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
%Docstring
2017-12-15 10:36:55 -04:00
Evaluates the parameter with matching ``definition`` to a raster layer.
Layers will either be taken from ``context``'s active project, or loaded from external
sources and stored temporarily in the ``context``. In either case, callers do not
need to handle deletion of the returned layer.
%End
static QgsRasterLayer *parameterAsRasterLayer( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
%Docstring
Evaluates the parameter with matching ``definition`` and ``value`` to a raster layer.
Layers will either be taken from ``context``'s active project, or loaded from external
sources and stored temporarily in the ``context``. In either case, callers do not
need to handle deletion of the returned layer.
.. versionadded:: 3.4
%End
static QString parameterAsOutputLayer( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
2017-06-06 14:38:24 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Evaluates the parameter with matching ``definition`` to a output layer destination.
%End
static QString parameterAsOutputLayer( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
%Docstring
Evaluates the parameter with matching ``definition`` and ``value`` to a output layer destination.
.. versionadded:: 3.4
2017-06-06 14:38:24 +10:00
%End
static QString parameterAsFileOutput( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
%Docstring
2017-12-15 10:36:55 -04:00
Evaluates the parameter with matching ``definition`` to a file based output destination.
%End
static QString parameterAsFileOutput( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
%Docstring
Evaluates the parameter with matching ``definition`` and ``value`` to a file based output destination.
.. versionadded:: 3.4
%End
static QgsVectorLayer *parameterAsVectorLayer( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
%Docstring
2017-12-15 10:36:55 -04:00
Evaluates the parameter with matching ``definition`` to a vector layer.
2017-12-15 10:36:55 -04:00
Layers will either be taken from ``context``'s active project, or loaded from external
sources and stored temporarily in the ``context``. In either case, callers do not
need to handle deletion of the returned layer.
%End
static QgsVectorLayer *parameterAsVectorLayer( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
%Docstring
Evaluates the parameter with matching ``definition`` and ``value`` to a vector layer.
Layers will either be taken from ``context``'s active project, or loaded from external
sources and stored temporarily in the ``context``. In either case, callers do not
need to handle deletion of the returned layer.
.. versionadded:: 3.4
%End
static QgsCoordinateReferenceSystem parameterAsCrs( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
%Docstring
2017-12-15 10:36:55 -04:00
Evaluates the parameter with matching ``definition`` to a coordinate reference system.
%End
static QgsCoordinateReferenceSystem parameterAsCrs( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
%Docstring
Evaluates the parameter with matching ``definition`` and ``value`` to a coordinate reference system.
.. versionadded:: 3.4
%End
static QgsRectangle parameterAsExtent( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context,
const QgsCoordinateReferenceSystem &crs = QgsCoordinateReferenceSystem() );
%Docstring
2017-12-15 10:36:55 -04:00
Evaluates the parameter with matching ``definition`` to a rectangular extent.
2017-12-15 10:36:55 -04:00
If ``crs`` is set, and the original coordinate reference system of the parameter can be determined, then the extent will be automatically
reprojected so that it is in the specified ``crs``. In this case the extent of the reproject rectangle will be returned.
.. seealso:: :py:func:`parameterAsExtentGeometry`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`parameterAsExtentCrs`
%End
static QgsRectangle parameterAsExtent( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context,
const QgsCoordinateReferenceSystem &crs = QgsCoordinateReferenceSystem() );
%Docstring
Evaluates the parameter with matching ``definition`` and ``value`` to a rectangular extent.
If ``crs`` is set, and the original coordinate reference system of the parameter can be determined, then the extent will be automatically
reprojected so that it is in the specified ``crs``. In this case the extent of the reproject rectangle will be returned.
.. seealso:: :py:func:`parameterAsExtentGeometry`
.. seealso:: :py:func:`parameterAsExtentCrs`
.. versionadded:: 3.4
%End
static QgsGeometry parameterAsExtentGeometry( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context,
const QgsCoordinateReferenceSystem &crs = QgsCoordinateReferenceSystem() );
%Docstring
2017-12-15 10:36:55 -04:00
Evaluates the parameter with matching ``definition`` to a rectangular extent, and returns a geometry covering this extent.
2017-12-15 10:36:55 -04:00
If ``crs`` is set, and the original coordinate reference system of the parameter can be determined, then the extent will be automatically
reprojected so that it is in the specified ``crs``. Unlike parameterAsExtent(), the reprojected rectangle returned by this function
will no longer be a rectangle itself (i.e. this method returns the geometry of the actual reprojected rectangle, while parameterAsExtent() returns
just the extent of the reprojected rectangle).
.. seealso:: :py:func:`parameterAsExtent`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`parameterAsExtentCrs`
%End
static QgsCoordinateReferenceSystem parameterAsExtentCrs( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
%Docstring
2017-12-15 10:36:55 -04:00
Returns the coordinate reference system associated with an extent parameter value.
.. seealso:: :py:func:`parameterAsExtent`
%End
static QgsPointXY parameterAsPoint( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context,
const QgsCoordinateReferenceSystem &crs = QgsCoordinateReferenceSystem() );
%Docstring
2017-12-15 10:36:55 -04:00
Evaluates the parameter with matching ``definition`` to a point.
If ``crs`` is set then the point will be automatically reprojected so that it is in the specified ``crs``.
.. seealso:: :py:func:`parameterAsPointCrs`
%End
static QgsPointXY parameterAsPoint( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context,
const QgsCoordinateReferenceSystem &crs = QgsCoordinateReferenceSystem() );
%Docstring
Evaluates the parameter with matching ``definition`` and ``value`` to a point.
If ``crs`` is set then the point will be automatically reprojected so that it is in the specified ``crs``.
.. seealso:: :py:func:`parameterAsPointCrs`
.. versionadded:: 3.4
%End
static QgsCoordinateReferenceSystem parameterAsPointCrs( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
%Docstring
2017-12-15 10:36:55 -04:00
Returns the coordinate reference system associated with an point parameter value.
.. seealso:: :py:func:`parameterAsPoint`
%End
static QString parameterAsFile( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
%Docstring
2017-12-15 10:36:55 -04:00
Evaluates the parameter with matching ``definition`` to a file/folder name.
%End
static QString parameterAsFile( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
%Docstring
Evaluates the parameter with matching ``definition`` and ``value`` to a file/folder name.
.. versionadded:: 3.4
%End
static QVariantList parameterAsMatrix( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
%Docstring
2017-12-15 10:36:55 -04:00
Evaluates the parameter with matching ``definition`` to a matrix/table of values.
Tables are collapsed to a 1 dimensional list.
%End
static QVariantList parameterAsMatrix( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
%Docstring
Evaluates the parameter with matching ``definition`` and ``value`` to a matrix/table of values.
Tables are collapsed to a 1 dimensional list.
.. versionadded:: 3.4
%End
static QList< QgsMapLayer *> parameterAsLayerList( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
%Docstring
2017-12-15 10:36:55 -04:00
Evaluates the parameter with matching ``definition`` to a list of map layers.
%End
static QList< QgsMapLayer *> parameterAsLayerList( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
%Docstring
Evaluates the parameter with matching ``definition`` and ``value`` to a list of map layers.
.. versionadded:: 3.4
%End
static QList<double> parameterAsRange( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
%Docstring
2017-12-15 10:36:55 -04:00
Evaluates the parameter with matching ``definition`` to a range of values.
%End
static QList<double> parameterAsRange( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
%Docstring
Evaluates the parameter with matching ``definition`` and ``value`` to a range of values.
.. versionadded:: 3.4
%End
static QStringList parameterAsFields( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
%Docstring
2017-12-15 10:36:55 -04:00
Evaluates the parameter with matching ``definition`` to a list of fields.
%End
static QStringList parameterAsFields( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
%Docstring
Evaluates the parameter with matching ``definition`` and ``value`` to a list of fields.
.. versionadded:: 3.4
%End
2017-06-20 19:23:21 +10:00
static QgsProcessingParameterDefinition *parameterFromVariantMap( const QVariantMap &map ) /Factory/;
%Docstring
2017-12-15 10:36:55 -04:00
Creates a new QgsProcessingParameterDefinition using the configuration from a
supplied variant ``map``.
The caller takes responsibility for deleting the returned object.
2017-06-20 19:23:21 +10:00
%End
static QString descriptionFromName( const QString &name );
%Docstring
2017-12-15 10:36:55 -04:00
Creates an autogenerated parameter description from a parameter ``name``.
%End
static QgsProcessingParameterDefinition *parameterFromScriptCode( const QString &code ) /Factory/;
%Docstring
2017-12-15 10:36:55 -04:00
Creates a new QgsProcessingParameterDefinition using the configuration from a
supplied script ``code`` string.
The caller takes responsibility for deleting the returned object.
%End
};
class QgsProcessingParameterBoolean : QgsProcessingParameterDefinition
{
%Docstring
2017-12-15 10:36:55 -04:00
A boolean parameter for processing algorithms.
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsprocessingparameters.h"
%End
public:
QgsProcessingParameterBoolean( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
bool optional = false );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsProcessingParameterBoolean.
%End
2017-07-03 19:42:29 +10:00
static QString typeName();
%Docstring
2017-12-15 10:36:55 -04:00
Returns the type name for the parameter class.
2017-07-03 19:42:29 +10:00
%End
virtual QgsProcessingParameterDefinition *clone() const /Factory/;
virtual QString type() const;
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
virtual QString asScriptCode() const;
static QgsProcessingParameterBoolean *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/;
%Docstring
2017-12-15 10:36:55 -04:00
Creates a new parameter using the definition from a script code.
%End
};
class QgsProcessingParameterCrs : QgsProcessingParameterDefinition
{
%Docstring
2017-12-15 10:36:55 -04:00
A coordinate reference system parameter for processing algorithms.
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsprocessingparameters.h"
%End
public:
QgsProcessingParameterCrs( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
bool optional = false );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsProcessingParameterCrs.
%End
2017-07-03 19:42:29 +10:00
static QString typeName();
%Docstring
2017-12-15 10:36:55 -04:00
Returns the type name for the parameter class.
2017-07-03 19:42:29 +10:00
%End
virtual QgsProcessingParameterDefinition *clone() const /Factory/;
virtual QString type() const;
virtual bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = 0 ) const;
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
static QgsProcessingParameterCrs *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/;
%Docstring
2017-12-15 10:36:55 -04:00
Creates a new parameter using the definition from a script code.
%End
};
class QgsProcessingParameterMapLayer : QgsProcessingParameterDefinition
{
%Docstring
2017-12-15 10:36:55 -04:00
A map layer parameter for processing algorithms.
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsprocessingparameters.h"
%End
public:
QgsProcessingParameterMapLayer( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
bool optional = false );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsProcessingParameterMapLayer.
%End
2017-07-03 19:42:29 +10:00
static QString typeName();
%Docstring
2017-12-15 10:36:55 -04:00
Returns the type name for the parameter class.
2017-07-03 19:42:29 +10:00
%End
virtual QgsProcessingParameterDefinition *clone() const /Factory/;
virtual QString type() const;
virtual bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = 0 ) const;
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
static QgsProcessingParameterMapLayer *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/;
%Docstring
2017-12-15 10:36:55 -04:00
Creates a new parameter using the definition from a script code.
%End
};
class QgsProcessingParameterExtent : QgsProcessingParameterDefinition
{
%Docstring
2017-12-15 10:36:55 -04:00
A rectangular map extent parameter for processing algorithms.
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsprocessingparameters.h"
%End
public:
QgsProcessingParameterExtent( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
bool optional = false );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsProcessingParameterExtent.
%End
2017-07-03 19:42:29 +10:00
static QString typeName();
%Docstring
2017-12-15 10:36:55 -04:00
Returns the type name for the parameter class.
2017-07-03 19:42:29 +10:00
%End
virtual QgsProcessingParameterDefinition *clone() const /Factory/;
virtual QString type() const;
virtual bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = 0 ) const;
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
static QgsProcessingParameterExtent *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/;
%Docstring
2017-12-15 10:36:55 -04:00
Creates a new parameter using the definition from a script code.
%End
};
class QgsProcessingParameterPoint : QgsProcessingParameterDefinition
{
%Docstring
2017-12-15 10:36:55 -04:00
A point parameter for processing algorithms.
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsprocessingparameters.h"
%End
public:
QgsProcessingParameterPoint( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
bool optional = false );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsProcessingParameterPoint.
%End
2017-07-03 19:42:29 +10:00
static QString typeName();
%Docstring
2017-12-15 10:36:55 -04:00
Returns the type name for the parameter class.
2017-07-03 19:42:29 +10:00
%End
virtual QgsProcessingParameterDefinition *clone() const /Factory/;
virtual QString type() const;
virtual bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = 0 ) const;
2017-05-16 15:21:41 +10:00
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
static QgsProcessingParameterPoint *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/;
%Docstring
2017-12-15 10:36:55 -04:00
Creates a new parameter using the definition from a script code.
%End
};
class QgsProcessingParameterFile : QgsProcessingParameterDefinition
{
%Docstring
2017-12-15 10:36:55 -04:00
An input file or folder parameter for processing algorithms.
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsprocessingparameters.h"
%End
public:
enum Behavior
{
File,
Folder,
};
QgsProcessingParameterFile( const QString &name, const QString &description = QString(), Behavior behavior = File, const QString &extension = QString(), const QVariant &defaultValue = QVariant(),
bool optional = false );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsProcessingParameterFile.
%End
2017-07-03 19:42:29 +10:00
static QString typeName();
%Docstring
2017-12-15 10:36:55 -04:00
Returns the type name for the parameter class.
2017-07-03 19:42:29 +10:00
%End
virtual QgsProcessingParameterDefinition *clone() const /Factory/;
virtual QString type() const;
virtual bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = 0 ) const;
2017-05-16 15:21:41 +10:00
virtual QString asScriptCode() const;
Behavior behavior() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the parameter behavior (e.g. File or Folder).
.. seealso:: :py:func:`setBehavior`
%End
void setBehavior( Behavior behavior );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the parameter ``behavior`` (e.g. File or Folder).
.. seealso:: :py:func:`behavior`
%End
QString extension() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns any specified file extension for the parameter.
.. seealso:: :py:func:`setExtension`
%End
void setExtension( const QString &extension );
%Docstring
2017-12-15 10:36:55 -04:00
Sets a file ``extension`` for the parameter.
.. seealso:: :py:func:`extension`
%End
virtual QVariantMap toVariantMap() const;
virtual bool fromVariantMap( const QVariantMap &map );
static QgsProcessingParameterFile *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition, Behavior behavior = File ) /Factory/;
%Docstring
2017-12-15 10:36:55 -04:00
Creates a new parameter using the definition from a script code.
%End
};
class QgsProcessingParameterMatrix : QgsProcessingParameterDefinition
{
%Docstring
2018-03-05 13:50:29 -05:00
A table (matrix) parameter for processing algorithms.
2017-12-15 10:36:55 -04:00
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsprocessingparameters.h"
%End
public:
QgsProcessingParameterMatrix( const QString &name, const QString &description = QString(), int numberRows = 3,
bool hasFixedNumberRows = false, const QStringList &headers = QStringList(),
const QVariant &defaultValue = QVariant(),
bool optional = false );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsProcessingParameterMatrix.
%End
2017-07-03 19:42:29 +10:00
static QString typeName();
%Docstring
2017-12-15 10:36:55 -04:00
Returns the type name for the parameter class.
2017-07-03 19:42:29 +10:00
%End
virtual QgsProcessingParameterDefinition *clone() const /Factory/;
virtual QString type() const;
virtual bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = 0 ) const;
2017-05-16 15:21:41 +10:00
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
QStringList headers() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns a list of column headers (if set).
.. seealso:: :py:func:`setHeaders`
%End
void setHeaders( const QStringList &headers );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the list of column ``headers``.
.. seealso:: :py:func:`headers`
%End
int numberRows() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the fixed number of rows in the table. This parameter only has an
effect if hasFixedNumberRows() is true.
.. seealso:: :py:func:`setNumberRows`
2017-12-15 10:36:55 -04:00
2018-05-25 09:00:58 +10:00
.. seealso:: :py:func:`setHasFixedNumberRows`
%End
void setNumberRows( int rows );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the fixed number of ``rows`` in the table. This parameter only has an
effect if hasFixedNumberRows() is true.
.. seealso:: :py:func:`numberRows`
2017-12-15 10:36:55 -04:00
2018-05-25 09:00:58 +10:00
.. seealso:: :py:func:`setHasFixedNumberRows`
%End
bool hasFixedNumberRows() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns whether the table has a fixed number of rows.
.. seealso:: :py:func:`numberRows`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setHasFixedNumberRows`
%End
void setHasFixedNumberRows( bool hasFixedNumberRows );
%Docstring
2017-12-15 10:36:55 -04:00
Sets whether the table has a fixed number of rows.
.. seealso:: :py:func:`setNumberRows`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`hasFixedNumberRows`
%End
virtual QVariantMap toVariantMap() const;
virtual bool fromVariantMap( const QVariantMap &map );
static QgsProcessingParameterMatrix *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/;
%Docstring
2017-12-15 10:36:55 -04:00
Creates a new parameter using the definition from a script code.
%End
};
class QgsProcessingParameterMultipleLayers : QgsProcessingParameterDefinition
{
%Docstring
2017-12-15 10:36:55 -04:00
A parameter for processing algorithms which accepts multiple map layers.
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsprocessingparameters.h"
%End
public:
2017-08-19 02:46:22 +10:00
QgsProcessingParameterMultipleLayers( const QString &name, const QString &description = QString(), QgsProcessing::SourceType layerType = QgsProcessing::TypeVectorAnyGeometry,
const QVariant &defaultValue = QVariant(),
bool optional = false );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsProcessingParameterMultipleLayers.
%End
2017-07-03 19:42:29 +10:00
static QString typeName();
%Docstring
2017-12-15 10:36:55 -04:00
Returns the type name for the parameter class.
2017-07-03 19:42:29 +10:00
%End
virtual QgsProcessingParameterDefinition *clone() const /Factory/;
virtual QString type() const;
virtual bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = 0 ) const;
2017-05-16 15:21:41 +10:00
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
virtual QString asScriptCode() const;
2017-08-19 02:46:22 +10:00
QgsProcessing::SourceType layerType() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the layer type for layers acceptable by the parameter.
.. seealso:: :py:func:`setLayerType`
%End
2017-08-19 02:46:22 +10:00
void setLayerType( QgsProcessing::SourceType type );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the layer ``type`` for layers acceptable by the parameter.
.. seealso:: :py:func:`layerType`
2017-05-16 15:21:41 +10:00
%End
int minimumNumberInputs() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the minimum number of layers required for the parameter. If the return value is < 1
then the parameter accepts any number of layers.
.. seealso:: :py:func:`setMinimumNumberInputs`
2017-05-16 15:21:41 +10:00
%End
void setMinimumNumberInputs( int minimum );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the ``minimum`` number of layers required for the parameter. The minimum must be >= 1
if the parameter is not optional.
.. seealso:: :py:func:`minimumNumberInputs`
%End
virtual QVariantMap toVariantMap() const;
virtual bool fromVariantMap( const QVariantMap &map );
static QgsProcessingParameterMultipleLayers *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/;
%Docstring
2017-12-15 10:36:55 -04:00
Creates a new parameter using the definition from a script code.
%End
};
class QgsProcessingParameterNumber : QgsProcessingParameterDefinition
{
%Docstring
2017-12-15 10:36:55 -04:00
A numeric parameter for processing algorithms.
For numeric parameters with a dataType() of Double, the number of decimals places
shown in the parameter's widget can be specified by setting the parameter's metadata. For example:
.. code-block:: python
param = QgsProcessingParameterNumber( 'VAL', 'Threshold', type=QgsProcessingParameter.Double)
# only show two decimal places in parameter's widgets, not 6:
param.setMetadata( {'widget_wrapper':
{ 'decimals': 2 }
})
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsprocessingparameters.h"
%End
public:
enum Type
{
Integer,
Double,
};
explicit QgsProcessingParameterNumber( const QString &name, const QString &description = QString(),
Type type = Integer,
const QVariant &defaultValue = QVariant(),
bool optional = false,
double minValue = -DBL_MAX + 1,
double maxValue = DBL_MAX
);
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsProcessingParameterNumber.
%End
2017-07-03 19:42:29 +10:00
static QString typeName();
%Docstring
2017-12-15 10:36:55 -04:00
Returns the type name for the parameter class.
2017-07-03 19:42:29 +10:00
%End
virtual QgsProcessingParameterDefinition *clone() const /Factory/;
virtual QString type() const;
virtual bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = 0 ) const;
2017-05-16 15:21:41 +10:00
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
virtual QString toolTip() const;
double minimum() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the minimum value acceptable by the parameter.
.. seealso:: :py:func:`setMinimum`
%End
void setMinimum( double minimum );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the ``minimum`` value acceptable by the parameter.
.. seealso:: :py:func:`minimum`
%End
double maximum() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the maximum value acceptable by the parameter.
.. seealso:: :py:func:`setMaximum`
%End
void setMaximum( double maximum );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the ``maximum`` value acceptable by the parameter.
.. seealso:: :py:func:`maximum`
%End
Type dataType() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the acceptable data type for the parameter.
.. seealso:: :py:func:`setDataType`
%End
void setDataType( Type type );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the acceptable data ``type`` for the parameter.
.. seealso:: :py:func:`dataType`
%End
virtual QVariantMap toVariantMap() const;
virtual bool fromVariantMap( const QVariantMap &map );
static QgsProcessingParameterNumber *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/;
%Docstring
2017-12-15 10:36:55 -04:00
Creates a new parameter using the definition from a script code.
%End
};
class QgsProcessingParameterDistance : QgsProcessingParameterNumber
{
%Docstring
A double numeric parameter for distance values. Linked to a source layer or CRS parameter
to determine what units the distance values are in.
The number of decimals places shown in a distance parameter's widget can be specified by
setting the parameter's metadata. For example:
.. code-block:: python
param = QgsProcessingParameterDistance( 'VAL', 'Threshold')
# only show two decimal places in parameter's widgets, not 6:
param.setMetadata( {'widget_wrapper':
{ 'decimals': 2 }
})
.. versionadded:: 3.2
%End
%TypeHeaderCode
#include "qgsprocessingparameters.h"
%End
public:
explicit QgsProcessingParameterDistance( const QString &name, const QString &description = QString(),
const QVariant &defaultValue = QVariant(),
const QString &parentParameterName = QString(),
bool optional = false,
double minValue = -DBL_MAX + 1,
double maxValue = DBL_MAX );
%Docstring
Constructor for QgsProcessingParameterDistance.
%End
static QString typeName();
%Docstring
Returns the type name for the parameter class.
%End
virtual QgsProcessingParameterDistance *clone() const /Factory/;
virtual QString type() const;
virtual QStringList dependsOnOtherParameters() const;
QString parentParameterName() const;
%Docstring
Returns the name of the parent parameter, or an empty string if this is not set.
.. seealso:: :py:func:`setParentParameterName`
%End
void setParentParameterName( const QString &parentParameterName );
%Docstring
Sets the name of the parent layer parameter. Use an empty string if this is not required.
.. seealso:: :py:func:`parentParameterName`
%End
virtual QVariantMap toVariantMap() const;
virtual bool fromVariantMap( const QVariantMap &map );
};
class QgsProcessingParameterRange : QgsProcessingParameterDefinition
{
%Docstring
2017-12-15 10:36:55 -04:00
A numeric range parameter for processing algorithms.
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsprocessingparameters.h"
%End
public:
QgsProcessingParameterRange( const QString &name, const QString &description = QString(),
QgsProcessingParameterNumber::Type type = QgsProcessingParameterNumber::Integer,
const QVariant &defaultValue = QVariant(),
bool optional = false );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsProcessingParameterRange.
%End
2017-07-03 19:42:29 +10:00
static QString typeName();
%Docstring
2017-12-15 10:36:55 -04:00
Returns the type name for the parameter class.
2017-07-03 19:42:29 +10:00
%End
virtual QgsProcessingParameterDefinition *clone() const /Factory/;
virtual QString type() const;
virtual bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = 0 ) const;
2017-05-16 15:21:41 +10:00
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
QgsProcessingParameterNumber::Type dataType() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the acceptable data type for the range.
.. seealso:: :py:func:`setDataType`
%End
void setDataType( QgsProcessingParameterNumber::Type dataType );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the acceptable data ``type`` for the range.
.. seealso:: :py:func:`dataType`
%End
virtual QVariantMap toVariantMap() const;
virtual bool fromVariantMap( const QVariantMap &map );
static QgsProcessingParameterRange *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/;
%Docstring
2017-12-15 10:36:55 -04:00
Creates a new parameter using the definition from a script code.
%End
};
class QgsProcessingParameterRasterLayer : QgsProcessingParameterDefinition
{
%Docstring
2017-12-15 10:36:55 -04:00
A raster layer parameter for processing algorithms.
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsprocessingparameters.h"
%End
public:
QgsProcessingParameterRasterLayer( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
bool optional = false );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsProcessingParameterRasterLayer.
%End
2017-07-03 19:42:29 +10:00
static QString typeName();
%Docstring
2017-12-15 10:36:55 -04:00
Returns the type name for the parameter class.
2017-07-03 19:42:29 +10:00
%End
virtual QgsProcessingParameterDefinition *clone() const /Factory/;
virtual QString type() const;
virtual bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = 0 ) const;
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
static QgsProcessingParameterRasterLayer *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/;
%Docstring
2017-12-15 10:36:55 -04:00
Creates a new parameter using the definition from a script code.
%End
};
class QgsProcessingParameterEnum : QgsProcessingParameterDefinition
{
%Docstring
2017-12-15 10:36:55 -04:00
An enum based parameter for processing algorithms, allowing for selection from predefined values.
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsprocessingparameters.h"
%End
public:
QgsProcessingParameterEnum( const QString &name, const QString &description = QString(), const QStringList &options = QStringList(),
bool allowMultiple = false,
const QVariant &defaultValue = QVariant(),
bool optional = false );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsProcessingParameterEnum.
%End
2017-07-03 19:42:29 +10:00
static QString typeName();
%Docstring
2017-12-15 10:36:55 -04:00
Returns the type name for the parameter class.
2017-07-03 19:42:29 +10:00
%End
virtual QgsProcessingParameterDefinition *clone() const /Factory/;
virtual QString type() const;
virtual bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = 0 ) const;
2017-05-16 15:21:41 +10:00
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
virtual QString asScriptCode() const;
QStringList options() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the list of acceptable options for the parameter.
.. seealso:: :py:func:`setOptions`
%End
void setOptions( const QStringList &options );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the list of acceptable ``options`` for the parameter.
.. seealso:: :py:func:`options`
%End
bool allowMultiple() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns true if the parameter allows multiple selected values.
.. seealso:: :py:func:`setAllowMultiple`
%End
void setAllowMultiple( bool allowMultiple );
%Docstring
2017-12-15 10:36:55 -04:00
Sets whether the parameter allows multiple selected values.
.. seealso:: :py:func:`allowMultiple`
%End
virtual QVariantMap toVariantMap() const;
virtual bool fromVariantMap( const QVariantMap &map );
static QgsProcessingParameterEnum *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/;
%Docstring
2017-12-15 10:36:55 -04:00
Creates a new parameter using the definition from a script code.
%End
};
class QgsProcessingParameterString : QgsProcessingParameterDefinition
{
%Docstring
2017-12-15 10:36:55 -04:00
A string parameter for processing algorithms.
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsprocessingparameters.h"
%End
public:
QgsProcessingParameterString( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
bool multiLine = false,
bool optional = false );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsProcessingParameterString.
%End
2017-07-03 19:42:29 +10:00
static QString typeName();
%Docstring
2017-12-15 10:36:55 -04:00
Returns the type name for the parameter class.
2017-07-03 19:42:29 +10:00
%End
virtual QgsProcessingParameterDefinition *clone() const /Factory/;
virtual QString type() const;
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
virtual QString asScriptCode() const;
bool multiLine() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns true if the parameter allows multiline strings.
.. seealso:: :py:func:`setMultiLine`
%End
void setMultiLine( bool multiLine );
%Docstring
2017-12-15 10:36:55 -04:00
Sets whether the parameter allows multiline strings.
.. seealso:: :py:func:`multiLine`
%End
virtual QVariantMap toVariantMap() const;
virtual bool fromVariantMap( const QVariantMap &map );
static QgsProcessingParameterString *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/;
%Docstring
2017-12-15 10:36:55 -04:00
Creates a new parameter using the definition from a script code.
%End
};
class QgsProcessingParameterExpression : QgsProcessingParameterDefinition
{
%Docstring
2017-12-15 10:36:55 -04:00
An expression parameter for processing algorithms.
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsprocessingparameters.h"
%End
public:
QgsProcessingParameterExpression( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
const QString &parentLayerParameterName = QString(),
bool optional = false );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsProcessingParameterExpression.
%End
2017-07-03 19:42:29 +10:00
static QString typeName();
%Docstring
2017-12-15 10:36:55 -04:00
Returns the type name for the parameter class.
2017-07-03 19:42:29 +10:00
%End
virtual QgsProcessingParameterDefinition *clone() const /Factory/;
virtual QString type() const;
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
virtual QStringList dependsOnOtherParameters() const;
QString parentLayerParameterName() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the name of the parent layer parameter, or an empty string if this is not set.
.. seealso:: :py:func:`setParentLayerParameterName`
%End
void setParentLayerParameterName( const QString &parentLayerParameterName );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the name of the parent layer parameter. Use an empty string if this is not required.
.. seealso:: :py:func:`parentLayerParameterName`
%End
virtual QVariantMap toVariantMap() const;
virtual bool fromVariantMap( const QVariantMap &map );
static QgsProcessingParameterExpression *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/;
%Docstring
2017-12-15 10:36:55 -04:00
Creates a new parameter using the definition from a script code.
%End
};
class QgsProcessingParameterLimitedDataTypes
{
%Docstring
2017-12-15 10:36:55 -04:00
Can be inherited by parameters which require limits to their acceptable data types.
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsprocessingparameters.h"
%End
public:
QgsProcessingParameterLimitedDataTypes( const QList< int > &types = QList< int >() );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsProcessingParameterLimitedDataTypes, with a list of acceptable data ``types``.
%End
QList< int > dataTypes() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the geometry types for sources acceptable by the parameter.
.. seealso:: :py:func:`setDataTypes`
%End
void setDataTypes( const QList< int > &types );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the geometry ``types`` for sources acceptable by the parameter.
.. seealso:: :py:func:`dataTypes`
%End
protected:
};
class QgsProcessingParameterVectorLayer : QgsProcessingParameterDefinition, QgsProcessingParameterLimitedDataTypes
{
%Docstring
2017-12-15 10:36:55 -04:00
A vector layer (with or without geometry) parameter for processing algorithms. Consider using
the more versatile QgsProcessingParameterFeatureSource wherever possible.
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsprocessingparameters.h"
%End
public:
QgsProcessingParameterVectorLayer( const QString &name,
const QString &description = QString(),
const QList< int > &types = QList< int >(),
const QVariant &defaultValue = QVariant(),
bool optional = false );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsProcessingParameterVectorLayer.
%End
2017-07-03 19:42:29 +10:00
static QString typeName();
%Docstring
2017-12-15 10:36:55 -04:00
Returns the type name for the parameter class.
2017-07-03 19:42:29 +10:00
%End
virtual QgsProcessingParameterDefinition *clone() const /Factory/;
virtual QString type() const;
virtual bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = 0 ) const;
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
virtual QVariantMap toVariantMap() const;
virtual bool fromVariantMap( const QVariantMap &map );
static QgsProcessingParameterVectorLayer *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/;
%Docstring
2017-12-15 10:36:55 -04:00
Creates a new parameter using the definition from a script code.
%End
};
class QgsProcessingParameterField : QgsProcessingParameterDefinition
{
%Docstring
2017-12-15 10:36:55 -04:00
A vector layer or feature source field parameter for processing algorithms.
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsprocessingparameters.h"
%End
public:
enum DataType
{
2017-06-07 19:43:45 +02:00
Any,
Numeric,
String,
DateTime
};
QgsProcessingParameterField( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
const QString &parentLayerParameterName = QString(),
DataType type = Any,
bool allowMultiple = false,
bool optional = false );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsProcessingParameterField.
%End
2017-07-03 19:42:29 +10:00
static QString typeName();
%Docstring
2017-12-15 10:36:55 -04:00
Returns the type name for the parameter class.
2017-07-03 19:42:29 +10:00
%End
virtual QgsProcessingParameterDefinition *clone() const /Factory/;
virtual QString type() const;
virtual bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = 0 ) const;
2017-05-16 15:21:41 +10:00
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
virtual QString asScriptCode() const;
virtual QStringList dependsOnOtherParameters() const;
QString parentLayerParameterName() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the name of the parent layer parameter, or an empty string if this is not set.
.. seealso:: :py:func:`setParentLayerParameterName`
%End
void setParentLayerParameterName( const QString &parentLayerParameterName );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the name of the parent layer parameter. Use an empty string if this is not required.
.. seealso:: :py:func:`parentLayerParameterName`
%End
DataType dataType() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the acceptable data type for the field.
.. seealso:: :py:func:`setDataType`
%End
void setDataType( DataType type );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the acceptable data ``type`` for the field.
.. seealso:: :py:func:`dataType`
%End
bool allowMultiple() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns whether multiple field selections are permitted.
.. seealso:: :py:func:`setAllowMultiple`
%End
void setAllowMultiple( bool allowMultiple );
%Docstring
2017-12-15 10:36:55 -04:00
Sets whether multiple field selections are permitted.
.. seealso:: :py:func:`allowMultiple`
%End
virtual QVariantMap toVariantMap() const;
virtual bool fromVariantMap( const QVariantMap &map );
static QgsProcessingParameterField *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/;
%Docstring
2017-12-15 10:36:55 -04:00
Creates a new parameter using the definition from a script code.
%End
};
class QgsProcessingParameterFeatureSource : QgsProcessingParameterDefinition, QgsProcessingParameterLimitedDataTypes
{
%Docstring
2017-12-15 10:36:55 -04:00
An input feature source (such as vector layers) parameter for processing algorithms.
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsprocessingparameters.h"
%End
public:
QgsProcessingParameterFeatureSource( const QString &name, const QString &description = QString(),
const QList< int > &types = QList< int >(),
const QVariant &defaultValue = QVariant(), bool optional = false );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsProcessingParameterFeatureSource.
%End
2017-07-03 19:42:29 +10:00
static QString typeName();
%Docstring
2017-12-15 10:36:55 -04:00
Returns the type name for the parameter class.
2017-07-03 19:42:29 +10:00
%End
virtual QgsProcessingParameterDefinition *clone() const /Factory/;
virtual QString type() const;
virtual bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = 0 ) const;
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
virtual QString asScriptCode() const;
virtual QVariantMap toVariantMap() const;
virtual bool fromVariantMap( const QVariantMap &map );
static QgsProcessingParameterFeatureSource *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/;
%Docstring
2017-12-15 10:36:55 -04:00
Creates a new parameter using the definition from a script code.
%End
};
2017-06-22 06:49:43 +10:00
class QgsProcessingDestinationParameter : QgsProcessingParameterDefinition
{
%Docstring
2017-12-15 10:36:55 -04:00
Base class for all parameter definitions which represent file or layer destinations, e.g. parameters
which are used for the destination for layers output by an algorithm.
2017-06-22 06:49:43 +10:00
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsprocessingparameters.h"
%End
public:
QgsProcessingDestinationParameter( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
bool optional = false, bool createByDefault = true );
2017-06-22 06:49:43 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsProcessingDestinationParameter.
If ``createByDefault`` is false and the parameter is ``optional``, then the destination
output will not be created by default.
2017-06-22 06:49:43 +10:00
%End
virtual bool isDestination() const;
virtual QVariantMap toVariantMap() const;
virtual bool fromVariantMap( const QVariantMap &map );
virtual QgsProcessingOutputDefinition *toOutputDefinition() const = 0 /Factory/;
%Docstring
2017-12-15 10:36:55 -04:00
Returns a new QgsProcessingOutputDefinition corresponding to the definition of the destination
parameter.
2017-06-22 06:49:43 +10:00
%End
bool supportsNonFileBasedOutput() const;
2017-06-22 06:49:43 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns true if the destination parameter supports non filed-based outputs,
such as memory layers or direct database outputs.
.. seealso:: :py:func:`setSupportsNonFileBasedOutput`
2017-06-22 06:49:43 +10:00
%End
void setSupportsNonFileBasedOutput( bool supportsNonFileBasedOutput );
2017-06-22 06:49:43 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets whether the destination parameter supports non filed-based outputs,
such as memory layers or direct database outputs.
.. seealso:: :py:func:`supportsNonFileBasedOutput`
2017-06-22 06:49:43 +10:00
%End
virtual QString defaultFileExtension() const = 0;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the default file extension for destination file paths
associated with this parameter.
2017-06-22 06:49:43 +10:00
%End
2017-06-22 06:49:43 +10:00
virtual QString generateTemporaryDestination() const;
%Docstring
2017-12-15 10:36:55 -04:00
Generates a temporary destination value for this parameter. The returned
value will be a file path or QGIS data provider URI suitable for
temporary storage of created layers and files.
2017-06-22 06:49:43 +10:00
%End
bool createByDefault() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns true if the destination should be created by default. For optional parameters,
a return value of false indicates that the destination should not be created by default.
.. seealso:: :py:func:`setCreateByDefault`
%End
void setCreateByDefault( bool createByDefault );
%Docstring
2017-12-15 10:36:55 -04:00
Sets whether the destination should be created by default. For optional parameters,
a value of false indicates that the destination should not be created by default.
.. seealso:: :py:func:`createByDefault`
%End
protected:
QgsProcessingProvider *originalProvider() const;
%Docstring
Original (source) provider which this parameter has been derived from.
In the case of destination parameters which are part of model algorithms, this
will reflect the child algorithm's provider which actually generates the
parameter, as opposed to the provider which this parameter belongs to (i.e.
the model provider)
.. versionadded:: 3.2
%End
2017-06-22 06:49:43 +10:00
};
class QgsProcessingParameterFeatureSink : QgsProcessingDestinationParameter
{
%Docstring
2017-12-15 10:36:55 -04:00
A feature sink output for processing algorithms.
A parameter which represents the destination feature sink for features created by an algorithm.
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsprocessingparameters.h"
%End
public:
2017-08-19 02:46:22 +10:00
QgsProcessingParameterFeatureSink( const QString &name, const QString &description = QString(), QgsProcessing::SourceType type = QgsProcessing::TypeVectorAnyGeometry, const QVariant &defaultValue = QVariant(),
bool optional = false, bool createByDefault = true );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsProcessingParameterFeatureSink.
If ``createByDefault`` is false and the parameter is ``optional``, then this destination
output will not be created by default.
%End
2017-07-03 19:42:29 +10:00
static QString typeName();
%Docstring
2017-12-15 10:36:55 -04:00
Returns the type name for the parameter class.
2017-07-03 19:42:29 +10:00
%End
virtual QgsProcessingParameterDefinition *clone() const /Factory/;
virtual QString type() const;
virtual bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = 0 ) const;
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
virtual QString asScriptCode() const;
2017-06-22 06:49:43 +10:00
virtual QgsProcessingOutputDefinition *toOutputDefinition() const /Factory/;
virtual QString defaultFileExtension() const;
virtual QStringList supportedOutputVectorLayerExtensions() const;
%Docstring
Returns a list of the vector format file extensions supported by this parameter.
.. seealso:: :py:func:`defaultFileExtension`
.. versionadded:: 3.2
%End
2017-08-19 02:46:22 +10:00
QgsProcessing::SourceType dataType() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the layer type for sinks associated with the parameter.
.. seealso:: :py:func:`setDataType`
%End
bool hasGeometry() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns true if sink is likely to include geometries. In cases were presence of geometry
cannot be reliably determined in advance, this method will default to returning true.
%End
2017-08-19 02:46:22 +10:00
void setDataType( QgsProcessing::SourceType type );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the layer ``type`` for the sinks associated with the parameter.
.. seealso:: :py:func:`dataType`
%End
virtual QVariantMap toVariantMap() const;
virtual bool fromVariantMap( const QVariantMap &map );
virtual QString generateTemporaryDestination() const;
2017-06-22 06:49:43 +10:00
static QgsProcessingParameterFeatureSink *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/;
%Docstring
2017-12-15 10:36:55 -04:00
Creates a new parameter using the definition from a script code.
%End
};
class QgsProcessingParameterVectorDestination : QgsProcessingDestinationParameter
{
%Docstring
2017-12-15 10:36:55 -04:00
A vector layer destination parameter, for specifying the destination path for a vector layer
created by the algorithm.
.. note::
Consider using the more flexible QgsProcessingParameterFeatureSink wherever
2018-01-12 20:51:17 -04:00
possible.
2017-12-15 10:36:55 -04:00
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsprocessingparameters.h"
%End
public:
2017-08-19 02:46:22 +10:00
QgsProcessingParameterVectorDestination( const QString &name, const QString &description = QString(), QgsProcessing::SourceType type = QgsProcessing::TypeVectorAnyGeometry, const QVariant &defaultValue = QVariant(),
bool optional = false, bool createByDefault = true );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsProcessingParameterVectorDestination.
If ``createByDefault`` is false and the parameter is ``optional``, then this destination
output will not be created by default.
%End
2017-07-03 19:42:29 +10:00
static QString typeName();
%Docstring
2017-12-15 10:36:55 -04:00
Returns the type name for the parameter class.
2017-07-03 19:42:29 +10:00
%End
virtual QgsProcessingParameterDefinition *clone() const /Factory/;
virtual QString type() const;
virtual bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = 0 ) const;
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
virtual QString asScriptCode() const;
2017-06-22 06:58:31 +10:00
virtual QgsProcessingOutputDefinition *toOutputDefinition() const /Factory/;
virtual QString defaultFileExtension() const;
virtual QStringList supportedOutputVectorLayerExtensions() const;
%Docstring
Returns a list of the vector format file extensions supported by this parameter.
.. seealso:: :py:func:`defaultFileExtension`
.. versionadded:: 3.2
%End
2017-08-19 02:46:22 +10:00
QgsProcessing::SourceType dataType() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the layer type for this created vector layer.
.. seealso:: :py:func:`setDataType`
%End
bool hasGeometry() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns true if the created layer is likely to include geometries. In cases were presence of geometry
cannot be reliably determined in advance, this method will default to returning true.
%End
2017-08-19 02:46:22 +10:00
void setDataType( QgsProcessing::SourceType type );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the layer ``type`` for the created vector layer.
.. seealso:: :py:func:`dataType`
%End
virtual QVariantMap toVariantMap() const;
virtual bool fromVariantMap( const QVariantMap &map );
static QgsProcessingParameterVectorDestination *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/;
%Docstring
2017-12-15 10:36:55 -04:00
Creates a new parameter using the definition from a script code.
%End
};
class QgsProcessingParameterRasterDestination : QgsProcessingDestinationParameter
2017-06-06 14:38:24 +10:00
{
%Docstring
2017-12-15 10:36:55 -04:00
A raster layer destination parameter, for specifying the destination path for a raster layer
created by the algorithm.
2017-06-06 14:38:24 +10:00
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsprocessingparameters.h"
%End
public:
QgsProcessingParameterRasterDestination( const QString &name, const QString &description = QString(),
const QVariant &defaultValue = QVariant(),
bool optional = false,
bool createByDefault = true );
2017-06-06 14:38:24 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsProcessingParameterRasterDestination.
If ``createByDefault`` is false and the parameter is ``optional``, then this destination
output will not be created by default.
2017-06-06 14:38:24 +10:00
%End
2017-07-03 19:42:29 +10:00
static QString typeName();
%Docstring
2017-12-15 10:36:55 -04:00
Returns the type name for the parameter class.
2017-07-03 19:42:29 +10:00
%End
virtual QgsProcessingParameterDefinition *clone() const /Factory/;
2017-06-06 14:38:24 +10:00
virtual QString type() const;
virtual bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = 0 ) const;
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
2017-06-22 06:49:43 +10:00
virtual QgsProcessingOutputDefinition *toOutputDefinition() const /Factory/;
virtual QString defaultFileExtension() const;
virtual QStringList supportedOutputRasterLayerExtensions() const;
%Docstring
Returns a list of the raster format file extensions supported for this parameter.
.. seealso:: :py:func:`defaultFileExtension`
.. versionadded:: 3.2
%End
static QgsProcessingParameterRasterDestination *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/;
%Docstring
2017-12-15 10:36:55 -04:00
Creates a new parameter using the definition from a script code.
%End
2017-06-06 14:38:24 +10:00
};
class QgsProcessingParameterFileDestination : QgsProcessingDestinationParameter
{
%Docstring
2017-12-15 10:36:55 -04:00
A generic file based destination parameter, for specifying the destination path for a file (non-map layer)
created by the algorithm.
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsprocessingparameters.h"
%End
public:
QgsProcessingParameterFileDestination( const QString &name, const QString &description = QString(),
const QString &fileFilter = QString(),
const QVariant &defaultValue = QVariant(),
bool optional = false,
bool createByDefault = true );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsProcessingParameterFileDestination.
If ``createByDefault`` is false and the parameter is ``optional``, then this destination
output will not be created by default.
%End
2017-07-03 19:42:29 +10:00
static QString typeName();
%Docstring
2017-12-15 10:36:55 -04:00
Returns the type name for the parameter class.
2017-07-03 19:42:29 +10:00
%End
virtual QgsProcessingParameterDefinition *clone() const /Factory/;
virtual QString type() const;
virtual bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = 0 ) const;
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
2017-06-22 06:49:43 +10:00
virtual QgsProcessingOutputDefinition *toOutputDefinition() const /Factory/;
virtual QString defaultFileExtension() const;
QString fileFilter() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the file filter string for file destinations compatible with this parameter.
.. seealso:: :py:func:`setFileFilter`
%End
void setFileFilter( const QString &filter );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the file ``filter`` string for file destinations compatible with this parameter.
.. seealso:: :py:func:`fileFilter`
%End
virtual QVariantMap toVariantMap() const;
virtual bool fromVariantMap( const QVariantMap &map );
static QgsProcessingParameterFileDestination *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/;
%Docstring
2017-12-15 10:36:55 -04:00
Creates a new parameter using the definition from a script code.
%End
};
class QgsProcessingParameterFolderDestination : QgsProcessingDestinationParameter
2017-06-13 10:58:53 +10:00
{
%Docstring
2017-12-15 10:36:55 -04:00
A folder destination parameter, for specifying the destination path for a folder created
by the algorithm or used for creating new files within the algorithm.
A folder output parameter.
2017-06-13 10:58:53 +10:00
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsprocessingparameters.h"
%End
public:
QgsProcessingParameterFolderDestination( const QString &name, const QString &description = QString(),
const QVariant &defaultValue = QVariant(),
bool optional = false );
2017-06-13 10:58:53 +10:00
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsProcessingParameterFolderDestination.
2017-06-13 10:58:53 +10:00
%End
2017-07-03 19:42:29 +10:00
static QString typeName();
%Docstring
2017-12-15 10:36:55 -04:00
Returns the type name for the parameter class.
2017-07-03 19:42:29 +10:00
%End
virtual QgsProcessingParameterDefinition *clone() const /Factory/;
2017-06-13 10:58:53 +10:00
virtual QString type() const;
virtual bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = 0 ) const;
2017-06-22 06:49:43 +10:00
virtual QgsProcessingOutputDefinition *toOutputDefinition() const /Factory/;
virtual QString defaultFileExtension() const;
2017-06-13 10:58:53 +10:00
static QgsProcessingParameterFolderDestination *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/;
%Docstring
2017-12-15 10:36:55 -04:00
Creates a new parameter using the definition from a script code.
%End
2017-06-13 10:58:53 +10:00
};
class QgsProcessingParameterBand : QgsProcessingParameterDefinition
{
%Docstring
2017-12-15 10:36:55 -04:00
A raster band parameter for Processing algorithms.
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsprocessingparameters.h"
%End
public:
QgsProcessingParameterBand( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
const QString &parentLayerParameterName = QString(),
bool optional = false,
bool allowMultiple = false );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsProcessingParameterBand.
%End
static QString typeName();
%Docstring
2017-12-15 10:36:55 -04:00
Returns the type name for the parameter class.
%End
virtual QgsProcessingParameterDefinition *clone() const /Factory/;
virtual QString type() const;
virtual bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = 0 ) const;
virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
virtual QString asScriptCode() const;
virtual QStringList dependsOnOtherParameters() const;
QString parentLayerParameterName() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the name of the parent layer parameter, or an empty string if this is not set.
.. seealso:: :py:func:`setParentLayerParameterName`
%End
void setParentLayerParameterName( const QString &parentLayerParameterName );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the name of the parent layer parameter. Use an empty string if this is not required.
.. seealso:: :py:func:`parentLayerParameterName`
%End
virtual QVariantMap toVariantMap() const;
virtual bool fromVariantMap( const QVariantMap &map );
static QgsProcessingParameterBand *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/;
%Docstring
2017-12-15 10:36:55 -04:00
Creates a new parameter using the definition from a script code.
%End
bool allowMultiple() const;
%Docstring
Returns whether multiple band selections are permitted.
.. seealso:: :py:func:`setAllowMultiple`
.. versionadded:: 3.4
%End
void setAllowMultiple( bool allowMultiple );
%Docstring
Sets whether multiple band selections are permitted.
.. seealso:: :py:func:`allowMultiple`
.. versionadded:: 3.4
%End
};
2017-09-25 14:20:39 +10:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/processing/qgsprocessingparameters.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/