QGIS API Documentation 3.36.0-Maidenhead (09951dc0acf)
Loading...
Searching...
No Matches
qgspointclusterrenderer.h
Go to the documentation of this file.
1/***************************************************************************
2 qgspointclusterrenderer.h
3 -------------------------
4 begin : February 2016
5 copyright : (C) 2016 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSPOINTCLUSTERRENDERER_H
19#define QGSPOINTCLUSTERRENDERER_H
20
21#include "qgis_core.h"
22#include "qgis.h"
24
31{
32 public:
33
35
37 void startRender( QgsRenderContext &context, const QgsFields &fields ) override;
38 void stopRender( QgsRenderContext &context ) override;
39 QDomElement save( QDomDocument &doc, const QgsReadWriteContext &context ) override;
40 QSet<QString> usedAttributes( const QgsRenderContext &context ) const override;
41 bool accept( QgsStyleEntityVisitorInterface *visitor ) const override;
42
44 static QgsFeatureRenderer *create( QDomElement &symbologyElem, const QgsReadWriteContext &context ) SIP_FACTORY;
45
50 QgsMarkerSymbol *clusterSymbol();
51
57 void setClusterSymbol( QgsMarkerSymbol *symbol SIP_TRANSFER );
58
63 static QgsPointClusterRenderer *convertFromRenderer( const QgsFeatureRenderer *renderer ) SIP_FACTORY;
64
65 private:
66#ifdef SIP_RUN
69#endif
70
72 std::unique_ptr< QgsMarkerSymbol > mClusterSymbol;
73
74 void drawGroup( QPointF centerPoint, QgsRenderContext &context, const QgsPointDistanceRenderer::ClusteredGroup &group ) const override SIP_FORCE;
75
76};
77
78#endif // QGSPOINTCLUSTERRENDERER_H
virtual QDomElement save(QDomDocument &doc, const QgsReadWriteContext &context)
Stores renderer properties to an XML element.
virtual QgsFeatureRenderer * clone() const =0
Create a deep copy of this renderer.
Container of fields for a vector layer.
Definition qgsfields.h:45
A marker symbol type, for rendering Point and MultiPoint geometries.
A renderer that automatically clusters points with the same geographic position.
An abstract base class for distance based point renderers (e.g., clusterer and displacement renderers...
void stopRender(QgsRenderContext &context) override
Must be called when a render cycle has finished, to allow the renderer to clean up.
void startRender(QgsRenderContext &context, const QgsFields &fields) override
Must be called when a new render cycle is started.
QSet< QString > usedAttributes(const QgsRenderContext &context) const override
Returns a list of attributes required by this renderer.
QList< QgsPointDistanceRenderer::GroupedFeature > ClusteredGroup
A group of clustered points (ie features within the distance tolerance).
bool accept(QgsStyleEntityVisitorInterface *visitor) const override
Accepts the specified symbology visitor, causing it to visit all symbols associated with the renderer...
The class is used as a container of context for various read/write operations on other objects.
Contains information about the context of a rendering operation.
An interface for classes which can visit style entity (e.g.
#define SIP_FORCE
Definition qgis_sip.h:131
#define SIP_TRANSFER
Definition qgis_sip.h:36
#define SIP_FACTORY
Definition qgis_sip.h:76