QGIS API Documentation  3.20.0-Odense (decaadbb31)
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_sip.h"
24 #include "qgsprocessingalgorithm.h"
25 #include "qgsapplication.h"
26 
28 
32 class QgsCollectorAlgorithm : public QgsProcessingAlgorithm
33 {
34  protected:
35 
36  QVariantMap processCollection( const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback,
37  const std::function<QgsGeometry( const QVector<QgsGeometry>& )> &collector, int maxQueueLength = 0, QgsProcessingFeatureSource::Flags sourceFlags = QgsProcessingFeatureSource::Flags() );
38 };
39 
43 class QgsDissolveAlgorithm : public QgsCollectorAlgorithm
44 {
45 
46  public:
47 
48  QgsDissolveAlgorithm() = default;
49  void initAlgorithm( const QVariantMap &configuration = QVariantMap() ) override;
50  QIcon icon() const override { return QgsApplication::getThemeIcon( QStringLiteral( "/algorithms/mAlgorithmDissolve.svg" ) ); }
51  QString svgIconPath() const override { return QgsApplication::iconPath( QStringLiteral( "/algorithms/mAlgorithmDissolve.svg" ) ); }
52  QString name() const override;
53  QString displayName() const override;
54  QStringList tags() const override;
55  QString group() const override;
56  QString groupId() const override;
57  QString shortHelpString() const override;
58  QgsDissolveAlgorithm *createInstance() const override SIP_FACTORY;
59 
60  protected:
61 
62  QVariantMap processAlgorithm( const QVariantMap &parameters,
63  QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
64 
65 };
66 
70 class QgsCollectAlgorithm : public QgsCollectorAlgorithm
71 {
72 
73  public:
74 
75  QgsCollectAlgorithm() = default;
76  QIcon icon() const override { return QgsApplication::getThemeIcon( QStringLiteral( "/algorithms/mAlgorithmCollect.svg" ) ); }
77  QString svgIconPath() const override { return QgsApplication::iconPath( QStringLiteral( "/algorithms/mAlgorithmCollect.svg" ) ); }
78  void initAlgorithm( const QVariantMap &configuration = QVariantMap() ) override;
79  QString name() const override;
80  QString displayName() const override;
81  QStringList tags() const override;
82  QString group() const override;
83  QString groupId() const override;
84  QString shortHelpString() const override;
85  QgsCollectAlgorithm *createInstance() const override SIP_FACTORY;
86 
87  protected:
88 
89  QVariantMap processAlgorithm( const QVariantMap &parameters,
90  QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
91 
92 };
93 
95 
96 #endif // QGSALGORITHMDISSOLVE_H
97 
98 
static QIcon getThemeIcon(const QString &name, const QColor &fillColor=QColor(), const QColor &strokeColor=QColor())
Helper to get a theme icon.
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:124
Abstract base class for processing algorithms.
Contains information about the context in which a processing algorithm is executed.
Base class for providing feedback from a processing algorithm.
#define SIP_FACTORY
Definition: qgis_sip.h:76