QGIS/python/core/symbology-ng/qgspointdistancerenderer.sip

269 lines
8.7 KiB
Plaintext
Raw Normal View History

2017-06-06 11:03:05 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/symbology-ng/qgspointdistancerenderer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsPointDistanceRenderer: QgsFeatureRenderer
{
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
%End
2017-06-06 11:03:05 +02:00
%TypeHeaderCode
#include "qgspointdistancerenderer.h"
%End
public:
struct GroupedFeature
{
2017-06-06 11:03:05 +02:00
GroupedFeature( const QgsFeature &feature, QgsMarkerSymbol *symbol, bool isSelected, const QString &label = QString() );
2017-06-06 11:03:05 +02:00
%Docstring
Constructor for GroupedFeature.
\param feature feature
\param symbol base symbol for rendering feature
\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
QgsFeature feature;
2017-06-06 11:03:05 +02:00
%Docstring
Feature
%End
QgsMarkerSymbol *symbol;
2017-06-06 11:03:05 +02:00
%Docstring
Base symbol for rendering feature
%End
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
QString label;
2017-06-06 11:03:05 +02:00
%Docstring
Optional label text
%End
};
typedef QList< QgsPointDistanceRenderer::GroupedFeature > ClusteredGroup;
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
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 );
virtual QSet<QString> usedAttributes( const QgsRenderContext &context ) const;
2017-06-06 11:03:05 +02:00
virtual QgsFeatureRenderer::Capabilities capabilities();
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 );
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 );
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 );
virtual QString filter( const QgsFields &fields = QgsFields() );
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
.. seealso:: labelAttributeName()
.. seealso:: setLabelFont()
.. seealso:: setLabelColor()
.. seealso:: setMinimumLabelScale()
2017-06-06 11:03:05 +02:00
%End
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.
.. seealso:: setLabelAttributeName()
.. seealso:: labelFont()
.. seealso:: minimumLabelScale()
2017-06-06 11:03:05 +02:00
.. seealso:: labelColor()
:rtype: str
%End
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
.. seealso:: labelFont()
.. seealso:: setLabelAttributeName()
.. seealso:: setLabelColor()
%End
QFont labelFont() const;
2017-06-06 11:03:05 +02:00
%Docstring
Returns the font used for labeling points.
.. seealso:: setLabelFont()
.. seealso:: labelAttributeName()
.. seealso:: labelColor()
:rtype: QFont
%End
void setMinimumLabelScale( double scale );
2017-06-06 11:03:05 +02:00
%Docstring
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.
.. seealso:: minimumLabelScale()
2017-06-06 11:03:05 +02:00
.. seealso:: setLabelAttributeName()
%End
double minimumLabelScale() const;
2017-06-06 11:03:05 +02:00
%Docstring
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.
.. seealso:: setMinimumLabelScale()
2017-06-06 11:03:05 +02:00
.. seealso:: labelAttributeName()
:rtype: float
%End
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
.. seealso:: labelColor()
.. seealso:: setLabelAttributeName()
.. seealso:: setLabelFont()
%End
QColor labelColor() const;
2017-06-06 11:03:05 +02:00
%Docstring
Returns the color used for for labeling points.
.. seealso:: setLabelColor()
.. seealso:: labelAttributeName()
.. seealso:: labelFont()
:rtype: QColor
%End
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
.. seealso:: tolerance()
.. seealso:: setToleranceUnit()
%End
double tolerance() const;
2017-06-06 11:03:05 +02:00
%Docstring
Returns the tolerance distance for grouping points. Units are retrieved using
toleranceUnit().
.. seealso:: setTolerance()
.. seealso:: toleranceUnit()
:rtype: float
%End
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
.. seealso:: setTolerance()
.. seealso:: toleranceUnit()
.. versionadded:: 2.12
%End
QgsUnitTypes::RenderUnit toleranceUnit() const;
2017-06-06 11:03:05 +02:00
%Docstring
Returns the units for the tolerance distance.
.. seealso:: tolerance()
.. seealso:: setToleranceUnit()
.. versionadded:: 2.12
:rtype: QgsUnitTypes.RenderUnit
%End
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
.. seealso:: toleranceMapUnitScale()
.. seealso:: setToleranceUnit()
%End
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.
.. seealso:: setToleranceMapUnitScale()
.. seealso:: toleranceUnit()
:rtype: QgsMapUnitScale
%End
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
};
2017-06-06 11:03:05 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/symbology-ng/qgspointdistancerenderer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/