16#ifndef QGSVECTORLAYERDIAGRAMPROVIDER_H
17#define QGSVECTORLAYERDIAGRAMPROVIDER_H
Base class that can be used for any class that is capable of returning features.
virtual QList< QgsLabelFeature * > labelFeatures(QgsRenderContext &context)=0
Returns list of label features (they are owned by the provider and thus deleted on its destruction).
virtual void drawLabel(QgsRenderContext &context, pal::LabelPosition *label) const =0
Draw this label at the position determined by the labeling engine.
QgsMapLayer * layer() const
Returns the associated layer, or nullptr if no layer is associated with the provider.
QgsAbstractLabelProvider(QgsMapLayer *layer, const QString &providerId=QString())
Construct the provider with default values.
Represents a coordinate reference system (CRS).
QgsDiagramLabelFeature(const QgsFeature &feature, geos::unique_ptr geometry, QSizeF size)
Create label feature, takes ownership of the geometry instance.
Stores the settings for rendering of all diagrams for a layer.
Evaluates and returns the diagram settings relating to a diagram for a specific feature.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Container of fields for a vector layer.
A geometry is the spatial representation of a feature.
Describes a feature that should be used within the labeling engine.
QgsLabelFeature(QgsFeatureId id, geos::unique_ptr geometry, QSizeF size)
Constructor for QgsLabelFeature.
QSizeF size(double angle=0.0) const
Size of the label (in map units).
void setFeature(const QgsFeature &feature)
Sets the original feature associated with this label.
GEOSGeometry * geometry() const
Gets access to the associated geometry.
QgsFeature feature() const
Returns the original feature associated with this label.
QgsFeatureId id() const
Identifier of the label (unique within the parent label provider).
Contains information about the context of a rendering operation.
QgsDiagramLayerSettings mSettings
Diagram layer settings.
QgsAbstractFeatureSource * mSource
Layer's feature source.
void init()
initialization method - called from constructors
bool mOwnsSource
Whether layer's feature source is owned.
QgsCoordinateReferenceSystem mLayerCrs
Layer's CRS.
virtual bool prepare(const QgsRenderContext &context, QSet< QString > &attributeNames)
Prepare for registration of features.
QgsLabelFeature * registerDiagram(const QgsFeature &feat, QgsRenderContext &context, const QgsGeometry &obstacleGeometry=QgsGeometry())
helper method to register one diagram feature
virtual void registerFeature(QgsFeature &feature, QgsRenderContext &context, const QgsGeometry &obstacleGeometry=QgsGeometry())
Register a feature for labeling as one or more QgsLabelFeature objects stored into mFeatures.
QgsDiagramRenderer * mDiagRenderer
Diagram renderer instance (owned by mSettings).
QList< QgsLabelFeature * > mFeatures
List of generated label features (owned by the provider).
QgsVectorLayerDiagramProvider(QgsVectorLayer *layer, bool ownFeatureLoop=true)
Convenience constructor to initialize the provider from given vector layer.
QgsFields mFields
Layer's fields.
QgsGeometry mLabelClipFeatureGeom
void setClipFeatureGeometry(const QgsGeometry &geometry)
Sets a geometry to use to clip features to when registering them as diagrams.
std::unique_ptr< QgsExpressionContextScope > mLayerScope
Represents a vector layer which manages a vector based dataset.
LabelPosition is a candidate feature label position.
std::unique_ptr< GEOSGeometry, GeosDeleter > unique_ptr
Scoped GEOS pointer.