QGIS API Documentation 4.3.0-Master (729d6602d19)
Loading...
Searching...
No Matches
qgsprocessingparameterinterpolationpixelsize.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgsprocessingparameterinterpolationpixelsize.cpp
3 ---------------------
4 Date : August 2026
5 Copyright : (C) 2026 by Nyall Dawson
6 Email : nyall dot dawson 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
17
19
20#include <QString>
21
22using namespace Qt::StringLiterals;
23
24
26 const QString &name, const QString &description, const QString &interpolationSourceParameter, const QString &extentParameter, const QVariant &defaultValue
27)
28 : QgsProcessingParameterNumber( name, description, Qgis::ProcessingNumberParameterType::Double, defaultValue, false, 0 )
29 , mInterpolationSourceParam( interpolationSourceParameter )
30 , mExtentParam( extentParameter )
31{}
32
37
42
44{
45 switch ( outputType )
46 {
48 {
49 QString code
50 = u"QgsProcessingParameterInterpolationPixelSize('%1', %2, %3, %4"_s
53 code += u", defaultValue=%1)"_s.arg( valueAsPythonString( mDefault, c ) );
54 return code;
55 }
56 }
57 return QString();
58}
Provides global constants and enumerations for use throughout the application.
Definition qgis.h:62
Contains information about the context in which a processing algorithm is executed.
QVariant defaultValue() const
Returns the default value for the parameter.
QString description() const
Returns the description for the parameter.
QString name() const
Returns the name of the parameter.
QVariant mDefault
Default value for parameter.
QString asPythonString(QgsProcessing::PythonOutputType outputType=QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass) const override
Returns the parameter definition as a Python command which can be used within a Python Processing scr...
static QString typeName()
Returns the type name for the parameter class.
QgsProcessingParameterInterpolationPixelSize(const QString &name, const QString &description=QString(), const QString &interpolationSourceParameter=QString(), const QString &extentParameter=QString(), const QVariant &defaultValue=QVariant())
Constructor for QgsProcessingParameterInterpolationPixelSize.
QString extentParameter() const
Returns the linked extent parameter name.
QgsProcessingParameterInterpolationPixelSize * clone() const override
Creates a clone of the parameter definition.
QString interpolationSourceParameter() const
Returns the linked interpolation source parameter name.
QString valueAsPythonString(const QVariant &value, QgsProcessingContext &context) const override
Returns a string version of the parameter input value, which is suitable for use as an input paramete...
QgsProcessingParameterNumber(const QString &name, const QString &description=QString(), Qgis::ProcessingNumberParameterType type=Qgis::ProcessingNumberParameterType::Integer, const QVariant &defaultValue=QVariant(), bool optional=false, double minValue=std::numeric_limits< double >::lowest()+1, double maxValue=std::numeric_limits< double >::max())
Constructor for QgsProcessingParameterNumber.
static QString stringToPythonLiteral(const QString &string)
Converts a string to a Python string literal.
PythonOutputType
Available Python output types.
@ PythonQgsProcessingAlgorithmSubclass
Full Python QgsProcessingAlgorithm subclass.
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into c