@@ -27,34 +27,120 @@ This represents an error reported by a geometry check.
27
27
#include "qgsgeometrycheckerror.h"
28
28
%End
29
29
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
+ };
32
45
33
46
QgsGeometryCheckError( const QgsGeometryCheck *check,
34
47
const QgsGeometryCheckerUtils::LayerFeature &layerFeature,
35
48
const QgsPointXY &errorLocation,
36
49
QgsVertexId vidx = QgsVertexId(),
37
50
const QVariant &value = QVariant(),
38
51
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
39
58
40
59
virtual ~QgsGeometryCheckError();
41
60
42
61
43
62
const QgsGeometryCheck *check() const;
63
+ %Docstring
64
+ The geometry check that created this error.
65
+ %End
66
+
44
67
const QString &layerId() const;
68
+ %Docstring
69
+ The id of the layer on which this error has been detected.
70
+ %End
71
+
45
72
QgsFeatureId featureId() const;
73
+ %Docstring
74
+ The id of the feature on which this error has been detected.
75
+ %End
76
+
46
77
QgsGeometry geometry() const;
78
+ %Docstring
79
+ The geometry of the error in map units.
80
+ %End
81
+
47
82
virtual QgsRectangle affectedAreaBBox() const;
83
+ %Docstring
84
+ The bounding box of the affected area of the error.
85
+ %End
86
+
48
87
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
+
49
93
const QgsPointXY &location() const;
94
+ %Docstring
95
+ The location of the error in map units.
96
+ %End
97
+
50
98
QVariant value() const;
99
+ %Docstring
100
+ An additional value for the error.
101
+ Lengths and areas are provided in map units.
102
+
103
+ .. seealso:: :py:func:`valueType`
104
+ %End
105
+
51
106
ValueType valueType() const;
107
+ %Docstring
108
+ The type of the value.
109
+
110
+ .. seealso:: :py:func:`value`
111
+ %End
112
+
52
113
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
+
53
119
Status status() const;
120
+ %Docstring
121
+ The status of the error.
122
+ %End
123
+
54
124
QString resolutionMessage() const;
125
+ %Docstring
126
+ A message with details, how the error has been resolved.
127
+ %End
128
+
55
129
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
+
56
135
void setFixFailed( const QString &reason );
136
+ %Docstring
137
+ Set the error status to failed and specify the ``reason`` for failure.
138
+ %End
139
+
57
140
void setObsolete();
141
+ %Docstring
142
+ Set the error status to obsolete.
143
+ %End
58
144
59
145
virtual bool isEqual( QgsGeometryCheckError *other ) const;
60
146
%Docstring
@@ -71,12 +157,13 @@ If this returns true, it can be used to update existing errors after re-checking
71
157
72
158
virtual void update( const QgsGeometryCheckError *other );
73
159
%Docstring
74
- Update this error with the information from \ other.
160
+ Update this error with the information from `` other`` .
75
161
Will be used to update existing errors whenever they are re-checked.
76
162
%End
77
163
78
164
79
165
protected:
166
+
80
167
QgsGeometryCheckError( const QgsGeometryCheck *check,
81
168
const QString &layerId,
82
169
QgsFeatureId featureId,
@@ -85,6 +172,14 @@ Will be used to update existing errors whenever they are re-checked.
85
172
QgsVertexId vidx = QgsVertexId(),
86
173
const QVariant &value = QVariant(),
87
174
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 coordinates.
180
+ Optionally the vertex can be specified via ``vixd`` and a ``value`` with
181
+ its ``value`` Type for additional information.
182
+ %End
88
183
89
184
90
185
};
0 commit comments