QGIS API Documentation  3.21.0-Master (909859188c)
qgsalgorithmgpsbabeltools.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsalgorithmgpsbabeltools.h
3  ------------------
4  begin : July 2021
5  copyright : (C) 2021 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 QGSALGORITHMGPSBABELTOOLS_H
19 #define QGSALGORITHMGPSBABELTOOLS_H
20 
21 #define SIP_NO_FILE
22 
23 #include "qgis_sip.h"
24 #include "qgis_analysis.h"
25 #include "qgsprocessingalgorithm.h"
26 #include "qgsapplication.h"
28 
30 
34 class ANALYSIS_EXPORT QgsConvertGpxFeatureTypeAlgorithm : public QgsProcessingAlgorithm
35 {
36 
37  public:
38 
39  QgsConvertGpxFeatureTypeAlgorithm() = default;
40  void initAlgorithm( const QVariantMap &configuration = QVariantMap() ) override;
41  QIcon icon() const override;
42  QString svgIconPath() const override;
43  QString name() const override;
44  QString displayName() const override;
45  QStringList tags() const override;
46  QString group() const override;
47  QString groupId() const override;
48  QString shortHelpString() const override;
49  QgsConvertGpxFeatureTypeAlgorithm *createInstance() const override SIP_FACTORY;
50 
51  protected:
52 
53  QVariantMap processAlgorithm( const QVariantMap &parameters,
54  QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
55 
56  private:
57 
58  enum ConversionType
59  {
60  WaypointsFromRoute = 0,
61  WaypointsFromTrack,
62  RouteFromWaypoints,
63  TrackFromWaypoints
64  };
65 
69  static void createArgumentLists(
70  const QString &inputFile,
71  const QString &outputFile,
72  ConversionType conversion,
73  QStringList &processArgs,
74  QStringList &logArgs
75  );
76 
77  friend class TestQgsProcessingAlgs;
78 
79 };
80 
81 
85 class ANALYSIS_EXPORT QgsConvertGpsDataAlgorithm : public QgsProcessingAlgorithm
86 {
87 
88  public:
89 
90  QgsConvertGpsDataAlgorithm() = default;
91  void initAlgorithm( const QVariantMap &configuration = QVariantMap() ) override;
92  QIcon icon() const override;
93  QString svgIconPath() const override;
94  QString name() const override;
95  QString displayName() const override;
96  QStringList tags() const override;
97  QString group() const override;
98  QString groupId() const override;
99  QString shortHelpString() const override;
100  QgsConvertGpsDataAlgorithm *createInstance() const override SIP_FACTORY;
101 
102  protected:
103 
104  QVariantMap processAlgorithm( const QVariantMap &parameters,
105  QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
106 
107  private:
108 
109  friend class TestQgsProcessingAlgs;
110 
111 };
112 
113 
117 class ANALYSIS_EXPORT QgsDownloadGpsDataAlgorithm : public QgsProcessingAlgorithm
118 {
119 
120  public:
121 
122  QgsDownloadGpsDataAlgorithm() = default;
123  void initAlgorithm( const QVariantMap &configuration = QVariantMap() ) override;
124  QIcon icon() const override;
125  QString svgIconPath() const override;
126  QString name() const override;
127  QString displayName() const override;
128  QStringList tags() const override;
129  QString group() const override;
130  QString groupId() const override;
131  QString shortHelpString() const override;
132  QgsDownloadGpsDataAlgorithm *createInstance() const override SIP_FACTORY;
133 
134  protected:
135 
136  QVariantMap processAlgorithm( const QVariantMap &parameters,
137  QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
138 
139  private:
140 
141  friend class TestQgsProcessingAlgs;
142 
143 };
144 
145 
149 class ANALYSIS_EXPORT QgsUploadGpsDataAlgorithm : public QgsProcessingAlgorithm
150 {
151 
152  public:
153 
154  QgsUploadGpsDataAlgorithm() = default;
155  void initAlgorithm( const QVariantMap &configuration = QVariantMap() ) override;
156  QIcon icon() const override;
157  QString svgIconPath() const override;
158  QString name() const override;
159  QString displayName() const override;
160  QStringList tags() const override;
161  QString group() const override;
162  QString groupId() const override;
163  QString shortHelpString() const override;
164  QgsUploadGpsDataAlgorithm *createInstance() const override SIP_FACTORY;
165 
166  protected:
167 
168  QVariantMap processAlgorithm( const QVariantMap &parameters,
169  QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
170 
171  private:
172 
173  friend class TestQgsProcessingAlgs;
174 
175 };
176 
177 
178 
180 
181 #endif // QGSALGORITHMGPSBABELTOOLS_H
182 
183 
Abstract base class for processing algorithms.
virtual QString group() const
Returns the name of the group this algorithm belongs to.
virtual QString groupId() const
Returns the unique ID of the group this algorithm belongs to.
virtual QIcon icon() const
Returns an icon for the algorithm.
virtual QString shortHelpString() const
Returns a localised short helper string for the algorithm.
virtual QVariantMap processAlgorithm(const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback) SIP_THROW(QgsProcessingException)=0
Runs the algorithm using the specified parameters.
virtual QString displayName() const =0
Returns the translated algorithm name, which should be used for any user-visible display of the algor...
virtual QgsProcessingAlgorithm * createInstance() const =0
Creates a new instance of the algorithm class.
virtual QStringList tags() const
Returns a list of tags which relate to the algorithm, and are used to assist users in searching for s...
virtual QString svgIconPath() const
Returns a path to an SVG version of the algorithm's icon.
virtual void initAlgorithm(const QVariantMap &configuration=QVariantMap())=0
Initializes the algorithm using the specified configuration.
virtual QString name() const =0
Returns the algorithm name, used for identifying the algorithm.
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