QGIS API Documentation  3.21.0-Master (564c892cfd)
qgsprocessing.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsprocessing.h
3  ---------------
4  begin : July 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 #ifndef QGSPROCESSING_H
19 #define QGSPROCESSING_H
20 
21 #include "qgis_core.h"
22 #include "qgssettingsentry.h"
23 #include <QString>
24 
25 //
26 // Output definitions
27 //
28 
39 class CORE_EXPORT QgsProcessing
40 {
41 
42  public:
43 
46  {
47  TypeMapLayer = -2,
48  TypeVectorAnyGeometry = -1,
49  TypeVectorPoint = 0,
50  TypeVectorLine = 1,
51  TypeVectorPolygon = 2,
52  TypeRaster = 3,
53  TypeFile = 4,
54  TypeVector = 5,
55  TypeMesh = 6
56  };
57 
60  {
62  };
63 
69  static QString sourceTypeToString( SourceType type )
70  {
71  switch ( type )
72  {
74  return QStringLiteral( "TypeMapLayer" );
76  return QStringLiteral( "TypeVectorAnyGeometry" );
78  return QStringLiteral( "TypeVectorPoint" );
80  return QStringLiteral( "TypeVectorLine" );
82  return QStringLiteral( "TypeVectorPolygon" );
84  return QStringLiteral( "TypeRaster" );
86  return QStringLiteral( "TypeFile" );
88  return QStringLiteral( "TypeVector" );
90  return QStringLiteral( "TypeMesh" );
91  }
92  return QString();
93  }
94 
100  static const QString TEMPORARY_OUTPUT;
101 
102 #ifndef SIP_RUN
104  static const inline QgsSettingsEntryBool settingsPreferFilenameAsLayerName = QgsSettingsEntryBool( QStringLiteral( "Processing/Configuration/PREFER_FILENAME_AS_LAYER_NAME" ), QgsSettings::NoSection, true, QObject::tr( "Prefer filename as layer name" ) );
106  static const inline QgsSettingsEntryString settingsTempPath = QgsSettingsEntryString( QStringLiteral( "Processing/Configuration/TEMP_PATH2" ), QgsSettings::NoSection, QString() );
108  static const inline QgsSettingsEntryInteger settingsDefaultOutputVectorLayerExt = QgsSettingsEntryInteger( QStringLiteral( "Processing/Configuration/DefaultOutputVectorLayerExt" ), QgsSettings::NoSection, -1 );
110  static const inline QgsSettingsEntryInteger settingsDefaultOutputRasterLayerExt = QgsSettingsEntryInteger( QStringLiteral( "Processing/Configuration/DefaultOutputRasterLayerExt" ), QgsSettings::NoSection, -1 );
111 #endif
112 };
113 
114 #endif // QGSPROCESSING_H
Contains enumerations and other constants for use in processing algorithms and parameters.
Definition: qgsprocessing.h:40
static const QString TEMPORARY_OUTPUT
Constant used to indicate that a Processing algorithm output should be a temporary layer/file.
PythonOutputType
Available Python output types.
Definition: qgsprocessing.h:60
@ PythonQgsProcessingAlgorithmSubclass
Full Python QgsProcessingAlgorithm subclass.
Definition: qgsprocessing.h:61
SourceType
Data source types enum.
Definition: qgsprocessing.h:46
@ TypeVectorLine
Vector line layers.
Definition: qgsprocessing.h:50
@ TypeMapLayer
Any map layer type (raster or vector or mesh)
Definition: qgsprocessing.h:47
@ TypeVectorPolygon
Vector polygon layers.
Definition: qgsprocessing.h:51
@ TypeFile
Files (i.e. non map layer sources, such as text files)
Definition: qgsprocessing.h:53
@ TypeMesh
Mesh layers.
Definition: qgsprocessing.h:55
@ TypeVector
Tables (i.e. vector layers with or without geometry). When used for a sink this indicates the sink ha...
Definition: qgsprocessing.h:54
@ TypeRaster
Raster layers.
Definition: qgsprocessing.h:52
@ TypeVectorPoint
Vector point layers.
Definition: qgsprocessing.h:49
@ TypeVectorAnyGeometry
Any vector layer with geometry.
Definition: qgsprocessing.h:48
static QString sourceTypeToString(SourceType type)
Converts a source type to a string representation.
Definition: qgsprocessing.h:69