1
0
mirror of https://github.com/qgis/QGIS.git synced 2025-04-23 00:03:02 -04:00
QGIS/src/analysis/processing/qgsalgorithmsegmentize.h
Pierre-Eric Pelloux-Prayer 25f2aba44d Include qgis_sip.h instead of qgis.h where possible ()
This PR continues the work started in PR .

This commit replaces occurences of #include "qgis.h" by #include "qgis_sip.h",
where possible = when files only depends on SIP_XXX features.
2019-01-24 11:33:22 -05:00

101 lines
3.6 KiB
C++

/***************************************************************************
qgsalgorithmsegmentize.h
---------------------
begin : March 2018
copyright : (C) 2018 by Nyall Dawson
email : nyall dot dawson at gmail dot com
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSALGORITHMSEGMENTIZE_H
#define QGSALGORITHMSEGMENTIZE_H
#define SIP_NO_FILE
#include "qgis_sip.h"
#include "qgsprocessingalgorithm.h"
#include "qgsmaptopixelgeometrysimplifier.h"
///@cond PRIVATE
/**
* Native segmentize by maximum distance algorithm.
*/
class QgsSegmentizeByMaximumDistanceAlgorithm : public QgsProcessingFeatureBasedAlgorithm
{
public:
QgsSegmentizeByMaximumDistanceAlgorithm() = default;
QString name() const override;
QString displayName() const override;
QStringList tags() const override;
QString group() const override;
QString groupId() const override;
QString shortHelpString() const override;
QgsSegmentizeByMaximumDistanceAlgorithm *createInstance() const override SIP_FACTORY;
QList<int> inputLayerTypes() const override;
void initParameters( const QVariantMap &configuration = QVariantMap() ) override;
bool supportInPlaceEdit( const QgsMapLayer *layer ) const override;
protected:
QString outputName() const override;
bool prepareAlgorithm( const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
QgsFeatureList processFeature( const QgsFeature &feature, QgsProcessingContext &, QgsProcessingFeedback *feedback ) override;
private:
double mTolerance = 1.0;
bool mDynamicTolerance = false;
QgsProperty mToleranceProperty;
};
/**
* Native segmentize by maximum angle algorithm.
*/
class QgsSegmentizeByMaximumAngleAlgorithm : public QgsProcessingFeatureBasedAlgorithm
{
public:
QgsSegmentizeByMaximumAngleAlgorithm() = default;
QString name() const override;
QString displayName() const override;
QStringList tags() const override;
QString group() const override;
QString groupId() const override;
QString shortHelpString() const override;
QgsSegmentizeByMaximumAngleAlgorithm *createInstance() const override SIP_FACTORY;
QList<int> inputLayerTypes() const override;
void initParameters( const QVariantMap &configuration = QVariantMap() ) override;
bool supportInPlaceEdit( const QgsMapLayer *layer ) const override;
protected:
QString outputName() const override;
bool prepareAlgorithm( const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
QgsFeatureList processFeature( const QgsFeature &feature, QgsProcessingContext &, QgsProcessingFeedback *feedback ) override;
private:
double mTolerance = 1.0;
bool mDynamicTolerance = false;
QgsProperty mToleranceProperty;
};
///@endcond PRIVATE
#endif // QGSALGORITHMSEGMENTIZE_H