Skip to content
Permalink
Browse files

Rename files because there are two densify algs

  • Loading branch information
m-kuhn committed Jan 21, 2019
1 parent 9452667 commit 1e8f8193e0d67c5d037e0ff98c1b11c3d40ccac4
@@ -32,7 +32,7 @@ SET(QGIS_ANALYSIS_SRCS
processing/qgsalgorithmclip.cpp
processing/qgsalgorithmconvexhull.cpp
processing/qgsalgorithmdbscanclustering.cpp
processing/qgsalgorithmdensifygeometries.cpp
processing/qgsalgorithmdensifygeometriesbyinterval.cpp
processing/qgsalgorithmdifference.cpp
processing/qgsalgorithmdissolve.cpp
processing/qgsalgorithmdrape.cpp
@@ -16,70 +16,70 @@
***************************************************************************/


#include "qgsalgorithmdensifygeometries.h"
#include "qgsalgorithmdensifygeometriesbyinterval.h"

QString QgsDensifyGeometriesAlgorithm::name() const
QString QgsDensifyGeometriesByIntervalAlgorithm::name() const
{
return QStringLiteral( "densifygeometriesgivenaninterval" );
}

QString QgsDensifyGeometriesAlgorithm::displayName() const
QString QgsDensifyGeometriesByIntervalAlgorithm::displayName() const
{
return QObject::tr( "Densify by interval" );
}

QStringList QgsDensifyGeometriesAlgorithm::tags() const
QStringList QgsDensifyGeometriesByIntervalAlgorithm::tags() const
{
return QObject::tr( "add,vertex,vertices,points,nodes" ).split( ',' );
}

QString QgsDensifyGeometriesAlgorithm::group() const
QString QgsDensifyGeometriesByIntervalAlgorithm::group() const
{
return QObject::tr( "Vector geometry" );
}

QString QgsDensifyGeometriesAlgorithm::groupId() const
QString QgsDensifyGeometriesByIntervalAlgorithm::groupId() const
{
return QStringLiteral( "vectorgeometry" );
}

QString QgsDensifyGeometriesAlgorithm::shortHelpString() const
QString QgsDensifyGeometriesByIntervalAlgorithm::shortHelpString() const
{
return QObject::tr( "Geometries are densified by adding additional vertices on "
"edges that have a maximum distance of the interval parameter "
"in map units." );
}

QString QgsDensifyGeometriesAlgorithm::shortDescription() const
QString QgsDensifyGeometriesByIntervalAlgorithm::shortDescription() const
{
return QObject::tr( "Creates a densified version of geometries." );
}

QgsDensifyGeometriesAlgorithm *QgsDensifyGeometriesAlgorithm::createInstance() const
QgsDensifyGeometriesByIntervalAlgorithm *QgsDensifyGeometriesByIntervalAlgorithm::createInstance() const
{
return new QgsDensifyGeometriesAlgorithm;
return new QgsDensifyGeometriesByIntervalAlgorithm;

}

QList<int> QgsDensifyGeometriesAlgorithm::inputLayerTypes() const
QList<int> QgsDensifyGeometriesByIntervalAlgorithm::inputLayerTypes() const
{
return QList<int>() << QgsProcessing::TypeVectorLine << QgsProcessing::TypeVectorPolygon;
}

void QgsDensifyGeometriesAlgorithm::initParameters( const QVariantMap &configuration )
void QgsDensifyGeometriesByIntervalAlgorithm::initParameters( const QVariantMap &configuration )
{
Q_UNUSED( configuration )
addParameter( new QgsProcessingParameterDistance( QStringLiteral( "INTERVAL" ),
QObject::tr( "Interval between vertices to add" ),
1, QStringLiteral( "INPUT" ), false, 0, 10000000 ) );
}

QString QgsDensifyGeometriesAlgorithm::outputName() const
QString QgsDensifyGeometriesByIntervalAlgorithm::outputName() const
{
return QObject::tr( "Densified" );
}

QgsFeatureList QgsDensifyGeometriesAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingContext &context, QgsProcessingFeedback *feedback )
QgsFeatureList QgsDensifyGeometriesByIntervalAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingContext &context, QgsProcessingFeedback *feedback )
{
Q_UNUSED( context );
Q_UNUSED( feedback );
@@ -90,7 +90,7 @@ QgsFeatureList QgsDensifyGeometriesAlgorithm::processFeature( const QgsFeature &
return QgsFeatureList() << modifiedFeature;
}

bool QgsDensifyGeometriesAlgorithm::prepareAlgorithm( const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback )
bool QgsDensifyGeometriesByIntervalAlgorithm::prepareAlgorithm( const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback )
{
Q_UNUSED( feedback );
mInterval = parameterAsDouble( parameters, QStringLiteral( "INTERVAL" ), context );
@@ -26,19 +26,19 @@
///@cond PRIVATE


class QgsDensifyGeometriesAlgorithm : public QgsProcessingFeatureBasedAlgorithm
class QgsDensifyGeometriesByIntervalAlgorithm : public QgsProcessingFeatureBasedAlgorithm
{
public:

QgsDensifyGeometriesAlgorithm() = default;
QgsDensifyGeometriesByIntervalAlgorithm() = 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;
QString shortDescription() const override;
QgsDensifyGeometriesAlgorithm *createInstance() const override SIP_FACTORY;
QgsDensifyGeometriesByIntervalAlgorithm *createInstance() const override SIP_FACTORY;
QList<int> inputLayerTypes() const override;

protected:
@@ -27,7 +27,7 @@
#include "qgsalgorithmclip.h"
#include "qgsalgorithmconvexhull.h"
#include "qgsalgorithmdbscanclustering.h"
#include "qgsalgorithmdensifygeometries.h"
#include "qgsalgorithmdensifygeometriesbyinterval.h"
#include "qgsalgorithmdifference.h"
#include "qgsalgorithmdissolve.h"
#include "qgsalgorithmdrape.h"
@@ -247,7 +247,7 @@ void QgsNativeAlgorithms::loadAlgorithms()
addAlgorithm( new QgsWedgeBuffersAlgorithm() );
addAlgorithm( new QgsZonalHistogramAlgorithm() );
addAlgorithm( new QgsPolygonsToLinesAlgorithm() );
addAlgorithm( new QgsDensifyGeometriesAlgorithm() );
addAlgorithm( new QgsDensifyGeometriesByIntervalAlgorithm() );
}


0 comments on commit 1e8f819

Please sign in to comment.
You can’t perform that action at this time.