27 #include <QGridLayout>
49 QLabel* label =
new QLabel(
tr(
"The heatmap renderer only applies to point and multipoint layers. \n"
50 "'%1' is not a point layer and cannot be rendered as a heatmap." )
51 .arg( layer->
name() ),
this );
68 mRampComboBox->setShowGradientOnly(
true );
70 connect( mRampComboBox, SIGNAL( currentIndexChanged(
int ) ),
this, SLOT( applyColorRamp() ) );
73 mRampComboBox->blockSignals(
true );
75 mRampComboBox->blockSignals(
false );
77 mRadiusSpinBox->blockSignals(
true );
79 mRadiusSpinBox->blockSignals(
false );
80 mRadiusUnitWidget->blockSignals(
true );
83 mRadiusUnitWidget->blockSignals(
false );
84 mMaxSpinBox->blockSignals(
true );
86 mMaxSpinBox->blockSignals(
false );
87 mQualitySlider->blockSignals(
true );
89 mQualitySlider->blockSignals(
false );
90 mInvertCheckBox->blockSignals(
true );
92 mInvertCheckBox->blockSignals(
false );
94 mWeightExpressionWidget->setLayer( layer );
96 connect( mWeightExpressionWidget, SIGNAL( fieldChanged(
QString ) ),
this, SLOT( weightExpressionChanged(
QString ) ) );
104 void QgsHeatmapRendererWidget::applyColorRamp()
118 void QgsHeatmapRendererWidget::on_mButtonEditRamp_clicked()
126 if ( dlg.exec() && gradRamp )
129 mRampComboBox->blockSignals(
true );
131 mRampComboBox->blockSignals(
false );
140 void QgsHeatmapRendererWidget::on_mRadiusUnitWidget_changed()
151 void QgsHeatmapRendererWidget::on_mRadiusSpinBox_valueChanged(
double d )
161 void QgsHeatmapRendererWidget::on_mMaxSpinBox_valueChanged(
double d )
171 void QgsHeatmapRendererWidget::on_mQualitySlider_valueChanged(
int v )
181 void QgsHeatmapRendererWidget::on_mInvertCheckBox_toggled(
bool v )
191 void QgsHeatmapRendererWidget::weightExpressionChanged(
QString expression )
void setInvertRamp(const bool invert)
Sets whether the ramp is inverted.
virtual QString type() const =0
QgsSymbolV2::OutputUnit radiusUnit() const
Returns the units used for the heatmap's radius.
double maximumValue() const
Returns the maximum value used for shading the heatmap.
void setWeightExpression(const QString &expression)
Sets the expression used for weighting points when generating the heatmap.
QgsVectorColorRampV2 * colorRamp() const
Returns the color ramp used for shading the heatmap.
QString tr(const char *sourceText, const char *disambiguation, int n)
void setRadiusUnit(const QgsSymbolV2::OutputUnit unit)
Sets the units used for the heatmap's radius.
const QString & name() const
Get the display name of the layer.
A renderer which draws points as a live heatmap.
const QgsMapUnitScale & radiusMapUnitScale() const
Returns the map unit scale used for the heatmap's radius.
double radius() const
Returns the radius for the heatmap.
void setRadiusMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale used for the heatmap's radius.
virtual QgsVectorColorRampV2 * clone() const =0
static QgsStyleV2 * defaultStyle()
return default application-wide style
QGis::GeometryType geometryType() const
Returns point, line or polygon.
void setRenderQuality(const int quality)
Sets the render quality used for drawing the heatmap.
void setRadius(const double radius)
Sets the radius for the heatmap.
double renderQuality() const
Returns the render quality used for drawing the heatmap.
void setColorRamp(QgsVectorColorRampV2 *ramp)
Sets the color ramp to use for shading the heatmap.
static QgsHeatmapRenderer * convertFromRenderer(const QgsFeatureRendererV2 *renderer)
double invertRamp() const
Returns whether the ramp is inverted.
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
Represents a vector layer which manages a vector based data sets.
QString weightExpression() const
Returns the expression used for weighting points when generating the heatmap.
void setMaximumValue(const double value)
Sets the maximum value used for shading the heatmap.