Skip to content

Commit

Permalink
Fix clearing multicurve should reset dimensionality
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Sep 25, 2017
1 parent b46d8d3 commit c9117fc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
9 changes: 2 additions & 7 deletions python/core/geometry/qgsmulticurve.sip
Expand Up @@ -24,25 +24,20 @@ class QgsMultiCurve: QgsGeometryCollection

virtual QgsMultiCurve *clone() const /Factory/;

virtual QgsMultiCurve *toCurveType() const /Factory/;
virtual void clear();

virtual QgsMultiCurve *toCurveType() const /Factory/;

virtual bool fromWkt( const QString &wkt );


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

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

virtual QString asJSON( int precision = 17 ) const;


virtual bool addGeometry( QgsAbstractGeometry *g /Transfer/ );

%Docstring
Adds a geometry and takes ownership. Returns true in case of success
:rtype: bool
%End

QgsMultiCurve *reversed() const /Factory/;
%Docstring
Expand Down
6 changes: 6 additions & 0 deletions src/core/geometry/qgsmulticurve.cpp
Expand Up @@ -38,6 +38,12 @@ QgsMultiCurve *QgsMultiCurve::clone() const
return new QgsMultiCurve( *this );
}

void QgsMultiCurve::clear()
{
QgsGeometryCollection::clear();
mWkbType = QgsWkbTypes::MultiCurve;
}

QgsMultiCurve *QgsMultiCurve::toCurveType() const
{
return clone();
Expand Down
8 changes: 1 addition & 7 deletions src/core/geometry/qgsmulticurve.h
Expand Up @@ -31,18 +31,12 @@ class CORE_EXPORT QgsMultiCurve: public QgsGeometryCollection
QgsMultiCurve();
QString geometryType() const override;
QgsMultiCurve *clone() const override SIP_FACTORY;
void clear() override;
QgsMultiCurve *toCurveType() const override SIP_FACTORY;

bool fromWkt( const QString &wkt ) override;

// inherited: int wkbSize() const;
// inherited: unsigned char* asWkb( int& binarySize ) const;
// inherited: QString asWkt( int precision = 17 ) const;
QDomElement asGML2( QDomDocument &doc, int precision = 17, const QString &ns = "gml" ) const override;
QDomElement asGML3( QDomDocument &doc, int precision = 17, const QString &ns = "gml" ) const override;
QString asJSON( int precision = 17 ) const override;

//! Adds a geometry and takes ownership. Returns true in case of success
bool addGeometry( QgsAbstractGeometry *g SIP_TRANSFER ) override;

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

0 comments on commit c9117fc

Please sign in to comment.