QGIS API Documentation  3.2.0-Bonn (bc43194)
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"
21 #include "qgsalgorithmboundary.h"
23 #include "qgsalgorithmbuffer.h"
24 #include "qgsalgorithmcentroid.h"
25 #include "qgsalgorithmclip.h"
26 #include "qgsalgorithmconvexhull.h"
27 #include "qgsalgorithmdifference.h"
28 #include "qgsalgorithmdissolve.h"
31 #include "qgsalgorithmexplode.h"
39 #include "qgsalgorithmfilter.h"
46 #include "qgsalgorithmloadlayer.h"
48 #include "qgsalgorithmmergelines.h"
55 #include "qgsalgorithmpackage.h"
65 #include "qgsalgorithmrotate.h"
67 #include "qgsalgorithmsegmentize.h"
68 #include "qgsalgorithmsimplify.h"
69 #include "qgsalgorithmsmooth.h"
70 #include "qgsalgorithmsnaptogrid.h"
73 #include "qgsalgorithmsubdivide.h"
74 #include "qgsalgorithmswapxy.h"
77 #include "qgsalgorithmtransect.h"
78 #include "qgsalgorithmtransform.h"
79 #include "qgsalgorithmtranslate.h"
80 #include "qgsalgorithmunion.h"
84 
85 
87 
89  : QgsProcessingProvider( parent )
90 {}
91 
92 QIcon QgsNativeAlgorithms::icon() const
93 {
94  return QgsApplication::getThemeIcon( QStringLiteral( "/providerQgis.svg" ) );
95 }
96 
98 {
99  return QgsApplication::iconPath( QStringLiteral( "providerQgis.svg" ) );
100 }
101 
102 QString QgsNativeAlgorithms::id() const
103 {
104  return QStringLiteral( "native" );
105 }
106 
107 QString QgsNativeAlgorithms::helpId() const
108 {
109  return QStringLiteral( "qgis" );
110 }
111 
112 QString QgsNativeAlgorithms::name() const
113 {
114  return tr( "QGIS (native c++)" );
115 }
116 
118 {
119  return true;
120 }
121 
123 {
124  addAlgorithm( new QgsAddIncrementalFieldAlgorithm() );
125  addAlgorithm( new QgsAddUniqueValueIndexAlgorithm() );
126  addAlgorithm( new QgsAssignProjectionAlgorithm() );
127  addAlgorithm( new QgsBoundaryAlgorithm() );
128  addAlgorithm( new QgsBoundingBoxAlgorithm() );
129  addAlgorithm( new QgsBufferAlgorithm() );
130  addAlgorithm( new QgsCentroidAlgorithm() );
131  addAlgorithm( new QgsClipAlgorithm() );
132  addAlgorithm( new QgsCollectAlgorithm() );
133  addAlgorithm( new QgsConvexHullAlgorithm() );
134  addAlgorithm( new QgsDifferenceAlgorithm() );
135  addAlgorithm( new QgsDissolveAlgorithm() );
136  addAlgorithm( new QgsDropGeometryAlgorithm() );
137  addAlgorithm( new QgsDropMZValuesAlgorithm() );
138  addAlgorithm( new QgsExplodeAlgorithm() );
139  addAlgorithm( new QgsExtentToLayerAlgorithm() );
140  addAlgorithm( new QgsExtractByAttributeAlgorithm() );
141  addAlgorithm( new QgsExtractByExpressionAlgorithm() );
142  addAlgorithm( new QgsExtractByExtentAlgorithm() );
143  addAlgorithm( new QgsExtractByLocationAlgorithm() );
144  addAlgorithm( new QgsExtractVerticesAlgorithm() );
145  addAlgorithm( new QgsFileDownloaderAlgorithm() );
146  addAlgorithm( new QgsFilterAlgorithm() );
147  addAlgorithm( new QgsFixGeometriesAlgorithm() );
148  addAlgorithm( new QgsImportPhotosAlgorithm() );
149  addAlgorithm( new QgsIntersectionAlgorithm() );
150  addAlgorithm( new QgsJoinByAttributeAlgorithm() );
151  addAlgorithm( new QgsJoinWithLinesAlgorithm() );
152  addAlgorithm( new QgsLineIntersectionAlgorithm() );
153  addAlgorithm( new QgsLoadLayerAlgorithm() );
154  addAlgorithm( new QgsMeanCoordinatesAlgorithm() );
155  addAlgorithm( new QgsMergeLinesAlgorithm() );
156  addAlgorithm( new QgsMergeVectorAlgorithm() );
157  addAlgorithm( new QgsMinimumEnclosingCircleAlgorithm() );
158  addAlgorithm( new QgsMultipartToSinglepartAlgorithm() );
159  addAlgorithm( new QgsMultiRingConstantBufferAlgorithm() );
160  addAlgorithm( new QgsOrderByExpressionAlgorithm() );
161  addAlgorithm( new QgsOrientedMinimumBoundingBoxAlgorithm() );
162  addAlgorithm( new QgsPackageAlgorithm() );
163  addAlgorithm( new QgsPointOnSurfaceAlgorithm() );
164  addAlgorithm( new QgsProjectPointCartesianAlgorithm() );
165  addAlgorithm( new QgsPromoteToMultipartAlgorithm() );
166  addAlgorithm( new QgsRasterLayerUniqueValuesReportAlgorithm() );
167  addAlgorithm( new QgsAlgorithmRemoveDuplicateVertices() );
168  addAlgorithm( new QgsReclassifyByLayerAlgorithm() );
169  addAlgorithm( new QgsReclassifyByTableAlgorithm() );
170  addAlgorithm( new QgsRemoveHolesAlgorithm() );
171  addAlgorithm( new QgsRemoveNullGeometryAlgorithm() );
172  addAlgorithm( new QgsRenameLayerAlgorithm() );
173  addAlgorithm( new QgsRotateFeaturesAlgorithm() );
174  addAlgorithm( new QgsSaveSelectedFeatures() );
175  addAlgorithm( new QgsSegmentizeByMaximumAngleAlgorithm() );
176  addAlgorithm( new QgsSegmentizeByMaximumDistanceAlgorithm() );
177  addAlgorithm( new QgsSelectByLocationAlgorithm() );
178  addAlgorithm( new QgsSimplifyAlgorithm() );
179  addAlgorithm( new QgsSmoothAlgorithm() );
180  addAlgorithm( new QgsSnapToGridAlgorithm() );
181  addAlgorithm( new QgsSplitWithLinesAlgorithm() );
182  addAlgorithm( new QgsStringConcatenationAlgorithm() );
183  addAlgorithm( new QgsSubdivideAlgorithm() );
184  addAlgorithm( new QgsSwapXYAlgorithm() );
185  addAlgorithm( new QgsSymmetricalDifferenceAlgorithm() );
186  addAlgorithm( new QgsTaperedBufferAlgorithm() );
187  addAlgorithm( new QgsTransectAlgorithm() );
188  addAlgorithm( new QgsTransformAlgorithm() );
189  addAlgorithm( new QgsTranslateAlgorithm() );
190  addAlgorithm( new QgsUnionAlgorithm() );
191  addAlgorithm( new QgsVariableWidthBufferByMAlgorithm() );
192  addAlgorithm( new QgsWedgeBuffersAlgorithm() );
193  addAlgorithm( new QgsZonalHistogramAlgorithm() );
194 }
195 
196 
198 
199 
200 
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.