Skip to content

Commit 65f6e7b

Browse files
committed
Doxymenation for gap checks
1 parent 2ad870b commit 65f6e7b

File tree

3 files changed

+224
-11
lines changed

3 files changed

+224
-11
lines changed

python/analysis/auto_generated/vector/geometry_checker/qgsgeometrycheckerror.sip.in

+97-2
Original file line numberDiff line numberDiff line change
@@ -27,34 +27,120 @@ This represents an error reported by a geometry check.
2727
#include "qgsgeometrycheckerror.h"
2828
%End
2929
public:
30-
enum Status { StatusPending, StatusFixFailed, StatusFixed, StatusObsolete };
31-
enum ValueType { ValueLength, ValueArea, ValueOther };
30+
31+
enum Status
32+
{
33+
StatusPending,
34+
StatusFixFailed,
35+
StatusFixed,
36+
StatusObsolete
37+
};
38+
39+
enum ValueType
40+
{
41+
ValueLength,
42+
ValueArea,
43+
ValueOther
44+
};
3245

3346
QgsGeometryCheckError( const QgsGeometryCheck *check,
3447
const QgsGeometryCheckerUtils::LayerFeature &layerFeature,
3548
const QgsPointXY &errorLocation,
3649
QgsVertexId vidx = QgsVertexId(),
3750
const QVariant &value = QVariant(),
3851
ValueType valueType = ValueOther );
52+
%Docstring
53+
Create a new geometry check error with the parent ``check`` and for the
54+
``layerFeature`` pair at the \errorLocation. Optionally the vertex can be
55+
specified via ``vixd`` and a ``value`` with its ``value`` Type for
56+
additional information.
57+
%End
3958

4059
virtual ~QgsGeometryCheckError();
4160

4261

4362
const QgsGeometryCheck *check() const;
63+
%Docstring
64+
The geometry check that created this error.
65+
%End
66+
4467
const QString &layerId() const;
68+
%Docstring
69+
The id of the layer on which this error has been detected.
70+
%End
71+
4572
QgsFeatureId featureId() const;
73+
%Docstring
74+
The id of the feature on which this error has been detected.
75+
%End
76+
4677
QgsGeometry geometry() const;
78+
%Docstring
79+
The geometry of the error in map units.
80+
%End
81+
4782
virtual QgsRectangle affectedAreaBBox() const;
83+
%Docstring
84+
The bounding box of the affected area of the error.
85+
%End
86+
4887
virtual QString description() const;
88+
%Docstring
89+
The error description. By default the description of the parent check
90+
will be returned.
91+
%End
92+
4993
const QgsPointXY &location() const;
94+
%Docstring
95+
The location of the error in map units.
96+
%End
97+
5098
QVariant value() const;
99+
%Docstring
100+
An additional value for the error.
101+
Lenghts and areas are provided in map units.
102+
103+
.. seealso:: :py:func:`valueType`
104+
%End
105+
51106
ValueType valueType() const;
107+
%Docstring
108+
The type of the value.
109+
110+
.. seealso:: :py:func:`value`
111+
%End
112+
52113
const QgsVertexId &vidx() const;
114+
%Docstring
115+
The id of the affected vertex. May be valid or not, depending on the
116+
check.
117+
%End
118+
53119
Status status() const;
120+
%Docstring
121+
The status of the error.
122+
%End
123+
54124
QString resolutionMessage() const;
125+
%Docstring
126+
A message with details, how the error has been resolved.
127+
%End
128+
55129
void setFixed( int method );
130+
%Docstring
131+
Set the status to fixed and specify the ``method`` that has been used to
132+
fix the error.
133+
%End
134+
56135
void setFixFailed( const QString &reason );
136+
%Docstring
137+
Set the error status to failed and specify the ``reason`` for failure.
138+
%End
139+
57140
void setObsolete();
141+
%Docstring
142+
Set the error status to obsolete.
143+
%End
58144

59145
virtual bool isEqual( QgsGeometryCheckError *other ) const;
60146
%Docstring
@@ -77,6 +163,7 @@ Will be used to update existing errors whenever they are re-checked.
77163

78164

