Skip to content

Commit

Permalink
Update sip bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Apr 29, 2016
1 parent caad989 commit bd6d22d
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 7 deletions.
6 changes: 6 additions & 0 deletions python/core/geometry/qgsabstractgeometryv2.sip
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions python/core/geometry/qgslinestringv2.sip
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions python/core/geometry/qgsmultilinestringv2.sip
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions python/core/geometry/qgsmultipolygonv2.sip
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions python/core/geometry/qgspolygonv2.sip
Original file line number Diff line number Diff line change
Expand Up @@ -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/ );
Expand Down
3 changes: 2 additions & 1 deletion src/core/geometry/qgsabstractgeometryv2.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/core/geometry/qgslinestringv2.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/core/geometry/qgsmultilinestringv2.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion src/core/geometry/qgsmultipolygonv2.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion src/core/geometry/qgspolygonv2.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsvectorlayereditbuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,6 @@ class CORE_EXPORT QgsVectorLayerEditBuffer : public QObject

void updateLayerFields();

QgsAbstractGeometryV2* outputGeometry( QgsAbstractGeometryV2* geom ) const;

protected:
QgsVectorLayer* L;
friend class QgsVectorLayer;
Expand Down Expand Up @@ -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

0 comments on commit bd6d22d

Please sign in to comment.