16 #ifndef QGSLABELINGENGINEV2_H 17 #define QGSLABELINGENGINEV2_H 21 #include "qgis_core.h" 58 DrawAllLabels = 1 << 2,
59 MergeConnectedLines = 1 << 3,
60 CentroidMustBeInside = 1 << 4,
61 LabelPerFeaturePart = 1 << 6,
63 Q_DECLARE_FLAGS( Flags,
Flag )
75 QString
name()
const {
return mName; }
78 QString
layerId()
const {
return mLayerId; }
91 Flags
flags()
const {
return mFlags; }
129 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsAbstractLabelProvider::Flags )
171 ~QgsLabelingEngine();
174 QgsLabelingEngine(
const QgsLabelingEngine &rh ) =
delete;
176 QgsLabelingEngine &operator=(
const QgsLabelingEngine &rh ) =
delete;
190 QList< QgsMapLayer * > participatingLayers()
const;
243 static QString encodePredefinedPositionOrder(
const QVector< QgsPalLayerSettings::PredefinedPointPosition > &positions );
251 static QVector< QgsPalLayerSettings::PredefinedPointPosition > decodePredefinedPositionOrder(
const QString &positionString );
257 static QString encodeLinePlacementFlags( pal::LineArrangementFlags flags );
263 static pal::LineArrangementFlags decodeLinePlacementFlags(
const QString &
string );
267 #endif // QGSLABELINGENGINEV2_H QString name() const
Name of the layer (for statistics, debugging etc.) - does not need to be unique.
Base class for all map layer types.
QgsWeakMapLayerPointer mLayer
Weak pointer to source layer.
QgsPalLayerSettings::Placement mPlacement
Placement strategy.
QList< QgsAbstractLabelProvider * > mProviders
List of providers (the are owned by the labeling engine)
double mPriority
Default priority of labels.
Contains helper utilities for working with QGIS' labeling engine.
QList< QgsAbstractLabelProvider * > mSubProviders
QgsPalLayerSettings::UpsideDownLabels upsidedownLabels() const
How to handle labels that would be upside down.
QPointer< QgsMapLayer > QgsWeakMapLayerPointer
Weak pointer for QgsMapLayer.
The QgsMapSettings class contains configuration for rendering of the map.
QString providerId() const
Returns provider ID - useful in case there is more than one label provider within a layer (e...
QgsPalLayerSettings::Placement placement() const
What placement strategy to use for the labels.
QgsMapLayer * layer() const
Returns the associated layer, or nullptr if no layer is associated with the provider.
QgsLabelingResults * results() const
For internal use by the providers.
Flags mFlags
Flags altering drawing and registration of features.
double priority() const
Default priority of labels (may be overridden by individual labels)
Flags flags() const
Flags associated with the provider.
The QgsAbstractLabelProvider class is an interface class.
QString layerId() const
Returns ID of associated layer, or empty string if no layer is associated with the provider...
const QgsMapSettings & mapSettings() const
Gets associated map settings.
Placement
Placement modes which determine how label candidates are generated for a feature. ...
The QgsLabelingEngine class provides map labeling functionality.
Contains information about the context of a rendering operation.
const QgsLabelingEngineSettings & engineSettings() const
Gets associated labeling engine settings.
The QgsLabelFeature class describes a feature that should be used within the labeling engine...
std::unique_ptr< QgsLabelingResults > mResults
Resulting labeling layout.
QString mName
Name of the layer.
QgsMapSettings mMapSettings
Associated map settings instance.
QgsPalLayerSettings::ObstacleType obstacleType() const
How the feature geometries will work as obstacles.
Stores global configuration for labeling engine.
QString mProviderId
Associated provider ID (one layer may have multiple providers, e.g. in rule-based labeling) ...
QgsPalLayerSettings::ObstacleType mObstacleType
Type of the obstacle of feature geometries.
QgsPalLayerSettings::UpsideDownLabels mUpsidedownLabels
How to handle labels that would be upside down.
Class that stores computed placement from labeling engine.
QString mLayerId
Associated layer's ID, if applicable.
void setEngine(const QgsLabelingEngine *engine)
Associate provider with a labeling engine (should be only called internally from QgsLabelingEngine) ...
ObstacleType
Valid obstacle types, which affect how features within the layer will act as obstacles for labels...