27 #include <QGridLayout>
74 QLabel* label =
new QLabel(
tr(
"The heatmap renderer only applies to point and multipoint layers. \n"
75 "'%1' is not a point layer and cannot be rendered as a heatmap." )
76 .arg( layer->
name() ),
this );
94 mRampComboBox->setShowGradientOnly(
true );
96 connect( mRampComboBox, SIGNAL( currentIndexChanged(
int ) ),
this, SLOT( applyColorRamp() ) );
97 connect( mRampComboBox, SIGNAL( sourceRampEdited() ),
this, SLOT( applyColorRamp() ) );
98 connect( mButtonEditRamp, SIGNAL( clicked() ), mRampComboBox, SLOT( editSourceRamp() ) );
102 mRampComboBox->blockSignals(
true );
104 mRampComboBox->blockSignals(
false );
106 mRadiusSpinBox->blockSignals(
true );
108 mRadiusSpinBox->blockSignals(
false );
109 mRadiusUnitWidget->blockSignals(
true );
112 mRadiusUnitWidget->blockSignals(
false );
113 mMaxSpinBox->blockSignals(
true );
115 mMaxSpinBox->blockSignals(
false );
116 mQualitySlider->blockSignals(
true );
118 mQualitySlider->blockSignals(
false );
119 mInvertCheckBox->blockSignals(
true );
121 mInvertCheckBox->blockSignals(
false );
123 mWeightExpressionWidget->setLayer( layer );
125 connect( mWeightExpressionWidget, SIGNAL( fieldChanged(
QString ) ),
this, SLOT( weightExpressionChanged(
QString ) ) );
136 if ( mRadiusUnitWidget )
137 mRadiusUnitWidget->setMapCanvas( canvas );
140 void QgsHeatmapRendererWidget::applyColorRamp()
154 void QgsHeatmapRendererWidget::on_mRadiusUnitWidget_changed()
165 void QgsHeatmapRendererWidget::on_mRadiusSpinBox_valueChanged(
double d )
175 void QgsHeatmapRendererWidget::on_mMaxSpinBox_valueChanged(
double d )
185 void QgsHeatmapRendererWidget::on_mQualitySlider_valueChanged(
int v )
195 void QgsHeatmapRendererWidget::on_mInvertCheckBox_toggled(
bool v )
205 void QgsHeatmapRendererWidget::weightExpressionChanged(
const QString& expression )
void setInvertRamp(const bool invert)
Sets whether the ramp is inverted.
static QgsExpressionContextScope * atlasScope(const QgsAtlasComposition *atlas)
Creates a new scope which contains variables and functions relating to a QgsAtlasComposition.
The output shall be in pixels.
QgsSymbolV2::OutputUnit radiusUnit() const
Returns the units used for the heatmap's radius.
const QgsMapSettings & mapSettings() const
Get access to properties used for map rendering.
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)
Map canvas is a class for displaying all GIS data types on a canvas.
void setRadiusUnit(const QgsSymbolV2::OutputUnit unit)
Sets the units used for the heatmap's radius.
The QgsMapSettings class contains configuration for rendering of the map.
const QString & name() const
Get the display name of the layer.
The output shall be in millimeters.
static QgsExpressionContextScope * globalScope()
Creates a new scope which contains variables and functions relating to the global QGIS context...
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.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
static QgsStyleV2 * defaultStyle()
return default application-wide style
The output shall be in map unitx.
QGis::GeometryType geometryType() const
Returns point, line or polygon.
Single scope for storing variables and functions for use within a QgsExpressionContext.
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 QgsExpressionContextScope * mapSettingsScope(const QgsMapSettings &mapSettings)
Creates a new scope which contains variables and functions relating to a QgsMapSettings object...
QgsExpressionContextScope & expressionContextScope()
Returns a reference to the expression context scope for the map canvas.
static QgsHeatmapRenderer * convertFromRenderer(const QgsFeatureRendererV2 *renderer)
bool invertRamp() const
Returns whether the ramp is inverted.
static QgsExpressionContextScope * projectScope()
Creates a new scope which contains variables and functions relating to the current QGIS project...
static QgsExpressionContextScope * layerScope(const QgsMapLayer *layer)
Creates a new scope which contains variables and functions relating to a QgsMapLayer.
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.