Skip to content

Commit 103856c

Browse files
author
Hugo Mercier
committed
Add TODO QGIS 3 comments
1 parent 6365eb7 commit 103856c

5 files changed

+29
-0
lines changed

src/core/geometry/qgsgeometry.h

+8
Original file line numberDiff line numberDiff line change
@@ -321,11 +321,13 @@ class CORE_EXPORT QgsGeometry
321321
/** Adds a new ring to this geometry. This makes only sense for polygon and multipolygons.
322322
@return 0 in case of success (ring added), 1 problem with geometry type, 2 ring not closed,
323323
3 ring is not valid geometry, 4 ring not disjoint with existing rings, 5 no polygon found which contained the ring*/
324+
// TODO QGIS 3.0 returns an enum instead of a magic constant
324325
int addRing( const QList<QgsPoint>& ring );
325326

326327
/** Adds a new ring to this geometry. This makes only sense for polygon and multipolygons.
327328
@return 0 in case of success (ring added), 1 problem with geometry type, 2 ring not closed,
328329
3 ring is not valid geometry, 4 ring not disjoint with existing rings, 5 no polygon found which contained the ring*/
330+
// TODO QGIS 3.0 returns an enum instead of a magic constant
329331
int addRing( QgsCurveV2* ring );
330332

331333
/** Adds a new part to a the geometry.
@@ -334,6 +336,7 @@ class CORE_EXPORT QgsGeometry
334336
* @returns 0 in case of success, 1 if not a multipolygon, 2 if ring is not a valid geometry, 3 if new polygon ring
335337
* not disjoint with existing polygons of the feature
336338
*/
339+
// TODO QGIS 3.0 returns an enum instead of a magic constant
337340
int addPart( const QList<QgsPoint> &points, QGis::GeometryType geomType = QGis::UnknownGeometry );
338341

339342
/** Adds a new part to a the geometry.
@@ -342,6 +345,7 @@ class CORE_EXPORT QgsGeometry
342345
* @returns 0 in case of success, 1 if not a multipolygon, 2 if ring is not a valid geometry, 3 if new polygon ring
343346
* not disjoint with existing polygons of the feature
344347
*/
348+
// TODO QGIS 3.0 returns an enum instead of a magic constant
345349
int addPart( const QList<QgsPointV2> &points, QGis::GeometryType geomType = QGis::UnknownGeometry );
346350

347351
/** Adds a new part to this geometry.
@@ -350,6 +354,7 @@ class CORE_EXPORT QgsGeometry
350354
* @returns 0 in case of success, 1 if not a multipolygon, 2 if ring is not a valid geometry, 3 if new polygon ring
351355
* not disjoint with existing polygons of the feature
352356
*/
357+
// TODO QGIS 3.0 returns an enum instead of a magic constant
353358
int addPart( QgsAbstractGeometryV2* part, QGis::GeometryType geomType = QGis::UnknownGeometry );
354359

355360
/** Adds a new island polygon to a multipolygon feature
@@ -358,13 +363,15 @@ class CORE_EXPORT QgsGeometry
358363
* not disjoint with existing polygons of the feature
359364
* @note not available in python bindings
360365
*/
366+
// TODO QGIS 3.0 returns an enum instead of a magic constant
361367
int addPart( GEOSGeometry *newPart );
362368

363369
/** Adds a new island polygon to a multipolygon feature
364370
@return 0 in case of success, 1 if not a multipolygon, 2 if ring is not a valid geometry, 3 if new polygon ring
365371
not disjoint with existing polygons of the feature
366372
@note available in python bindings as addPartGeometry (added in 2.2)
367373
*/
374+
// TODO QGIS 3.0 returns an enum instead of a magic constant
368375
int addPart( const QgsGeometry *newPart );
369376

