1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/symbology/qgspointdistancerenderer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsPointDistanceRenderer: QgsFeatureRenderer
{
%Docstring(signature="appended")
An abstract base class for distance based point renderers (e.g.,
clusterer and displacement renderers).
:py:class:`QgsPointDistanceRenderer` handles calculation of point
clusters using a distance based threshold. Subclasses must implement
:py:func:`~drawGroup` to handle the rendering of individual point
clusters in the desired style.
%End
%TypeHeaderCode
#include "qgspointdistancerenderer.h"
%End
public:
struct GroupedFeature
{
GroupedFeature( const QgsFeature &feature, QgsMarkerSymbol *symbol /Transfer/, bool isSelected, const QString &label = QString() );
%Docstring
Constructor for GroupedFeature.
:param feature: feature
:param symbol: base symbol for rendering feature (owned by
GroupedFeature)
: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
~GroupedFeature();
QgsFeature feature;
QgsMarkerSymbol *symbol() const;
%Docstring
Base symbol for rendering feature
%End
bool isSelected;
QString label;
};
typedef QList< QgsPointDistanceRenderer::GroupedFeature > ClusteredGroup;
QgsPointDistanceRenderer( const QString &rendererName, const QString &labelAttributeName = QString() );
%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 QVariantMap &props = QVariantMap() ) const;
virtual bool renderFeature( const QgsFeature &feature, QgsRenderContext &context, int layer = -1, bool selected = false, bool drawVertexMarker = false ) throw( QgsCsException );
virtual QSet<QString> usedAttributes( const QgsRenderContext &context ) const;
virtual bool filterNeedsGeometry() const;
virtual QgsFeatureRenderer::Capabilities capabilities();
virtual QgsSymbolList symbols( QgsRenderContext &context ) const;
virtual QgsSymbol *symbolForFeature( const QgsFeature &feature, QgsRenderContext &context ) const;
virtual QgsSymbol *originalSymbolForFeature( const QgsFeature &feature, QgsRenderContext &context ) const;
virtual QgsSymbolList symbolsForFeature( const QgsFeature &feature, QgsRenderContext &context ) const;
virtual QgsSymbolList originalSymbolsForFeature( const QgsFeature &feature, QgsRenderContext &context ) const;
virtual QSet< QString > legendKeysForFeature( const QgsFeature &feature, QgsRenderContext &context ) const;
virtual QString legendKeyToExpression( const QString &key, QgsVectorLayer *layer, bool &ok ) const;
virtual bool willRenderFeature( const QgsFeature &feature, QgsRenderContext &context ) const;
virtual void startRender( QgsRenderContext &context, const QgsFields &fields );
virtual void stopRender( QgsRenderContext &context );
virtual QgsLegendSymbolList legendSymbolItems() const;
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() );
virtual bool accept( QgsStyleEntityVisitorInterface *visitor ) const;
void setLabelAttributeName( const QString &name );
%Docstring
Sets the attribute name for labeling points.
:param name: attribute name, or empty string to avoid labeling features
by the renderer
.. seealso:: :py:func:`labelAttributeName`
.. seealso:: :py:func:`setLabelFont`
.. seealso:: :py:func:`setLabelColor`
.. seealso:: :py:func:`setMinimumLabelScale`
%End
QString labelAttributeName() const;
%Docstring
Returns the attribute name used for labeling points, or an empty string
if no labeling will be done by the renderer.
.. seealso:: :py:func:`setLabelAttributeName`
.. seealso:: :py:func:`labelFont`
.. seealso:: :py:func:`minimumLabelScale`
.. seealso:: :py:func:`labelColor`
%End
void setLabelFont( const QFont &font );
%Docstring
Sets the font used for labeling points.
:param font: label font
.. seealso:: :py:func:`labelFont`
.. seealso:: :py:func:`setLabelAttributeName`
.. seealso:: :py:func:`setLabelColor`
%End
QFont labelFont() const;
%Docstring
Returns the font used for labeling points.
.. seealso:: :py:func:`setLabelFont`
.. seealso:: :py:func:`labelAttributeName`
.. seealso:: :py:func:`labelColor`
%End
void setMinimumLabelScale( double scale );
%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:: :py:func:`minimumLabelScale`
.. seealso:: :py:func:`setLabelAttributeName`
%End
double minimumLabelScale() const;
%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:: :py:func:`setMinimumLabelScale`
.. seealso:: :py:func:`labelAttributeName`
%End
void setLabelColor( const QColor &color );
%Docstring
Sets the color to use for for labeling points.
:param color: label color
.. seealso:: :py:func:`labelColor`
.. seealso:: :py:func:`setLabelAttributeName`
.. seealso:: :py:func:`setLabelFont`
%End
QColor labelColor() const;
%Docstring
Returns the color used for for labeling points.
.. seealso:: :py:func:`setLabelColor`
.. seealso:: :py:func:`labelAttributeName`
.. seealso:: :py:func:`labelFont`
%End
void setTolerance( double distance );
%Docstring
Sets the tolerance distance for grouping points. Units are specified
using :py:func:`~QgsPointDistanceRenderer.setToleranceUnit`.
:param distance: tolerance distance
.. seealso:: :py:func:`tolerance`
.. seealso:: :py:func:`setToleranceUnit`
%End
double tolerance() const;
%Docstring
Returns the tolerance distance for grouping points. Units are retrieved
using :py:func:`~QgsPointDistanceRenderer.toleranceUnit`.
.. seealso:: :py:func:`setTolerance`
.. seealso:: :py:func:`toleranceUnit`
%End
void setToleranceUnit( Qgis::RenderUnit unit );
%Docstring
Sets the units for the tolerance distance.
:param unit: tolerance distance units
.. seealso:: :py:func:`setTolerance`
.. seealso:: :py:func:`toleranceUnit`
%End
Qgis::RenderUnit toleranceUnit() const;
%Docstring
Returns the units for the tolerance distance.
.. seealso:: :py:func:`tolerance`
.. seealso:: :py:func:`setToleranceUnit`
%End
void setToleranceMapUnitScale( const QgsMapUnitScale &scale );
%Docstring
Sets the map unit scale object for the distance tolerance. This is only
used if the :py:func:`~QgsPointDistanceRenderer.toleranceUnit` is set to
:py:class:`QgsUnitTypes`.RenderMapUnits.
:param scale: scale for distance tolerance
.. seealso:: :py:func:`toleranceMapUnitScale`
.. seealso:: :py:func:`setToleranceUnit`
%End
const QgsMapUnitScale &toleranceMapUnitScale() const;
%Docstring
Returns the map unit scale object for the distance tolerance. This is
only used if the :py:func:`~QgsPointDistanceRenderer.toleranceUnit` is
set to :py:class:`QgsUnitTypes`.RenderMapUnits.
.. seealso:: :py:func:`setToleranceMapUnitScale`
.. seealso:: :py:func:`toleranceUnit`
%End
protected:
void drawLabels( QPointF centerPoint, QgsSymbolRenderContext &context, const QList<QPointF> &labelShifts, const ClusteredGroup &group ) const;
%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 ) const = 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
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/symbology/qgspointdistancerenderer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|