Move kernelShape enum to heatmap.h

This commit is contained in:
Nyall Dawson 2013-03-19 07:21:23 +11:00
parent 80c39816a6
commit 7423e9aad7
4 changed files with 17 additions and 15 deletions

View File

@ -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;

View File

@ -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

View File

@ -12,6 +12,7 @@
// qgis includes
#include "qgis.h"
#include "heatmapgui.h"
#include "heatmap.h"
#include "qgscontexthelp.h"
#include "qgsmaplayer.h"
#include "qgsmaplayerregistry.h"
@ -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 );
}
/*

View File

@ -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();