QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
Public Member Functions | Static Public Member Functions | List of all members
QgsMeshLayerSimpleLabeling Class Reference

Basic implementation of the labeling interface for mesh layer. More...

#include <qgsmeshlayerlabeling.h>

Inheritance diagram for QgsMeshLayerSimpleLabeling:
Inheritance graph
[legend]

Public Member Functions

 QgsMeshLayerSimpleLabeling (const QgsPalLayerSettings &settings, bool labelFaces=false)
 Constructs simple labeling configuration with given initial settings. More...
 
bool accept (QgsStyleEntityVisitorInterface *visitor) const override
 Accepts the specified symbology visitor, causing it to visit all symbols associated with the labeling. More...
 
QgsMeshLayerSimpleLabelingclone () const override
 Returns a new copy of the object. More...
 
void multiplyOpacity (double opacityFactor) override
 Multiply opacity by opacityFactor. More...
 
QgsMeshLayerLabelProviderprovider (QgsMeshLayer *layer) const override
 
bool requiresAdvancedEffects () const override
 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. More...
 
QDomElement save (QDomDocument &doc, const QgsReadWriteContext &context) const override
 Returns labeling configuration as XML element. More...
 
void setSettings (QgsPalLayerSettings *settings, const QString &providerId=QString()) override
 Set pal settings (takes ownership). More...
 
QgsPalLayerSettings settings (const QString &providerId=QString()) const override
 Gets associated label settings. More...
 
QString type () const override
 Unique type string of the labeling configuration implementation. More...
 
- Public Member Functions inherited from QgsAbstractMeshLayerLabeling
 QgsAbstractMeshLayerLabeling ()=default
 Default constructor. More...
 
virtual ~QgsAbstractMeshLayerLabeling ()=default
 
virtual bool accept (QgsStyleEntityVisitorInterface *visitor) const
 Accepts the specified symbology visitor, causing it to visit all symbols associated with the labeling. More...
 
virtual QgsAbstractMeshLayerLabelingclone () const =0
 Returns a new copy of the object. More...
 
virtual void multiplyOpacity (double opacityFactor)
 Multiply opacity by opacityFactor. More...
 
virtual QgsMeshLayerLabelProviderprovider (QgsMeshLayer *layer) const
 Factory for label provider implementation. More...
 
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. More...
 
virtual QDomElement save (QDomDocument &doc, const QgsReadWriteContext &context) const =0
 Returns labeling configuration as XML element. More...
 
virtual void setSettings (QgsPalLayerSettings *settings, const QString &providerId=QString())=0
 Set pal settings for a specific provider (takes ownership). More...
 
virtual QgsPalLayerSettings settings (const QString &providerId=QString()) const =0
 Gets associated label settings. More...
 
virtual QStringList subProviders () const
 Gets list of sub-providers within the layer's labeling. More...
 
virtual void toSld (QDomNode &parent, const QVariantMap &props) const
 Writes the SE 1.1 TextSymbolizer element based on the current layer labeling settings. More...
 
virtual QString type () const =0
 Unique type string of the labeling configuration implementation. More...
 

Static Public Member Functions

static QgsMeshLayerSimpleLabelingcreate (const QDomElement &element, const QgsReadWriteContext &context)
 Create the instance from a DOM element with saved configuration. More...
 
- Static Public Member Functions inherited from QgsAbstractMeshLayerLabeling
static QgsAbstractMeshLayerLabelingcreate (const QDomElement &element, const QgsReadWriteContext &context)
 Try to create instance of an implementation based on the XML data. More...
 
static QgsPalLayerSettings defaultSettingsForLayer (const QgsMeshLayer *layer)
 Returns the default layer settings to use for the specified mesh layer. More...
 

Detailed Description

Basic implementation of the labeling interface for mesh layer.

Since
QGIS 3.36

Definition at line 145 of file qgsmeshlayerlabeling.h.

Constructor & Destructor Documentation

◆ QgsMeshLayerSimpleLabeling()

QgsMeshLayerSimpleLabeling::QgsMeshLayerSimpleLabeling ( const QgsPalLayerSettings settings,
bool  labelFaces = false 
)
explicit

Constructs simple labeling configuration with given initial settings.

Labels are placed on mesh vertices unless labelFaces is true, when they are placed on mesh faces.

Definition at line 54 of file qgsmeshlayerlabeling.cpp.

Member Function Documentation

◆ accept()

bool QgsMeshLayerSimpleLabeling::accept ( QgsStyleEntityVisitorInterface visitor) const
overridevirtual

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 from QgsAbstractMeshLayerLabeling.

Definition at line 90 of file qgsmeshlayerlabeling.cpp.

◆ clone()

QgsMeshLayerSimpleLabeling * QgsMeshLayerSimpleLabeling::clone ( ) const
overridevirtual

Returns a new copy of the object.

Implements QgsAbstractMeshLayerLabeling.

Definition at line 65 of file qgsmeshlayerlabeling.cpp.

◆ create()

QgsMeshLayerSimpleLabeling * QgsMeshLayerSimpleLabeling::create ( const QDomElement &  element,
const QgsReadWriteContext context 
)
static

Create the instance from a DOM element with saved configuration.

Definition at line 106 of file qgsmeshlayerlabeling.cpp.

◆ multiplyOpacity()

void QgsMeshLayerSimpleLabeling::multiplyOpacity ( double  opacityFactor)
overridevirtual

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 from QgsAbstractMeshLayerLabeling.

Definition at line 120 of file qgsmeshlayerlabeling.cpp.

◆ provider()

QgsMeshLayerLabelProvider * QgsMeshLayerSimpleLabeling::provider ( QgsMeshLayer layer) const
overridevirtual
Note
not available in Python bindings

Reimplemented from QgsAbstractMeshLayerLabeling.

Definition at line 70 of file qgsmeshlayerlabeling.cpp.

◆ requiresAdvancedEffects()

bool QgsMeshLayerSimpleLabeling::requiresAdvancedEffects ( ) const
overridevirtual

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.

Implements QgsAbstractMeshLayerLabeling.

Definition at line 101 of file qgsmeshlayerlabeling.cpp.

◆ save()

QDomElement QgsMeshLayerSimpleLabeling::save ( QDomDocument &  doc,
const QgsReadWriteContext context 
) const
overridevirtual

Returns labeling configuration as XML element.

Implements QgsAbstractMeshLayerLabeling.

Definition at line 75 of file qgsmeshlayerlabeling.cpp.

◆ setSettings()

void QgsMeshLayerSimpleLabeling::setSettings ( QgsPalLayerSettings settings,
const QString &  providerId = QString() 
)
overridevirtual

Set pal settings (takes ownership).

Parameters
settingsPal layer settings
providerIdUnused parameter

Implements QgsAbstractMeshLayerLabeling.

Definition at line 127 of file qgsmeshlayerlabeling.cpp.

◆ settings()

QgsPalLayerSettings QgsMeshLayerSimpleLabeling::settings ( const QString &  providerId = QString()) const
overridevirtual

Gets associated label settings.

In case of multiple sub-providers with different settings, they are identified by their ID.

Implements QgsAbstractMeshLayerLabeling.

Definition at line 84 of file qgsmeshlayerlabeling.cpp.

◆ type()

QString QgsMeshLayerSimpleLabeling::type ( ) const
overridevirtual

Unique type string of the labeling configuration implementation.

Implements QgsAbstractMeshLayerLabeling.

Definition at line 60 of file qgsmeshlayerlabeling.cpp.


The documentation for this class was generated from the following files: