QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
Public Member Functions | List of all members
QgsMaskIdProvider Class Reference

Some rendering operations may need multiple mask images. 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. More...
 
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. More...
 
int size () const
 Returns the number of identifiers allocated. More...
 

Detailed Description

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.

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

Since
QGIS 3.12

Definition at line 37 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 18 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 35 of file qgsmaskidprovider.cpp.

◆ size()

int QgsMaskIdProvider::size ( ) const

Returns the number of identifiers allocated.

Definition at line 49 of file qgsmaskidprovider.cpp.


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