18 #ifndef QGSPOINTDISTANCERENDERER_H 19 #define QGSPOINTDISTANCERENDERER_H 21 #include "qgis_core.h" 55 , isSelected( isSelected )
73 std::shared_ptr< QgsMarkerSymbol > mSymbol;
87 bool renderFeature(
QgsFeature &feature,
QgsRenderContext &context,
int layer = -1,
bool selected =
false,
bool drawVertexMarker =
false )
override;
88 QSet<QString> usedAttributes(
const QgsRenderContext &context )
const override;
89 QgsFeatureRenderer::Capabilities capabilities()
override;
103 bool legendSymbolItemsCheckable()
const override;
104 bool legendSymbolItemChecked(
const QString &key )
override;
105 void checkLegendSymbolItem(
const QString &key,
bool state )
override;
254 double mMinLabelScale = 0;
276 void drawLabels( QPointF centerPoint,
QgsSymbolRenderContext &context,
const QList<QPointF> &labelShifts,
const ClusteredGroup &group );
292 void printGroupInfo()
const;
295 QString getLabel(
const QgsFeature &feature )
const;
316 #endif // QGSPOINTDISTANCERENDERER_H An abstract base class for distance based point renderers (e.g., clusterer and displacement renderers...
A rectangle specified with double values.
QString mLabelAttributeName
Attribute name for labeling. An empty string indicates that no labels should be rendered.
QString label
Optional label text.
double minimumLabelScale() const
Returns the minimum map scale (i.e.
QList< QgsLegendSymbolItem > QgsLegendSymbolList
QgsUnitTypes::RenderUnit mToleranceUnit
Unit for distance tolerance.
QgsFeature feature
Feature.
void setLabelFont(const QFont &font)
Sets the font used for labeling points.
GroupedFeature(const QgsFeature &feature, QgsMarkerSymbol *symbol, bool isSelected, const QString &label=QString())
Constructor for GroupedFeature.
A class to represent a 2D point.
void setTolerance(double distance)
Sets the tolerance distance for grouping points.
void setLabelColor(const QColor &color)
Sets the color to use for for labeling points.
void setToleranceMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale object for the distance tolerance.
void setToleranceUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the tolerance distance.
Container of fields for a vector layer.
QMap< QgsFeatureId, int > mGroupIndex
Mapping of feature ID to the feature's group index.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
QString labelAttributeName() const
Returns the attribute name used for labeling points, or an empty string if no labeling will be done b...
QMap< QString, QString > QgsStringMap
QgsUnitTypes::RenderUnit toleranceUnit() const
Returns the units for the tolerance distance.
bool mDrawLabels
Whether labels should be drawn for points. This is set internally from startRender() depending on sca...
QFont labelFont() const
Returns the font used for labeling points.
QFont mLabelFont
Label font.
QList< QgsSymbol * > QgsSymbolList
bool isSelected
True if feature is selected and should be rendered in a selected state.
double mTolerance
Distance tolerance. Points that are closer together than this distance are considered clustered...
QMap< QgsFeatureId, QgsPointXY > mGroupLocations
Mapping of feature ID to approximate group location.
void setLabelAttributeName(const QString &name)
Sets the attribute name for labeling points.
QColor mLabelColor
Label text color.
Single scope for storing variables and functions for use within a QgsExpressionContext.
QgsMapUnitScale mToleranceMapUnitScale
Map unit scale for distance tolerance.
double tolerance() const
Returns the tolerance distance for grouping points.
const QgsMapUnitScale & toleranceMapUnitScale() const
Returns the map unit scale object for the distance tolerance.
Contains properties for a feature within a clustered group.
QgsMarkerSymbol * symbol() const
Base symbol for rendering feature.
Contains information about the context of a rendering operation.
A spatial index for QgsFeature objects.
Struct for storing maximum and minimum scales for measurements in map units.
void setMinimumLabelScale(double scale)
Sets the minimum map scale (i.e.
std::unique_ptr< QgsFeatureRenderer > mRenderer
Embedded base renderer. This can be used for rendering individual, isolated points.
QList< QgsPointDistanceRenderer::GroupedFeature > ClusteredGroup
A group of clustered points (ie features within the distance tolerance).
QList< ClusteredGroup > mClusteredGroups
Groups of features that are considered clustered together.
int mLabelIndex
Label attribute index (or -1 if none). This index is not stored, it is requested in the startRender()...
RenderUnit
Rendering size units.
QColor labelColor() const
Returns the color used for for labeling points.