22QString QgsExtendLinesAlgorithm::name()
 const 
   24  return QStringLiteral( 
"extendlines" );
 
   27QString QgsExtendLinesAlgorithm::displayName()
 const 
   29  return QObject::tr( 
"Extend lines" );
 
   32QStringList QgsExtendLinesAlgorithm::tags()
 const 
   34  return QObject::tr( 
"linestring,continue,grow,extrapolate" ).split( 
',' );
 
   37QString QgsExtendLinesAlgorithm::group()
 const 
   39  return QObject::tr( 
"Vector geometry" );
 
   42QString QgsExtendLinesAlgorithm::groupId()
 const 
   44  return QStringLiteral( 
"vectorgeometry" );
 
   47QString QgsExtendLinesAlgorithm::outputName()
 const 
   49  return QObject::tr( 
"Extended" );
 
   52QString QgsExtendLinesAlgorithm::shortHelpString()
 const 
   54  return QObject::tr( 
"This algorithm extends line geometries by a specified amount at the start and end " 
   55                      "of the line. Lines are extended using the bearing of the first and last segment " 
   59QString QgsExtendLinesAlgorithm::shortDescription()
 const 
   61  return QObject::tr( 
"Extends LineString geometries by extrapolating the start and end segments." );
 
   64QList<int> QgsExtendLinesAlgorithm::inputLayerTypes()
 const 
   74QgsExtendLinesAlgorithm *QgsExtendLinesAlgorithm::createInstance()
 const 
   76  return new QgsExtendLinesAlgorithm();
 
   79void QgsExtendLinesAlgorithm::initParameters( 
const QVariantMap & )
 
   81  auto startDistance = std::make_unique<QgsProcessingParameterDistance>( QStringLiteral( 
"START_DISTANCE" ), QObject::tr( 
"Start distance" ), 0.0, QStringLiteral( 
"INPUT" ), 
false, 0 );
 
   82  startDistance->setIsDynamic( 
true );
 
   84  startDistance->setDynamicLayerParameterName( QStringLiteral( 
"INPUT" ) );
 
   85  addParameter( startDistance.release() );
 
   87  auto endDistance = std::make_unique<QgsProcessingParameterDistance>( QStringLiteral( 
"END_DISTANCE" ), QObject::tr( 
"End distance" ), 0.0, QStringLiteral( 
"INPUT" ), 
false, 0 );
 
   88  endDistance->setIsDynamic( 
true );
 
   90  endDistance->setDynamicLayerParameterName( QStringLiteral( 
"INPUT" ) );
 
   91  addParameter( endDistance.release() );
 
  102  mStartDistance = parameterAsDouble( parameters, QStringLiteral( 
"START_DISTANCE" ), context );
 
  104  if ( mDynamicStartDistance )
 
  105    mStartDistanceProperty = parameters.value( QStringLiteral( 
"START_DISTANCE" ) ).value<
QgsProperty>();
 
  107  mEndDistance = parameterAsDouble( parameters, QStringLiteral( 
"END_DISTANCE" ), context );
 
  109  if ( mDynamicEndDistance )
 
  110    mEndDistanceProperty = parameters.value( QStringLiteral( 
"END_DISTANCE" ) ).value<
QgsProperty>();
 
  121    double startDistance = mStartDistance;
 
  122    if ( mDynamicStartDistance )
 
  123      startDistance = mStartDistanceProperty.valueAsDouble( context.
expressionContext(), startDistance );
 
  125    double endDistance = mEndDistance;
 
  126    if ( mDynamicEndDistance )
 
  130    if ( outGeometry.
isNull() )
 
ProcessingSourceType
Processing data source types.
 
@ VectorLine
Vector line layers.
 
@ SkipGeometryValidityChecks
Invalid geometry checks should always be skipped. This flag can be useful for algorithms which always...
 
QFlags< ProcessingFeatureSourceFlag > ProcessingFeatureSourceFlags
Flags which control how QgsProcessingFeatureSource fetches features.
 
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
 
bool hasGeometry() const
Returns true if the feature has an associated geometry.
 
void setGeometry(const QgsGeometry &geometry)
Set the feature's geometry.
 
A geometry is the spatial representation of a feature.
 
QgsGeometry extendLine(double startDistance, double endDistance) const
Extends a (multi)line geometry by extrapolating out the start or end of the line by a specified dista...
 
Contains information about the context in which a processing algorithm is executed.
 
QgsExpressionContext & expressionContext()
Returns the expression context.
 
Custom exception class for processing related exceptions.
 
Base class for providing feedback from a processing algorithm.
 
static bool isDynamic(const QVariantMap ¶meters, const QString &name)
Returns true if the parameter with matching name is a dynamic parameter, and must be evaluated once f...
 
Definition for a property.
 
@ DoublePositive
Positive double value (including 0)
 
A store for object properties.
 
double valueAsDouble(const QgsExpressionContext &context, double defaultValue=0.0, bool *ok=nullptr) const
Calculates the current value of the property and interprets it as a double.
 
QList< QgsFeature > QgsFeatureList