79165
protected:
166+
80167
QgsGeometryCheckError( const QgsGeometryCheck *check,
81168
const QString &layerId,
82169
QgsFeatureId featureId,
@@ -85,6 +172,14 @@ Will be used to update existing errors whenever they are re-checked.
85172
QgsVertexId vidx = QgsVertexId(),
86173
const QVariant &value = QVariant(),
87174
ValueType valueType = ValueOther );
175+
%Docstring
176+
Create a new geometry check error with the parent ``check`` and for the
177+
layer with ``layerId`` and ``featureId``.
178+
The ``geometry`` of the error and the ``errorLocation`` need to be
179+
specified in map coordiantes.
180+
Optionally the vertex can be specified via ``vixd`` and a ``value`` with
181+
its ``value`` Type for additional information.
182+
%End
88183

89184

90185
};

src/analysis/vector/geometry_checker/qgsgeometrycheckerror.h

+101-7
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,34 @@ class QgsPointXY;
3535
class ANALYSIS_EXPORT QgsGeometryCheckError
3636
{
3737
public:
38-
enum Status { StatusPending, StatusFixFailed, StatusFixed, StatusObsolete };
39-
enum ValueType { ValueLength, ValueArea, ValueOther };
4038

39+
/**
40+
* The status of an error.
41+
*/
42+
enum Status
43+
{
44+
StatusPending, //!< The error is detected and pending to be handled
45+
StatusFixFailed, //!< A fix has been tried on the error but failed
46+
StatusFixed, //!< The error is fixed
47+
StatusObsolete //!< The error is obsolete because of other modifications
48+
};
49+
50+
/**
51+
* Describes the type of an error value.
52+
*/
53+
enum ValueType
54+
{
55+
ValueLength, //!< The value is a length
56+
ValueArea, //!< The value is an area
57+
ValueOther //!< The value if of another type
58+
};
59+
60+
/**
61+
* Create a new geometry check error with the parent \a check and for the
62+
* \a layerFeature pair at the \errorLocation. Optionally the vertex can be
63+
* specified via \a vixd and a \a value with its \a value Type for
64+
* additional information.
65+
*/
4166
QgsGeometryCheckError( const QgsGeometryCheck *check,
4267
const QgsGeometryCheckerUtils::LayerFeature &layerFeature,
4368
const QgsPointXY &errorLocation,
@@ -49,24 +74,85 @@ class ANALYSIS_EXPORT QgsGeometryCheckError
4974

5075
const QgsGeometryCheckError &operator=( const QgsGeometryCheckError & ) = delete;
5176

77+
/**
78+
* The geometry check that created this error.
79+
*/
5280
const QgsGeometryCheck *check() const { return mCheck; }
81+
82+
/**
83+
* The id of the layer on which this error has been detected.
84+
*/
5385
const QString &layerId() const { return mLayerId; }
86+
87+
/**
88+
* The id of the feature on which this error has been detected.
89+
*/
5490
QgsFeatureId featureId() const { return mFeatureId; }
55-
// In map units
91+
92+
/**
93+
* The geometry of the error in map units.
94+
*/
5695
QgsGeometry geometry() const;
57-
// In map units
96+
97+
/**
98+
* The bounding box of the affected area of the error.
99+
*/
58100
virtual QgsRectangle affectedAreaBBox() const;
101+
102+
/**
103+
* The error description. By default the description of the parent check
104+
* will be returned.
105+
*/
59106
virtual QString description() const { return mCheck->description(); }
60-
// In map units
107+
108+
/**
109+
* The location of the error in map units.
110+
*/
61111
const QgsPointXY &location() const { return mErrorLocation; }
62-
// Lengths, areas in map units
112+
113+
/**
114+
* An additional value for the error.
115+
* Lenghts and areas are provided in map units.
116+
* \see valueType()
117+
*/
63118
QVariant value() const { return mValue; }
119+
120+
/**
121+
* The type of the value.
122+
* \see value()
123+
*/
64124
ValueType valueType() const { return mValueType; }
125+
126+
/**
127+
* The id of the affected vertex. May be valid or not, depending on the
128+
* check.
129+
*/
65130
const QgsVertexId &vidx() const { return mVidx; }
131+
132+
/**
133+
* The status of the error.
134+
*/
66135
Status status() const { return mStatus; }
136+
137+
/**
138+
* A message with details, how the error has been resolved.
139+
*/
67140
QString resolutionMessage() const { return mResolutionMessage; }
141+
142+
/**
143+
* Set the status to fixed and specify the \a method that has been used to
144+
* fix the error.
145+
*/
68146
void setFixed( int method );
147+
148+
/**
149+
* Set the error status to failed and specify the \a reason for failure.
150+
*/
69151
void setFixFailed( const QString &reason );
152+
153+
/**
154+
* Set the error status to obsolete.
155+
*/
70156
void setObsolete() { mStatus = StatusObsolete; }
71157

72158
/**
@@ -94,7 +180,15 @@ class ANALYSIS_EXPORT QgsGeometryCheckError
94180
virtual bool handleChanges( const QgsGeometryCheck::Changes &changes ) SIP_SKIP;
95181

96182
protected:
97-
// Users of this constructor must ensure geometry and errorLocation are in map coordinates
183+
184+
/**
185+
* Create a new geometry check error with the parent \a check and for the
186+
* layer with \a layerId and \a featureId.
187+
* The \a geometry of the error and the \a errorLocation need to be
188+
* specified in map coordiantes.
189+
* Optionally the vertex can be specified via \a vixd and a \a value with
190+
* its \a value Type for additional information.
191+
*/
98192
QgsGeometryCheckError( const QgsGeometryCheck *check,
99193
const QString &layerId,
100194
QgsFeatureId featureId,

src/analysis/vector/geometry_checker/qgsgeometrygapcheck.h

+26-2
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,22 @@
2222
#include "qgsgeometrycheckerror.h"
2323
#include "qgsfeatureid.h"
2424

25+
/**
26+
* \ingroup analysis
27+
* An error produced by a QgsGeometryGapCheck.
28+
*
29+
* \since QGIS 3.4
30+
*/
2531
class ANALYSIS_EXPORT QgsGeometryGapCheckError : public QgsGeometryCheckError
2632
{
2733
public:
34+
35+
/**
36+
* Create a new gap check error produced by \a check on the layer \a layerId.
37+
* The \a geometry of the gap needs to be in map coordinates.
38+
* The \a neighbors are a map of layer ids and feature ids.
39+
* The \a area of the gap in map units and the bounding box of the gap in map units too.
40+
*/
2841
QgsGeometryGapCheckError( const QgsGeometryCheck *check,
2942
const QString &layerId,
3043
const QgsGeometry &geometry,
@@ -36,6 +49,10 @@ class ANALYSIS_EXPORT QgsGeometryGapCheckError : public QgsGeometryCheckError
3649
, mGapAreaBBox( gapAreaBBox )
3750
{
3851
}
52+
53+
/**
54+
* A map of layers and feature ids of the neighbors of the gap.
55+
*/
3956
const QMap<QString, QgsFeatureIds> &neighbors() const { return mNeighbors; }
4057

4158
bool isEqual( QgsGeometryCheckError *other ) const override
@@ -74,15 +91,22 @@ class ANALYSIS_EXPORT QgsGeometryGapCheckError : public QgsGeometryCheckError
7491
QgsRectangle mGapAreaBBox;
7592
};
7693

94+
95+
/**
96+
* \ingroup analysis
97+
* Checks for gaps between neighbouring polygons.
98+
*
99+
* \since QGIS 3.4
100+
*/
77101
class ANALYSIS_EXPORT QgsGeometryGapCheck : public QgsGeometryCheck
78102
{
79103
Q_GADGET
80104
public:
81105
//! Resolution methods for geometry gap checks
82106
enum ResolutionMethod
83107
{
84-
MergeLongestEdge,
85-
NoChange
108+
MergeLongestEdge, //!< Merge the gap with the polygon with the longest shared edge.
109+
NoChange //!< Do not handle the error.
86110
};
87111
Q_ENUM( ResolutionMethod )
88112

0 commit comments

Comments
 (0)