15 #ifndef QGSHEATMAPRENDERER_H 16 #define QGSHEATMAPRENDERER_H 18 #include "qgis_core.h" 54 QString
dump()
const override;
88 double radius()
const {
return mRadius; }
97 void setRadius(
const double radius ) { mRadius = radius; }
183 QVector<double> mValues;
185 double mCalculatedMaxValue = 0;
188 int mRadiusPixels = 0;
189 double mRadiusSquared = 0;
193 QString mWeightExpressionString;
194 int mWeightAttrNum = -1;
195 std::unique_ptr<QgsExpression> mWeightExpression;
199 double mExplicitMax = 0.0;
200 int mRenderQuality = 3;
202 int mFeaturesRendered = 0;
204 double uniformKernel(
double distance,
int bandwidth )
const;
205 double quarticKernel(
double distance,
int bandwidth )
const;
206 double triweightKernel(
double distance,
int bandwidth )
const;
207 double epanechnikovKernel(
double distance,
int bandwidth )
const;
208 double triangularKernel(
double distance,
int bandwidth )
const;
216 #endif // QGSHEATMAPRENDERER_H The class is used as a container of context for various read/write operations on other objects...
A rectangle specified with double values.
double renderQuality() const
Returns the render quality used for drawing the heatmap.
Abstract base class for all rendered symbols.
virtual QDomElement save(QDomDocument &doc, const QgsReadWriteContext &context)
store renderer info to XML element
Abstract base class for color ramps.
double maximumValue() const
Returns the maximum value used for shading the heatmap.
Container of fields for a vector layer.
A geometry is the spatial representation of a feature.
void setWeightExpression(const QString &expression)
Sets the expression used for weighting points when generating the heatmap.
QVector< QgsPointXY > QgsMultiPointXY
A collection of QgsPoints that share a common collection of attributes.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
virtual QgsSymbol * symbolForFeature(const QgsFeature &feature, QgsRenderContext &context) const =0
To be overridden.
virtual QSet< QString > usedAttributes(const QgsRenderContext &context) const =0
Returns a list of attributes required by this renderer.
QList< QgsSymbol * > QgsSymbolList
virtual bool renderFeature(const QgsFeature &feature, QgsRenderContext &context, int layer=-1, bool selected=false, bool drawVertexMarker=false)
Render a feature using this renderer in the given 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.
virtual void modifyRequestExtent(QgsRectangle &extent, QgsRenderContext &context)
Allows for a renderer to modify the extent of a feature request prior to rendering.
double radius() const
Returns the radius for the heatmap.
const QgsMapUnitScale & radiusMapUnitScale() const
Returns the map unit scale used for the heatmap's radius.
QgsColorRamp * colorRamp() const
Returns the color ramp used for shading the heatmap.
void setRenderQuality(const int quality)
Sets the render quality used for drawing the heatmap.
void setRadiusUnit(const QgsUnitTypes::RenderUnit unit)
Sets the units used for the heatmap's radius.
void setRadius(const double radius)
Sets the radius for the heatmap.
Contains information about the context of a rendering operation.
Struct for storing maximum and minimum scales for measurements in map units.
virtual QgsSymbolList symbols(QgsRenderContext &context) const
Returns list of symbols used by the renderer.
virtual void startRender(QgsRenderContext &context, const QgsFields &fields)
Must be called when a new render cycle is started.
virtual void stopRender(QgsRenderContext &context)
Must be called when a render cycle has finished, to allow the renderer to clean up.
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.
QgsUnitTypes::RenderUnit radiusUnit() const
Returns the units used for the heatmap's radius.
virtual QgsFeatureRenderer * clone() const =0
Create a deep copy of this renderer.
RenderUnit
Rendering size units.
virtual QString dump() const
Returns debug information about this renderer.