Skip to content
Permalink
Browse files
Move kernelShape enum to heatmap.h
  • Loading branch information
nyalldawson committed Mar 18, 2013
1 parent 80c3981 commit 7423e9aad75880475e4d21f1e06f4cabf0b485e9
@@ -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;
@@ -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
@@ -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 );
}

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

0 comments on commit 7423e9a

Please sign in to comment.