QGIS API Documentation  3.6.0-Noosa (5873452)
qgsnativealgorithms.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgsnativealgorithms.cpp
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 #include "qgsnativealgorithms.h"
22 #include "qgsalgorithmboundary.h"
24 #include "qgsalgorithmbuffer.h"
26 #include "qgsalgorithmcentroid.h"
27 #include "qgsalgorithmclip.h"
28 #include "qgsalgorithmconvexhull.h"
31 #include "qgsalgorithmdifference.h"
32 #include "qgsalgorithmdissolve.h"
33 #include "qgsalgorithmdrape.h"
36 #include "qgsalgorithmexplode.h"
48 #include "qgsalgorithmfilter.h"
51 #include "qgsalgorithmforcerhr.h"
60 #include "qgsalgorithmloadlayer.h"
62 #include "qgsalgorithmmergelines.h"
70 #include "qgsalgorithmpackage.h"
85 #include "qgsalgorithmrotate.h"
87 #include "qgsalgorithmsegmentize.h"
91 #include "qgsalgorithmsimplify.h"
92 #include "qgsalgorithmsmooth.h"
93 #include "qgsalgorithmsnaptogrid.h"
98 #include "qgsalgorithmsubdivide.h"
99 #include "qgsalgorithmswapxy.h"
102 #include "qgsalgorithmtransect.h"
103 #include "qgsalgorithmtransform.h"
104 #include "qgsalgorithmtranslate.h"
105 #include "qgsalgorithmunion.h"
107 #include "qgsalgorithmvectorize.h"
111 
113 
115  : QgsProcessingProvider( parent )
116 {}
117 
118 QIcon QgsNativeAlgorithms::icon() const
119 {
120  return QgsApplication::getThemeIcon( QStringLiteral( "/providerQgis.svg" ) );
121 }
122 
123 QString QgsNativeAlgorithms::svgIconPath() const
124 {
125  return QgsApplication::iconPath( QStringLiteral( "providerQgis.svg" ) );
126 }
127 
128 QString QgsNativeAlgorithms::id() const
129 {
130  return QStringLiteral( "native" );
131 }
132 
133 QString QgsNativeAlgorithms::helpId() const
134 {
135  return QStringLiteral( "qgis" );
136 }
137 
138 QString QgsNativeAlgorithms::name() const
139 {
140  return tr( "QGIS (native c++)" );
141 }
142 
144 {
145  return true;
146 }
147 
149 {
150  addAlgorithm( new QgsAddIncrementalFieldAlgorithm() );
151  addAlgorithm( new QgsAddUniqueValueIndexAlgorithm() );
152  addAlgorithm( new QgsArrayTranslatedFeaturesAlgorithm() );
153  addAlgorithm( new QgsAssignProjectionAlgorithm() );
154  addAlgorithm( new QgsBoundaryAlgorithm() );
155  addAlgorithm( new QgsBoundingBoxAlgorithm() );
156  addAlgorithm( new QgsBufferAlgorithm() );
157  addAlgorithm( new QgsCategorizeUsingStyleAlgorithm() );
158  addAlgorithm( new QgsCentroidAlgorithm() );
159  addAlgorithm( new QgsClipAlgorithm() );
160  addAlgorithm( new QgsCollectAlgorithm() );
161  addAlgorithm( new QgsConvexHullAlgorithm() );
162  addAlgorithm( new QgsDbscanClusteringAlgorithm() );
163  addAlgorithm( new QgsDifferenceAlgorithm() );
164  addAlgorithm( new QgsDissolveAlgorithm() );
165  addAlgorithm( new QgsDrapeToMAlgorithm() );
166  addAlgorithm( new QgsDrapeToZAlgorithm() );
167  addAlgorithm( new QgsDropGeometryAlgorithm() );
168  addAlgorithm( new QgsDropMZValuesAlgorithm() );
169  addAlgorithm( new QgsExplodeAlgorithm() );
170  addAlgorithm( new QgsExplodeHstoreAlgorithm() );
171  addAlgorithm( new QgsExtendLinesAlgorithm() );
172  addAlgorithm( new QgsExtentToLayerAlgorithm() );
173  addAlgorithm( new QgsExtractBinaryFieldAlgorithm() );
174  addAlgorithm( new QgsExtractByAttributeAlgorithm() );
175  addAlgorithm( new QgsExtractByExpressionAlgorithm() );
176  addAlgorithm( new QgsExtractByExtentAlgorithm() );
177  addAlgorithm( new QgsExtractByLocationAlgorithm() );
178  addAlgorithm( new QgsExtractMValuesAlgorithm() );
179  addAlgorithm( new QgsExtractVerticesAlgorithm() );
180  addAlgorithm( new QgsExtractZValuesAlgorithm() );
181  addAlgorithm( new QgsFileDownloaderAlgorithm() );
182  addAlgorithm( new QgsFilterAlgorithm() );
183  addAlgorithm( new QgsFilterVerticesByM() );
184  addAlgorithm( new QgsFilterVerticesByZ() );
185  addAlgorithm( new QgsFixGeometriesAlgorithm() );
186  addAlgorithm( new QgsForceRHRAlgorithm() );
187  addAlgorithm( new QgsImportPhotosAlgorithm() );
188  addAlgorithm( new QgsInterpolatePointAlgorithm() );
189  addAlgorithm( new QgsIntersectionAlgorithm() );
190  addAlgorithm( new QgsJoinByAttributeAlgorithm() );
191  addAlgorithm( new QgsJoinWithLinesAlgorithm() );
192  addAlgorithm( new QgsKMeansClusteringAlgorithm() );
193  addAlgorithm( new QgsLineIntersectionAlgorithm() );
194  addAlgorithm( new QgsLineSubstringAlgorithm() );
195  addAlgorithm( new QgsLoadLayerAlgorithm() );
196  addAlgorithm( new QgsMeanCoordinatesAlgorithm() );
197  addAlgorithm( new QgsMergeLinesAlgorithm() );
198  addAlgorithm( new QgsMergeVectorAlgorithm() );
199  addAlgorithm( new QgsMinimumEnclosingCircleAlgorithm() );
200  addAlgorithm( new QgsMultipartToSinglepartAlgorithm() );
201  addAlgorithm( new QgsMultiRingConstantBufferAlgorithm() );
202  addAlgorithm( new QgsOffsetLinesAlgorithm() );
203  addAlgorithm( new QgsOrderByExpressionAlgorithm() );
204  addAlgorithm( new QgsOrientedMinimumBoundingBoxAlgorithm() );
205  addAlgorithm( new QgsPackageAlgorithm() );
206  addAlgorithm( new QgsCreateArrayOffsetLinesAlgorithm() );
207  addAlgorithm( new QgsPointOnSurfaceAlgorithm() );
208  addAlgorithm( new QgsProjectPointCartesianAlgorithm() );
209  addAlgorithm( new QgsPromoteToMultipartAlgorithm() );
210  addAlgorithm( new QgsRasterLayerUniqueValuesReportAlgorithm() );
211  addAlgorithm( new QgsRasterLayerZonalStatsAlgorithm() );
212  addAlgorithm( new QgsRasterPixelsToPointsAlgorithm() );
213  addAlgorithm( new QgsRasterPixelsToPolygonsAlgorithm() );
214  addAlgorithm( new QgsRasterSurfaceVolumeAlgorithm() );
215  addAlgorithm( new QgsAlgorithmRemoveDuplicateVertices() );
216  addAlgorithm( new QgsReclassifyByLayerAlgorithm() );
217  addAlgorithm( new QgsReclassifyByTableAlgorithm() );
218  addAlgorithm( new QgsRemoveDuplicatesByAttributeAlgorithm() );
219  addAlgorithm( new QgsRemoveHolesAlgorithm() );
220  addAlgorithm( new QgsRemoveNullGeometryAlgorithm() );
221  addAlgorithm( new QgsRenameLayerAlgorithm() );
222  addAlgorithm( new QgsReverseLineDirectionAlgorithm() );
223  addAlgorithm( new QgsRotateFeaturesAlgorithm() );
224  addAlgorithm( new QgsSaveSelectedFeatures() );
225  addAlgorithm( new QgsSegmentizeByMaximumAngleAlgorithm() );
226  addAlgorithm( new QgsSegmentizeByMaximumDistanceAlgorithm() );
227  addAlgorithm( new QgsSelectByLocationAlgorithm() );
228  addAlgorithm( new QgsShortestPathLayerToPointAlgorithm() );
229  addAlgorithm( new QgsShortestPathPointToLayerAlgorithm() );
230  addAlgorithm( new QgsShortestPathPointToPointAlgorithm() );
231  addAlgorithm( new QgsSimplifyAlgorithm() );
232  addAlgorithm( new QgsSmoothAlgorithm() );
233  addAlgorithm( new QgsSnapToGridAlgorithm() );
234  addAlgorithm( new QgsSplitGeometryAtAntimeridianAlgorithm() );
235  addAlgorithm( new QgsSplitLinesByLengthAlgorithm() );
236  addAlgorithm( new QgsSplitWithLinesAlgorithm() );
237  addAlgorithm( new QgsStringConcatenationAlgorithm() );
238  addAlgorithm( new QgsSubdivideAlgorithm() );
239  addAlgorithm( new QgsSwapXYAlgorithm() );
240  addAlgorithm( new QgsSymmetricalDifferenceAlgorithm() );
241  addAlgorithm( new QgsTaperedBufferAlgorithm() );
242  addAlgorithm( new QgsTransectAlgorithm() );
243  addAlgorithm( new QgsTransformAlgorithm() );
244  addAlgorithm( new QgsTranslateAlgorithm() );
245  addAlgorithm( new QgsUnionAlgorithm() );
246  addAlgorithm( new QgsVariableWidthBufferByMAlgorithm() );
247  addAlgorithm( new QgsWedgeBuffersAlgorithm() );
248  addAlgorithm( new QgsZonalHistogramAlgorithm() );
249  addAlgorithm( new QgsPolygonsToLinesAlgorithm() );
250  addAlgorithm( new QgsDensifyGeometriesByIntervalAlgorithm() );
251 }
252 
253 
255 
256 
257 
QIcon icon() const override
Returns an icon for the provider.
QString id() const override
Returns the unique provider id, used for identifying the provider.
static QString iconPath(const QString &iconFile)
Returns path to the desired icon file.
static QIcon getThemeIcon(const QString &name)
Helper to get a theme icon.
Abstract base class for processing providers.
QString helpId() const override
Returns the provider help id string, used for creating QgsHelp urls for algorithms belong to this pro...
void loadAlgorithms() override
Loads all algorithms belonging to this provider.
bool supportsNonFileBasedOutput() const override
Returns true if the provider supports non-file based outputs (such as memory layers or direct databas...
QString name() const override
Returns the provider name, which is used to describe the provider within the GUI. ...
bool addAlgorithm(QgsProcessingAlgorithm *algorithm)
Adds an algorithm to the provider.
QString svgIconPath() const override
Returns a path to an SVG version of the provider's icon.
QgsNativeAlgorithms(QObject *parent=nullptr)
Constructor for QgsNativeAlgorithms.