QGIS API Documentation 3.41.0-Master (3440c17df1d)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
QgsMaskIdProvider Class Reference

This class allows the creation of mask ids based on the different label layers and to give a mask id from a label layer. More...

#include <qgsmaskidprovider.h>

Public Member Functions

int insertLabelLayer (const QString &layerId, const QString &ruleId, const QSet< QgsSymbolLayerReference > &maskedSymbolLayers)
 Inserts a label layer to the provider and returns its associated mask id.
 
int maskId (const QString &labelLayerId=QString(), const QString &labelRuleId=QString()) const
 Returns the mask id associated with a label layer and its optional label rule.
 
int size () const
 Returns the number of identifiers allocated.
 

Detailed Description

This class allows the creation of mask ids based on the different label layers and to give a mask id from a label layer.

Some rendering operations may need multiple mask images. This is the case for label rendering in which we can have different mask images: one different for each labeling rule for instance. Some label layers may need to share their mask images, some other need to have distinct mask images. Label layers share the same mask image if the set of symbol layers they mask is the same.

A "mask id" is then associated to each label layer. They are contiguous integer numbers starting at 0.

Since
QGIS 3.12

Definition at line 39 of file qgsmaskidprovider.h.

Member Function Documentation

◆ insertLabelLayer()

int QgsMaskIdProvider::insertLabelLayer ( const QString &  layerId,
const QString &  ruleId,
const QSet< QgsSymbolLayerReference > &  maskedSymbolLayers 
)

Inserts a label layer to the provider and returns its associated mask id.

Parameters
layerIdid of the vector layer that carries these labels
ruleIdid of the labeling rule, if any
maskedSymbolLayersthe symbol layers that are masked by this label layer
Returns
the associated mask id.

Definition at line 19 of file qgsmaskidprovider.cpp.

◆ maskId()

int QgsMaskIdProvider::maskId ( const QString &  labelLayerId = QString(),
const QString &  labelRuleId = QString() 
) const

Returns the mask id associated with a label layer and its optional label rule.

Returns -1 if not found.

Definition at line 36 of file qgsmaskidprovider.cpp.

◆ size()

int QgsMaskIdProvider::size ( ) const

Returns the number of identifiers allocated.

Definition at line 50 of file qgsmaskidprovider.cpp.


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