From f2d4d877ecf92661c87b5bf7d70fcb699cc570ba Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Sat, 22 Dec 2018 11:04:13 +0100 Subject: [PATCH] Overlap check documentation --- .../qgsgeometryoverlapcheck.h | 32 +++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/src/analysis/vector/geometry_checker/qgsgeometryoverlapcheck.h b/src/analysis/vector/geometry_checker/qgsgeometryoverlapcheck.h index fcaa05d09cb..b7806435d18 100644 --- a/src/analysis/vector/geometry_checker/qgsgeometryoverlapcheck.h +++ b/src/analysis/vector/geometry_checker/qgsgeometryoverlapcheck.h @@ -21,7 +21,12 @@ #include "qgsgeometrycheck.h" #include "qgsgeometrycheckerror.h" - +/** + * \ingroup analysis + * An error of a QgsGeometryOverlapCheck. + * + * \since QGIS 3.4 + */ class ANALYSIS_EXPORT QgsGeometryOverlapCheckError : public QgsGeometryCheckError { public: @@ -46,12 +51,22 @@ class ANALYSIS_EXPORT QgsGeometryOverlapCheckError : public QgsGeometryCheckErro QgsFeatureId mFeatureId; }; + /** + * Creates a new overlap check error for \a check and the \a layerFeature combination. + * The \a geometry and \a errorLocation ned to be in map coordinates. + * The \a value is the area of the overlapping area in map units. + * The \a overlappedFeature provides more details about the overlap. + */ QgsGeometryOverlapCheckError( const QgsGeometryCheck *check, const QgsGeometryCheckerUtils::LayerFeature &layerFeature, const QgsGeometry &geometry, const QgsPointXY &errorLocation, const QVariant &value, const QgsGeometryCheckerUtils::LayerFeature &overlappedFeature ); + + /** + * Returns the overlapped feature + */ const OverlappedFeature &overlappedFeature() const { return mOverlappedFeature; } bool isEqual( QgsGeometryCheckError *other ) const override @@ -90,11 +105,24 @@ class ANALYSIS_EXPORT QgsGeometryOverlapCheckError : public QgsGeometryCheckErro OverlappedFeature mOverlappedFeature; }; +/** + * \ingroup analysis + * Checks if geometries overlap. + * + * \since QGIS 3.4 + */ class ANALYSIS_EXPORT QgsGeometryOverlapCheck : public QgsGeometryCheck { public: - enum ResolutionMethod { Subtract, NoChange }; + /** + * Available resolution methods. + */ + enum ResolutionMethod + { + Subtract, //!< Subtract the overlap region from the polygon + NoChange //!< Do not change anything + }; /** * Checks for overlapping polygons.