QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
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  bool separateDisjoint = false );
39 };
40 
44 class QgsDissolveAlgorithm : public QgsCollectorAlgorithm
45 {
46 
47  public:
48 
49  QgsDissolveAlgorithm() = default;
50  void initAlgorithm( const QVariantMap &configuration = QVariantMap() ) override;
51  QIcon icon() const override { return QgsApplication::getThemeIcon( QStringLiteral( "/algorithms/mAlgorithmDissolve.svg" ) ); }
52  QString svgIconPath() const override { return QgsApplication::iconPath( QStringLiteral( "/algorithms/mAlgorithmDissolve.svg" ) ); }
53  QString name() const override;
54  QString displayName() const override;
55  QStringList tags() const override;
56  QString group() const override;
57  QString groupId() const override;
58  QString shortHelpString() const override;
59  QgsDissolveAlgorithm *createInstance() const override SIP_FACTORY;
60 
61  protected:
62 
63  QVariantMap processAlgorithm( const QVariantMap &parameters,
64  QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
65 
66 };
67 
71 class QgsCollectAlgorithm : public QgsCollectorAlgorithm
72 {
73 
74  public:
75 
76  QgsCollectAlgorithm() = default;
77  QIcon icon() const override { return QgsApplication::getThemeIcon( QStringLiteral( "/algorithms/mAlgorithmCollect.svg" ) ); }
78  QString svgIconPath() const override { return QgsApplication::iconPath( QStringLiteral( "/algorithms/mAlgorithmCollect.svg" ) ); }
79  void initAlgorithm( const QVariantMap &configuration = QVariantMap() ) override;
80  QString name() const override;
81  QString displayName() const override;
82  QStringList tags() const override;
83  QString group() const override;
84  QString groupId() const override;
85  QString shortHelpString() const override;
86  QgsCollectAlgorithm *createInstance() const override SIP_FACTORY;
87 
88  protected:
89 
90  QVariantMap processAlgorithm( const QVariantMap &parameters,
91  QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
92 
93 };
94 
96 
97 #endif // QGSALGORITHMDISSOLVE_H
98 
99 
QgsProcessingFeedback
Base class for providing feedback from a processing algorithm.
Definition: qgsprocessingfeedback.h:37
QgsApplication::iconPath
static QString iconPath(const QString &iconFile)
Returns path to the desired icon file.
Definition: qgsapplication.cpp:682
SIP_FACTORY
#define SIP_FACTORY
Definition: qgis_sip.h:76
qgsapplication.h
QgsProcessingContext
Contains information about the context in which a processing algorithm is executed.
Definition: qgsprocessingcontext.h:46
qgsprocessingalgorithm.h
qgis_sip.h
QgsProcessingAlgorithm
Abstract base class for processing algorithms.
Definition: qgsprocessingalgorithm.h:52
QgsGeometry
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:124
QgsApplication::getThemeIcon
static QIcon getThemeIcon(const QString &name, const QColor &fillColor=QColor(), const QColor &strokeColor=QColor())
Helper to get a theme icon.
Definition: qgsapplication.cpp:693