QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
18 #ifndef QGSPOINTDISTANCERENDERER_H
19 #define QGSPOINTDISTANCERENDERER_H
21 #include "qgis_core.h"
55 , isSelected( isSelected )
73 std::shared_ptr< QgsMarkerSymbol > mSymbol;
88 QSet<QString> usedAttributes( const
QgsRenderContext &context ) const override;
89 bool filterNeedsGeometry() 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;
318 #endif // QGSPOINTDISTANCERENDERER_H
QString labelAttributeName() const
Returns the attribute name used for labeling points, or an empty string if no labeling will be done b...
RenderUnit
Rendering size units.
QMap< QgsFeatureId, QgsPointXY > mGroupLocations
Mapping of feature ID to approximate group location.
QgsUnitTypes::RenderUnit mToleranceUnit
Unit for distance tolerance.
QString mLabelAttributeName
Attribute name for labeling. An empty string indicates that no labels should be rendered.
Container of fields for a vector layer.
Contains information about the context of a rendering operation.
An interface for classes which can visit style entity (e.g.
Abstract base class for all rendered symbols.
QFont mLabelFont
Label font.
virtual void toSld(QDomDocument &doc, QDomElement &element, const QgsStringMap &props=QgsStringMap()) const
used from subclasses to create SLD Rule elements following SLD v1.1 specs
const QgsMapUnitScale & toleranceMapUnitScale() const
Returns the map unit scale object for the distance tolerance.
A rectangle specified with double values.
std::unique_ptr< QgsFeatureRenderer > mRenderer
Embedded base renderer. This can be used for rendering individual, isolated points.
QList< ClusteredGroup > mClusteredGroups
Groups of features that are considered clustered together.
QgsUnitTypes::RenderUnit toleranceUnit() const
Returns the units for the tolerance distance.
Custom exception class for Coordinate Reference System related exceptions.
void setLabelColor(const QColor &color)
Sets the color to use for for labeling points.
int mLabelIndex
Label attribute index (or -1 if none). This index is not stored, it is requested in the startRender()...
QList< QgsSymbol * > QgsSymbolList
A marker symbol type, for rendering Point and MultiPoint geometries.
QColor mLabelColor
Label text color.
An abstract base class for distance based point renderers (e.g., clusterer and displacement renderers...
QgsMarkerSymbol * symbol() const
Base symbol for rendering feature.
A spatial index for QgsFeature objects.
QgsMapUnitScale mToleranceMapUnitScale
Map unit scale for distance tolerance.
Struct for storing maximum and minimum scales for measurements in map units.
QColor labelColor() const
Returns the color used for for labeling points.
void setToleranceMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale object for the distance tolerance.
Single scope for storing variables and functions for use within a QgsExpressionContext.
double tolerance() const
Returns the tolerance distance for grouping points.
QList< QgsPointDistanceRenderer::GroupedFeature > ClusteredGroup
A group of clustered points (ie features within the distance tolerance).
A class to represent a 2D point.
void setToleranceUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the tolerance distance.
QMap< QString, QString > QgsStringMap
QString label
Optional label text.
bool mDrawLabels
Whether labels should be drawn for points. This is set internally from startRender() depending on sca...
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.
void setLabelFont(const QFont &font)
Sets the font used for labeling points.
double minimumLabelScale() const
Returns the minimum map scale (i.e.
QFont labelFont() const
Returns the font used for labeling points.
void setMinimumLabelScale(double scale)
Sets the minimum map scale (i.e.
void setTolerance(double distance)
Sets the tolerance distance for grouping points.
GroupedFeature(const QgsFeature &feature, QgsMarkerSymbol *symbol, bool isSelected, const QString &label=QString())
Constructor for GroupedFeature.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
QList< QgsLegendSymbolItem > QgsLegendSymbolList
QMap< QgsFeatureId, int > mGroupIndex
Mapping of feature ID to the feature's group index.
QgsFeature feature
Feature.
double mTolerance
Distance tolerance. Points that are closer together than this distance are considered clustered.
bool isSelected
True if feature is selected and should be rendered in a selected state.
Contains properties for a feature within a clustered group.