Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add TODO QGIS 3 comments
  • Loading branch information
Hugo Mercier committed Feb 16, 2016
1 parent 6365eb7 commit 103856c
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/core/geometry/qgsgeometry.h
Expand Up @@ -321,11 +321,13 @@ class CORE_EXPORT QgsGeometry
/** Adds a new ring to this geometry. This makes only sense for polygon and multipolygons.
@return 0 in case of success (ring added), 1 problem with geometry type, 2 ring not closed,
3 ring is not valid geometry, 4 ring not disjoint with existing rings, 5 no polygon found which contained the ring*/
// TODO QGIS 3.0 returns an enum instead of a magic constant

This comment has been minimized.

Copy link
@m-kuhn

m-kuhn Mar 1, 2016

Member

I don't think this needs to be tied to QGIS 3 if the values of the enum match the current return value.

int addRing( const QList<QgsPoint>& ring );

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

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

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

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

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

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

/** Translate this geometry by dx, dy
Expand Down Expand Up @@ -393,6 +400,7 @@ class CORE_EXPORT QgsGeometry
@param topological true if topological editing is enabled
@param[out] topologyTestPoints points that need to be tested for topological completeness in the dataset
@return 0 in case of success, 1 if geometry has not been split, error else*/
// TODO QGIS 3.0 returns an enum instead of a magic constant
int splitGeometry( const QList<QgsPoint>& splitLine,
QList<QgsGeometry*>&newGeometries,
bool topological,
Expand Down
2 changes: 2 additions & 0 deletions src/core/geometry/qgsgeometryeditutils.h
Expand Up @@ -37,11 +37,13 @@ class QgsGeometryEditUtils
/** Adds interior ring (taking ownership).
@return 0 in case of success (ring added), 1 problem with geometry type, 2 ring not closed,
3 ring is not valid geometry, 4 ring not disjoint with existing rings, 5 no polygon found which contained the ring*/
// TODO QGIS 3.0 returns an enum instead of a magic constant
static int addRing( QgsAbstractGeometryV2* geom, QgsCurveV2* ring );

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

/** Deletes a ring from a geometry.
Expand Down
6 changes: 6 additions & 0 deletions src/core/qgsvectorlayer.h
Expand Up @@ -953,6 +953,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
* 5 no feature found where ring can be inserted
* 6 layer not editable
*/
// TODO QGIS 3.0 returns an enum instead of a magic constant
int addRing( const QList<QgsPoint>& ring, QgsFeatureId* featureId = nullptr );

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

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

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

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

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

/** Changes the specified geometry such that it has no intersections with other
Expand Down
7 changes: 7 additions & 0 deletions src/core/qgsvectorlayereditutils.h
Expand Up @@ -76,6 +76,7 @@ class CORE_EXPORT QgsVectorLayerEditUtils
* 4 ring crosses existing rings,
* 5 no feature found where ring can be inserted
*/
// TODO QGIS 3.0 returns an enum instead of a magic constant
int addRing( const QList<QgsPoint>& ring, const QgsFeatureIds& targetFeatureIds = QgsFeatureIds(), QgsFeatureId* modifiedFeatureId = nullptr );

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

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

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

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

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

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

/** Adds topological points for every vertex of the geometry.
Expand Down
6 changes: 6 additions & 0 deletions src/gui/qgsmaptoolcapture.h
Expand Up @@ -98,6 +98,7 @@ class GUI_EXPORT QgsMapToolCapture : public QgsMapToolAdvancedDigitizing
* 2 if the transformation failed
* @deprecated use nextPoint(const QgsPointV2&, QgsPointV2&)
*/
// TODO QGIS 3.0 returns an enum instead of a magic constant
Q_DECL_DEPRECATED int nextPoint( const QgsPoint& mapPoint, QgsPoint& layerPoint );

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

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

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

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

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

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

0 comments on commit 103856c

Please sign in to comment.