27 #include <QGridLayout> 73 QLabel* label =
new QLabel(
tr(
"The heatmap renderer only applies to point and multipoint layers. \n" 74 "'%1' is not a point layer and cannot be rendered as a heatmap." )
75 .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()
155 void QgsHeatmapRendererWidget::on_mRadiusUnitWidget_changed()
167 void QgsHeatmapRendererWidget::on_mRadiusSpinBox_valueChanged(
double d )
178 void QgsHeatmapRendererWidget::on_mMaxSpinBox_valueChanged(
double d )
189 void QgsHeatmapRendererWidget::on_mQualitySlider_valueChanged(
int v )
200 void QgsHeatmapRendererWidget::on_mInvertCheckBox_toggled(
bool v )
211 void QgsHeatmapRendererWidget::weightExpressionChanged(
const QString& expression )
void setInvertRamp(const bool invert)
Sets whether the ramp is inverted.
double renderQuality() const
Returns the render quality used for drawing the heatmap.
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.
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.
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.
QgsVectorColorRampV2 * colorRamp() const
Returns the color ramp used for shading the heatmap.
The QgsMapSettings class contains configuration for rendering of the map.
The output shall be in millimeters.
bool invertRamp() const
Returns whether the ramp is inverted.
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.
void setRadiusMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale used for the heatmap's radius.
double radius() const
Returns the radius for the heatmap.
const QgsMapUnitScale & radiusMapUnitScale() const
Returns 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.
QgsSymbolV2::OutputUnit radiusUnit() const
Returns the units used for the heatmap's radius.
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.
const QgsMapSettings & mapSettings() const
Get access to properties used for map rendering.
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)
QString name
Read property of QString layerName.
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.
QString weightExpression() const
Returns the expression used for weighting points when generating the heatmap.
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.
Abstract base class for color ramps.
void setMaximumValue(const double value)
Sets the maximum value used for shading the heatmap.