Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Merge pull request #3966 from nyalldawson/proc_prov_c
[processing] Port some stuff to c++
- Loading branch information
Showing
73 changed files
with
936 additions
and
363 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/** | ||
* \class QgsProcessingProvider | ||
* \ingroup core | ||
* Abstract base class for processing providers. An algorithm provider is a set of | ||
* related algorithms, typically from the same external application or related | ||
* to a common area of analysis. | ||
* \note added in QGIS 3.0 | ||
*/ | ||
class QgsProcessingProvider | ||
{ | ||
%TypeHeaderCode | ||
#include <qgsprocessingprovider.h> | ||
%End | ||
|
||
public: | ||
|
||
QgsProcessingProvider(); | ||
|
||
virtual ~QgsProcessingProvider(); | ||
|
||
/** | ||
* Returns an icon for the provider. | ||
* @see svgIcon() | ||
*/ | ||
virtual QIcon icon() const; | ||
|
||
/** | ||
* Returns a path to an SVG version of the provider's icon. | ||
* @see icon() | ||
*/ | ||
virtual QString svgIconPath() const; | ||
|
||
/** | ||
* Returns the unique provider id, used for identifying the provider. This string | ||
* should be a unique, short, character only string, eg "qgis" or "gdal". This | ||
* string should not be localised. | ||
* @see name() | ||
*/ | ||
virtual QString id() const = 0; | ||
|
||
/** | ||
* Returns the full provider name, which is used to describe the provider within the GUI. | ||
* This string should be localised. | ||
* @see id() | ||
*/ | ||
virtual QString name() const = 0; | ||
|
||
virtual bool canBeActivated() const; | ||
|
||
private: | ||
|
||
//! Providers cannot be copied | ||
QgsProcessingProvider( const QgsProcessingProvider& other ); | ||
//! Providers cannot be copied | ||
//QgsProcessingProvider& operator=( const QgsProcessingProvider& other ); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/** | ||
* \class QgsProcessingRegistry | ||
* \ingroup core | ||
* Registry for various processing components, including providers, algorithms | ||
* and various parameters and outputs. | ||
* | ||
* QgsProcessingRegistry is not usually directly created, but rather accessed through | ||
* QgsApplication::processingRegistry(). | ||
* \note added in QGIS 3.0 | ||
*/ | ||
class QgsProcessingRegistry : QObject | ||
{ | ||
%TypeHeaderCode | ||
#include <qgsprocessingregistry.h> | ||
%End | ||
|
||
public: | ||
|
||
/** | ||
* Constructor for QgsProcessingRegistry. | ||
*/ | ||
QgsProcessingRegistry( QObject* parent /TransferThis/ = nullptr ); | ||
|
||
~QgsProcessingRegistry(); | ||
|
||
/** | ||
* Get list of available providers. | ||
*/ | ||
QList<QgsProcessingProvider*> providers() const; | ||
|
||
/** | ||
* Add a processing provider to the registry. Ownership of the provider is transferred to the registry. | ||
* Returns false if the provider could not be added (eg if a provider with a duplicate ID already exists | ||
* in the registry). | ||
* @see removeProvider() | ||
*/ | ||
bool addProvider( QgsProcessingProvider* provider /Transfer/ ); | ||
|
||
/** | ||
* Removes a provider implementation from the registry (the provider object is deleted). | ||
* Returns false if the provider could not be removed (eg provider does not exist in the registry). | ||
* @see addProvider() | ||
*/ | ||
bool removeProvider( QgsProcessingProvider* provider ); | ||
|
||
/** | ||
* Removes a provider implementation from the registry (the provider object is deleted). | ||
* Returns false if the provider could not be removed (eg provider does not exist in the registry). | ||
* @see addProvider() | ||
*/ | ||
bool removeProvider( const QString& providerId ); | ||
|
||
/** | ||
* Returns a matching provider by provider ID. | ||
*/ | ||
QgsProcessingProvider* providerById( const QString& id ); | ||
|
||
signals: | ||
|
||
//! Emitted when a provider has been added to the registry. | ||
void providerAdded( const QString& id ); | ||
|
||
//! Emitted when a provider is removed from the registry | ||
void providerRemoved( const QString& id ); | ||
|
||
private: | ||
|
||
//! Registry cannot be copied | ||
QgsProcessingRegistry( const QgsProcessingRegistry& other ); | ||
//! Registry cannot be copied | ||
//QgsProcessingRegistry& operator=( const QgsProcessingRegistry& other ); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.