2017-06-06 11:03:05 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
2017-08-06 13:39:03 +02:00
|
|
|
* src/core/symbology/qgspointdistancerenderer.h *
|
2017-06-06 11:03:05 +02:00
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class QgsPointDistanceRenderer: QgsFeatureRenderer
|
2016-08-15 12:04:17 +10:00
|
|
|
{
|
2017-06-06 11:03:05 +02:00
|
|
|
%Docstring
|
|
|
|
An abstract base class for distance based point renderers (e.g., clusterer and displacement renderers).
|
|
|
|
QgsPointDistanceRenderer handles calculation of point clusters using a distance based threshold.
|
|
|
|
Subclasses must implement drawGroup() to handle the rendering of individual point clusters
|
|
|
|
in the desired style.
|
|
|
|
.. versionadded:: 3.0
|
2016-08-15 12:04:17 +10:00
|
|
|
%End
|
|
|
|
|
2017-06-06 11:03:05 +02:00
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgspointdistancerenderer.h"
|
|
|
|
%End
|
2016-08-15 12:04:17 +10:00
|
|
|
public:
|
|
|
|
|
|
|
|
struct GroupedFeature
|
|
|
|
{
|
2017-06-06 11:03:05 +02:00
|
|
|
|
2017-07-23 14:15:01 +10:00
|
|
|
GroupedFeature( const QgsFeature &feature, QgsMarkerSymbol *symbol /Transfer/, bool isSelected, const QString &label = QString() );
|
2017-06-06 11:03:05 +02:00
|
|
|
%Docstring
|
|
|
|
Constructor for GroupedFeature.
|
|
|
|
\param feature feature
|
2017-07-23 14:15:01 +10:00
|
|
|
\param symbol base symbol for rendering feature (owned by GroupedFeature)
|
2017-06-06 11:03:05 +02:00
|
|
|
\param isSelected set to true if feature is selected and should be rendered in a selected state
|
|
|
|
\param label optional label text, or empty string for no label
|
|
|
|
%End
|
2016-08-15 12:04:17 +10:00
|
|
|
|
2017-07-23 14:15:01 +10:00
|
|
|
QgsFeature feature;
|
2017-06-06 11:03:05 +02:00
|
|
|
%Docstring
|
|
|
|
Feature
|
|
|
|
%End
|
2016-08-15 12:04:17 +10:00
|
|
|
|
2017-07-23 14:15:01 +10:00
|
|
|
QgsMarkerSymbol *symbol() const;
|
2017-06-06 11:03:05 +02:00
|
|
|
%Docstring
|
|
|
|
Base symbol for rendering feature
|
2017-07-23 14:15:01 +10:00
|
|
|
:rtype: QgsMarkerSymbol
|
2017-06-06 11:03:05 +02:00
|
|
|
%End
|
2016-08-15 12:04:17 +10:00
|
|
|
|
2017-07-23 14:15:01 +10:00
|
|
|
bool isSelected;
|
2017-06-06 11:03:05 +02:00
|
|
|
%Docstring
|
|
|
|
True if feature is selected and should be rendered in a selected state
|
|
|
|
%End
|
2016-08-15 12:04:17 +10:00
|
|
|
|
2017-07-23 14:15:01 +10:00
|
|
|
QString label;
|
2017-06-06 11:03:05 +02:00
|
|
|
%Docstring
|
|
|
|
Optional label text
|
|
|
|
%End
|
2017-07-23 14:15:01 +10:00
|
|
|
|
2016-08-15 12:04:17 +10:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef QList< QgsPointDistanceRenderer::GroupedFeature > ClusteredGroup;
|
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
QgsPointDistanceRenderer( const QString &rendererName, const QString &labelAttributeName = QString() );
|
2017-06-06 11:03:05 +02:00
|
|
|
%Docstring
|
|
|
|
Constructor for QgsPointDistanceRenderer.
|
|
|
|
\param rendererName name of renderer for registry
|
|
|
|
\param labelAttributeName optional attribute for labeling points
|
|
|
|
%End
|
2016-08-15 12:04:17 +10:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props = QgsStringMap() ) const;
|
2017-06-06 11:03:05 +02:00
|
|
|
virtual bool renderFeature( QgsFeature &feature, QgsRenderContext &context, int layer = -1, bool selected = false, bool drawVertexMarker = false );
|
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual QSet<QString> usedAttributes( const QgsRenderContext &context ) const;
|
2017-06-06 11:03:05 +02:00
|
|
|
virtual QgsFeatureRenderer::Capabilities capabilities();
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual QgsSymbolList symbols( QgsRenderContext &context );
|
|
|
|
virtual QgsSymbol *symbolForFeature( QgsFeature &feature, QgsRenderContext &context );
|
|
|
|
virtual QgsSymbol *originalSymbolForFeature( QgsFeature &feat, QgsRenderContext &context );
|
|
|
|
virtual QgsSymbolList symbolsForFeature( QgsFeature &feat, QgsRenderContext &context );
|
|
|
|
virtual QgsSymbolList originalSymbolsForFeature( QgsFeature &feat, QgsRenderContext &context );
|
2017-06-06 11:03:05 +02:00
|
|
|
virtual QSet< QString > legendKeysForFeature( QgsFeature &feature, QgsRenderContext &context );
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual bool willRenderFeature( QgsFeature &feat, QgsRenderContext &context );
|
|
|
|
virtual void startRender( QgsRenderContext &context, const QgsFields &fields );
|
2017-06-06 11:03:05 +02:00
|
|
|
virtual void stopRender( QgsRenderContext &context );
|
|
|
|
|
2017-06-09 17:22:59 +02:00
|
|
|
virtual QgsLegendSymbolList legendSymbolItems() const;
|
2017-06-06 11:03:05 +02:00
|
|
|
virtual void setEmbeddedRenderer( QgsFeatureRenderer *r /Transfer/ );
|
|
|
|
|
|
|
|
virtual const QgsFeatureRenderer *embeddedRenderer() const;
|
|
|
|
|
|
|
|
virtual void setLegendSymbolItem( const QString &key, QgsSymbol *symbol /Transfer/ );
|
|
|
|
|
|
|
|
virtual bool legendSymbolItemsCheckable() const;
|
|
|
|
|
|
|
|
virtual bool legendSymbolItemChecked( const QString &key );
|
|
|
|
|
|
|
|
virtual void checkLegendSymbolItem( const QString &key, bool state );
|
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual QString filter( const QgsFields &fields = QgsFields() );
|
2016-08-15 12:04:17 +10:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
void setLabelAttributeName( const QString &name );
|
2017-06-06 11:03:05 +02:00
|
|
|
%Docstring
|
|
|
|
Sets the attribute name for labeling points.
|
|
|
|
\param name attribute name, or empty string to avoid labeling features by the renderer
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`labelAttributeName()`
|
|
|
|
.. seealso:: :py:func:`setLabelFont()`
|
|
|
|
.. seealso:: :py:func:`setLabelColor()`
|
|
|
|
.. seealso:: :py:func:`setMinimumLabelScale()`
|
2017-06-06 11:03:05 +02:00
|
|
|
%End
|
2016-08-15 12:04:17 +10:00
|
|
|
|
|
|
|
QString labelAttributeName() const;
|
2017-06-06 11:03:05 +02:00
|
|
|
%Docstring
|
|
|
|
Returns the attribute name used for labeling points, or an empty string if no labeling
|
|
|
|
will be done by the renderer.
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`setLabelAttributeName()`
|
|
|
|
.. seealso:: :py:func:`labelFont()`
|
|
|
|
.. seealso:: :py:func:`minimumLabelScale()`
|
|
|
|
.. seealso:: :py:func:`labelColor()`
|
2017-06-06 11:03:05 +02:00
|
|
|
:rtype: str
|
|
|
|
%End
|
2016-08-15 12:04:17 +10:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
void setLabelFont( const QFont &font );
|
2017-06-06 11:03:05 +02:00
|
|
|
%Docstring
|
|
|
|
Sets the font used for labeling points.
|
|
|
|
\param font label font
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`labelFont()`
|
|
|
|
.. seealso:: :py:func:`setLabelAttributeName()`
|
|
|
|
.. seealso:: :py:func:`setLabelColor()`
|
2017-06-06 11:03:05 +02:00
|
|
|
%End
|
2016-08-15 12:04:17 +10:00
|
|
|
|
|
|
|
QFont labelFont() const;
|
2017-06-06 11:03:05 +02:00
|
|
|
%Docstring
|
|
|
|
Returns the font used for labeling points.
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`setLabelFont()`
|
|
|
|
.. seealso:: :py:func:`labelAttributeName()`
|
|
|
|
.. seealso:: :py:func:`labelColor()`
|
2017-06-06 11:03:05 +02:00
|
|
|
:rtype: QFont
|
|
|
|
%End
|
2016-08-15 12:04:17 +10:00
|
|
|
|
2017-06-09 10:26:01 +10:00
|
|
|
void setMinimumLabelScale( double scale );
|
2017-06-06 11:03:05 +02:00
|
|
|
%Docstring
|
2017-06-09 10:26:01 +10:00
|
|
|
Sets the minimum map ``scale`` (i.e. most "zoomed out") at which points should be labeled by the renderer.
|
|
|
|
The ``scale`` value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`minimumLabelScale()`
|
|
|
|
.. seealso:: :py:func:`setLabelAttributeName()`
|
2017-06-06 11:03:05 +02:00
|
|
|
%End
|
2016-08-15 12:04:17 +10:00
|
|
|
|
2017-06-09 10:26:01 +10:00
|
|
|
double minimumLabelScale() const;
|
2017-06-06 11:03:05 +02:00
|
|
|
%Docstring
|
2017-06-09 10:26:01 +10:00
|
|
|
Returns the minimum map scale (i.e. most "zoomed out") at which points should be labeled by the renderer.
|
|
|
|
The scale value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`setMinimumLabelScale()`
|
|
|
|
.. seealso:: :py:func:`labelAttributeName()`
|
2017-06-06 11:03:05 +02:00
|
|
|
:rtype: float
|
|
|
|
%End
|
2016-08-15 12:04:17 +10:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
void setLabelColor( const QColor &color );
|
2017-06-06 11:03:05 +02:00
|
|
|
%Docstring
|
|
|
|
Sets the color to use for for labeling points.
|
|
|
|
\param color label color
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`labelColor()`
|
|
|
|
.. seealso:: :py:func:`setLabelAttributeName()`
|
|
|
|
.. seealso:: :py:func:`setLabelFont()`
|
2017-06-06 11:03:05 +02:00
|
|
|
%End
|
2016-08-15 12:04:17 +10:00
|
|
|
|
|
|
|
QColor labelColor() const;
|
2017-06-06 11:03:05 +02:00
|
|
|
%Docstring
|
|
|
|
Returns the color used for for labeling points.
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`setLabelColor()`
|
|
|
|
.. seealso:: :py:func:`labelAttributeName()`
|
|
|
|
.. seealso:: :py:func:`labelFont()`
|
2017-06-06 11:03:05 +02:00
|
|
|
:rtype: QColor
|
|
|
|
%End
|
2016-08-15 12:04:17 +10:00
|
|
|
|
|
|
|
void setTolerance( double distance );
|
2017-06-06 11:03:05 +02:00
|
|
|
%Docstring
|
|
|
|
Sets the tolerance distance for grouping points. Units are specified using
|
|
|
|
setToleranceUnit().
|
|
|
|
\param distance tolerance distance
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`tolerance()`
|
|
|
|
.. seealso:: :py:func:`setToleranceUnit()`
|
2017-06-06 11:03:05 +02:00
|
|
|
%End
|
2016-08-15 12:04:17 +10:00
|
|
|
|
|
|
|
double tolerance() const;
|
2017-06-06 11:03:05 +02:00
|
|
|
%Docstring
|
|
|
|
Returns the tolerance distance for grouping points. Units are retrieved using
|
|
|
|
toleranceUnit().
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`setTolerance()`
|
|
|
|
.. seealso:: :py:func:`toleranceUnit()`
|
2017-06-06 11:03:05 +02:00
|
|
|
:rtype: float
|
|
|
|
%End
|
2016-08-15 12:04:17 +10:00
|
|
|
|
|
|
|
void setToleranceUnit( QgsUnitTypes::RenderUnit unit );
|
2017-06-06 11:03:05 +02:00
|
|
|
%Docstring
|
|
|
|
Sets the units for the tolerance distance.
|
|
|
|
\param unit tolerance distance units
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`setTolerance()`
|
|
|
|
.. seealso:: :py:func:`toleranceUnit()`
|
2017-06-06 11:03:05 +02:00
|
|
|
.. versionadded:: 2.12
|
|
|
|
%End
|
2016-08-15 12:04:17 +10:00
|
|
|
|
|
|
|
QgsUnitTypes::RenderUnit toleranceUnit() const;
|
2017-06-06 11:03:05 +02:00
|
|
|
%Docstring
|
|
|
|
Returns the units for the tolerance distance.
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`tolerance()`
|
|
|
|
.. seealso:: :py:func:`setToleranceUnit()`
|
2017-06-06 11:03:05 +02:00
|
|
|
.. versionadded:: 2.12
|
|
|
|
:rtype: QgsUnitTypes.RenderUnit
|
|
|
|
%End
|
2016-08-15 12:04:17 +10:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
void setToleranceMapUnitScale( const QgsMapUnitScale &scale );
|
2017-06-06 11:03:05 +02:00
|
|
|
%Docstring
|
|
|
|
Sets the map unit scale object for the distance tolerance. This is only used if the
|
|
|
|
toleranceUnit() is set to QgsUnitTypes.RenderMapUnits.
|
|
|
|
\param scale scale for distance tolerance
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`toleranceMapUnitScale()`
|
|
|
|
.. seealso:: :py:func:`setToleranceUnit()`
|
2017-06-06 11:03:05 +02:00
|
|
|
%End
|
2016-08-15 12:04:17 +10:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
const QgsMapUnitScale &toleranceMapUnitScale() const;
|
2017-06-06 11:03:05 +02:00
|
|
|
%Docstring
|
|
|
|
Returns the map unit scale object for the distance tolerance. This is only used if the
|
|
|
|
toleranceUnit() is set to QgsUnitTypes.RenderMapUnits.
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`setToleranceMapUnitScale()`
|
|
|
|
.. seealso:: :py:func:`toleranceUnit()`
|
2017-06-06 11:03:05 +02:00
|
|
|
:rtype: QgsMapUnitScale
|
|
|
|
%End
|
2016-08-15 12:04:17 +10:00
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-06 11:03:05 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void drawLabels( QPointF centerPoint, QgsSymbolRenderContext &context, const QList<QPointF> &labelShifts, const ClusteredGroup &group );
|
|
|
|
%Docstring
|
|
|
|
Renders the labels for a group.
|
|
|
|
\param centerPoint center point of group
|
|
|
|
\param context destination render context
|
|
|
|
\param labelShifts displacement for individual label positions
|
|
|
|
\param group group of clustered features to label
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
may not be available in Python bindings on some platforms
|
|
|
|
%End
|
|
|
|
|
|
|
|
private:
|
|
|
|
virtual void drawGroup( QPointF centerPoint, QgsRenderContext &context, const ClusteredGroup &group ) = 0 ;
|
|
|
|
%Docstring
|
|
|
|
Draws a group of clustered points.
|
|
|
|
\param centerPoint central point (geographic centroid) of all points contained within the cluster
|
|
|
|
\param context destination render context
|
|
|
|
\param group contents of group
|
|
|
|
%End
|
2016-08-15 12:04:17 +10:00
|
|
|
};
|
2017-06-06 11:03:05 +02:00
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
2017-08-06 13:39:03 +02:00
|
|
|
* src/core/symbology/qgspointdistancerenderer.h *
|
2017-06-06 11:03:05 +02:00
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|