Skip to content
Permalink
Browse files

Fix clearing multicurve should reset dimensionality

  • Loading branch information
nyalldawson committed Sep 25, 2017
1 parent b46d8d3 commit c9117fc58580ed43a9df5bd90c493cddd1ed5c88
@@ -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
@@ -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();
@@ -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.

0 comments on commit c9117fc

Please sign in to comment.
You can’t perform that action at this time.