Skip to content

Commit

Permalink
Move kernelShape enum to heatmap.h
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Mar 18, 2013
1 parent 80c3981 commit 7423e9a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
10 changes: 5 additions & 5 deletions src/plugins/heatmap/heatmap.cpp
Expand Up @@ -338,19 +338,19 @@ double Heatmap::calculateKernelValue( double distance, int bandwidth, int kernel
{
switch ( kernelShape )
{
case HeatmapGui::Triangular:
case Heatmap::Triangular:
return triangularKernel( distance , bandwidth );

case HeatmapGui::Uniform:
case Heatmap::Uniform:
return uniformKernel( distance, bandwidth );

case HeatmapGui::Quartic:
case Heatmap::Quartic:
return quarticKernel( distance, bandwidth );

case HeatmapGui::Triweight:
case Heatmap::Triweight:
return triweightKernel( distance, bandwidth );

case HeatmapGui::Epanechnikov:
case Heatmap::Epanechnikov:
return epanechnikovKernel( distance, bandwidth );
}
return 0;
Expand Down
10 changes: 10 additions & 0 deletions src/plugins/heatmap/heatmap.h
Expand Up @@ -69,6 +69,16 @@ class Heatmap: public QObject, public QgisPlugin
Heatmap( QgisInterface * theInterface );
//! Destructor
virtual ~Heatmap();

// Kernel shape type
enum kernelShape
{
Quartic,
Triangular,
Uniform,
Triweight,
Epanechnikov
};

public slots:
//! init the gui
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/heatmap/heatmapgui.cpp
Expand Up @@ -12,6 +12,7 @@
// qgis includes
#include "qgis.h"
#include "heatmapgui.h"
#include "heatmap.h"
#include "qgscontexthelp.h"
#include "qgsmaplayer.h"
#include "qgsmaplayerregistry.h"
Expand Down Expand Up @@ -230,7 +231,7 @@ void HeatmapGui::on_kernelShapeCombo_currentIndexChanged( int index )
{
Q_UNUSED( index );
// Only enable the decay edit if the kernel shape is set to triangular
mDecayLineEdit->setEnabled( index == HeatmapGui::Triangular );
mDecayLineEdit->setEnabled( index == Heatmap::Triangular );
}

/*
Expand Down
9 changes: 0 additions & 9 deletions src/plugins/heatmap/heatmapgui.h
Expand Up @@ -36,15 +36,6 @@ class HeatmapGui : public QDialog, private Ui::HeatmapGuiBase
MapUnits
};

enum kernelShape
{
Quartic,
Triangular,
Uniform,
Triweight,
Epanechnikov
};

/** Returns whether to apply weighted heat */
bool weighted();

Expand Down

0 comments on commit 7423e9a

Please sign in to comment.