QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
processing
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
16
#include "
qgsprocessingparameterinterpolationpixelsize.h
"
17
18
#include "
qgsprocessingcontext.h
"
19
20
#include <QString>
21
22
using namespace
Qt::StringLiterals;
23
24
25
QgsProcessingParameterInterpolationPixelSize::QgsProcessingParameterInterpolationPixelSize
(
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
33
QgsProcessingParameterInterpolationPixelSize
*
QgsProcessingParameterInterpolationPixelSize::clone
()
const
34
{
35
return
new
QgsProcessingParameterInterpolationPixelSize
(
name
(),
description
(), mInterpolationSourceParam, mExtentParam,
defaultValue
() );
36
}
37
38
QString
QgsProcessingParameterInterpolationPixelSize::type
()
const
39
{
40
return
typeName
();
41
}
42
43
QString
QgsProcessingParameterInterpolationPixelSize::asPythonString
(
QgsProcessing::PythonOutputType
outputType )
const
44
{
45
switch
( outputType )
46
{
47
case
QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass
:
48
{
49
QString code
50
= u
"QgsProcessingParameterInterpolationPixelSize('%1', %2, %3, %4"
_s
51
.arg(
name
(),
QgsProcessingUtils::stringToPythonLiteral
(
description
() ),
QgsProcessingUtils::stringToPythonLiteral
( mInterpolationSourceParam ),
QgsProcessingUtils::stringToPythonLiteral
( mExtentParam ) );
52
QgsProcessingContext
c
;
53
code += u
", defaultValue=%1)"
_s.arg(
valueAsPythonString
(
mDefault
,
c
) );
54
return
code;
55
}
56
}
57
return
QString();
58
}
Qgis
Provides global constants and enumerations for use throughout the application.
Definition
qgis.h:62
QgsProcessingContext
Contains information about the context in which a processing algorithm is executed.
Definition
qgsprocessingcontext.h:45
QgsProcessingParameterDefinition::defaultValue
QVariant defaultValue() const
Returns the default value for the parameter.
Definition
qgsprocessingparameters.h:660
QgsProcessingParameterDefinition::description
QString description() const
Returns the description for the parameter.
Definition
qgsprocessingparameters.h:623
QgsProcessingParameterDefinition::name
QString name() const
Returns the name of the parameter.
Definition
qgsprocessingparameters.h:609
QgsProcessingParameterDefinition::mDefault
QVariant mDefault
Default value for parameter.
Definition
qgsprocessingparameters.h:1018
QgsProcessingParameterInterpolationPixelSize::asPythonString
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...
Definition
qgsprocessingparameterinterpolationpixelsize.cpp:43
QgsProcessingParameterInterpolationPixelSize::typeName
static QString typeName()
Returns the type name for the parameter class.
Definition
qgsprocessingparameterinterpolationpixelsize.h:49
QgsProcessingParameterInterpolationPixelSize::QgsProcessingParameterInterpolationPixelSize
QgsProcessingParameterInterpolationPixelSize(const QString &name, const QString &description=QString(), const QString &interpolationSourceParameter=QString(), const QString &extentParameter=QString(), const QVariant &defaultValue=QVariant())
Constructor for QgsProcessingParameterInterpolationPixelSize.
Definition
qgsprocessingparameterinterpolationpixelsize.cpp:25
QgsProcessingParameterInterpolationPixelSize::type
QString type() const override
Unique parameter type name.
Definition
qgsprocessingparameterinterpolationpixelsize.cpp:38
QgsProcessingParameterInterpolationPixelSize::extentParameter
QString extentParameter() const
Returns the linked extent parameter name.
Definition
qgsprocessingparameterinterpolationpixelsize.h:60
QgsProcessingParameterInterpolationPixelSize::clone
QgsProcessingParameterInterpolationPixelSize * clone() const override
Creates a clone of the parameter definition.
Definition
qgsprocessingparameterinterpolationpixelsize.cpp:33
QgsProcessingParameterInterpolationPixelSize::interpolationSourceParameter
QString interpolationSourceParameter() const
Returns the linked interpolation source parameter name.
Definition
qgsprocessingparameterinterpolationpixelsize.h:55
QgsProcessingParameterNumber::valueAsPythonString
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...
Definition
qgsprocessingparameters.cpp:4879
QgsProcessingParameterNumber::QgsProcessingParameterNumber
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.
Definition
qgsprocessingparameters.cpp:4836
QgsProcessingUtils::stringToPythonLiteral
static QString stringToPythonLiteral(const QString &string)
Converts a string to a Python string literal.
Definition
qgsprocessingutils.cpp:869
QgsProcessing::PythonOutputType
PythonOutputType
Available Python output types.
Definition
qgsprocessing.h:50
QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass
@ PythonQgsProcessingAlgorithmSubclass
Full Python QgsProcessingAlgorithm subclass.
Definition
qgsprocessing.h:51
c
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
Definition
porting_processing.dox:1
qgsprocessingcontext.h
qgsprocessingparameterinterpolationpixelsize.h
Generated on
for QGIS API Documentation by
1.17.0