2017-04-24 10:22:38 +10:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/processing/qgsprocessingcontext.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class QgsProcessingContext
|
|
|
|
{
|
|
|
|
%Docstring
|
|
|
|
Contains information about the context in which a processing algorithm is executed.
|
|
|
|
|
|
|
|
Contextual information includes settings such as the associated project, and
|
|
|
|
expression context.
|
|
|
|
.. versionadded:: 3.0
|
|
|
|
%End
|
|
|
|
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgsprocessingcontext.h"
|
|
|
|
%End
|
|
|
|
public:
|
|
|
|
|
2017-04-25 15:32:09 +10:00
|
|
|
enum Flag
|
|
|
|
{
|
2017-06-05 15:18:39 +10:00
|
|
|
// UseSelectionIfPresent,
|
2017-04-25 15:32:09 +10:00
|
|
|
};
|
|
|
|
typedef QFlags<QgsProcessingContext::Flag> Flags;
|
|
|
|
|
|
|
|
|
2017-04-24 10:22:38 +10:00
|
|
|
QgsProcessingContext();
|
2017-04-25 18:46:27 +10:00
|
|
|
%Docstring
|
|
|
|
Constructor for QgsProcessingContext.
|
|
|
|
%End
|
2017-04-24 10:22:38 +10:00
|
|
|
|
2017-04-26 11:31:56 +02:00
|
|
|
|
2017-04-25 15:32:09 +10:00
|
|
|
QgsProcessingContext::Flags flags() const;
|
|
|
|
%Docstring
|
|
|
|
Returns any flags set in the context.
|
2017-04-30 16:51:18 +02:00
|
|
|
.. seealso:: setFlags()
|
2017-04-25 15:32:09 +10:00
|
|
|
:rtype: QgsProcessingContext.Flags
|
|
|
|
%End
|
|
|
|
|
|
|
|
void setFlags( const QgsProcessingContext::Flags &flags );
|
|
|
|
%Docstring
|
|
|
|
Sets ``flags`` for the context.
|
2017-04-30 16:51:18 +02:00
|
|
|
.. seealso:: flags()
|
2017-04-25 15:32:09 +10:00
|
|
|
%End
|
|
|
|
|
2017-04-24 10:22:38 +10:00
|
|
|
QgsProject *project() const;
|
|
|
|
%Docstring
|
|
|
|
Returns the project in which the algorithm is being executed.
|
2017-04-30 16:51:18 +02:00
|
|
|
.. seealso:: setProject()
|
2017-04-24 10:22:38 +10:00
|
|
|
:rtype: QgsProject
|
|
|
|
%End
|
|
|
|
|
|
|
|
void setProject( QgsProject *project );
|
|
|
|
%Docstring
|
|
|
|
Sets the ``project`` in which the algorithm will be executed.
|
2017-04-30 16:51:18 +02:00
|
|
|
.. seealso:: project()
|
2017-04-24 10:22:38 +10:00
|
|
|
%End
|
|
|
|
|
2017-04-24 14:48:29 +10:00
|
|
|
QgsExpressionContext &expressionContext();
|
2017-04-24 10:22:38 +10:00
|
|
|
%Docstring
|
|
|
|
Returns the expression context.
|
|
|
|
:rtype: QgsExpressionContext
|
|
|
|
%End
|
|
|
|
|
2017-05-09 15:04:41 +10:00
|
|
|
|
2017-04-24 10:22:38 +10:00
|
|
|
void setExpressionContext( const QgsExpressionContext &context );
|
|
|
|
%Docstring
|
|
|
|
Sets the expression ``context``.
|
|
|
|
%End
|
|
|
|
|
2017-05-03 07:49:32 +10:00
|
|
|
QgsMapLayerStore *temporaryLayerStore();
|
2017-04-26 14:33:53 +10:00
|
|
|
%Docstring
|
2017-05-02 11:07:42 +10:00
|
|
|
Returns a reference to the layer store used for storing temporary layers during
|
2017-04-26 14:33:53 +10:00
|
|
|
algorithm execution.
|
2017-05-02 11:07:42 +10:00
|
|
|
:rtype: QgsMapLayerStore
|
2017-04-26 14:33:53 +10:00
|
|
|
%End
|
2017-04-26 14:06:59 +10:00
|
|
|
|
2017-06-06 08:40:23 +10:00
|
|
|
struct LayerDetails
|
|
|
|
{
|
|
|
|
|
|
|
|
LayerDetails( const QString &name, QgsProject *project );
|
|
|
|
%Docstring
|
|
|
|
Constructor for LayerDetails.
|
|
|
|
%End
|
|
|
|
|
|
|
|
QString name;
|
|
|
|
%Docstring
|
|
|
|
Friendly name for layer, to use when loading layer into project.
|
|
|
|
%End
|
|
|
|
|
|
|
|
QgsProject *project;
|
|
|
|
%Docstring
|
|
|
|
Destination project
|
|
|
|
%End
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
QMap< QString, QgsProcessingContext::LayerDetails > layersToLoadOnCompletion() const;
|
2017-05-15 19:01:15 +10:00
|
|
|
%Docstring
|
2017-06-06 08:40:23 +10:00
|
|
|
Returns a map of layers (by ID or datasource) to LayerDetails, to load into the canvas upon completion of the algorithm or model.
|
2017-05-15 19:01:15 +10:00
|
|
|
.. seealso:: setLayersToLoadOnCompletion()
|
|
|
|
.. seealso:: addLayerToLoadOnCompletion()
|
2017-06-06 08:40:23 +10:00
|
|
|
:rtype: QMap< str, QgsProcessingContext.LayerDetails >
|
2017-05-15 19:01:15 +10:00
|
|
|
%End
|
|
|
|
|
2017-06-06 08:40:23 +10:00
|
|
|
void setLayersToLoadOnCompletion( const QMap< QString, QgsProcessingContext::LayerDetails > &layers );
|
2017-05-15 19:01:15 +10:00
|
|
|
%Docstring
|
2017-06-06 08:40:23 +10:00
|
|
|
Sets the map of ``layers`` (by ID or datasource) to LayerDetails, to load into the canvas upon completion of the algorithm or model.
|
2017-05-15 19:01:15 +10:00
|
|
|
.. seealso:: addLayerToLoadOnCompletion()
|
|
|
|
.. seealso:: layersToLoadOnCompletion()
|
|
|
|
%End
|
|
|
|
|
2017-06-06 08:40:23 +10:00
|
|
|
void addLayerToLoadOnCompletion( const QString &layer, const QgsProcessingContext::LayerDetails &details );
|
2017-05-15 19:01:15 +10:00
|
|
|
%Docstring
|
|
|
|
Adds a ``layer`` to load (by ID or datasource) into the canvas upon completion of the algorithm or model.
|
2017-06-06 08:40:23 +10:00
|
|
|
The ``details`` parameter dictates the LayerDetails.
|
2017-05-15 19:01:15 +10:00
|
|
|
.. seealso:: setLayersToLoadOnCompletion()
|
|
|
|
.. seealso:: layersToLoadOnCompletion()
|
|
|
|
%End
|
|
|
|
|
2017-05-09 15:04:41 +10:00
|
|
|
|
2017-04-25 15:37:45 +10:00
|
|
|
QgsFeatureRequest::InvalidGeometryCheck invalidGeometryCheck() const;
|
|
|
|
%Docstring
|
|
|
|
Returns the behavior used for checking invalid geometries in input layers.
|
2017-04-30 16:51:18 +02:00
|
|
|
.. seealso:: setInvalidGeometryCheck()
|
2017-04-25 15:37:45 +10:00
|
|
|
:rtype: QgsFeatureRequest.InvalidGeometryCheck
|
|
|
|
%End
|
2017-04-25 15:32:09 +10:00
|
|
|
|
2017-04-25 15:37:45 +10:00
|
|
|
void setInvalidGeometryCheck( const QgsFeatureRequest::InvalidGeometryCheck &check );
|
|
|
|
%Docstring
|
|
|
|
Sets the behavior used for checking invalid geometries in input layers.
|
2017-04-30 16:51:18 +02:00
|
|
|
.. seealso:: invalidGeometryCheck()
|
2017-04-25 15:37:45 +10:00
|
|
|
%End
|
2017-04-25 15:32:09 +10:00
|
|
|
|
2017-04-25 17:22:33 +10:00
|
|
|
|
|
|
|
void setInvalidGeometryCallback( SIP_PYCALLABLE / AllowNone / );
|
|
|
|
%Docstring
|
|
|
|
Sets a callback function to use when encountering an invalid geometry and
|
|
|
|
invalidGeometryCheck() is set to GeometryAbortOnInvalid. This function will be
|
|
|
|
called using the feature with invalid geometry as a parameter.
|
|
|
|
.. versionadded:: 3.0
|
2017-04-30 16:51:18 +02:00
|
|
|
.. seealso:: invalidGeometryCallback()
|
2017-04-25 17:22:33 +10:00
|
|
|
%End
|
|
|
|
%MethodCode
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
|
|
|
sipCpp->setInvalidGeometryCallback( [a0]( const QgsFeature &arg )
|
|
|
|
{
|
|
|
|
SIP_BLOCK_THREADS
|
|
|
|
Py_XDECREF( sipCallMethod( NULL, a0, "D", &arg, sipType_QgsFeature, NULL ) );
|
|
|
|
SIP_UNBLOCK_THREADS
|
|
|
|
} );
|
|
|
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
%End
|
|
|
|
|
|
|
|
|
2017-06-12 08:05:32 +10:00
|
|
|
void setTransformErrorCallback( SIP_PYCALLABLE / AllowNone / );
|
|
|
|
%Docstring
|
|
|
|
Sets a callback function to use when encountering a transform error when iterating
|
|
|
|
features. This function will be
|
|
|
|
called using the feature which encountered the transform error as a parameter.
|
|
|
|
.. versionadded:: 3.0
|
|
|
|
.. seealso:: transformErrorCallback()
|
|
|
|
%End
|
|
|
|
%MethodCode
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
|
|
|
|
sipCpp->setTransformErrorCallback( [a0]( const QgsFeature &arg )
|
|
|
|
{
|
|
|
|
SIP_BLOCK_THREADS
|
|
|
|
Py_XDECREF( sipCallMethod( NULL, a0, "D", &arg, sipType_QgsFeature, NULL ) );
|
|
|
|
SIP_UNBLOCK_THREADS
|
|
|
|
} );
|
|
|
|
|
|
|
|
Py_END_ALLOW_THREADS
|
|
|
|
%End
|
|
|
|
|
|
|
|
|
2017-05-02 21:15:54 +10:00
|
|
|
QString defaultEncoding() const;
|
|
|
|
%Docstring
|
|
|
|
Returns the default encoding to use for newly created files.
|
|
|
|
.. seealso:: setDefaultEncoding()
|
|
|
|
:rtype: str
|
|
|
|
%End
|
|
|
|
|
|
|
|
void setDefaultEncoding( const QString &encoding );
|
|
|
|
%Docstring
|
|
|
|
Sets the default ``encoding`` to use for newly created files.
|
|
|
|
.. seealso:: defaultEncoding()
|
|
|
|
%End
|
|
|
|
|
2017-04-26 14:06:59 +10:00
|
|
|
private:
|
|
|
|
QgsProcessingContext( const QgsProcessingContext &other );
|
2017-04-25 15:37:45 +10:00
|
|
|
};
|
2017-05-02 21:15:54 +10:00
|
|
|
|
2017-05-15 19:01:15 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-04-25 15:32:09 +10:00
|
|
|
QFlags<QgsProcessingContext::Flag> operator|(QgsProcessingContext::Flag f1, QFlags<QgsProcessingContext::Flag> f2);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-04-24 10:22:38 +10:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/processing/qgsprocessingcontext.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|