18#ifndef QGSPOINTDISTANCERENDERER_H
19#define QGSPOINTDISTANCERENDERER_H
72 std::shared_ptr< QgsMarkerSymbol > mSymbol;
85 void toSld( QDomDocument &doc, QDomElement &element,
const QVariantMap &props = QVariantMap() )
const override;
87 QSet<QString> usedAttributes( const
QgsRenderContext &context ) const override;
88 bool filterNeedsGeometry() const override;
96 QString legendKeyToExpression( const QString &key,
QgsVectorLayer *layer,
bool &ok ) const override;
104 bool legendSymbolItemsCheckable() const override;
105 bool legendSymbolItemChecked( const QString &key ) override;
106 void checkLegendSymbolItem( const QString &key,
bool state ) override;
118 void setLabelAttributeName( const QString &name ) { mLabelAttributeName = name; }
256 double mMinLabelScale = 0;
294 void printGroupInfo()
const;
297 QString getLabel(
const QgsFeature &feature )
const;
Custom exception class for Coordinate Reference System related exceptions.
Single scope for storing variables and functions for use within a QgsExpressionContext.
virtual void toSld(QDomDocument &doc, QDomElement &element, const QVariantMap &props=QVariantMap()) const
used from subclasses to create SLD Rule elements following SLD v1.1 specs
virtual bool renderFeature(const QgsFeature &feature, QgsRenderContext &context, int layer=-1, bool selected=false, bool drawVertexMarker=false) SIP_THROW(QgsCsException)
Render a feature using this renderer in the given context.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Container of fields for a vector layer.
Struct for storing maximum and minimum scales for measurements in map units.
A marker symbol type, for rendering Point and MultiPoint geometries.
An abstract base class for distance based point renderers (e.g., clusterer and displacement renderers...
QMap< QgsFeatureId, QgsPointXY > mGroupLocations
Mapping of feature ID to approximate group location.
void setLabelColor(const QColor &color)
Sets the color to use for for labeling points.
QColor labelColor() const
Returns the color used for for labeling points.
int mLabelIndex
Label attribute index (or -1 if none). This index is not stored, it is requested in the startRender()...
QColor mLabelColor
Label text color.
QgsMapUnitScale mToleranceMapUnitScale
Map unit scale for distance tolerance.
QgsUnitTypes::RenderUnit toleranceUnit() const
Returns the units for the tolerance distance.
QList< ClusteredGroup > mClusteredGroups
Groups of features that are considered clustered together.
void setLabelFont(const QFont &font)
Sets the font used for labeling points.
QMap< QgsFeatureId, int > mGroupIndex
Mapping of feature ID to the feature's group index.
double minimumLabelScale() const
Returns the minimum map scale (i.e.
void setMinimumLabelScale(double scale)
Sets the minimum map scale (i.e.
double tolerance() const
Returns the tolerance distance for grouping points.
QFont labelFont() const
Returns the font used for labeling points.
QString labelAttributeName() const
Returns the attribute name used for labeling points, or an empty string if no labeling will be done b...
const QgsMapUnitScale & toleranceMapUnitScale() const
Returns the map unit scale object for the distance tolerance.
void setToleranceUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the tolerance distance.
QString mLabelAttributeName
Attribute name for labeling. An empty string indicates that no labels should be rendered.
double mTolerance
Distance tolerance. Points that are closer together than this distance are considered clustered.
bool mDrawLabels
Whether labels should be drawn for points. This is set internally from startRender() depending on sca...
QFont mLabelFont
Label font.
std::unique_ptr< QgsFeatureRenderer > mRenderer
Embedded base renderer. This can be used for rendering individual, isolated points.
QgsUnitTypes::RenderUnit mToleranceUnit
Unit for distance tolerance.
void setToleranceMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale object for the distance tolerance.
void setTolerance(double distance)
Sets the tolerance distance for grouping points.
QList< QgsPointDistanceRenderer::GroupedFeature > ClusteredGroup
A group of clustered points (ie features within the distance tolerance).
Point geometry type, with support for z-dimension and m-values.
A rectangle specified with double values.
Contains information about the context of a rendering operation.
A spatial index for QgsFeature objects.
An interface for classes which can visit style entity (e.g.
Abstract base class for all rendered symbols.
RenderUnit
Rendering size units.
Represents a vector layer which manages a vector based data sets.
#define SIP_THROW(name,...)
QList< QgsLegendSymbolItem > QgsLegendSymbolList
QList< QgsSymbol * > QgsSymbolList
Contains properties for a feature within a clustered group.
bool isSelected
True if feature is selected and should be rendered in a selected state.
QString label
Optional label text.
QgsMarkerSymbol * symbol() const
Base symbol for rendering feature.
QgsFeature feature
Feature.