Skip to content
Permalink
Browse files

add more feedback cancellation and fix doc

  • Loading branch information
vcloarec committed Sep 10, 2020
1 parent 0f70883 commit abd5fad9ddb88249d0936f7dd43c1dfbcef19ddf
@@ -228,7 +228,7 @@ Creates a new instance of the raster data provider.
const QString &driverName,
const QgsCoordinateReferenceSystem &crs ) const;
%Docstring
Creates mesh data source (depending of the provider)
Creates mesh data source, that is the mesh frame stored in file, memory or with other way (depending of the provider)

.. versionadded:: 3.16
%End
@@ -85,6 +85,9 @@ bool QgsTinMeshCreationAlgorithm::prepareAlgorithm( const QVariantMap &parameter

for ( const QVariant &layer : layersList )
{
if ( feedback && feedback->isCanceled() )
return false;

if ( layer.type() != QVariant::Map )
continue;
const QVariantMap layerMap = layer.toMap();
@@ -112,6 +115,7 @@ bool QgsTinMeshCreationAlgorithm::prepareAlgorithm( const QVariantMap &parameter

if ( mVerticesLayer.isEmpty() && mBreakLinesLayer.isEmpty() )
return false;

return true;
}

@@ -124,10 +128,21 @@ QVariantMap QgsTinMeshCreationAlgorithm::processAlgorithm( const QVariantMap &pa
triangulation.setCrs( destinationCrs );

for ( Layer &l : mVerticesLayer )
{
if ( feedback && feedback->isCanceled() )
break;
triangulation.addVertices( l.fit, l.attributeIndex, l.transform, feedback, l.featureCount );
}

for ( Layer &l : mBreakLinesLayer )
{
if ( feedback && feedback->isCanceled() )
break;
triangulation.addBreakLines( l.fit, l.attributeIndex, l.transform, feedback, l.featureCount );
}

if ( feedback && feedback->isCanceled() )
return QVariantMap();

const QString fileName = parameterAsFile( parameters, QStringLiteral( "OUTPUT_MESH" ), context );
int driverIndex = parameterAsEnum( parameters, QStringLiteral( "MESH_FORMAT" ), context );
@@ -292,7 +292,7 @@ class CORE_EXPORT QgsProviderMetadata : public QObject
const QStringList &createOptions = QStringList() ) SIP_FACTORY;

/**
* Creates mesh data source (depending of the provider)
* Creates mesh data source, that is the mesh frame stored in file, memory or with other way (depending of the provider)
* \since QGIS 3.16
*/
virtual bool createMeshData(

0 comments on commit abd5fad

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