Skip to content

Commit c9117fc

Browse files
committedSep 25, 2017
Fix clearing multicurve should reset dimensionality
1 parent b46d8d3 commit c9117fc

File tree

3 files changed

+9
-14
lines changed

3 files changed

+9
-14
lines changed
 

‎python/core/geometry/qgsmulticurve.sip

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,20 @@ class QgsMultiCurve: QgsGeometryCollection
2424

2525
virtual QgsMultiCurve *clone() const /Factory/;
2626

27-
virtual QgsMultiCurve *toCurveType() const /Factory/;
27+
virtual void clear();
2828

29+
virtual QgsMultiCurve *toCurveType() const /Factory/;
2930

3031
virtual bool fromWkt( const QString &wkt );
3132

32-
3333
virtual QDomElement asGML2( QDomDocument &doc, int precision = 17, const QString &ns = "gml" ) const;
3434

3535
virtual QDomElement asGML3( QDomDocument &doc, int precision = 17, const QString &ns = "gml" ) const;
3636

3737
virtual QString asJSON( int precision = 17 ) const;
3838

39-
4039
virtual bool addGeometry( QgsAbstractGeometry *g /Transfer/ );
4140

42-
%Docstring
43-
Adds a geometry and takes ownership. Returns true in case of success
44-
:rtype: bool
45-
%End
4641

4742
QgsMultiCurve *reversed() const /Factory/;
4843
%Docstring

‎src/core/geometry/qgsmulticurve.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ QgsMultiCurve *QgsMultiCurve::clone() const
3838
return new QgsMultiCurve( *this );
3939
}
4040

41+
void QgsMultiCurve::clear()
42+
{
43+
QgsGeometryCollection::clear();
44+
mWkbType = QgsWkbTypes::MultiCurve;
45+
}
46+
4147
QgsMultiCurve *QgsMultiCurve::toCurveType() const
4248
{
4349
return clone();

‎src/core/geometry/qgsmulticurve.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,12 @@ class CORE_EXPORT QgsMultiCurve: public QgsGeometryCollection
3131
QgsMultiCurve();
3232
QString geometryType() const override;
3333
QgsMultiCurve *clone() const override SIP_FACTORY;
34+
void clear() override;
3435
QgsMultiCurve *toCurveType() const override SIP_FACTORY;
35-
3636
bool fromWkt( const QString &wkt ) override;
37-
38-
// inherited: int wkbSize() const;
39-
// inherited: unsigned char* asWkb( int& binarySize ) const;
40-
// inherited: QString asWkt( int precision = 17 ) const;
4137
QDomElement asGML2( QDomDocument &doc, int precision = 17, const QString &ns = "gml" ) const override;
4238
QDomElement asGML3( QDomDocument &doc, int precision = 17, const QString &ns = "gml" ) const override;
4339
QString asJSON( int precision = 17 ) const override;
44-
45-
//! Adds a geometry and takes ownership. Returns true in case of success
4640
bool addGeometry( QgsAbstractGeometry *g SIP_TRANSFER ) override;
4741

4842
/** Returns a copy of the multi curve, where each component curve has had its line direction reversed.

0 commit comments

Comments
 (0)
Please sign in to comment.