diff --git a/python/core/geometry/qgsabstractgeometryv2.sip b/python/core/geometry/qgsabstractgeometryv2.sip index 3cd3ab502c1..aa66e56d2f1 100644 --- a/python/core/geometry/qgsabstractgeometryv2.sip +++ b/python/core/geometry/qgsabstractgeometryv2.sip @@ -306,6 +306,12 @@ class QgsAbstractGeometryV2 */ virtual QgsAbstractGeometryV2* segmentize() const /Factory/; + /** Returns the geometry converted to the more generic curve type. + E.g. QgsLineStringV2 -> QgsCompoundCurveV2, QgsPolygonV2 -> QgsCurvePolygonV2, + QgsMultiLineStringV2 -> QgsMultiCurveV2, QgsMultiPolygonV2 -> QgsMultiSurfaceV2 + @return the converted geometry. Caller takes ownership*/ + virtual QgsAbstractGeometryV2* toCurveType() const /Factory/; + /** Returns approximate angle at a vertex. This is usually the average angle between adjacent * segments, and can be pictured as the orientation of a line following the curvature of the * geometry at the specified vertex. diff --git a/python/core/geometry/qgslinestringv2.sip b/python/core/geometry/qgslinestringv2.sip index fad5fca934c..dc5ead486bb 100644 --- a/python/core/geometry/qgslinestringv2.sip +++ b/python/core/geometry/qgslinestringv2.sip @@ -106,6 +106,10 @@ class QgsLineStringV2: public QgsCurveV2 */ QPolygonF asQPolygonF() const; + /** Returns the geometry converted to the more generic curve type QgsCompoundCurveV2 + @return the converted geometry. Caller takes ownership*/ + QgsAbstractGeometryV2* toCurveType() const /Factory/; + //reimplemented methods virtual QString geometryType() const; diff --git a/python/core/geometry/qgsmultilinestringv2.sip b/python/core/geometry/qgsmultilinestringv2.sip index c1833e74975..f42c39ec53c 100644 --- a/python/core/geometry/qgsmultilinestringv2.sip +++ b/python/core/geometry/qgsmultilinestringv2.sip @@ -20,6 +20,10 @@ class QgsMultiLineStringV2: public QgsMultiCurveV2 /** Adds a geometry and takes ownership. Returns true in case of success*/ virtual bool addGeometry( QgsAbstractGeometryV2* g ); + /** Returns the geometry converted to the more generic curve type QgsMultiCurveV2 + @return the converted geometry. Caller takes ownership*/ + QgsAbstractGeometryV2* toCurveType() const /Factory/; + protected: virtual bool wktOmitChildType() const; diff --git a/python/core/geometry/qgsmultipolygonv2.sip b/python/core/geometry/qgsmultipolygonv2.sip index 26392e2e1e7..f5d5ebd4e31 100644 --- a/python/core/geometry/qgsmultipolygonv2.sip +++ b/python/core/geometry/qgsmultipolygonv2.sip @@ -20,6 +20,10 @@ class QgsMultiPolygonV2: public QgsMultiSurfaceV2 /** Adds a geometry and takes ownership. Returns true in case of success*/ virtual bool addGeometry( QgsAbstractGeometryV2* g ); + /** Returns the geometry converted to the more generic curve type QgsMultiSurfaceV2 + @return the converted geometry. Caller takes ownership*/ + QgsAbstractGeometryV2* toCurveType() const /Factory/; + protected: virtual bool wktOmitChildType() const; diff --git a/python/core/geometry/qgspolygonv2.sip b/python/core/geometry/qgspolygonv2.sip index f52273e6589..fb38cd87372 100644 --- a/python/core/geometry/qgspolygonv2.sip +++ b/python/core/geometry/qgspolygonv2.sip @@ -26,6 +26,10 @@ class QgsPolygonV2: public QgsCurvePolygonV2 QgsPolygonV2* surfaceToPolygon() const; + /** Returns the geometry converted to the more generic curve type QgsCurvePolygonV2 + @return the converted geometry. Caller takes ownership*/ + QgsAbstractGeometryV2* toCurveType() const /Factory/; + void addInteriorRing( QgsCurveV2* ring /Transfer/ ); //overridden to handle LineString25D rings virtual void setExteriorRing( QgsCurveV2* ring /Transfer/ ); diff --git a/src/core/geometry/qgsabstractgeometryv2.h b/src/core/geometry/qgsabstractgeometryv2.h index 9057cebadd1..5863a97cc8e 100644 --- a/src/core/geometry/qgsabstractgeometryv2.h +++ b/src/core/geometry/qgsabstractgeometryv2.h @@ -294,7 +294,8 @@ class CORE_EXPORT QgsAbstractGeometryV2 /** Returns the geometry converted to the more generic curve type. E.g. QgsLineStringV2 -> QgsCompoundCurveV2, QgsPolygonV2 -> QgsCurvePolygonV2, - QgsMultiLineStringV2 -> QgsMultiCurveV2, QgsMultiPolygonV2 -> QgsMultiSurfaceV2*/ + QgsMultiLineStringV2 -> QgsMultiCurveV2, QgsMultiPolygonV2 -> QgsMultiSurfaceV2 + @return the converted geometry. Caller takes ownership*/ virtual QgsAbstractGeometryV2* toCurveType() const { return 0; } /** Returns approximate angle at a vertex. This is usually the average angle between adjacent diff --git a/src/core/geometry/qgslinestringv2.h b/src/core/geometry/qgslinestringv2.h index 16677d56287..76e250d3b45 100644 --- a/src/core/geometry/qgslinestringv2.h +++ b/src/core/geometry/qgslinestringv2.h @@ -132,7 +132,8 @@ class CORE_EXPORT QgsLineStringV2: public QgsCurveV2 */ QPolygonF asQPolygonF() const; - /** Returns the geometry converted to QgsCompoundCurveV2*/ + /** Returns the geometry converted to the more generic curve type QgsCompoundCurveV2 + @return the converted geometry. Caller takes ownership*/ QgsAbstractGeometryV2* toCurveType() const override; //reimplemented methods diff --git a/src/core/geometry/qgsmultilinestringv2.h b/src/core/geometry/qgsmultilinestringv2.h index 6e28ad4728d..1516893d34a 100644 --- a/src/core/geometry/qgsmultilinestringv2.h +++ b/src/core/geometry/qgsmultilinestringv2.h @@ -42,7 +42,8 @@ class CORE_EXPORT QgsMultiLineStringV2: public QgsMultiCurveV2 /** Adds a geometry and takes ownership. Returns true in case of success*/ virtual bool addGeometry( QgsAbstractGeometryV2* g ) override; - /** Returns the geometry converted to QgsMultiCurveV2*/ + /** Returns the geometry converted to the more generic curve type QgsMultiCurveV2 + @return the converted geometry. Caller takes ownership*/ QgsAbstractGeometryV2* toCurveType() const override; protected: diff --git a/src/core/geometry/qgsmultipolygonv2.h b/src/core/geometry/qgsmultipolygonv2.h index 176dfd14e47..e6bb7585083 100644 --- a/src/core/geometry/qgsmultipolygonv2.h +++ b/src/core/geometry/qgsmultipolygonv2.h @@ -43,7 +43,8 @@ class CORE_EXPORT QgsMultiPolygonV2: public QgsMultiSurfaceV2 /** Adds a geometry and takes ownership. Returns true in case of success*/ virtual bool addGeometry( QgsAbstractGeometryV2* g ) override; - /** Returns the geometry converted to QgsMultiSurfaceV2*/ + /** Returns the geometry converted to the more generic curve type QgsMultiSurfaceV2 + @return the converted geometry. Caller takes ownership*/ QgsAbstractGeometryV2* toCurveType() const override; protected: diff --git a/src/core/geometry/qgspolygonv2.h b/src/core/geometry/qgspolygonv2.h index 1f0c125f270..031a0428a28 100644 --- a/src/core/geometry/qgspolygonv2.h +++ b/src/core/geometry/qgspolygonv2.h @@ -50,7 +50,8 @@ class CORE_EXPORT QgsPolygonV2: public QgsCurvePolygonV2 QgsPolygonV2* surfaceToPolygon() const override; - /** Returns the geometry converted to QgsCurvePolygonV2*/ + /** Returns the geometry converted to the more generic curve type QgsCurvePolygonV2 + @return the converted geometry. Caller takes ownership*/ QgsAbstractGeometryV2* toCurveType() const override; void addInteriorRing( QgsCurveV2* ring ) override; diff --git a/src/core/qgsvectorlayereditbuffer.h b/src/core/qgsvectorlayereditbuffer.h index 8f2abb8e2bf..8f52849b6ca 100644 --- a/src/core/qgsvectorlayereditbuffer.h +++ b/src/core/qgsvectorlayereditbuffer.h @@ -156,8 +156,6 @@ class CORE_EXPORT QgsVectorLayerEditBuffer : public QObject void updateLayerFields(); - QgsAbstractGeometryV2* outputGeometry( QgsAbstractGeometryV2* geom ) const; - protected: QgsVectorLayer* L; friend class QgsVectorLayer; @@ -191,6 +189,8 @@ class CORE_EXPORT QgsVectorLayerEditBuffer : public QObject /** Changed geometries which are not commited. */ QgsGeometryMap mChangedGeometries; + private: + QgsAbstractGeometryV2* outputGeometry( QgsAbstractGeometryV2* geom ) const; }; #endif // QGSVECTORLAYEREDITBUFFER_H