QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
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 #define SIP_NO_FILE
17 
18 #ifndef QGS_GEOMETRY_SELFINTERSECTION_CHECK_H
19 #define QGS_GEOMETRY_SELFINTERSECTION_CHECK_H
20 
21 #include "qgsgeometryutils.h"
22 #include "qgssinglegeometrycheck.h"
23 
29 {
30  public:
32  const QgsGeometry &geometry,
33  const QgsGeometry &errorLocation,
34  QgsVertexId vertexId,
35  const QgsGeometryUtils::SelfIntersection &intersection )
36  : QgsSingleGeometryCheckError( check, geometry, errorLocation, vertexId )
37  , mIntersection( intersection )
38  {}
39 
40  const QgsGeometryUtils::SelfIntersection &intersection() const { return mIntersection; }
41  bool isEqual( const QgsSingleGeometryCheckError *other ) const override;
42  bool handleChanges( const QList<QgsGeometryCheck::Change> &changes ) override;
43  void update( const QgsSingleGeometryCheckError *other ) override;
44 
45  private:
47 };
48 
54 {
55  Q_DECLARE_TR_FUNCTIONS( QgsGeometrySelfIntersectionCheck )
56  public:
58  {
61  NoChange
62  };
63 
64  explicit QgsGeometrySelfIntersectionCheck( const QgsGeometryCheckContext *context, const QVariantMap &configuration = QVariantMap() )
65  : QgsSingleGeometryCheck( context,
66  configuration ) {}
67  QList<QgsWkbTypes::GeometryType> compatibleGeometryTypes() const override { return factoryCompatibleGeometryTypes(); }
68  void fixError( const QMap<QString, QgsFeaturePool *> &featurePools, QgsGeometryCheckError *error, int method, const QMap<QString, int> &mergeAttributeIndices, Changes &changes ) const override;
69  Q_DECL_DEPRECATED QStringList resolutionMethods() const override;
70  QString description() const override { return factoryDescription(); }
71  QString id() const override { return factoryId(); }
72  QgsGeometryCheck::Flags flags() const override {return factoryFlags(); }
73  QgsGeometryCheck::CheckType checkType() const override { return factoryCheckType(); }
74 
75  QList<QgsSingleGeometryCheckError *> processGeometry( const QgsGeometry &geometry ) const override;
76 
78  static QList<QgsWkbTypes::GeometryType> factoryCompatibleGeometryTypes() SIP_SKIP;
79  static bool factoryIsCompatible( QgsVectorLayer *layer ) SIP_SKIP;
80  static QString factoryDescription() SIP_SKIP;
81  static QgsGeometryCheck::Flags factoryFlags() SIP_SKIP;
82  static QString factoryId() SIP_SKIP;
83  static QgsGeometryCheck::CheckType factoryCheckType() SIP_SKIP;
85 
86 };
87 
88 #endif // QGS_GEOMETRY_SELFINTERSECTION_CHECK_H
QgsGeometrySelfIntersectionCheck::ToMultiObject
@ ToMultiObject
Definition: qgsgeometryselfintersectioncheck.h:59
QgsGeometryUtils::SelfIntersection
Definition: qgsgeometryutils.h:258
QgsSingleGeometryCheckError::update
virtual void update(const QgsSingleGeometryCheckError *other)
Update this error with the information from other.
Definition: qgssinglegeometrycheck.cpp:42
QgsGeometryCheck::resolutionMethods
virtual Q_DECL_DEPRECATED QStringList resolutionMethods() const
Returns a list of descriptions for available resolutions for errors.
Definition: qgsgeometrycheck.cpp:77
QgsSingleGeometryCheckError
An error from a QgsSingleGeometryCheck.
Definition: qgssinglegeometrycheck.h:39
QgsGeometrySelfIntersectionCheckError
A self intersection check error.
Definition: qgsgeometryselfintersectioncheck.h:28
QgsGeometrySelfIntersectionCheck
A self intersection check.
Definition: qgsgeometryselfintersectioncheck.h:53
QgsGeometrySelfIntersectionCheck::ResolutionMethod
ResolutionMethod
Definition: qgsgeometryselfintersectioncheck.h:57
QgsSingleGeometryCheck::processGeometry
virtual QList< QgsSingleGeometryCheckError * > processGeometry(const QgsGeometry &geometry) const =0
Check the geometry for errors.
QgsSingleGeometryCheck
Base class for geometry checks for a single geometry without any context of the layer or other layers...
Definition: qgssinglegeometrycheck.h:149
QgsGeometryCheck
This class implements a geometry check.
Definition: qgsgeometrycheck.h:91
QgsGeometryCheck::fixError
virtual void fixError(const QMap< QString, QgsFeaturePool * > &featurePools, QgsGeometryCheckError *error, int method, const QMap< QString, int > &mergeAttributeIndices, Changes &changes) const
Fixes the error error with the specified method.
Definition: qgsgeometrycheck.cpp:50
SIP_SKIP
#define SIP_SKIP
Definition: qgis_sip.h:126
QgsGeometrySelfIntersectionCheck::QgsGeometrySelfIntersectionCheck
QgsGeometrySelfIntersectionCheck(const QgsGeometryCheckContext *context, const QVariantMap &configuration=QVariantMap())
Definition: qgsgeometryselfintersectioncheck.h:64
QgsGeometrySelfIntersectionCheck::id
QString id() const override
Returns an id for this check.
Definition: qgsgeometryselfintersectioncheck.h:71
QgsGeometryCheckContext
Base configuration for geometry checks.
Definition: qgsgeometrycheckcontext.h:31
qgsgeometryutils.h
QgsGeometrySelfIntersectionCheck::compatibleGeometryTypes
QList< QgsWkbTypes::GeometryType > compatibleGeometryTypes() const override
A list of geometry types for which this check can be performed.
Definition: qgsgeometryselfintersectioncheck.h:67
QgsGeometrySelfIntersectionCheckError::intersection
const QgsGeometryUtils::SelfIntersection & intersection() const
Definition: qgsgeometryselfintersectioncheck.h:40
QgsSingleGeometryCheckError::isEqual
virtual bool isEqual(const QgsSingleGeometryCheckError *other) const
Check if this error is equal to other.
Definition: qgssinglegeometrycheck.cpp:50
QgsGeometrySelfIntersectionCheck::checkType
QgsGeometryCheck::CheckType checkType() const override
Returns the check type.
Definition: qgsgeometryselfintersectioncheck.h:73
QgsGeometrySelfIntersectionCheck::ToSingleObjects
@ ToSingleObjects
Definition: qgsgeometryselfintersectioncheck.h:60
QgsGeometry
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:124
QgsGeometrySelfIntersectionCheckError::QgsGeometrySelfIntersectionCheckError
QgsGeometrySelfIntersectionCheckError(const QgsSingleGeometryCheck *check, const QgsGeometry &geometry, const QgsGeometry &errorLocation, QgsVertexId vertexId, const QgsGeometryUtils::SelfIntersection &intersection)
Definition: qgsgeometryselfintersectioncheck.h:31
QgsVectorLayer
Represents a vector layer which manages a vector based data sets.
Definition: qgsvectorlayer.h:391
QgsGeometryCheck::CheckType
CheckType
The type of a check.
Definition: qgsgeometrycheck.h:154
QgsVertexId
Utility class for identifying a unique vertex within a geometry.
Definition: qgsvertexid.h:30
QgsGeometrySelfIntersectionCheck::description
QString description() const override
Returns a human readable description for this check.
Definition: qgsgeometryselfintersectioncheck.h:70
qgssinglegeometrycheck.h
QgsGeometryCheckError
This represents an error reported by a geometry check.
Definition: qgsgeometrycheckerror.h:35
QgsGeometrySelfIntersectionCheck::flags
QgsGeometryCheck::Flags flags() const override
Flags for this geometry check.
Definition: qgsgeometryselfintersectioncheck.h:72
QgsSingleGeometryCheckError::handleChanges
virtual bool handleChanges(const QList< QgsGeometryCheck::Change > &changes)
Apply a list of changes.
Definition: qgssinglegeometrycheck.cpp:58