QGIS/python/core/symbology-ng/qgspointclusterrenderer.sip
Martin Dobias 8ffd91ea90 Propagate path resolver through renderers, annotations, diagrams
This is necessary in order to be able to correctly translate between absolute and relative paths
deeper in the code - e.g. paths to SVG files used in marker or fill symbols.

Until now, relative paths were translated to absolute paths on the fly.
This is now changed - paths to files should be always absolute within QGIS objects - and paths
only get turned into relative when saving projects. When loading a project, relative paths
are translated to absolute paths immediately.

This should lower the overall confusion about relative/absolute paths within QGIS, and also
allow having different base directories for relative paths (e.g. QML or QPT files may use relative paths
to their directory - rather than to the project directory)
2017-05-13 18:02:19 +08:00

47 lines
1.8 KiB
Plaintext

/** \class QgsPointClusterRenderer
* \ingroup core
* A renderer that automatically clusters points with the same geographic position.
* \note added in QGIS 3.0
*/
class QgsPointClusterRenderer : QgsPointDistanceRenderer
{
%TypeHeaderCode
#include <qgspointclusterrenderer.h>
%End
public:
QgsPointClusterRenderer();
virtual QgsPointClusterRenderer* clone() const /Factory/;
virtual void startRender( QgsRenderContext& context, const QgsFields& fields );
void stopRender( QgsRenderContext& context );
QDomElement save( QDomDocument& doc, const QgsPathResolver &pathResolver );
virtual QSet<QString> usedAttributes( const QgsRenderContext& context ) const;
//! Create a renderer from XML element
static QgsFeatureRenderer* create( QDomElement& symbologyElem, const QgsPathResolver &pathResolver ) /Factory/;
/** Returns the symbol used for rendering clustered groups (but not ownership of the symbol).
* @see setClusterSymbol()
*/
QgsMarkerSymbol *clusterSymbol();
/** Sets the symbol for rendering clustered groups.
* @param symbol new cluster symbol. Ownership is transferred to the renderer.
* @see clusterSymbol()
*/
void setClusterSymbol( QgsMarkerSymbol *symbol /Transfer/ );
/** Creates a QgsPointDisplacementRenderer from an existing renderer.
* @note added in 2.5
* @returns a new renderer if the conversion was possible, otherwise nullptr.
*/
static QgsPointClusterRenderer *convertFromRenderer( const QgsFeatureRenderer *renderer ) /Factory/;
private:
QgsPointClusterRenderer( const QgsPointClusterRenderer & );
QgsPointClusterRenderer &operator=( const QgsPointClusterRenderer & );
void drawGroup( QPointF centerPoint, QgsRenderContext &context, const QgsPointDistanceRenderer::ClusteredGroup &group );
};