Skip to content
Permalink
Browse files
Temporarily make QgsProcessingAlgorithm::run non pure-virtual (for tr…
…avis)
  • Loading branch information
nyalldawson committed May 10, 2017
1 parent 3706d88 commit 02b560e90d7446937e04daf39639bdf51789fb94
@@ -113,7 +113,7 @@ class QgsProcessingAlgorithm
void setProvider( QgsProcessingProvider *provider );

virtual bool run( const QVariantMap &parameters,
QgsProcessingContext &context, QgsProcessingFeedback *feedback, QVariantMap &outputs /Out/ ) const = 0;
QgsProcessingContext &context, QgsProcessingFeedback *feedback, QVariantMap &outputs /Out/ ) const;
%Docstring
Runs the algorithm using the specified ``parameters``. Algorithms should implement
their custom processing logic here.
@@ -78,7 +78,7 @@ bool QgsBufferAlgorithm::run( const QVariantMap &parameters, QgsProcessingContex
std::unique_ptr< QgsFeatureSink > writer( QgsProcessingUtils::createFeatureSink( dest, QString(), layer->fields(), QgsWkbTypes::Point, layer->crs(), context, outputLayer ) );

// fixed parameters
bool dissolve = QgsProcessingParameters::parameterAsBool( parameters, QStringLiteral( "DISSOLVE" ), context );
//bool dissolve = QgsProcessingParameters::parameterAsBool( parameters, QStringLiteral( "DISSOLVE" ), context );
int segments = QgsProcessingParameters::parameterAsInt( parameters, QStringLiteral( "DISSOLVE" ), context );
QgsGeometry::EndCapStyle endCapStyle = static_cast< QgsGeometry::EndCapStyle >( QgsProcessingParameters::parameterAsInt( parameters, QStringLiteral( "END_CAP_STYLE" ), context ) );
QgsGeometry::JoinStyle joinStyle = static_cast< QgsGeometry::JoinStyle>( QgsProcessingParameters::parameterAsInt( parameters, QStringLiteral( "JOIN_STYLE" ), context ) );
@@ -51,3 +51,8 @@ void QgsProcessingAlgorithm::setProvider( QgsProcessingProvider *provider )
{
mProvider = provider;
}

bool QgsProcessingAlgorithm::run( const QVariantMap &, QgsProcessingContext &, QgsProcessingFeedback *, QVariantMap & ) const
{
return true;
}
@@ -142,7 +142,7 @@ class CORE_EXPORT QgsProcessingAlgorithm
* \returns true if algorithm run was successful, or false if run was unsuccessful.
*/
virtual bool run( const QVariantMap &parameters,
QgsProcessingContext &context, QgsProcessingFeedback *feedback, QVariantMap &outputs SIP_OUT ) const = 0;
QgsProcessingContext &context, QgsProcessingFeedback *feedback, QVariantMap &outputs SIP_OUT ) const;

private:

0 comments on commit 02b560e

Please sign in to comment.