QGIS API Documentation  3.2.0-Bonn (bc43194)
qgsalgorithmdissolve.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsalgorithmdissolve.h
3  ---------------------
4  begin : April 2017
5  copyright : (C) 2017 by Nyall Dawson
6  email : nyall dot dawson at gmail dot com
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSALGORITHMDISSOLVE_H
19 #define QGSALGORITHMDISSOLVE_H
20 
21 #define SIP_NO_FILE
22 
23 #include "qgis.h"
24 #include "qgsprocessingalgorithm.h"
25 
27 
31 class QgsCollectorAlgorithm : public QgsProcessingAlgorithm
32 {
33  protected:
34 
35  QVariantMap processCollection( const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback,
36  const std::function<QgsGeometry( const QVector<QgsGeometry>& )> &collector, int maxQueueLength = 0 );
37 };
38 
42 class QgsDissolveAlgorithm : public QgsCollectorAlgorithm
43 {
44 
45  public:
46 
47  QgsDissolveAlgorithm() = default;
48  void initAlgorithm( const QVariantMap &configuration = QVariantMap() ) override;
49  QIcon icon() const override { return QgsApplication::getThemeIcon( QStringLiteral( "/algorithms/mAlgorithmDissolve.svg" ) ); }
50  QString svgIconPath() const override { return QgsApplication::iconPath( QStringLiteral( "/algorithms/mAlgorithmDissolve.svg" ) ); }
51  QString name() const override;
52  QString displayName() const override;
53  QStringList tags() const override;
54  QString group() const override;
55  QString groupId() const override;
56  QString shortHelpString() const override;
57  QgsDissolveAlgorithm *createInstance() const override SIP_FACTORY;
58 
59  protected:
60 
61  QVariantMap processAlgorithm( const QVariantMap &parameters,
62  QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
63 
64 };
65 
69 class QgsCollectAlgorithm : public QgsCollectorAlgorithm
70 {
71 
72  public:
73 
74  QgsCollectAlgorithm() = default;
75  QIcon icon() const override { return QgsApplication::getThemeIcon( QStringLiteral( "/algorithms/mAlgorithmCollect.svg" ) ); }
76  QString svgIconPath() const override { return QgsApplication::iconPath( QStringLiteral( "/algorithms/mAlgorithmCollect.svg" ) ); }
77  void initAlgorithm( const QVariantMap &configuration = QVariantMap() ) override;
78  QString name() const override;
79  QString displayName() const override;
80  QStringList tags() const override;
81  QString group() const override;
82  QString groupId() const override;
83  QString shortHelpString() const override;
84  QgsCollectAlgorithm *createInstance() const override SIP_FACTORY;
85 
86  protected:
87 
88  QVariantMap processAlgorithm( const QVariantMap &parameters,
89  QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
90 
91 };
92 
94 
95 #endif // QGSALGORITHMDISSOLVE_H
96 
97 
Base class for providing feedback from a processing algorithm.
static QString iconPath(const QString &iconFile)
Returns path to the desired icon file.
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:104
static QIcon getThemeIcon(const QString &name)
Helper to get a theme icon.
Abstract base class for processing algorithms.
#define SIP_FACTORY
Definition: qgis_sip.h:69
Contains information about the context in which a processing algorithm is executed.