QGIS API Documentation 3.41.0-Master (cea29feecf2)
Loading...
Searching...
No Matches
qgsgeometrymissingvertexcheck.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsgeometrymissingvertexcheck.h
3 ---------------------
4 begin : September 2018
5 copyright : (C) 2018 Matthias Kuhn
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 QGSGEOMETRYMISSINGVERTEXCHECK_H
19#define QGSGEOMETRYMISSINGVERTEXCHECK_H
20
21#include "qgsgeometrycheck.h"
23
24class QgsCurvePolygon;
25
38{
39 public:
43 QgsGeometryMissingVertexCheckError( const QgsGeometryCheck *check, const QgsGeometryCheckerUtils::LayerFeature &layerFeature, const QgsPointXY &errorLocation, QgsVertexId vidx = QgsVertexId(), const QVariant &value = QVariant(), ValueType valueType = ValueOther );
44
45 QgsRectangle affectedAreaBBox() const override;
46
52 void setAffectedAreaBBox( const QgsRectangle &affectedAreaBBox );
53
54 QMap<QString, QgsFeatureIds> involvedFeatures() const override;
55
62 void setInvolvedFeatures( const QMap<QString, QgsFeatureIds> &involvedFeatures );
63
64 QIcon icon() const override;
65
66 private:
67 QgsRectangle mAffectedAreaBBox;
68 QMap<QString, QgsFeatureIds> mInvolvedFeatures;
69};
70
81class ANALYSIS_EXPORT QgsGeometryMissingVertexCheck : public QgsGeometryCheck
82{
83 Q_DECLARE_TR_FUNCTIONS( QgsGeometryMissingVertexCheck )
84
85 public:
90 {
92 AddMissingVertex
93 };
94 Q_ENUM( ResolutionMethod )
95
96
99 explicit QgsGeometryMissingVertexCheck( const QgsGeometryCheckContext *context, const QVariantMap &geometryCheckConfiguration );
100 void collectErrors( const QMap<QString, QgsFeaturePool *> &featurePools, QList<QgsGeometryCheckError *> &errors, QStringList &messages, QgsFeedback *feedback, const LayerFeatureIds &ids = LayerFeatureIds() ) const override;
101 void fixError( const QMap<QString, QgsFeaturePool *> &featurePools, QgsGeometryCheckError *error, int method, const QMap<QString, int> &mergeAttributeIndices, Changes &changes ) const override;
102 Q_DECL_DEPRECATED QStringList resolutionMethods() const override;
103
104 QString description() const override;
105 QString id() const override;
106 QList<Qgis::GeometryType> compatibleGeometryTypes() const override;
107 QgsGeometryCheck::Flags flags() const override;
108 QgsGeometryCheck::CheckType checkType() const override;
109
111 static QList<Qgis::GeometryType> factoryCompatibleGeometryTypes() SIP_SKIP;
112 static bool factoryIsCompatible( QgsVectorLayer *layer ) SIP_SKIP;
113 static QString factoryDescription() SIP_SKIP;
114 static QString factoryId() SIP_SKIP;
115 static QgsGeometryCheck::Flags factoryFlags() SIP_SKIP;
116 static QgsGeometryCheck::CheckType factoryCheckType() SIP_SKIP;
118
119 private:
120 void processPolygon( const QgsCurvePolygon *polygon, QgsFeaturePool *featurePool, QList<QgsGeometryCheckError *> &errors, const QgsGeometryCheckerUtils::LayerFeature &layerFeature, QgsFeedback *feedback ) const;
121
122 QgsRectangle contextBoundingBox( const QgsCurvePolygon *polygon, const QgsVertexId &vertexId, const QgsPoint &point ) const;
123};
124
125
126#endif // QGSGEOMETRYMISSINGVERTEXCHECK_H
Curve polygon geometry type.
A feature pool is based on a vector layer and caches features.
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Definition qgsfeedback.h:44
Base configuration for geometry checks.
This represents an error reported by a geometry check.
ValueType
Describes the type of an error value.
virtual QMap< QString, QgsFeatureIds > involvedFeatures() const
Returns a list of involved features.
virtual QString description() const
The error description.
virtual QgsRectangle affectedAreaBBox() const
The bounding box of the affected area of the error.
virtual QIcon icon() const
Returns an icon that should be shown for this kind of error.
This class implements a geometry check.
QFlags< Flag > Flags
CheckType
The type of a check.
A layer feature combination to uniquely identify and access a feature in a set of layers.
Contains utilities required for geometry checks.
A geometry check error for a missing vertex.
A topology check for missing vertices.
ResolutionMethod
The available resolutions for missing vertex check.
A class to represent a 2D point.
Definition qgspointxy.h:60
Point geometry type, with support for z-dimension and m-values.
Definition qgspoint.h:49
A rectangle specified with double values.
Represents a vector layer which manages a vector based data sets.
#define SIP_SKIP
Definition qgis_sip.h:126
void CPL_STDCALL collectErrors(CPLErr, int, const char *msg)
Utility class for identifying a unique vertex within a geometry.
Definition qgsvertexid.h:30