17#include "moc_qgsprocessingmeshdatasetwidget.cpp"
41 QHBoxLayout *hl =
new QHBoxLayout();
42 hl->setContentsMargins( 0, 0, 0, 0 );
44 mLineEdit =
new QLineEdit();
45 mLineEdit->setEnabled(
false );
46 hl->addWidget( mLineEdit, 1 );
48 mToolButton =
new QToolButton();
49 mToolButton->setText( QString( QChar( 0x2026 ) ) );
50 hl->addWidget( mToolButton );
54 mLineEdit->setText( tr(
"%1 dataset groups selected" ).arg( 0 ) );
56 mToolButton->setPopupMode( QToolButton::InstantPopup );
57 QMenu *toolButtonMenu =
new QMenu(
this );
58 mActionCurrentActiveDatasetGroups = toolButtonMenu->addAction( tr(
"Current Active Dataset Group" ) );
59 connect( mActionCurrentActiveDatasetGroups,
60 &QAction::triggered,
this, &QgsProcessingMeshDatasetGroupsWidget::selectCurrentActiveDatasetGroup );
62 mActionAvailableDatasetGroups = toolButtonMenu->addAction( tr(
"Select in Available Dataset Groups" ) );
63 connect( mActionAvailableDatasetGroups, &QAction::triggered,
this, &QgsProcessingMeshDatasetGroupsWidget::showDialog );
65 mToolButton->setMenu( toolButtonMenu );
68void QgsProcessingMeshDatasetGroupsWidget::setMeshLayer(
QgsMeshLayer *layer,
bool layerFromProject )
70 mActionCurrentActiveDatasetGroups->setEnabled( layer && layerFromProject );
71 mActionAvailableDatasetGroups->setEnabled( layer );
73 if ( mMeshLayer == layer )
76 mDatasetGroupsNames.clear();
78 if ( layerFromProject )
86 for (
int i : datasetGroupsIndexes )
89 if ( mParam->isDataTypeSupported( meta.
dataType() ) )
91 mDatasetGroupsNames[i] = meta.
name();
101void QgsProcessingMeshDatasetGroupsWidget::setValue(
const QVariant &value )
103 if ( value.isValid() )
104 mValue = value.userType() == QMetaType::Type::QVariantList ? value.toList() : QVariantList() << value;
112QVariant QgsProcessingMeshDatasetGroupsWidget::value()
const
117void QgsProcessingMeshDatasetGroupsWidget::showDialog()
119 QList<int> datasetGroupsIndexes;
121 QVariantList availableOptions;
124 datasetGroupsIndexes = mMeshLayer->datasetGroupsIndexes();
125 for (
int i : std::as_const( datasetGroupsIndexes ) )
128 if ( mParam->isDataTypeSupported( meta.
dataType() ) )
130 availableOptions.append( i );
131 options.append( meta.
name() );
137 for (
auto it = mDatasetGroupsNames.constBegin(); it != mDatasetGroupsNames.constEnd(); it++ )
139 availableOptions.append( it.key() );
140 options.append( it.value() );
147 QgsProcessingMultipleSelectionPanelWidget *widget =
new QgsProcessingMultipleSelectionPanelWidget( availableOptions, mValue );
148 widget->setPanelTitle( tr(
"Dataset Groups Available" ) );
150 widget->setValueFormatter( [availableOptions, options](
const QVariant & v ) -> QString
152 const int index = v.toInt();
153 const int pos = availableOptions.indexOf( index );
154 return ( pos >= 0 && pos < options.size() ) ? options.at( pos ) : QString();
157 connect( widget, &QgsProcessingMultipleSelectionPanelWidget::selectionChanged,
this, [ = ]()
159 setValue( widget->selectedOptions() );
166 QgsProcessingMultipleSelectionDialog dlg( availableOptions, mValue,
this, Qt::WindowFlags() );
168 dlg.setValueFormatter( [datasetGroupsIndexes, options](
const QVariant & v ) -> QString
170 const int index = v.toInt();
171 const int pos = datasetGroupsIndexes.indexOf( index );
172 return ( pos >= 0 && pos < options.size() ) ? options.at( pos ) : QString();
176 setValue( dlg.selectedOptions() );
181void QgsProcessingMeshDatasetGroupsWidget::selectCurrentActiveDatasetGroup()
183 QVariantList options;
184 if ( mMeshLayer && mParam )
186 int scalarDatasetGroup = mMeshLayer->rendererSettings().activeScalarDatasetGroup();
187 int vectorDatasetGroup = mMeshLayer->rendererSettings().activeVectorDatasetGroup();
189 if ( scalarDatasetGroup >= 0 && mParam->isDataTypeSupported( mMeshLayer->datasetGroupMetadata( scalarDatasetGroup ).dataType() ) )
190 options.append( scalarDatasetGroup );
192 if ( vectorDatasetGroup >= 0
193 && mParam->isDataTypeSupported( mMeshLayer->datasetGroupMetadata( vectorDatasetGroup ).dataType() )
194 && vectorDatasetGroup != scalarDatasetGroup )
195 options.append( vectorDatasetGroup );
205QString QgsProcessingMeshDatasetGroupsWidgetWrapper::parameterType()
const
212 return new QgsProcessingMeshDatasetGroupsWidgetWrapper( parameter, type );
217 return new QgsProcessingMeshDatasetGroupsParameterDefinitionWidget( context, widgetContext, definition,
algorithm );
220void QgsProcessingMeshDatasetGroupsWidgetWrapper::postInitialize(
const QList<QgsAbstractProcessingParameterWidgetWrapper *> &wrappers )
232 setMeshLayerWrapperValue( wrapper );
235 setMeshLayerWrapperValue( wrapper );
254 if ( mProcessingContextGenerator )
255 context = mProcessingContextGenerator->processingContext();
257 bool layerFromProject;
263 layerFromProject =
false;
272 mWidget->setMeshLayer( meshLayer, layerFromProject );
275QStringList QgsProcessingMeshDatasetGroupsWidgetWrapper::compatibleParameterTypes()
const
282QStringList QgsProcessingMeshDatasetGroupsWidgetWrapper::compatibleOutputTypes()
const
288QWidget *QgsProcessingMeshDatasetGroupsWidgetWrapper::createWidget()
SIP_FACTORY
291 connect( mWidget, &QgsProcessingMeshDatasetGroupsWidget::changed,
this, [ = ]
293 emit widgetValueHasChanged(
this );
299void QgsProcessingMeshDatasetGroupsWidgetWrapper::setWidgetValue(
const QVariant &value,
QgsProcessingContext &context )
304 QList<int> datasetGroupIndexes;
305 if ( value.userType() == QMetaType::Type::QVariantList )
313 QVariantList varList;
314 for (
const int index : std::as_const( datasetGroupIndexes ) )
315 varList.append( index );
317 mWidget->setValue( varList );
320QVariant QgsProcessingMeshDatasetGroupsWidgetWrapper::widgetValue()
const
323 return mWidget->value();
328void QgsProcessingMeshDatasetGroupsWidget::updateSummaryText()
330 mLineEdit->setText( tr(
"%n option(s) selected",
nullptr, mValue.count() ) );
341QString QgsProcessingMeshDatasetTimeWidgetWrapper::parameterType()
const
348 return new QgsProcessingMeshDatasetTimeWidgetWrapper( parameter, type );
351void QgsProcessingMeshDatasetTimeWidgetWrapper::postInitialize(
const QList<QgsAbstractProcessingParameterWidgetWrapper *> &wrappers )
364 layerParameterWrapper = wrapper;
367 datasetGroupsParameterWrapper = wrapper;
369 setMeshLayerWrapperValue( layerParameterWrapper );
370 setDatasetGroupIndexesWrapperValue( datasetGroupsParameterWrapper );
373 setMeshLayerWrapperValue( layerParameterWrapper );
374 setDatasetGroupIndexesWrapperValue( datasetGroupsParameterWrapper );
387 return new QgsProcessingMeshDatasetTimeParameterDefinitionWidget( context, widgetContext, definition,
algorithm );
392 if ( !mWidget || !wrapper )
397 if ( mProcessingContextGenerator )
398 context = mProcessingContextGenerator->processingContext();
400 bool layerFromProject;
406 layerFromProject =
false;
414 mWidget->setMeshLayer( meshLayer, layerFromProject );
419 if ( !mWidget || !wrapper )
424 if ( !datasetGroupsVariant.isValid() || datasetGroupsVariant.userType() != QMetaType::Type::QVariantList )
425 mWidget->setDatasetGroupIndexes( QList<int>() );
427 QVariantList datasetGroupsListVariant = datasetGroupsVariant.toList();
429 QList<int> datasetGroupsIndexes;
430 for (
const QVariant &variantIndex : datasetGroupsListVariant )
431 datasetGroupsIndexes << variantIndex.toInt();
433 mWidget->setDatasetGroupIndexes( datasetGroupsIndexes );
437QStringList QgsProcessingMeshDatasetTimeWidgetWrapper::compatibleParameterTypes()
const
445QStringList QgsProcessingMeshDatasetTimeWidgetWrapper::compatibleOutputTypes()
const
451QWidget *QgsProcessingMeshDatasetTimeWidgetWrapper::createWidget()
460 connect( mWidget, &QgsProcessingMeshDatasetTimeWidget::changed,
this, [ = ]
462 emit widgetValueHasChanged(
this );
468void QgsProcessingMeshDatasetTimeWidgetWrapper::setWidgetValue(
const QVariant &value,
QgsProcessingContext &context )
472 mWidget->setValue( value );
475QVariant QgsProcessingMeshDatasetTimeWidgetWrapper::widgetValue()
const
478 return mWidget->value();
482QgsProcessingMeshDatasetTimeWidget::QgsProcessingMeshDatasetTimeWidget( QWidget *parent,
490 mValue.insert( QStringLiteral(
"type" ), QStringLiteral(
"static" ) );
492 dateTimeEdit->setDisplayFormat(
"yyyy-MM-dd HH:mm:ss" );
496 connect( radioButtonCurrentCanvasTime, &QRadioButton::toggled,
this, [
this](
bool isChecked ) {
if ( isChecked ) this->updateValue();} );
497 connect( radioButtonDefinedDateTime, &QRadioButton::toggled,
this, [
this](
bool isChecked ) {
if ( isChecked ) this->updateValue();} );
498 connect( radioButtonDatasetGroupTimeStep, &QRadioButton::toggled,
this, [
this](
bool isChecked ) {
if ( isChecked ) this->updateValue();} );
499 connect( dateTimeEdit, &QgsDateTimeEdit::dateTimeChanged,
this, &QgsProcessingMeshDatasetTimeWidget::updateValue );
500 connect( comboBoxDatasetTimeStep, qOverload<int>( &QComboBox::currentIndexChanged ),
501 this, &QgsProcessingMeshDatasetTimeWidget::updateValue );
506void QgsProcessingMeshDatasetTimeWidget::setMeshLayer(
QgsMeshLayer *layer,
bool layerFromProject )
508 if ( mMeshLayer == layer )
511 mReferenceTime = QDateTime();
513 if ( layerFromProject )
520 mMeshLayer =
nullptr;
523 storeTimeStepsFromLayer( layer );
526 if ( mReferenceTime.isValid() )
527 whileBlocking( dateTimeEdit )->setDateTime( mReferenceTime );
532void QgsProcessingMeshDatasetTimeWidget::setDatasetGroupIndexes(
const QList<int> datasetGroupIndexes )
534 if ( datasetGroupIndexes == mDatasetGroupIndexes )
536 mDatasetGroupIndexes = datasetGroupIndexes;
541void QgsProcessingMeshDatasetTimeWidget::setValue(
const QVariant &value )
543 if ( !value.isValid() || ( value.userType() != QMetaType::Type::QVariantMap && !value.toDateTime().isValid() ) )
547 if ( value.toDateTime().isValid() )
549 QDateTime dateTime = value.toDateTime();
550 dateTime.setTimeSpec( Qt::UTC );
551 mValue.insert( QStringLiteral(
"type" ), QStringLiteral(
"defined-date-time" ) );
552 mValue.insert( QStringLiteral(
"value" ), dateTime );
555 mValue = value.toMap();
557 if ( !mValue.contains( QStringLiteral(
"type" ) ) || !mValue.contains( QStringLiteral(
"value" ) ) )
560 QString type = mValue.value( QStringLiteral(
"type" ) ).toString();
563 if ( type == QLatin1String(
"static" ) )
567 else if ( type == QLatin1String(
"dataset-time-step" ) )
569 QVariantList dataset = mValue.value( QStringLiteral(
"value" ) ).toList();
570 whileBlocking( comboBoxDatasetTimeStep )->setCurrentIndex( comboBoxDatasetTimeStep->findData( dataset ) );
571 whileBlocking( radioButtonDatasetGroupTimeStep )->setChecked(
true );
573 else if ( type == QLatin1String(
"defined-date-time" ) )
575 whileBlocking( dateTimeEdit )->setDateTime( mValue.value( QStringLiteral(
"value" ) ).toDateTime() );
576 whileBlocking( radioButtonDefinedDateTime )->setChecked(
true );
578 else if ( type == QLatin1String(
"current-context-time" ) )
580 whileBlocking( radioButtonCurrentCanvasTime )->setChecked(
true );
587QVariant QgsProcessingMeshDatasetTimeWidget::value()
const
592void QgsProcessingMeshDatasetTimeWidget::updateWidget()
594 bool isStatic = !hasTemporalDataset();
595 setEnabled( !isStatic );
597 if ( mCanvas && mCanvas->mapSettings().isTemporal() )
599 whileBlocking( radioButtonCurrentCanvasTime )->setEnabled(
true && mReferenceTime.isValid() );
600 labelCurrentCanvasTime->setText( mCanvas->mapSettings().temporalRange().begin().toString(
"yyyy-MM-dd HH:mm:ss" ) );
604 whileBlocking( radioButtonCurrentCanvasTime )->setEnabled(
false );
605 if ( radioButtonCurrentCanvasTime->isChecked() )
606 whileBlocking( radioButtonDefinedDateTime )->setChecked(
true );
609 if ( ! mReferenceTime.isValid() )
610 whileBlocking( radioButtonDatasetGroupTimeStep )->setChecked(
true );
612 whileBlocking( radioButtonDefinedDateTime )->setEnabled( mReferenceTime.isValid() );
614 dateTimeEdit->setVisible( radioButtonDefinedDateTime->isChecked() && !isStatic );
615 labelCurrentCanvasTime->setVisible( radioButtonCurrentCanvasTime->isChecked() && !isStatic );
616 comboBoxDatasetTimeStep->setVisible( radioButtonDatasetGroupTimeStep->isChecked() && !isStatic );
619bool QgsProcessingMeshDatasetTimeWidget::hasTemporalDataset()
const
621 for (
int index : mDatasetGroupIndexes )
623 if ( mMeshLayer && mMeshLayer->datasetGroupMetadata( index ).isTemporal() )
625 else if ( mDatasetTimeSteps.contains( index ) )
633void QgsProcessingMeshDatasetTimeWidget::populateTimeSteps()
637 populateTimeStepsFromLayer();
641 QMap<quint64, QgsMeshDatasetIndex> timeStep;
642 for (
int groupIndex : mDatasetGroupIndexes )
644 if ( !mDatasetTimeSteps.contains( groupIndex ) )
646 const QList<qint64> relativeTimeSteps = mDatasetTimeSteps.value( groupIndex );
647 for (
int index = 0; index < relativeTimeSteps.count(); ++index )
650 if ( timeStep.contains( relativeTimeSteps.at( index ) ) )
652 timeStep[relativeTimeSteps.at( index )] = datasetIndex;
656 for (
auto it = timeStep.constBegin(); it != timeStep.constEnd(); it++ )
658 QString stringTime = QgsMeshLayerUtils::formatTime(
static_cast<double>( it.key() ) / 1000. / 3600., mReferenceTime,
QgsMeshTimeSettings() );
662 whileBlocking( comboBoxDatasetTimeStep )->addItem( stringTime, data );
667void QgsProcessingMeshDatasetTimeWidget::populateTimeStepsFromLayer()
674 QMap<quint64, QgsMeshDatasetIndex> timeStep;
675 for (
int groupIndex : std::as_const( mDatasetGroupIndexes ) )
680 int datasetCount = mMeshLayer->datasetCount( groupIndex );
682 for (
int index = 0; index < datasetCount; ++index )
685 qint64 relativeTime = mMeshLayer->datasetRelativeTimeInMilliseconds( datasetIndex );
686 if ( timeStep.contains( relativeTime ) )
688 timeStep[relativeTime] = datasetIndex;
692 for (
auto it = timeStep.constBegin(); it != timeStep.constEnd(); it++ )
694 QString stringTime = mMeshLayer->formatTime(
static_cast<double>( it.key() ) / 1000.0 / 3600.0 );
698 whileBlocking( comboBoxDatasetTimeStep )->addItem( stringTime, data );
702void QgsProcessingMeshDatasetTimeWidget::storeTimeStepsFromLayer(
QgsMeshLayer *layer )
704 mDatasetTimeSteps.clear();
708 for (
int groupIndex : datasetGroupsList )
714 QList<qint64> relativeTimeSteps;
715 relativeTimeSteps.reserve( datasetCount );
716 for (
int index = 0; index < datasetCount; ++index )
718 mDatasetTimeSteps[groupIndex] = relativeTimeSteps;
722void QgsProcessingMeshDatasetTimeWidget::buildValue()
728 mValue[QStringLiteral(
"type" )] = QStringLiteral(
"static" );
730 else if ( radioButtonDatasetGroupTimeStep->isChecked() )
732 mValue[QStringLiteral(
"type" )] = QStringLiteral(
"dataset-time-step" );
733 mValue[QStringLiteral(
"value" )] = comboBoxDatasetTimeStep->currentData();
735 else if ( radioButtonDefinedDateTime->isChecked() )
737 mValue[QStringLiteral(
"type" )] = QStringLiteral(
"defined-date-time" );
738 mValue[QStringLiteral(
"value" )] = dateTimeEdit->dateTime();
740 else if ( radioButtonCurrentCanvasTime->isChecked() && mCanvas )
742 mValue[QStringLiteral(
"type" )] = QStringLiteral(
"current-context-time" );
748void QgsProcessingMeshDatasetTimeWidget::updateValue()
755QgsProcessingMeshDatasetGroupsParameterDefinitionWidget::QgsProcessingMeshDatasetGroupsParameterDefinitionWidget(
763 QVBoxLayout *vlayout =
new QVBoxLayout();
764 vlayout->setContentsMargins( 0, 0, 0, 0 );
766 vlayout->addWidget(
new QLabel( tr(
"Linked input" ) ) );
768 mParentLayerComboBox =
new QComboBox();
769 vlayout->addWidget( mParentLayerComboBox );
771 if ( QgsProcessingModelAlgorithm *model = widgetContext.
model() )
773 const QMap<QString, QgsProcessingModelParameter> components = model->parameterComponents();
774 for (
auto it = components.constBegin(); it != components.constEnd(); ++it )
786 if ( datasetGroupDef )
789 if ( currentIndex != -1 )
790 mParentLayerComboBox->setCurrentIndex( currentIndex );
795 mParentLayerComboBox->setCurrentIndex( mParentLayerComboBox->count() - 1 );
799 setLayout( vlayout );
804 const QString &description,
807 QSet<int> supportedDataType;
812 std::unique_ptr<QgsProcessingParameterMeshDatasetGroups> param =
813 std::make_unique<QgsProcessingParameterMeshDatasetGroups>( name, description, mParentLayerComboBox->currentData().toString(), supportedDataType );
814 param->setFlags( flags );
815 return param.release();
818QgsProcessingMeshDatasetTimeParameterDefinitionWidget::QgsProcessingMeshDatasetTimeParameterDefinitionWidget(
833 QVBoxLayout *vlayout =
new QVBoxLayout();
834 vlayout->setContentsMargins( 0, 0, 0, 0 );
836 vlayout->addWidget(
new QLabel( tr(
"Linked input" ) ) );
838 mParentDatasetComboBox =
new QComboBox();
839 vlayout->addWidget( mParentDatasetComboBox );
841 QgsProcessingModelAlgorithm *model = widgetContext.
model();
844 const QMap<QString, QgsProcessingModelParameter> components = model->parameterComponents();
845 for (
auto it = components.constBegin(); it != components.constEnd(); ++it )
858 if ( currentIndex != -1 )
859 mParentDatasetComboBox->setCurrentIndex( currentIndex );
864 mParentDatasetComboBox->setCurrentIndex( mParentDatasetComboBox->count() - 1 );
874 connect( mParentDatasetComboBox, qOverload<int>( &QComboBox::currentIndexChanged ),
this, [
this, model]
882 setLayout( vlayout );
887 std::unique_ptr<QgsProcessingParameterMeshDatasetTime> param = std::make_unique<QgsProcessingParameterMeshDatasetTime>(
888 name, description, mMeshLayerParameterName, mParentDatasetComboBox->currentData().toString() );
890 param->setFlags( flags );
891 return param.release();
QFlags< ProcessingParameterFlag > ProcessingParameterFlags
Flags which dictate the behavior of Processing parameters.
Map canvas is a class for displaying all GIS data types on a canvas.
void temporalRangeChanged()
Emitted when the map canvas temporal range changes.
QVector< T > layers() const
Returns a list of registered map layers with a specified layer type.
QDateTime referenceTime() const
Returns the reference time.
QgsMeshDataProviderTemporalCapabilities * temporalCapabilities() override
Returns the provider's temporal capabilities.
QgsMeshDatasetIndex is index that identifies the dataset group (e.g.
int group() const
Returns a group index.
int dataset() const
Returns a dataset index within group()
Implementation of map layer temporal properties for mesh layers.
Represents a mesh layer supporting display of data on structured or unstructured meshes.
int datasetCount(const QgsMeshDatasetIndex &index) const
Returns the dataset count in the dataset groups.
QList< int > datasetGroupsIndexes() const
Returns the list of indexes of dataset groups handled by the layer.
QgsMeshDataProvider * dataProvider() override
Returns the layer's data provider, it may be nullptr.
QgsMapLayerTemporalProperties * temporalProperties() override
Returns the layer's temporal properties.
qint64 datasetRelativeTimeInMilliseconds(const QgsMeshDatasetIndex &index)
Returns the relative time (in milliseconds) of the dataset from the reference time of its group.
QgsMeshDatasetGroupMetadata datasetGroupMetadata(const QgsMeshDatasetIndex &index) const
Returns the dataset groups metadata.
Represents a mesh time settings for mesh datasets.
Abstract base class for processing algorithms.
Contains information about the context in which a processing algorithm is executed.
QgsProject * project() const
Returns the project in which the algorithm is being executed.
WidgetType
Types of dialogs which Processing widgets can be created for.
@ Standard
Standard algorithm dialog.
@ Batch
Batch processing dialog.
static QString typeName()
Returns the type name for the output class.
static QString typeName()
Returns the type name for the output class.
static QString typeName()
Returns the type name for the parameter class.
Base class for the definition of processing parameters.
QString description() const
Returns the description for the parameter.
virtual QString type() const =0
Unique parameter type name.
QString name() const
Returns the name of the parameter.
A parameter for processing algorithms that need a list of mesh dataset groups.
static QString typeName()
Returns the type name for the parameter class.
QString meshLayerParameterName() const
Returns the name of the mesh layer parameter.
A parameter for processing algorithms that need a list of mesh dataset index from time parameter.
QString datasetGroupParameterName() const
Returns the name of the dataset groups parameter.
QString meshLayerParameterName() const
Returns the name of the mesh layer parameter.
static QString typeName()
Returns the type name for the parameter class.
static QString typeName()
Returns the type name for the parameter class.
static QString typeName()
Returns the type name for the parameter class.
static QString typeName()
Returns the type name for the parameter class.
Contains settings which reflect the context in which a Processing parameter widget is shown,...
QgsMapCanvas * mapCanvas() const
Returns the map canvas associated with the widget.
QgsProcessingModelAlgorithm * model() const
Returns the model which the parameter widget is associated with.
static QList< int > parameterAsInts(const QgsProcessingParameterDefinition *definition, const QVariantMap ¶meters, const QgsProcessingContext &context)
Evaluates the parameter with matching definition to a list of integer values.
static QgsMeshLayer * parameterAsMeshLayer(const QgsProcessingParameterDefinition *definition, const QVariantMap ¶meters, QgsProcessingContext &context)
Evaluates the parameter with matching definition and value to a mesh layer.
static int parameterAsInt(const QgsProcessingParameterDefinition *definition, const QVariantMap ¶meters, const QgsProcessingContext &context)
Evaluates the parameter with matching definition to a static integer value.
QgsMapLayerStore * layerStore()
Returns a pointer to the project's internal layer store.
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into allowing algorithms to be written in pure substantial changes are required in order to port existing x Processing algorithms for QGIS x The most significant changes are outlined not GeoAlgorithm For algorithms which operate on features one by consider subclassing the QgsProcessingFeatureBasedAlgorithm class This class allows much of the boilerplate code for looping over features from a vector layer to be bypassed and instead requires implementation of a processFeature method Ensure that your algorithm(or algorithm 's parent class) implements the new pure virtual createInstance(self) call
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.