1 /*************************************************************************** 2 qgsalgorithmarrayoffsetlines.h 3 --------------------- 4 begin : July 2018 5 copyright : (C) 2018 by Nyall Dawson 6 email : nyall dot dawson at gmail dot com 7 ***************************************************************************/ 8 9 /*************************************************************************** 10 * * 11 * This program is free software; you can redistribute it and/or modify * 12 * it under the terms of the GNU General Public License as published by * 13 * the Free Software Foundation; either version 2 of the License, or * 14 * (at your option) any later version. * 15 * * 16 ***************************************************************************/ 17 18 #ifndef QGSALGORITHMARRAYOFFSETLINES_H 19 #define QGSALGORITHMARRAYOFFSETLINES_H 20 21 #define SIP_NO_FILE 22 23 #include "qgis_sip.h" 24 #include "qgsprocessingalgorithm.h" 25 26 ///@cond PRIVATE 27 28 /** 29 * Native create parallel lines algorithm. 30 */ 31 class QgsCreateArrayOffsetLinesAlgorithm : public QgsProcessingFeatureBasedAlgorithm 32 { 33 34 public: 35 36 QgsCreateArrayOffsetLinesAlgorithm() = default; 37 QString name() const override; 38 QString displayName() const override; 39 QStringList tags() const override; 40 QString group() const override; 41 QString groupId() const override; 42 QString shortHelpString() const override; 43 QString shortDescription() const override; 44 QgsCreateArrayOffsetLinesAlgorithm *createInstance() const override SIP_FACTORY; 45 void initParameters( const QVariantMap &configuration = QVariantMap() ) override; 46 QList<int> inputLayerTypes() const override; 47 48 protected: 49 QString outputName() const override; 50 bool prepareAlgorithm( const QVariantMap ¶meters, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override; 51 QgsFeatureList processFeature( const QgsFeature &feature, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override; 52 QgsFields outputFields( const QgsFields &inputFields ) const override; 53 QgsFeatureSink::SinkFlags sinkFlags() const override; 54 55 private: 56 57 int mCount = 0; 58 bool mDynamicCount = false; 59 QgsProperty mCountProperty; 60 61 double mOffsetStep = 0.0; 62 bool mDynamicOffset = false; 63 QgsProperty mOffsetStepProperty; 64 65 int mSegments = 8; 66 Qgis::JoinStyle mJoinStyle = Qgis::JoinStyle::Round; 67 double mMiterLimit = 2; 68 69 70 }; 71 72 73 ///@endcond PRIVATE 74 75 #endif // QGSALGORITHMARRAYOFFSETLINES_H 76 77 78