QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
60 #if PROJ_VERSION_MAJOR>=6
76 const auto constMProviders = mProviders;
95 if ( mProviders.contains( provider->
id() ) )
97 QgsLogger::warning( QStringLiteral(
"Duplicate provider %1 registered" ).arg( provider->
id() ) );
102 if ( !provider->
load() )
109 provider->setParent(
this );
110 mProviders[ provider->
id()] = provider;
120 QString
id = provider->
id();
122 if ( !mProviders.contains(
id ) )
127 delete mProviders.take(
id );
140 return mProviders.value(
id,
nullptr );
145 QList< const QgsProcessingAlgorithm * > algs;
146 QMap<QString, QgsProcessingProvider *>::const_iterator it = mProviders.constBegin();
147 for ( ; it != mProviders.constEnd(); ++it )
149 algs.append( it.value()->algorithms() );
157 QString
id = mAlgorithmAliases.value( constId, constId );
159 QMap<QString, QgsProcessingProvider *>::const_iterator it = mProviders.constBegin();
160 for ( ; it != mProviders.constEnd(); ++it )
162 const auto constAlgorithms = it.value()->algorithms();
164 if ( alg->id() ==
id )
171 if (
id.startsWith( QLatin1String(
"qgis:" ) ) )
173 QString newId = QStringLiteral(
"native:" ) +
id.mid( 5 );
185 std::unique_ptr< QgsProcessingAlgorithm > creation( alg->
create( configuration ) );
186 return creation.release();
191 mAlgorithmAliases.insert( aliasId, actualId );
196 if ( !mParameterTypes.contains( type->
id() ) )
198 mParameterTypes.insert( type->
id(), type );
204 QgsLogger::warning( QStringLiteral(
"Duplicate parameter type %1 (\"%2\") registered" ).arg( type->
id(), type->
name() ) );
206 if ( mParameterTypes.value( type->
id() ) != type )
215 mParameterTypes.remove( type->
id() );
222 return mParameterTypes.value(
id );
227 return mParameterTypes.values();
A crs parameter for processing algorithms.
A authentication configuration parameter for processing algorithms.
void providerRemoved(const QString &id)
Emitted when a provider is removed from the registry.
A provider connection name parameter for processing algorithms.
virtual bool load()
Loads the provider.
QgsProcessingAlgorithm * createAlgorithmById(const QString &id, const QVariantMap &configuration=QVariantMap()) const
Creates a new instance of an algorithm by its ID.
const QgsProcessingAlgorithm * algorithmById(const QString &id) const
Finds an algorithm by its ID.
virtual QString id() const =0
Returns the unique provider id, used for identifying the provider.
A coordinate operation parameter for Processing algorithms.
A map theme parameter for Processing algorithms.
bool addParameterType(QgsProcessingParameterType *type)
Register a new parameter type for processing.
Abstract base class for processing providers.
QList< QgsProcessingParameterType * > parameterTypes() const
Returns a list with all known parameter types.
bool removeProvider(QgsProcessingProvider *provider)
Removes a provider implementation from the registry (the provider object is deleted).
A parameter for processing algorithms which accepts multiple map layers.
virtual QString name() const =0
A human readable and translatable short name for this parameter type.
A table (matrix) parameter for processing algorithms.
A geometry parameter for processing algorithms.
A vector layer destination parameter, for specifying the destination path for a vector layer created ...
void removeParameterType(QgsProcessingParameterType *type)
Unregister a custom parameter type from processing.
bool addProvider(QgsProcessingProvider *provider)
Add a processing provider to the registry.
A rectangular map extent parameter for processing algorithms.
A datetime parameter for processing algorithms.
Makes metadata of processing parameters available.
An expression parameter for processing algorithms.
~QgsProcessingRegistry() override
virtual void unload()
Unloads the provider.
A boolean parameter for processing algorithms.
QList< const QgsProcessingAlgorithm * > algorithms() const
Returns a list of all available algorithms from registered providers.
A folder destination parameter, for specifying the destination path for a folder created by the algor...
void providerAdded(const QString &id)
Emitted when a provider has been added to the registry.
A database table name parameter for processing algorithms.
A database schema name parameter for processing algorithms.
A print layout parameter for Processing algorithms.
A vector layer parameter for processing algorithms.
virtual QString id() const =0
A static id for this type which will be used for storing this parameter type.
A raster layer parameter for processing algorithms.
A scale parameter for processing algorithms.
An input file or folder parameter for processing algorithms.
QgsProcessingParameterType * parameterType(const QString &id) const
Returns the parameter type registered for id.
static void warning(const QString &msg)
Goes to qWarning.
A color parameter for Processing algorithms.
QgsProcessingRegistry(QObject *parent=nullptr)
Constructor for QgsProcessingRegistry.
A point parameter for processing algorithms.
An input feature source (such as vector layers) parameter for processing algorithms.
A numeric range parameter for processing algorithms.
A feature sink parameter for Processing algorithms.
Abstract base class for processing algorithms.
A print layout item parameter for Processing algorithms.
QgsProcessingAlgorithm * create(const QVariantMap &configuration=QVariantMap()) const SIP_THROW(QgsProcessingException)
Creates a copy of the algorithm, ready for execution.
A vector layer or feature source field parameter for processing algorithms.
Parameter type definition for QgsProcessingParameterVectorTileWriterLayers.
A generic file based destination parameter, for specifying the destination path for a file (non-map l...
A numeric parameter for processing algorithms.
A mesh layer parameter for processing algorithms.
A string parameter for processing algorithms.
void parameterTypeAdded(QgsProcessingParameterType *type)
Emitted when a new parameter type has been added to the registry.
A distance parameter for processing algorithms.
void parameterTypeRemoved(QgsProcessingParameterType *type)
Emitted when a parameter type has been removed from the registry and is about to be deleted.
A generic map layer parameter for processing algorithms.
A raster band parameter for Processing algorithms.
QgsProcessingProvider * providerById(const QString &id)
Returns a matching provider by provider ID.
A raster layer destination parameter, for specifying the destination path for a raster layer created ...
void addAlgorithmAlias(const QString &aliasId, const QString &actualId)
Adds a new alias to an existing algorithm.
An enum based parameter for processing algorithms, allowing for selection from predefined values.