370377
/** Translate this geometry by dx, dy
@@ -393,6 +400,7 @@ class CORE_EXPORT QgsGeometry
393400
@param topological true if topological editing is enabled
394401
@param[out] topologyTestPoints points that need to be tested for topological completeness in the dataset
395402
@return 0 in case of success, 1 if geometry has not been split, error else*/
403+
// TODO QGIS 3.0 returns an enum instead of a magic constant
396404
int splitGeometry( const QList<QgsPoint>& splitLine,
397405
QList<QgsGeometry*>&newGeometries,
398406
bool topological,

src/core/geometry/qgsgeometryeditutils.h

+2
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,13 @@ class QgsGeometryEditUtils
3737
/** Adds interior ring (taking ownership).
3838
@return 0 in case of success (ring added), 1 problem with geometry type, 2 ring not closed,
3939
3 ring is not valid geometry, 4 ring not disjoint with existing rings, 5 no polygon found which contained the ring*/
40+
// TODO QGIS 3.0 returns an enum instead of a magic constant
4041
static int addRing( QgsAbstractGeometryV2* geom, QgsCurveV2* ring );
4142

4243
/** Adds part to multi type geometry (taking ownership)
4344
@return 0 in case of success, 1 if not a multigeometry, 2 if part is not a valid geometry, 3 if new polygon ring
4445
not disjoint with existing polygons of the feature*/
46+
// TODO QGIS 3.0 returns an enum instead of a magic constant
4547
static int addPart( QgsAbstractGeometryV2* geom, QgsAbstractGeometryV2* part );
4648

4749
/** Deletes a ring from a geometry.

src/core/qgsvectorlayer.h

+6
Original file line numberDiff line numberDiff line change
@@ -953,6 +953,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
953953
* 5 no feature found where ring can be inserted
954954
* 6 layer not editable
955955
*/
956+
// TODO QGIS 3.0 returns an enum instead of a magic constant
956957
int addRing( const QList<QgsPoint>& ring, QgsFeatureId* featureId = nullptr );
957958

958959
/** Adds a ring to polygon/multipolygon features (takes ownership)
@@ -965,6 +966,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
965966
* 6 layer not editable
966967
* @note available in python as addCurvedRing
967968
*/
969+
// TODO QGIS 3.0 returns an enum instead of a magic constant
968970
int addRing( QgsCurveV2* ring, QgsFeatureId* featureId = nullptr );
969971

970972
/** Adds a new part polygon to a multipart feature
@@ -978,6 +980,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
978980
* 6 if selected geometry not found
979981
* 7 layer not editable
980982
*/
983+
// TODO QGIS 3.0 returns an enum instead of a magic constant
981984
int addPart( const QList<QgsPoint>& ring );
982985

983986
/** Adds a new part polygon to a multipart feature
@@ -992,6 +995,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
992995
* 7 layer not editable
993996
* @note available in python bindings as addPartV2
994997
*/
998+
// TODO QGIS 3.0 returns an enum instead of a magic constant
995999
int addPart( const QList<QgsPointV2>& ring );
9961000

9971001
//! @note available in python as addCurvedPart
@@ -1012,6 +1016,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
10121016
* 0 in case of success,
10131017
* 4 if there is a selection but no feature split
10141018
*/
1019+
// TODO QGIS 3.0 returns an enum instead of a magic constant
10151020
int splitParts( const QList<QgsPoint>& splitLine, bool topologicalEditing = false );
10161021

10171022
/** Splits features cut by the given line
@@ -1021,6 +1026,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
10211026
* 0 in case of success,
10221027
* 4 if there is a selection but no feature split
10231028
*/
1029+
// TODO QGIS 3.0 returns an enum instead of a magic constant
10241030
int splitFeatures( const QList<QgsPoint>& splitLine, bool topologicalEditing = false );
10251031

10261032
/** Changes the specified geometry such that it has no intersections with other

src/core/qgsvectorlayereditutils.h

+7
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ class CORE_EXPORT QgsVectorLayerEditUtils
7676
* 4 ring crosses existing rings,
7777
* 5 no feature found where ring can be inserted
7878
*/
79+
// TODO QGIS 3.0 returns an enum instead of a magic constant
7980
int addRing( const QList<QgsPoint>& ring, const QgsFeatureIds& targetFeatureIds = QgsFeatureIds(), QgsFeatureId* modifiedFeatureId = nullptr );
8081

8182
/** Adds a ring to polygon/multipolygon features
@@ -92,6 +93,7 @@ class CORE_EXPORT QgsVectorLayerEditUtils
9293
* 5 no feature found where ring can be inserted
9394
* @note available in python bindings as addCurvedRing
9495
*/
96+
// TODO QGIS 3.0 returns an enum instead of a magic constant
9597
int addRing( QgsCurveV2* ring, const QgsFeatureIds& targetFeatureIds = QgsFeatureIds(), QgsFeatureId* modifiedFeatureId = nullptr );
9698

9799
/** Adds a new part polygon to a multipart feature
@@ -104,6 +106,7 @@ class CORE_EXPORT QgsVectorLayerEditUtils
104106
* 5 if several features are selected,
105107
* 6 if selected geometry not found
106108
*/
109+
// TODO QGIS 3.0 returns an enum instead of a magic constant
107110
int addPart( const QList<QgsPoint>& ring, QgsFeatureId featureId );
108111

109112
/** Adds a new part polygon to a multipart feature
@@ -117,9 +120,11 @@ class CORE_EXPORT QgsVectorLayerEditUtils
117120
* 6 if selected geometry not found
118121
* @note available in python bindings as addPartV2
119122
*/
123+
// TODO QGIS 3.0 returns an enum instead of a magic constant
120124
int addPart( const QList<QgsPointV2>& ring, QgsFeatureId featureId );
121125

122126
// @note available in python bindings as addCurvedPart
127+
// TODO QGIS 3.0 returns an enum instead of a magic constant
123128
int addPart( QgsCurveV2* ring, QgsFeatureId featureId );
124129

125130
/** Translates feature by dx, dy
@@ -137,6 +142,7 @@ class CORE_EXPORT QgsVectorLayerEditUtils
137142
* 0 in case of success,
138143
* 4 if there is a selection but no feature split
139144
*/
145+
// TODO QGIS 3.0 returns an enum instead of a magic constant
140146
int splitParts( const QList<QgsPoint>& splitLine, bool topologicalEditing = false );
141147

142148
/** Splits features cut by the given line
@@ -146,6 +152,7 @@ class CORE_EXPORT QgsVectorLayerEditUtils
146152
* 0 in case of success,
147153
* 4 if there is a selection but no feature split
148154
*/
155+
// TODO QGIS 3.0 returns an enum instead of a magic constant
149156
int splitFeatures( const QList<QgsPoint>& splitLine, bool topologicalEditing = false );
150157

151158
/** Adds topological points for every vertex of the geometry.

src/gui/qgsmaptoolcapture.h

+6
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ class GUI_EXPORT QgsMapToolCapture : public QgsMapToolAdvancedDigitizing
9898
* 2 if the transformation failed
9999
* @deprecated use nextPoint(const QgsPointV2&, QgsPointV2&)
100100
*/
101+
// TODO QGIS 3.0 returns an enum instead of a magic constant
101102
Q_DECL_DEPRECATED int nextPoint( const QgsPoint& mapPoint, QgsPoint& layerPoint );
102103

103104
/** Converts a map point to layer coordinates
@@ -108,6 +109,7 @@ class GUI_EXPORT QgsMapToolCapture : public QgsMapToolAdvancedDigitizing
108109
* 1 if the current layer is null or not a vector layer
109110
* 2 if the transformation failed
110111
*/
112+
// TODO QGIS 3.0 returns an enum instead of a magic constant
111113
int nextPoint( const QgsPointV2& mapPoint, QgsPointV2& layerPoint );
112114

113115
/** Converts a point to map coordinates and layer coordinates
@@ -120,6 +122,7 @@ class GUI_EXPORT QgsMapToolCapture : public QgsMapToolAdvancedDigitizing
120122
* 2 if the transformation failed
121123
* @deprecated use nextPoint( const QPoint&, QgsPointV2&, QgsPointV2& )
122124
*/
125+
// TODO QGIS 3.0 returns an enum instead of a magic constant
123126
Q_DECL_DEPRECATED int nextPoint( QPoint p, QgsPoint &layerPoint, QgsPoint &mapPoint );
124127

125128
/** Converts a point to map coordinates and layer coordinates
@@ -131,18 +134,21 @@ class GUI_EXPORT QgsMapToolCapture : public QgsMapToolAdvancedDigitizing
131134
* 1 if the current layer is null or not a vector layer
132135
* 2 if the transformation failed
133136
*/
137+
// TODO QGIS 3.0 returns an enum instead of a magic constant
134138
int nextPoint( QPoint p, QgsPointV2 &layerPoint, QgsPointV2 &mapPoint );
135139

136140
/** Fetches the original point from the source layer if it has the same
137141
* CRS as the current layer.
138142
* @return 0 in case of success, 1 if not applicable (CRS mismatch), 2 in case of failure
139143
* @note added in 2.14
140144
*/
145+
// TODO QGIS 3.0 returns an enum instead of a magic constant
141146
int fetchLayerPoint( QgsPointLocator::Match match, QgsPointV2& layerPoint );
142147

143148
/** Adds a point to the rubber band (in map coordinates) and to the capture list (in layer coordinates)
144149
* @return 0 in case of success, 1 if current layer is not a vector layer, 2 if coordinate transformation failed
145150
*/
151+
// TODO QGIS 3.0 returns an enum instead of a magic constant
146152
int addVertex( const QgsPoint& point );
147153

148154
/** Variant to supply more information in the case of snapping

0 commit comments

Comments
 (0)