Skip to content

Commit

Permalink
Rename files because there are two densify algs
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Jan 21, 2019
1 parent 9452667 commit 1e8f819
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/analysis/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand All @@ -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 );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions src/analysis/processing/qgsnativealgorithms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -247,7 +247,7 @@ void QgsNativeAlgorithms::loadAlgorithms()
addAlgorithm( new QgsWedgeBuffersAlgorithm() );
addAlgorithm( new QgsZonalHistogramAlgorithm() );
addAlgorithm( new QgsPolygonsToLinesAlgorithm() );
addAlgorithm( new QgsDensifyGeometriesAlgorithm() );
addAlgorithm( new QgsDensifyGeometriesByIntervalAlgorithm() );
}


Expand Down

0 comments on commit 1e8f819

Please sign in to comment.