QGIS API Documentation 3.99.0-Master (a5475b57e34)
Loading...
Searching...
No Matches
qgsgeometryselfintersectioncheck.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsgeometryselfintersectioncheck.h
3 ---------------------
4 begin : September 2015
5 copyright : (C) 2014 by Sandro Mani / Sourcepole AG
6 email : smani at sourcepole dot ch
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16
17#ifndef QGS_GEOMETRY_SELFINTERSECTION_CHECK_H
18#define QGS_GEOMETRY_SELFINTERSECTION_CHECK_H
19
20#include "qgsgeometryutils.h"
22
23#define SIP_NO_FILE
24
30{
31 public:
36
37 const QgsGeometryUtils::SelfIntersection &intersection() const { return mIntersection; }
38 bool isEqual( const QgsSingleGeometryCheckError *other ) const override;
39 bool handleChanges( const QList<QgsGeometryCheck::Change> &changes ) override;
40 void update( const QgsSingleGeometryCheckError *other ) override;
41
42 private:
44};
45
51{
52 Q_DECLARE_TR_FUNCTIONS( QgsGeometrySelfIntersectionCheck )
53 public:
60
61 explicit QgsGeometrySelfIntersectionCheck( const QgsGeometryCheckContext *context, const QVariantMap &configuration = QVariantMap() )
62 : QgsSingleGeometryCheck( context, configuration ) {}
63 QList<Qgis::GeometryType> compatibleGeometryTypes() const override { return factoryCompatibleGeometryTypes(); }
64 void fixError( const QMap<QString, QgsFeaturePool *> &featurePools, QgsGeometryCheckError *error, int method, const QMap<QString, int> &mergeAttributeIndices, Changes &changes ) const override;
65 Q_DECL_DEPRECATED QStringList resolutionMethods() const override;
66 QString description() const override { return factoryDescription(); }
67 QString id() const override { return factoryId(); }
68 QgsGeometryCheck::Flags flags() const override { return factoryFlags(); }
69 QgsGeometryCheck::CheckType checkType() const override { return factoryCheckType(); }
70
71 QList<QgsSingleGeometryCheckError *> processGeometry( const QgsGeometry &geometry ) const override;
72
74 static QList<Qgis::GeometryType> factoryCompatibleGeometryTypes() SIP_SKIP;
75 static bool factoryIsCompatible( QgsVectorLayer *layer ) SIP_SKIP;
76 static QString factoryDescription() SIP_SKIP;
77 static QgsGeometryCheck::Flags factoryFlags() SIP_SKIP;
78 static QString factoryId() SIP_SKIP;
79 static QgsGeometryCheck::CheckType factoryCheckType() SIP_SKIP;
81};
82
83#endif // QGS_GEOMETRY_SELFINTERSECTION_CHECK_H
Base configuration for geometry checks.
This represents an error reported by a geometry check.
Base class for geometry checks.
QFlags< Flag > Flags
CheckType
The type of a check.
const QgsGeometryCheckContext * context() const
Returns the context.
const QgsGeometryUtils::SelfIntersection & intersection() const
QgsGeometrySelfIntersectionCheckError(const QgsSingleGeometryCheck *check, const QgsGeometry &geometry, const QgsGeometry &errorLocation, QgsVertexId vertexId, const QgsGeometryUtils::SelfIntersection &intersection)
QgsGeometryCheck::Flags flags() const override
Flags for this geometry check.
QString description() const override
Returns a human readable description for this check.
QgsGeometryCheck::CheckType checkType() const override
Returns the check type.
QList< Qgis::GeometryType > compatibleGeometryTypes() const override
A list of geometry types for which this check can be performed.
QString id() const override
Returns an id for this check.
QgsGeometrySelfIntersectionCheck(const QgsGeometryCheckContext *context, const QVariantMap &configuration=QVariantMap())
A geometry is the spatial representation of a feature.
An error from a QgsSingleGeometryCheck.
QgsGeometry errorLocation() const
The exact location of the error.
virtual bool isEqual(const QgsSingleGeometryCheckError *other) const
Check if this error is equal to other.
QgsSingleGeometryCheckError(const QgsSingleGeometryCheck *check, const QgsGeometry &geometry, const QgsGeometry &errorLocation, const QgsVertexId &vertexId=QgsVertexId())
Creates a new single geometry check error.
virtual bool handleChanges(const QList< QgsGeometryCheck::Change > &changes)
Apply a list of changes.
const QgsSingleGeometryCheck * check() const
The check that created this error.
QgsVertexId vertexId() const
The vertex id of the error.
virtual void update(const QgsSingleGeometryCheckError *other)
Update this error with the information from other.
Base class for geometry checks for a single geometry without any context of the layer or other layers...
QgsSingleGeometryCheck(const QgsGeometryCheckContext *context, const QVariantMap &configuration)
Creates a new single geometry check.
Represents a vector layer which manages a vector based dataset.
#define SIP_SKIP
Definition qgis_sip.h:133
Utility class for identifying a unique vertex within a geometry.
Definition qgsvertexid.h:34