24 QString QgsReverseLineDirectionAlgorithm ::name()
const 26 return QStringLiteral(
"reverselinedirection" );
29 QString QgsReverseLineDirectionAlgorithm ::displayName()
const 31 return QObject::tr(
"Reverse line direction" );
34 QStringList QgsReverseLineDirectionAlgorithm ::tags()
const 36 return QObject::tr(
"swap,reverse,switch,flip,linestring,orientation" ).split(
',' );
39 QString QgsReverseLineDirectionAlgorithm ::group()
const 41 return QObject::tr(
"Vector geometry" );
44 QString QgsReverseLineDirectionAlgorithm ::groupId()
const 46 return QStringLiteral(
"vectorgeometry" );
49 QString QgsReverseLineDirectionAlgorithm ::outputName()
const 51 return QObject::tr(
"Reversed" );
54 QString QgsReverseLineDirectionAlgorithm ::shortHelpString()
const 56 return QObject::tr(
"This algorithm reverses the direction of curve or LineString geometries." );
59 QString QgsReverseLineDirectionAlgorithm::shortDescription()
const 61 return QObject::tr(
"Reverses the direction of curve or LineString geometries." );
64 QgsReverseLineDirectionAlgorithm *QgsReverseLineDirectionAlgorithm ::createInstance()
const 66 return new QgsReverseLineDirectionAlgorithm();
74 QList<int> QgsReverseLineDirectionAlgorithm::inputLayerTypes()
const 96 std::unique_ptr< QgsCurve > reversed( curve->
reversed() );
102 const QgsGeometry outGeom( std::move( reversed ) );
111 destCollection->
reserve( collection->numGeometries() );
112 for (
int i = 0; i < collection->numGeometries(); ++i )
117 std::unique_ptr< QgsCurve > reversed( curve->
reversed() );
123 destCollection->addGeometry( reversed.release() );
virtual QgsCurve * reversed() const =0
Returns a reversed copy of the curve, where the direction of the curve has been flipped.
Base class for providing feedback from a processing algorithm.
Invalid geometry checks should always be skipped. This flag can be useful for algorithms which always...
bool isMultipart() const
Returns true if WKB of the geometry is of WKBMulti* type.
QList< QgsFeature > QgsFeatureList
A geometry is the spatial representation of a feature.
virtual QgsAbstractGeometry * createEmptyWithSameType() const =0
Creates a new geometry with the same class and same WKB type as the original and transfers ownership...
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
bool hasGeometry() const
Returns true if the feature has an associated geometry.
T qgsgeometry_cast(const QgsAbstractGeometry *geom)
Custom exception class for processing related exceptions.
Abstract base class for curved geometry type.
Flag
Flags controlling how QgsProcessingFeatureSource fetches features.
const QgsAbstractGeometry * constGet() const
Returns a non-modifiable (const) reference to the underlying abstract geometry primitive.
void reserve(int size)
Attempts to allocate memory for at least size geometries.
void setGeometry(const QgsGeometry &geometry)
Set the feature's geometry.
SourceType
Data source types enum.
Contains information about the context in which a processing algorithm is executed.