Skip to content
Permalink
Browse files

Fix in-place support check for some more algs

  • Loading branch information
elpaso authored and nyalldawson committed Sep 14, 2018
1 parent 7b162b5 commit 08fbf38a8897b022a446a7b5c6f2507e3ff627f1
@@ -105,3 +105,6 @@ def processFeature(self, feature, context, feedback):
feature.setGeometry(QgsGeometry(new_geom))

return [feature]

def supportInPlaceEdit(self, layer):
return super().supportInPlaceEdit(layer) and QgsWkbTypes.hasM(layer.wkbType())
@@ -105,3 +105,6 @@ def processFeature(self, feature, context, feedback):
feature.setGeometry(QgsGeometry(new_geom))

return [feature]

def supportInPlaceEdit(self, layer):
return super().supportInPlaceEdit(layer) and QgsWkbTypes.hasZ(layer.wkbType())
@@ -16,6 +16,7 @@
***************************************************************************/

#include "qgsalgorithmfiltervertices.h"
#include "qgsvectorlayer.h"

///@cond PRIVATE

@@ -135,6 +136,13 @@ QgsFilterVerticesByM *QgsFilterVerticesByM::createInstance() const
return new QgsFilterVerticesByM();
}

bool QgsFilterVerticesByM::supportInPlaceEdit( const QgsVectorLayer *layer ) const
{
if ( ! QgsFilterVerticesAlgorithmBase::supportInPlaceEdit( layer ) )
return false;
return QgsWkbTypes::hasM( layer->wkbType() );
}

QString QgsFilterVerticesByM::componentString() const
{
return QObject::tr( "m-value" );
@@ -174,6 +182,13 @@ QgsFilterVerticesByZ *QgsFilterVerticesByZ::createInstance() const
return new QgsFilterVerticesByZ();
}

bool QgsFilterVerticesByZ::supportInPlaceEdit( const QgsVectorLayer *layer ) const
{
if ( ! QgsFilterVerticesAlgorithmBase::supportInPlaceEdit( layer ) )
return false;
return QgsWkbTypes::hasZ( layer->wkbType() );
}

QString QgsFilterVerticesByZ::componentString() const
{
return QObject::tr( "z-value" );
@@ -72,11 +72,13 @@ class QgsFilterVerticesByM : public QgsFilterVerticesAlgorithmBase
QString displayName() const override;
QStringList tags() const override;
QgsFilterVerticesByM *createInstance() const override SIP_FACTORY;
bool supportInPlaceEdit( const QgsVectorLayer *layer ) const override;

private:

QString componentString() const override;
void filter( QgsGeometry &geometry, double min, double max ) const override;

};


@@ -93,6 +95,7 @@ class QgsFilterVerticesByZ : public QgsFilterVerticesAlgorithmBase
QString displayName() const override;
QStringList tags() const override;
QgsFilterVerticesByZ *createInstance() const override SIP_FACTORY;
bool supportInPlaceEdit( const QgsVectorLayer *layer ) const override;

private:

@@ -16,6 +16,7 @@
***************************************************************************/

#include "qgsalgorithmpromotetomultipart.h"
#include "qgsvectorlayer.h"

///@cond PRIVATE

@@ -65,6 +66,13 @@ QgsPromoteToMultipartAlgorithm *QgsPromoteToMultipartAlgorithm::createInstance()
return new QgsPromoteToMultipartAlgorithm();
}

bool QgsPromoteToMultipartAlgorithm::supportInPlaceEdit( const QgsVectorLayer *layer ) const
{
if ( ! QgsProcessingFeatureBasedAlgorithm::supportInPlaceEdit( layer ) )
return false;
return QgsWkbTypes::isMultiType( layer->wkbType() );
}

QgsWkbTypes::Type QgsPromoteToMultipartAlgorithm::outputWkbType( QgsWkbTypes::Type inputWkbType ) const
{
return QgsWkbTypes::multiType( inputWkbType );
@@ -44,6 +44,7 @@ class QgsPromoteToMultipartAlgorithm : public QgsProcessingFeatureBasedAlgorithm
QString groupId() const override;
QString shortHelpString() const override;
QgsPromoteToMultipartAlgorithm *createInstance() const override SIP_FACTORY;
bool supportInPlaceEdit( const QgsVectorLayer *layer ) const override;

protected:
QString outputName() const override;

0 comments on commit 08fbf38

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