QGIS API Documentation  3.4.15-Madeira (e83d02e274)
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"
30 #include "qgsalgorithmdifference.h"
31 #include "qgsalgorithmdissolve.h"
32 #include "qgsalgorithmdrape.h"
35 #include "qgsalgorithmexplode.h"
44 #include "qgsalgorithmfilter.h"
55 #include "qgsalgorithmloadlayer.h"
57 #include "qgsalgorithmmergelines.h"
65 #include "qgsalgorithmpackage.h"
77 #include "qgsalgorithmrotate.h"
79 #include "qgsalgorithmsegmentize.h"
83 #include "qgsalgorithmsimplify.h"
84 #include "qgsalgorithmsmooth.h"
85 #include "qgsalgorithmsnaptogrid.h"
88 #include "qgsalgorithmsubdivide.h"
89 #include "qgsalgorithmswapxy.h"
92 #include "qgsalgorithmtransect.h"
93 #include "qgsalgorithmtransform.h"
94 #include "qgsalgorithmtranslate.h"
95 #include "qgsalgorithmunion.h"
97 #include "qgsalgorithmvectorize.h"
100 
101 
103 
105  : QgsProcessingProvider( parent )
106 {}
107 
108 QIcon QgsNativeAlgorithms::icon() const
109 {
110  return QgsApplication::getThemeIcon( QStringLiteral( "/providerQgis.svg" ) );
111 }
112 
113 QString QgsNativeAlgorithms::svgIconPath() const
114 {
115  return QgsApplication::iconPath( QStringLiteral( "providerQgis.svg" ) );
116 }
117 
118 QString QgsNativeAlgorithms::id() const
119 {
120  return QStringLiteral( "native" );
121 }
122 
123 QString QgsNativeAlgorithms::helpId() const
124 {
125  return QStringLiteral( "qgis" );
126 }
127 
128 QString QgsNativeAlgorithms::name() const
129 {
130  return tr( "QGIS (native c++)" );
131 }
132 
134 {
135  return true;
136 }
137 
139 {
140  addAlgorithm( new QgsAddIncrementalFieldAlgorithm() );
141  addAlgorithm( new QgsAddUniqueValueIndexAlgorithm() );
142  addAlgorithm( new QgsArrayTranslatedFeaturesAlgorithm() );
143  addAlgorithm( new QgsAssignProjectionAlgorithm() );
144  addAlgorithm( new QgsBoundaryAlgorithm() );
145  addAlgorithm( new QgsBoundingBoxAlgorithm() );
146  addAlgorithm( new QgsBufferAlgorithm() );
147  addAlgorithm( new QgsCategorizeUsingStyleAlgorithm() );
148  addAlgorithm( new QgsCentroidAlgorithm() );
149  addAlgorithm( new QgsClipAlgorithm() );
150  addAlgorithm( new QgsCollectAlgorithm() );
151  addAlgorithm( new QgsConvexHullAlgorithm() );
152  addAlgorithm( new QgsDbscanClusteringAlgorithm() );
153  addAlgorithm( new QgsDifferenceAlgorithm() );
154  addAlgorithm( new QgsDissolveAlgorithm() );
155  addAlgorithm( new QgsDrapeToMAlgorithm() );
156  addAlgorithm( new QgsDrapeToZAlgorithm() );
157  addAlgorithm( new QgsDropGeometryAlgorithm() );
158  addAlgorithm( new QgsDropMZValuesAlgorithm() );
159  addAlgorithm( new QgsExplodeAlgorithm() );
160  addAlgorithm( new QgsExtendLinesAlgorithm() );
161  addAlgorithm( new QgsExtentToLayerAlgorithm() );
162  addAlgorithm( new QgsExtractByAttributeAlgorithm() );
163  addAlgorithm( new QgsExtractByExpressionAlgorithm() );
164  addAlgorithm( new QgsExtractByExtentAlgorithm() );
165  addAlgorithm( new QgsExtractByLocationAlgorithm() );
166  addAlgorithm( new QgsExtractVerticesAlgorithm() );
167  addAlgorithm( new QgsFileDownloaderAlgorithm() );
168  addAlgorithm( new QgsFilterAlgorithm() );
169  addAlgorithm( new QgsFilterVerticesByM() );
170  addAlgorithm( new QgsFilterVerticesByZ() );
171  addAlgorithm( new QgsFixGeometriesAlgorithm() );
172  addAlgorithm( new QgsImportPhotosAlgorithm() );
173  addAlgorithm( new QgsInterpolatePointAlgorithm() );
174  addAlgorithm( new QgsIntersectionAlgorithm() );
175  addAlgorithm( new QgsJoinByAttributeAlgorithm() );
176  addAlgorithm( new QgsJoinWithLinesAlgorithm() );
177  addAlgorithm( new QgsKMeansClusteringAlgorithm() );
178  addAlgorithm( new QgsLineIntersectionAlgorithm() );
179  addAlgorithm( new QgsLineSubstringAlgorithm() );
180  addAlgorithm( new QgsLoadLayerAlgorithm() );
181  addAlgorithm( new QgsMeanCoordinatesAlgorithm() );
182  addAlgorithm( new QgsMergeLinesAlgorithm() );
183  addAlgorithm( new QgsMergeVectorAlgorithm() );
184  addAlgorithm( new QgsMinimumEnclosingCircleAlgorithm() );
185  addAlgorithm( new QgsMultipartToSinglepartAlgorithm() );
186  addAlgorithm( new QgsMultiRingConstantBufferAlgorithm() );
187  addAlgorithm( new QgsOffsetLinesAlgorithm() );
188  addAlgorithm( new QgsOrderByExpressionAlgorithm() );
189  addAlgorithm( new QgsOrientedMinimumBoundingBoxAlgorithm() );
190  addAlgorithm( new QgsPackageAlgorithm() );
191  addAlgorithm( new QgsCreateArrayOffsetLinesAlgorithm() );
192  addAlgorithm( new QgsPointOnSurfaceAlgorithm() );
193  addAlgorithm( new QgsProjectPointCartesianAlgorithm() );
194  addAlgorithm( new QgsPromoteToMultipartAlgorithm() );
195  addAlgorithm( new QgsRasterLayerUniqueValuesReportAlgorithm() );
196  addAlgorithm( new QgsRasterPixelsToPointsAlgorithm() );
197  addAlgorithm( new QgsRasterPixelsToPolygonsAlgorithm() );
198  addAlgorithm( new QgsAlgorithmRemoveDuplicateVertices() );
199  addAlgorithm( new QgsReclassifyByLayerAlgorithm() );
200  addAlgorithm( new QgsReclassifyByTableAlgorithm() );
201  addAlgorithm( new QgsRemoveHolesAlgorithm() );
202  addAlgorithm( new QgsRemoveNullGeometryAlgorithm() );
203  addAlgorithm( new QgsRenameLayerAlgorithm() );
204  addAlgorithm( new QgsReverseLineDirectionAlgorithm() );
205  addAlgorithm( new QgsRotateFeaturesAlgorithm() );
206  addAlgorithm( new QgsSaveSelectedFeatures() );
207  addAlgorithm( new QgsSegmentizeByMaximumAngleAlgorithm() );
208  addAlgorithm( new QgsSegmentizeByMaximumDistanceAlgorithm() );
209  addAlgorithm( new QgsSelectByLocationAlgorithm() );
210  addAlgorithm( new QgsShortestPathLayerToPointAlgorithm() );
211  addAlgorithm( new QgsShortestPathPointToLayerAlgorithm() );
212  addAlgorithm( new QgsShortestPathPointToPointAlgorithm() );
213  addAlgorithm( new QgsSimplifyAlgorithm() );
214  addAlgorithm( new QgsSmoothAlgorithm() );
215  addAlgorithm( new QgsSnapToGridAlgorithm() );
216  addAlgorithm( new QgsSplitWithLinesAlgorithm() );
217  addAlgorithm( new QgsStringConcatenationAlgorithm() );
218  addAlgorithm( new QgsSubdivideAlgorithm() );
219  addAlgorithm( new QgsSwapXYAlgorithm() );
220  addAlgorithm( new QgsSymmetricalDifferenceAlgorithm() );
221  addAlgorithm( new QgsTaperedBufferAlgorithm() );
222  addAlgorithm( new QgsTransectAlgorithm() );
223  addAlgorithm( new QgsTransformAlgorithm() );
224  addAlgorithm( new QgsTranslateAlgorithm() );
225  addAlgorithm( new QgsUnionAlgorithm() );
226  addAlgorithm( new QgsVariableWidthBufferByMAlgorithm() );
227  addAlgorithm( new QgsWedgeBuffersAlgorithm() );
228  addAlgorithm( new QgsZonalHistogramAlgorithm() );
229 }
230 
231 
233 
234 
235 
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.