QGIS API Documentation 3.43.0-Master (56aa1fd18d7)
|
Abstract base class - its implementations define different approaches to the labeling of a vector layer. More...
#include <qgsvectorlayerlabeling.h>
Public Member Functions | |
QgsAbstractVectorLayerLabeling ()=default | |
virtual | ~QgsAbstractVectorLayerLabeling ()=default |
virtual bool | accept (QgsStyleEntityVisitorInterface *visitor) const |
Accepts the specified symbology visitor, causing it to visit all symbols associated with the labeling. | |
virtual QgsAbstractVectorLayerLabeling * | clone () const =0 |
Returns a new copy of the object. | |
virtual void | multiplyOpacity (double opacityFactor) |
Multiply opacity by opacityFactor. | |
virtual QgsVectorLayerLabelProvider * | provider (QgsVectorLayer *layer) const |
Factory for label provider implementation. | |
virtual bool | requiresAdvancedEffects () const =0 |
Returns true if drawing labels requires advanced effects like composition modes, which could prevent it being used as an isolated cached image or exported to a vector format. | |
virtual QDomElement | save (QDomDocument &doc, const QgsReadWriteContext &context) const =0 |
Returns labeling configuration as XML element. | |
virtual void | setSettings (QgsPalLayerSettings *settings, const QString &providerId=QString())=0 |
Set pal settings for a specific provider (takes ownership). | |
virtual QgsPalLayerSettings | settings (const QString &providerId=QString()) const =0 |
Gets associated label settings. | |
virtual QStringList | subProviders () const |
Gets list of sub-providers within the layer's labeling. | |
virtual Q_DECL_DEPRECATED void | toSld (QDomNode &parent, const QVariantMap &props) const |
Writes the SE 1.1 TextSymbolizer element based on the current layer labeling settings. | |
virtual bool | toSld (QDomNode &parent, QgsSldExportContext &context) const |
Writes the SE 1.1 TextSymbolizer element based on the current layer labeling settings. | |
virtual QString | type () const =0 |
Unique type string of the labeling configuration implementation. | |
Static Public Member Functions | |
static QgsAbstractVectorLayerLabeling * | create (const QDomElement &element, const QgsReadWriteContext &context) |
Try to create instance of an implementation based on the XML data. | |
static QgsPalLayerSettings | defaultSettingsForLayer (const QgsVectorLayer *layer) |
Returns the default layer settings to use for the specified vector layer. | |
Protected Member Functions | |
virtual Q_DECL_DEPRECATED void | writeTextSymbolizer (QDomNode &parent, QgsPalLayerSettings &settings, const QVariantMap &props) const |
Writes a TextSymbolizer element contents based on the provided labeling settings. | |
virtual bool | writeTextSymbolizer (QDomNode &parent, QgsPalLayerSettings &settings, QgsSldExportContext &context) const |
Writes a TextSymbolizer element contents based on the provided labeling settings. | |
Abstract base class - its implementations define different approaches to the labeling of a vector layer.
Definition at line 41 of file qgsvectorlayerlabeling.h.
|
default |
|
virtualdefault |
|
virtual |
Accepts the specified symbology visitor, causing it to visit all symbols associated with the labeling.
Returns true
if the visitor should continue visiting other objects, or false
if visiting should be canceled.
Reimplemented in QgsRuleBasedLabeling, and QgsVectorLayerSimpleLabeling.
Definition at line 58 of file qgsvectorlayerlabeling.cpp.
|
pure virtual |
Returns a new copy of the object.
Implemented in QgsRuleBasedLabeling, and QgsVectorLayerSimpleLabeling.
|
static |
Try to create instance of an implementation based on the XML data.
Definition at line 28 of file qgsvectorlayerlabeling.cpp.
|
static |
Returns the default layer settings to use for the specified vector layer.
Definition at line 63 of file qgsvectorlayerlabeling.cpp.
|
inlinevirtual |
Multiply opacity by opacityFactor.
This method multiplies the opacity of the labeling elements (text, shadow, buffer etc.) by opacity effectively changing the opacity of the whole labeling elements.
Reimplemented in QgsRuleBasedLabeling, and QgsVectorLayerSimpleLabeling.
Definition at line 108 of file qgsvectorlayerlabeling.h.
|
inlinevirtual |
Factory for label provider implementation.
Reimplemented in QgsRuleBasedLabeling, and QgsVectorLayerSimpleLabeling.
Definition at line 70 of file qgsvectorlayerlabeling.h.
|
pure virtual |
Returns true
if drawing labels requires advanced effects like composition modes, which could prevent it being used as an isolated cached image or exported to a vector format.
Implemented in QgsRuleBasedLabeling, and QgsVectorLayerSimpleLabeling.
|
pure virtual |
Returns labeling configuration as XML element.
Implemented in QgsRuleBasedLabeling, and QgsVectorLayerSimpleLabeling.
|
pure virtual |
Set pal settings for a specific provider (takes ownership).
settings | Pal layer settings |
providerId | The id of the provider |
Implemented in QgsRuleBasedLabeling, and QgsVectorLayerSimpleLabeling.
|
pure virtual |
Gets associated label settings.
In case of multiple sub-providers with different settings, they are identified by their ID (e.g. in case of rule-based labeling, provider ID == rule key)
Implemented in QgsRuleBasedLabeling, and QgsVectorLayerSimpleLabeling.
|
inlinevirtual |
Gets list of sub-providers within the layer's labeling.
Reimplemented in QgsRuleBasedLabeling.
Definition at line 76 of file qgsvectorlayerlabeling.h.
|
virtual |
Writes the SE 1.1 TextSymbolizer element based on the current layer labeling settings.
Reimplemented in QgsRuleBasedLabeling, and QgsVectorLayerSimpleLabeling.
Definition at line 45 of file qgsvectorlayerlabeling.cpp.
|
virtual |
Writes the SE 1.1 TextSymbolizer element based on the current layer labeling settings.
Reimplemented in QgsRuleBasedLabeling, and QgsVectorLayerSimpleLabeling.
Definition at line 52 of file qgsvectorlayerlabeling.cpp.
|
pure virtual |
Unique type string of the labeling configuration implementation.
Implemented in QgsRuleBasedLabeling, and QgsVectorLayerSimpleLabeling.
|
protectedvirtual |
Writes a TextSymbolizer element contents based on the provided labeling settings.
parent | the node that will have the text symbolizer element added to it |
settings | the settings getting translated to a TextSymbolizer |
props | a open ended set of properties that can drive/inform the SLD encoding |
Definition at line 292 of file qgsvectorlayerlabeling.cpp.
|
protectedvirtual |
Writes a TextSymbolizer element contents based on the provided labeling settings.
parent | the node that will have the text symbolizer element added to it |
settings | the settings getting translated to a TextSymbolizer |
context | export context |
Definition at line 299 of file qgsvectorlayerlabeling.cpp.