18 #ifndef QGSPROCESSINGMODELCHILDALGORITHM_H
19 #define QGSPROCESSINGMODELCHILDALGORITHM_H
21 #include "qgis_core.h"
30 class QgsProcessingModelAlgorithm;
40 class CORE_EXPORT QgsProcessingModelChildAlgorithm :
public QgsProcessingModelComponent
48 QgsProcessingModelChildAlgorithm(
const QString &algorithmId = QString() );
50 QgsProcessingModelChildAlgorithm(
const QgsProcessingModelChildAlgorithm &other );
51 QgsProcessingModelChildAlgorithm &operator=(
const QgsProcessingModelChildAlgorithm &other );
53 QgsProcessingModelChildAlgorithm *clone() const override
SIP_FACTORY;
63 void copyNonDefinitionPropertiesFromModel( QgsProcessingModelAlgorithm *model );
71 QString childId()
const {
return mId; }
79 void setChildId(
const QString &
id ) { mId = id; }
87 void generateChildId(
const QgsProcessingModelAlgorithm &model );
94 QString algorithmId()
const {
return mAlgorithmId; }
106 bool setAlgorithmId(
const QString &algorithmId );
119 bool reattach()
const;
131 QVariantMap configuration()
const;
143 void setConfiguration(
const QVariantMap &configuration );
159 QMap< QString, QList< QgsProcessingModelChildParameterSource > > parameterSources()
const {
return mParams; }
167 void setParameterSources(
const QMap< QString, QList< QgsProcessingModelChildParameterSource > > &sources ) { mParams = sources; }
178 void addParameterSources(
const QString &name,
const QList< QgsProcessingModelChildParameterSource > &source ) { mParams.insert( name, source ); }
184 bool isActive()
const {
return mActive; }
190 void setActive(
bool active ) { mActive = active; }
197 QList< QgsProcessingModelChildDependency > dependencies()
const {
return mDependencies; }
204 void setDependencies(
const QList< QgsProcessingModelChildDependency > &dependencies ) { mDependencies = dependencies; }
213 QMap<QString, QgsProcessingModelOutput> modelOutputs()
const {
return mModelOutputs; }
225 QgsProcessingModelOutput &modelOutput(
const QString &name ) {
return mModelOutputs[ name ]; }
236 void setModelOutputs(
const QMap<QString, QgsProcessingModelOutput> &outputs );
246 bool removeModelOutput(
const QString &name );
252 QVariant toVariant()
const;
258 bool loadVariant(
const QVariant &child );
272 const QMap<QString, QString> &friendlyChildNames,
const QMap<QString, QString> &friendlyOutputNames )
const;
274 SIP_SKIP const QgsProcessingModelComment *comment()
const override {
return &mComment; }
275 QgsProcessingModelComment *comment()
override {
return &mComment; }
276 void setComment(
const QgsProcessingModelComment &comment )
override { mComment = comment; }
282 QString mAlgorithmId;
283 std::unique_ptr< QgsProcessingAlgorithm > mAlgorithm;
285 QVariantMap mConfiguration;
288 QMap< QString, QgsProcessingModelChildParameterSources > mParams;
291 QMap< QString, QgsProcessingModelOutput > mModelOutputs;
296 QList< QgsProcessingModelChildDependency > mDependencies;
298 QgsProcessingModelComment mComment;
300 friend class TestQgsProcessingModelAlgorithm;
306 #endif // QGSPROCESSINGMODELCHILDALGORITHM_H