QGIS API Documentation  3.0.2-Girona (307d082)
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 "qgsalgorithmdissolve.h"
41 #include "qgsalgorithmloadlayer.h"
43 #include "qgsalgorithmmergelines.h"
49 #include "qgsalgorithmpackage.h"
56 #include "qgsalgorithmsimplify.h"
57 #include "qgsalgorithmsmooth.h"
58 #include "qgsalgorithmsnaptogrid.h"
61 #include "qgsalgorithmsubdivide.h"
62 #include "qgsalgorithmtransect.h"
63 #include "qgsalgorithmtransform.h"
64 #include "qgsalgorithmtranslate.h"
66 
67 
69 
71  : QgsProcessingProvider( parent )
72 {}
73 
74 QIcon QgsNativeAlgorithms::icon() const
75 {
76  return QgsApplication::getThemeIcon( QStringLiteral( "/providerQgis.svg" ) );
77 }
78 
80 {
81  return QgsApplication::iconPath( QStringLiteral( "providerQgis.svg" ) );
82 }
83 
84 QString QgsNativeAlgorithms::id() const
85 {
86  return QStringLiteral( "native" );
87 }
88 
89 QString QgsNativeAlgorithms::helpId() const
90 {
91  return QStringLiteral( "qgis" );
92 }
93 
94 QString QgsNativeAlgorithms::name() const
95 {
96  return tr( "QGIS (native c++)" );
97 }
98 
100 {
101  return true;
102 }
103 
105 {
106  addAlgorithm( new QgsAddIncrementalFieldAlgorithm() );
107  addAlgorithm( new QgsAddUniqueValueIndexAlgorithm() );
108  addAlgorithm( new QgsAssignProjectionAlgorithm() );
109  addAlgorithm( new QgsBoundaryAlgorithm() );
110  addAlgorithm( new QgsBoundingBoxAlgorithm() );
111  addAlgorithm( new QgsBufferAlgorithm() );
112  addAlgorithm( new QgsCentroidAlgorithm() );
113  addAlgorithm( new QgsClipAlgorithm() );
114  addAlgorithm( new QgsCollectAlgorithm() );
115  addAlgorithm( new QgsConvexHullAlgorithm() );
116  addAlgorithm( new QgsDissolveAlgorithm() );
117  addAlgorithm( new QgsDropGeometryAlgorithm() );
118  addAlgorithm( new QgsDropMZValuesAlgorithm() );
119  addAlgorithm( new QgsExtentToLayerAlgorithm() );
120  addAlgorithm( new QgsExtractByAttributeAlgorithm() );
121  addAlgorithm( new QgsExtractByExpressionAlgorithm() );
122  addAlgorithm( new QgsExtractByExtentAlgorithm() );
123  addAlgorithm( new QgsExtractByLocationAlgorithm() );
124  addAlgorithm( new QgsExtractVerticesAlgorithm() );
125  addAlgorithm( new QgsFileDownloaderAlgorithm() );
126  addAlgorithm( new QgsFixGeometriesAlgorithm() );
127  addAlgorithm( new QgsJoinByAttributeAlgorithm() );
128  addAlgorithm( new QgsJoinWithLinesAlgorithm() );
129  addAlgorithm( new QgsLineIntersectionAlgorithm() );
130  addAlgorithm( new QgsLoadLayerAlgorithm() );
131  addAlgorithm( new QgsMeanCoordinatesAlgorithm() );
132  addAlgorithm( new QgsMergeLinesAlgorithm() );
133  addAlgorithm( new QgsMergeVectorAlgorithm() );
134  addAlgorithm( new QgsMinimumEnclosingCircleAlgorithm() );
135  addAlgorithm( new QgsMultipartToSinglepartAlgorithm() );
136  addAlgorithm( new QgsOrderByExpressionAlgorithm() );
137  addAlgorithm( new QgsOrientedMinimumBoundingBoxAlgorithm() );
138  addAlgorithm( new QgsPackageAlgorithm() );
139  addAlgorithm( new QgsPromoteToMultipartAlgorithm() );
140  addAlgorithm( new QgsRasterLayerUniqueValuesReportAlgorithm() );
141  addAlgorithm( new QgsAlgorithmRemoveDuplicateVertices() );
142  addAlgorithm( new QgsRemoveNullGeometryAlgorithm() );
143  addAlgorithm( new QgsRenameLayerAlgorithm() );
144  addAlgorithm( new QgsSaveSelectedFeatures() );
145  addAlgorithm( new QgsSelectByLocationAlgorithm() );
146  addAlgorithm( new QgsSimplifyAlgorithm() );
147  addAlgorithm( new QgsSmoothAlgorithm() );
148  addAlgorithm( new QgsSnapToGridAlgorithm() );
149  addAlgorithm( new QgsSplitWithLinesAlgorithm() );
150  addAlgorithm( new QgsStringConcatenationAlgorithm() );
151  addAlgorithm( new QgsSubdivideAlgorithm() );
152  addAlgorithm( new QgsTransectAlgorithm() );
153  addAlgorithm( new QgsTransformAlgorithm() );
154  addAlgorithm( new QgsTranslateAlgorithm() );
155 }
156 
157 
159 
160 
161 
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.