15#ifndef QGSHEATMAPRENDERER_H
16#define QGSHEATMAPRENDERER_H
53 QString
dump() const override;
105 double radius()
const {
return mRadius; }
200 QVector<double> mValues;
202 double mCalculatedMaxValue = 0;
205 int mRadiusPixels = 0;
206 double mRadiusSquared = 0;
210 QString mWeightExpressionString;
211 int mWeightAttrNum = -1;
212 std::unique_ptr<QgsExpression> mWeightExpression;
216 double mExplicitMax = 0.0;
217 int mRenderQuality = 3;
219 int mFeaturesRendered = 0;
223 double uniformKernel(
double distance,
int bandwidth )
const;
224 double quarticKernel(
double distance,
int bandwidth )
const;
225 double triweightKernel(
double distance,
int bandwidth )
const;
226 double epanechnikovKernel(
double distance,
int bandwidth )
const;
227 double triangularKernel(
double distance,
int bandwidth )
const;
RenderUnit
Rendering size units.
@ Millimeters
Millimeters.
Settings for a color ramp legend node.
Abstract base class for color ramps.
Custom exception class for Coordinate Reference System related exceptions.
QgsFeatureRenderer(const QString &type)
virtual QgsFeatureRenderer * clone() const =0
Create a deep copy of this renderer.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Container of fields for a vector layer.
A geometry is the spatial representation of a feature.
QString weightExpression() const
Returns the expression used for weighting points when generating the heatmap.
QgsSymbol * symbolForFeature(const QgsFeature &feature, QgsRenderContext &context) const override
To be overridden.
void modifyRequestExtent(QgsRectangle &extent, QgsRenderContext &context) override
Allows for a renderer to modify the extent of a feature request prior to rendering.
void startRender(QgsRenderContext &context, const QgsFields &fields) override
Must be called when a new render cycle is started.
QgsHeatmapRenderer & operator=(const QgsHeatmapRenderer &)=delete
Direct copies are forbidden. Use clone() instead.
QgsColorRamp * colorRamp() const
Returns the color ramp used for shading the heatmap.
QSet< QString > usedAttributes(const QgsRenderContext &context) const override
Returns a list of attributes required by this renderer.
void setRadius(const double radius)
Sets the radius for the heatmap.
double maximumValue() const
Returns the maximum value used for shading the heatmap.
void setRadiusUnit(const Qgis::RenderUnit unit)
Sets the units used for the heatmap's radius.
double renderQuality() const
Returns the render quality used for drawing the heatmap.
static QgsFeatureRenderer * create(QDomElement &element, const QgsReadWriteContext &context)
Creates a new heatmap renderer instance from XML.
void setRenderQuality(const int quality)
Sets the render quality used for drawing the heatmap.
bool renderFeature(const QgsFeature &feature, QgsRenderContext &context, int layer=-1, bool selected=false, bool drawVertexMarker=false) override
Render a feature using this renderer in the given context.
double radius() const
Returns the radius for the heatmap.
QgsHeatmapRenderer(const QgsHeatmapRenderer &)=delete
Direct copies are forbidden. Use clone() instead.
Qgis::RenderUnit radiusUnit() const
Returns the units used for the heatmap's radius.
static QgsHeatmapRenderer * convertFromRenderer(const QgsFeatureRenderer *renderer)
void setWeightExpression(const QString &expression)
Sets the expression used for weighting points when generating the heatmap.
void setMaximumValue(const double value)
Sets the maximum value used for shading the heatmap.
void stopRender(QgsRenderContext &context) override
Must be called when a render cycle has finished, to allow the renderer to clean up.
QString dump() const override
Returns debug information about this renderer.
QDomElement save(QDomDocument &doc, const QgsReadWriteContext &context) override
Stores renderer properties to an XML element.
const QgsMapUnitScale & radiusMapUnitScale() const
Returns the map unit scale used for the heatmap's radius.
QList< QgsLayerTreeModelLegendNode * > createLegendNodes(QgsLayerTreeLayer *nodeLayer) const override
Returns a list of legend nodes to be used for the legend for the renderer.
const QgsColorRampLegendNodeSettings & legendSettings() const
Returns the color ramp legend settings.
bool accept(QgsStyleEntityVisitorInterface *visitor) const override
Accepts the specified symbology visitor, causing it to visit all symbols associated with the renderer...
void setRadiusMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale used for the heatmap's radius.
QgsSymbolList symbols(QgsRenderContext &context) const override
Returns list of symbols used by the renderer.
Layer tree node points to a map layer.
An abstract interface for legend items returned from QgsMapLayerLegend implementation.
Struct for storing maximum and minimum scales for measurements in map units.
A container for the context for various read/write operations on objects.
A rectangle specified with double values.
Contains information about the context of a rendering operation.
An interface for classes which can visit style entity (e.g.
Abstract base class for all rendered symbols.
#define SIP_THROW(name,...)
QVector< QgsPointXY > QgsMultiPointXY
A collection of QgsPoints that share a common collection of attributes.
QList< QgsSymbol * > QgsSymbolList