16 #ifndef QGS_GEOMETRY_CHECK_H
17 #define QGS_GEOMETRY_CHECK_H
19 #include <QApplication>
21 #include <QStringList>
24 #include "qgis_analysis.h"
112 QMap<QString, QgsFeatureIds>
toMap()
const
119 return ids.isEmpty();
166 AvailableInValidation = 1 << 1
168 Q_DECLARE_FLAGS( Flags, Flag )
207 return what == other.
what && type == other.
type && vidx == other.
vidx;
212 return !( *
this == other );
220 typedef QMap<QString, QMap<QgsFeatureId, QList<QgsGeometryCheck::Change> > >
Changes;
244 return mConfiguration.value( name,
QgsSettings().value(
"/geometry_checker/" +
id() +
"/" + name, defaultValue ) ).value<T>();
266 virtual QgsGeometryCheck::Flags flags()
const;
292 virtual QList<QgsGeometryCheckResolutionMethod> availableResolutionMethods()
const;
301 Q_DECL_DEPRECATED
virtual QStringList resolutionMethods() const
SIP_DEPRECATED;
308 virtual QString description() const = 0;
315 virtual QString
id() const = 0;
339 QMap<QString, QgsFeatureIds> allLayerFeatureIds(
const QMap<QString, QgsFeaturePool *> &featurePools )
const SIP_SKIP;
347 void replaceFeatureGeometryPart(
const QMap<QString, QgsFeaturePool *> &featurePools,
const QString &layerId,
QgsFeature &feature,
int partIdx,
QgsAbstractGeometry *newPartGeom, Changes &changes )
const SIP_SKIP;
355 void deleteFeatureGeometryPart(
const QMap<QString, QgsFeaturePool *> &featurePools,
const QString &layerId,
QgsFeature &feature,
int partIdx, Changes &changes )
const SIP_SKIP;
363 void deleteFeatureGeometryRing(
const QMap<QString, QgsFeaturePool *> &featurePools,
const QString &layerId,
QgsFeature &feature,
int partIdx,
int ringIdx, Changes &changes )
const SIP_SKIP;
374 double scaleFactor(
const QPointer<QgsVectorLayer> &layer )
const SIP_SKIP;
Abstract base class for all geometries.
A feature pool is based on a vector layer and caches features.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Base configuration for geometry checks.
This represents an error reported by a geometry check.
This class implements a geometry check.
QMap< QString, QMap< QgsFeatureId, QList< QgsGeometryCheck::Change > > > Changes
A collection of changes.
virtual void collectErrors(const QMap< QString, QgsFeaturePool * > &featurePools, QList< QgsGeometryCheckError * > &errors, QStringList &messages, QgsFeedback *feedback, const LayerFeatureIds &ids=QgsGeometryCheck::LayerFeatureIds()) const =0
The main worker method.
T configurationValue(const QString &name, const QVariant &defaultValue=QVariant())
Returns the configuration value with the name, saved in the QGIS settings for this geometry check.
const QgsGeometryCheckContext * mContext
ChangeWhat
Description of a change to indicate at which level a change occurred.
@ ChangeRing
This change happens on ring level.
@ ChangeFeature
This change happens on feature level.
@ ChangePart
This change happens on part level.
Flag
Flags for geometry checks.
CheckType
The type of a check.
@ FeatureNodeCheck
The check controls individual nodes.
@ FeatureCheck
The check controls geometries as a whole.
virtual QList< QgsWkbTypes::GeometryType > compatibleGeometryTypes() const =0
A list of geometry types for which this check can be performed.
QVariantMap mConfiguration
ChangeType
Description of the type of a change.
@ ChangeAdded
Something has been added.
@ ChangeRemoved
Something has been removed.
virtual ~QgsGeometryCheck()=default
This class is a composition of two QSettings instances:
Represents a vector layer which manages a vector based data sets.
Descripts a change to fix a geometry.
Change(QgsGeometryCheck::ChangeWhat _what, QgsGeometryCheck::ChangeType _type, QgsVertexId _vidx=QgsVertexId())
Create a new Change.
QgsGeometryCheck::ChangeType type
What action this change performs.
QgsVertexId vidx
The index of the part / ring / vertex, depending on.
QgsGeometryCheck::ChangeWhat what
What level this change affects.
bool operator==(const QgsGeometryCheck::Change &other) const
bool operator!=(const QgsGeometryCheck::Change &other) const
A list of layers and feature ids for each of these layers.
QMap< QString, QgsFeatureIds > toMap() const
LayerFeatureIds()=default
Utility class for identifying a unique vertex within a geometry.