QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
qgsprocessingparametertininputlayers.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsprocessingparametertininputlayers.h
3  ---------------------
4  Date : August 2020
5  Copyright : (C) 2020 by Vincent Cloarec
6  Email : vcloarec at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #ifndef QGSPROCESSINGPARAMETERTININPUTLAYERS_H
17 #define QGSPROCESSINGPARAMETERTININPUTLAYERS_H
18 
21 
36 {
37  public:
38 
40  enum Type
41  {
44  BreakLines
45  };
46 
48  struct InputLayer
49  {
50  QString source;
53  };
54 
56  QgsProcessingParameterTinInputLayers( const QString &name, const QString &description = QString() );
57 
58  QgsProcessingParameterDefinition *clone() const override;
59  QString type() const override;
60  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
61  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
63 
65  static QString typeName() { return QStringLiteral( "tininputlayers" ); }
66 };
67 
75 {
76  public:
77  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
78  {
79  return new QgsProcessingParameterTinInputLayers( name );
80  }
81 
82  QString description() const override
83  {
84  return QCoreApplication::translate( "Processing", "An input allowing selection of multiple layers to create a TIN with vertices and/or break lines" );
85  }
86 
87  QString name() const override
88  {
89  return QCoreApplication::translate( "Processing", "TIN Creation Layers" );
90  }
91 
92  QString id() const override
93  {
95  }
96 
97  QString pythonImportString() const override
98  {
99  return QStringLiteral( "from qgis.core import QgsProcessingParameterTinInputLayers" );
100  }
101 
102  QString className() const override
103  {
104  return QStringLiteral( "QgsProcessingParameterTinInputLayers" );
105  }
106 
107  QStringList acceptedPythonTypes() const override
108  {
109  return QStringList() << QObject::tr( "list[dict]: list of input layers as dictionaries, see QgsProcessingParameterTinInputLayers docs" );
110  }
111 };
112 
113 #endif // QGSPROCESSINGPARAMETERTININPUTLAYERS_H
QgsProcessingParameterTinInputLayers::InputLayer::source
QString source
Definition: qgsprocessingparametertininputlayers.h:50
qgsprocessingparametertype.h
QgsProcessingParameterTinInputLayers::Type
Type
Defines the type of input layer.
Definition: qgsprocessingparametertininputlayers.h:41
QgsProcessingParameterTinInputLayers::InputLayer
Used to store input layer Id and other associated parameters.
Definition: qgsprocessingparametertininputlayers.h:49
QgsProcessingParameterDefinition::valueAsPythonString
virtual QString valueAsPythonString(const QVariant &value, QgsProcessingContext &context) const
Returns a string version of the parameter input value, which is suitable for use as an input paramete...
Definition: qgsprocessingparameters.cpp:2312
QgsProcessingParameterTinInputLayers
A parameter for processing algorithms that need a list of input vector layers to construct a TIN A va...
Definition: qgsprocessingparametertininputlayers.h:36
QgsProcessingParameterTypeTinInputLayers::acceptedPythonTypes
QStringList acceptedPythonTypes() const override
Returns a list of the Python data types accepted as values for the parameter.
Definition: qgsprocessingparametertininputlayers.h:107
QgsProcessingParameterTinInputLayers::InputLayer::type
Type type
The source of the input layer.
Definition: qgsprocessingparametertininputlayers.h:51
QgsProcessingParameterTypeTinInputLayers::className
QString className() const override
Returns the corresponding class name for the parameter type.
Definition: qgsprocessingparametertininputlayers.h:102
QgsProcessingParameterDefinition
Base class for the definition of processing parameters.
Definition: qgsprocessingparameters.h:331
QgsProcessingParameterType
Makes metadata of processing parameters available.
Definition: qgsprocessingparametertype.h:34
SIP_FACTORY
#define SIP_FACTORY
Definition: qgis_sip.h:76
QgsProcessingParameterTypeTinInputLayers
Parameter type definition for QgsProcessingParameterTinInputLayers.
Definition: qgsprocessingparametertininputlayers.h:75
QgsProcessing::PythonQgsProcessingAlgorithmSubclass
@ PythonQgsProcessingAlgorithmSubclass
Full Python QgsProcessingAlgorithm subclass.
Definition: qgsprocessing.h:60
QgsProcessingContext
Contains information about the context in which a processing algorithm is executed.
Definition: qgsprocessingcontext.h:44
QgsProcessingParameterTypeTinInputLayers::pythonImportString
QString pythonImportString() const override
Returns a valid Python import string for importing the corresponding parameter type,...
Definition: qgsprocessingparametertininputlayers.h:97
QgsProcessingParameterTinInputLayers::Vertices
@ Vertices
Input that adds only vertices.
Definition: qgsprocessingparametertininputlayers.h:42
QgsProcessingParameterTinInputLayers::StructureLines
@ StructureLines
Input that adds add structure lines.
Definition: qgsprocessingparametertininputlayers.h:43
QgsProcessingParameterTypeTinInputLayers::description
QString description() const override
A human readable and translatable description for this parameter type.
Definition: qgsprocessingparametertininputlayers.h:82
qgsprocessingparameters.h
QgsProcessingParameterTypeTinInputLayers::create
QgsProcessingParameterDefinition * create(const QString &name) const override
Creates a new parameter of this type.
Definition: qgsprocessingparametertininputlayers.h:77
QgsProcessingParameterTinInputLayers::InputLayer::attributeIndex
int attributeIndex
The type of the input layer (see Type)
Definition: qgsprocessingparametertininputlayers.h:52
QgsProcessingParameterDefinition::asPythonString
virtual QString asPythonString(QgsProcessing::PythonOutputType outputType=QgsProcessing::PythonQgsProcessingAlgorithmSubclass) const
Returns the parameter definition as a Python command which can be used within a Python Processing scr...
Definition: qgsprocessingparameters.cpp:2333
QgsProcessingParameterDefinition::clone
virtual QgsProcessingParameterDefinition * clone() const =0
Creates a clone of the parameter definition.
QgsProcessingParameterDefinition::type
virtual QString type() const =0
Unique parameter type name.
QgsProcessing::PythonOutputType
PythonOutputType
Available Python output types.
Definition: qgsprocessing.h:59
QgsProcessingParameterTypeTinInputLayers::id
QString id() const override
A static id for this type which will be used for storing this parameter type.
Definition: qgsprocessingparametertininputlayers.h:92
QgsProcessingParameterTypeTinInputLayers::name
QString name() const override
A human readable and translatable short name for this parameter type.
Definition: qgsprocessingparametertininputlayers.h:87
QgsProcessingParameterDefinition::checkValueIsAcceptable
virtual bool checkValueIsAcceptable(const QVariant &input, QgsProcessingContext *context=nullptr) const
Checks whether the specified input value is acceptable for the parameter.
Definition: qgsprocessingparameters.cpp:2300
QgsProcessingParameterTinInputLayers::typeName
static QString typeName()
Returns the type name for the parameter class.
Definition: qgsprocessingparametertininputlayers.h:65