22 QString QgsConvertToCurvesAlgorithm::name()
const
24 return QStringLiteral(
"converttocurves" );
27 QString QgsConvertToCurvesAlgorithm::displayName()
const
29 return QObject::tr(
"Convert to curved geometries" );
32 QStringList QgsConvertToCurvesAlgorithm::tags()
const
34 return QObject::tr(
"straight,segmentize,curves,curved,circular" ).split(
',' );
37 QString QgsConvertToCurvesAlgorithm::group()
const
39 return QObject::tr(
"Vector geometry" );
42 QString QgsConvertToCurvesAlgorithm::groupId()
const
44 return QStringLiteral(
"vectorgeometry" );
47 QString QgsConvertToCurvesAlgorithm::outputName()
const
49 return QObject::tr(
"Curves" );
52 QString QgsConvertToCurvesAlgorithm::shortHelpString()
const
54 return QObject::tr(
"This algorithm converts a geometry into its curved geometry equivalent.\n\n"
55 "Already curved geometries will be retained without change." );
58 QgsConvertToCurvesAlgorithm *QgsConvertToCurvesAlgorithm::createInstance()
const
60 return new QgsConvertToCurvesAlgorithm();
63 QList<int> QgsConvertToCurvesAlgorithm::inputLayerTypes()
const
68 void QgsConvertToCurvesAlgorithm::initParameters(
const QVariantMap & )
70 std::unique_ptr< QgsProcessingParameterNumber > tolerance = std::make_unique< QgsProcessingParameterNumber >( QStringLiteral(
"DISTANCE" ),
72 0.000001,
false, 0, 10000000.0 );
73 tolerance->setIsDynamic(
true );
75 tolerance->setDynamicLayerParameterName( QStringLiteral(
"INPUT" ) );
76 addParameter( tolerance.release() );
78 std::unique_ptr< QgsProcessingParameterNumber > angleTolerance = std::make_unique< QgsProcessingParameterNumber >( QStringLiteral(
"ANGLE" ),
80 0.000001,
false, 0, 45.0 );
81 angleTolerance->setIsDynamic(
true );
83 angleTolerance->setDynamicLayerParameterName( QStringLiteral(
"INPUT" ) );
84 addParameter( angleTolerance.release() );
89 mTolerance = parameterAsDouble( parameters, QStringLiteral(
"DISTANCE" ), context );
91 if ( mDynamicTolerance )
92 mToleranceProperty = parameters.value( QStringLiteral(
"DISTANCE" ) ).value<
QgsProperty >();
94 mAngleTolerance = parameterAsDouble( parameters, QStringLiteral(
"ANGLE" ), context );
96 if ( mDynamicAngleTolerance )
97 mAngleToleranceProperty = parameters.value( QStringLiteral(
"ANGLE" ) ).value<
QgsProperty >();
108 double tolerance = mTolerance;
109 if ( mDynamicTolerance )
110 tolerance = mToleranceProperty.valueAsDouble( context.
expressionContext(), tolerance );
111 double angleTolerance = mAngleTolerance;
112 if ( mDynamicAngleTolerance )