2018-09-06 17:30:56 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/analysis/vector/geometry_checker/qgsgeometrycheck.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class QgsGeometryCheck
|
|
|
|
{
|
|
|
|
%Docstring
|
2018-10-15 13:54:07 +02:00
|
|
|
This class manages all known geometry check factories.
|
|
|
|
|
|
|
|
QgsGeometryCheckRegistry is not usually directly created, but rather accessed through
|
|
|
|
:py:func:`QgsAnalysis.geometryCheckRegistry()`
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
This class is a technology preview and unstable API.
|
|
|
|
|
|
|
|
.. versionadded:: 3.4
|
2018-09-06 17:30:56 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgsgeometrycheck.h"
|
|
|
|
%End
|
|
|
|
public:
|
|
|
|
static const QMetaObject staticMetaObject;
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
struct LayerFeatureIds
|
|
|
|
{
|
|
|
|
LayerFeatureIds();
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
enum ChangeWhat
|
|
|
|
{
|
|
|
|
ChangeFeature,
|
|
|
|
ChangePart,
|
|
|
|
ChangeRing,
|
|
|
|
ChangeNode
|
|
|
|
};
|
|
|
|
|
|
|
|
enum ChangeType
|
|
|
|
{
|
|
|
|
ChangeAdded,
|
|
|
|
ChangeRemoved,
|
|
|
|
ChangeChanged
|
|
|
|
};
|
|
|
|
|
|
|
|
enum CheckType
|
|
|
|
{
|
|
|
|
FeatureNodeCheck,
|
|
|
|
FeatureCheck,
|
|
|
|
LayerCheck
|
|
|
|
};
|
|
|
|
|
|
|
|
enum Flag
|
|
|
|
{
|
|
|
|
AvailableInValidation
|
|
|
|
};
|
|
|
|
typedef QFlags<QgsGeometryCheck::Flag> Flags;
|
|
|
|
|
|
|
|
|
|
|
|
struct Change
|
|
|
|
{
|
|
|
|
Change();
|
2018-09-28 13:59:42 +02:00
|
|
|
|
2018-10-05 01:36:40 +02:00
|
|
|
Change( QgsGeometryCheck::ChangeWhat _what, QgsGeometryCheck::ChangeType _type, QgsVertexId _vidx = QgsVertexId() );
|
2018-09-28 13:59:42 +02:00
|
|
|
%Docstring
|
|
|
|
Create a new Change
|
|
|
|
%End
|
|
|
|
|
2018-10-05 01:36:40 +02:00
|
|
|
QgsGeometryCheck::ChangeWhat what;
|
2018-09-28 13:59:42 +02:00
|
|
|
|
2018-10-05 01:36:40 +02:00
|
|
|
QgsGeometryCheck::ChangeType type;
|
2018-09-28 13:59:42 +02:00
|
|
|
|
2018-09-06 17:30:56 +02:00
|
|
|
QgsVertexId vidx;
|
2018-10-05 01:36:40 +02:00
|
|
|
bool operator==( const QgsGeometryCheck::Change &other );
|
2018-09-06 17:30:56 +02:00
|
|
|
};
|
|
|
|
|
2018-10-05 01:36:40 +02:00
|
|
|
typedef QMap<QString, QMap<QgsFeatureId, QList<QgsGeometryCheck::Change> > > Changes;
|
2018-09-06 17:30:56 +02:00
|
|
|
|
2018-09-30 16:09:58 +02:00
|
|
|
QgsGeometryCheck( const QgsGeometryCheckContext *context, const QVariantMap &configuration );
|
2018-09-28 13:59:42 +02:00
|
|
|
%Docstring
|
|
|
|
Create a new geometry check.
|
|
|
|
%End
|
2018-09-06 17:30:56 +02:00
|
|
|
virtual ~QgsGeometryCheck();
|
|
|
|
|
|
|
|
|
|
|
|
virtual bool isCompatible( QgsVectorLayer *layer ) const;
|
2018-09-28 13:59:42 +02:00
|
|
|
%Docstring
|
|
|
|
Returns if this geometry check is compatible with ``layer``.
|
|
|
|
By default it checks for the geometry type in ``compatibleGeometryTypes``().
|
|
|
|
|
|
|
|
.. versionadded:: 3.4
|
|
|
|
%End
|
|
|
|
|
2018-09-06 17:30:56 +02:00
|
|
|
virtual QList<QgsWkbTypes::GeometryType> compatibleGeometryTypes() const = 0;
|
2018-09-28 13:59:42 +02:00
|
|
|
%Docstring
|
|
|
|
A list of geometry types for which this check can be performed.
|
|
|
|
|
|
|
|
.. versionadded:: 3.4
|
|
|
|
%End
|
|
|
|
|
2018-09-06 17:30:56 +02:00
|
|
|
virtual QgsGeometryCheck::Flags flags() const;
|
2018-09-28 13:59:42 +02:00
|
|
|
%Docstring
|
|
|
|
Flags for this geometry check.
|
|
|
|
%End
|
|
|
|
|
2018-10-01 15:00:16 +02:00
|
|
|
virtual void collectErrors( const QMap<QString, QgsFeaturePool *> &featurePools, QList<QgsGeometryCheckError *> &errors /In,Out/, QStringList &messages /In,Out/, QgsFeedback *feedback, const LayerFeatureIds &ids = QgsGeometryCheck::LayerFeatureIds() ) const = 0;
|
2018-09-28 13:59:42 +02:00
|
|
|
%Docstring
|
|
|
|
The main worker method.
|
|
|
|
Check all features available from ``featurePools`` and write errors found to ``errors``.
|
|
|
|
Other status messages can be written to ``messages``.
|
|
|
|
Progress should be reported to ``feedback``. Only features and layers listed in ``ids`` should be checked.
|
|
|
|
|
|
|
|
.. versionadded:: 3.4
|
|
|
|
%End
|
|
|
|
|
2018-09-06 17:30:56 +02:00
|
|
|
|
|
|
|
virtual QStringList resolutionMethods() const = 0;
|
2018-09-28 13:59:42 +02:00
|
|
|
%Docstring
|
|
|
|
Returns a list of descriptions for available resolutions for errors. The index will be passed as ``method`` to :py:func:`fixError`.
|
|
|
|
|
|
|
|
.. versionadded:: 3.4
|
|
|
|
%End
|
|
|
|
|
2018-09-06 17:30:56 +02:00
|
|
|
virtual QString description() const = 0;
|
2018-09-28 13:59:42 +02:00
|
|
|
%Docstring
|
|
|
|
Returns a human readable description for this check.
|
|
|
|
|
|
|
|
.. versionadded:: 3.4
|
|
|
|
%End
|
|
|
|
|
2018-09-06 17:30:56 +02:00
|
|
|
virtual QString id() const = 0;
|
2018-09-28 13:59:42 +02:00
|
|
|
%Docstring
|
|
|
|
Returns an id for this check.
|
|
|
|
|
|
|
|
.. versionadded:: 3.4
|
|
|
|
%End
|
|
|
|
|
2018-09-30 16:09:58 +02:00
|
|
|
virtual CheckType checkType() const = 0;
|
2018-09-28 13:59:42 +02:00
|
|
|
%Docstring
|
|
|
|
Returns the check type.
|
|
|
|
|
|
|
|
.. versionadded:: 3.4
|
|
|
|
%End
|
|
|
|
|
2018-09-06 17:30:56 +02:00
|
|
|
const QgsGeometryCheckContext *context() const;
|
2018-09-28 13:59:42 +02:00
|
|
|
%Docstring
|
|
|
|
Returns the context
|
|
|
|
|
|
|
|
.. versionadded:: 3.4
|
|
|
|
%End
|
2018-09-06 17:30:56 +02:00
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/analysis/vector/geometry_checker/qgsgeometrycheck.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|