QGIS API Documentation  2.99.0-Master (5169e0d)
Static Public Member Functions | Static Protected Member Functions | Friends | List of all members
QgsPalLabeling Class Reference

#include <qgspallabeling.h>

Static Public Member Functions

static void drawLabelCandidateRect (pal::LabelPosition *lp, QPainter *painter, const QgsMapToPixel *xform, QList< QgsLabelCandidate > *candidates=nullptr)
 
static bool geometryRequiresPreparation (const QgsGeometry &geometry, QgsRenderContext &context, const QgsCoordinateTransform &ct, QgsGeometry *clipGeometry=nullptr)
 Checks whether a geometry requires preparation before registration with PAL. More...
 
static QgsGeometry prepareGeometry (const QgsGeometry &geometry, QgsRenderContext &context, const QgsCoordinateTransform &ct, QgsGeometry *clipGeometry=nullptr)
 Prepares a geometry for registration with PAL. More...
 
static QStringList splitToGraphemes (const QString &text)
 Splits a text string to a list of graphemes, which are the smallest allowable character divisions in the string. More...
 
static QStringList splitToLines (const QString &text, const QString &wrapCharacter)
 Splits a text string to a list of separate lines, using a specified wrap character. More...
 
static bool staticWillUseLayer (QgsVectorLayer *layer)
 called to find out whether the layer is used for labeling More...
 

Static Protected Member Functions

static bool checkMinimumSizeMM (const QgsRenderContext &context, const QgsGeometry *geom, double minSize)
 Checks whether a geometry exceeds the minimum required size for a geometry to be labeled. More...
 
static void dataDefinedDropShadow (QgsPalLayerSettings &tmpLyr, const QMap< QgsPalLayerSettings::Property, QVariant > &ddValues)
 Update temporary QgsPalLayerSettings with any data defined drop shadow values. More...
 
static void dataDefinedShapeBackground (QgsPalLayerSettings &tmpLyr, const QMap< QgsPalLayerSettings::Property, QVariant > &ddValues)
 Update temporary QgsPalLayerSettings with any data defined shape background values. More...
 
static void dataDefinedTextBuffer (QgsPalLayerSettings &tmpLyr, const QMap< QgsPalLayerSettings::Property, QVariant > &ddValues)
 Update temporary QgsPalLayerSettings with any data defined text buffer values. More...
 
static void dataDefinedTextFormatting (QgsPalLayerSettings &tmpLyr, const QMap< QgsPalLayerSettings::Property, QVariant > &ddValues)
 Update temporary QgsPalLayerSettings with any data defined text formatting values. More...
 
static void dataDefinedTextStyle (QgsPalLayerSettings &tmpLyr, const QMap< QgsPalLayerSettings::Property, QVariant > &ddValues)
 Update temporary QgsPalLayerSettings with any data defined text style values. More...
 

Friends

class QgsDxfExport
 
class QgsPalLayerSettings
 
class QgsVectorLayerLabelProvider
 

Detailed Description

Definition at line 705 of file qgspallabeling.h.

Member Function Documentation

◆ checkMinimumSizeMM()

bool QgsPalLabeling::checkMinimumSizeMM ( const QgsRenderContext context,
const QgsGeometry geom,
double  minSize 
)
staticprotected

Checks whether a geometry exceeds the minimum required size for a geometry to be labeled.

Parameters
contextrender context
geomgeometry
minSizeminimum size for geometry
Returns
true if geometry exceeds minimum size
Since
QGIS 2.9

Definition at line 2916 of file qgspallabeling.cpp.

◆ dataDefinedDropShadow()

void QgsPalLabeling::dataDefinedDropShadow ( QgsPalLayerSettings tmpLyr,
const QMap< QgsPalLayerSettings::Property, QVariant > &  ddValues 
)
staticprotected

Update temporary QgsPalLayerSettings with any data defined drop shadow values.

Definition at line 3273 of file qgspallabeling.cpp.

◆ dataDefinedShapeBackground()

void QgsPalLabeling::dataDefinedShapeBackground ( QgsPalLayerSettings tmpLyr,
const QMap< QgsPalLayerSettings::Property, QVariant > &  ddValues 
)
staticprotected

Update temporary QgsPalLayerSettings with any data defined shape background values.

Definition at line 3122 of file qgspallabeling.cpp.

◆ dataDefinedTextBuffer()

void QgsPalLabeling::dataDefinedTextBuffer ( QgsPalLayerSettings tmpLyr,
const QMap< QgsPalLayerSettings::Property, QVariant > &  ddValues 
)
staticprotected

Update temporary QgsPalLayerSettings with any data defined text buffer values.

Definition at line 3044 of file qgspallabeling.cpp.

◆ dataDefinedTextFormatting()

void QgsPalLabeling::dataDefinedTextFormatting ( QgsPalLayerSettings tmpLyr,
const QMap< QgsPalLayerSettings::Property, QVariant > &  ddValues 
)
staticprotected

Update temporary QgsPalLayerSettings with any data defined text formatting values.

Definition at line 2989 of file qgspallabeling.cpp.

◆ dataDefinedTextStyle()

void QgsPalLabeling::dataDefinedTextStyle ( QgsPalLayerSettings tmpLyr,
const QMap< QgsPalLayerSettings::Property, QVariant > &  ddValues 
)
staticprotected

Update temporary QgsPalLayerSettings with any data defined text style values.

Definition at line 2955 of file qgspallabeling.cpp.

◆ drawLabelCandidateRect()

void QgsPalLabeling::drawLabelCandidateRect ( pal::LabelPosition lp,
QPainter *  painter,
const QgsMapToPixel xform,
QList< QgsLabelCandidate > *  candidates = nullptr 
)
static
Note
not available in Python bindings

Definition at line 3368 of file qgspallabeling.cpp.

◆ geometryRequiresPreparation()

bool QgsPalLabeling::geometryRequiresPreparation ( const QgsGeometry geometry,
QgsRenderContext context,
const QgsCoordinateTransform ct,
QgsGeometry clipGeometry = nullptr 
)
static

Checks whether a geometry requires preparation before registration with PAL.

Parameters
geometrygeometry to prepare
contextrender context
ctcoordinate transform, or invalid transform if no transformation required
clipGeometrygeometry to clip features to, if applicable
Returns
true if geometry requires preparation
Since
QGIS 2.9

Definition at line 2778 of file qgspallabeling.cpp.

◆ prepareGeometry()

QgsGeometry QgsPalLabeling::prepareGeometry ( const QgsGeometry geometry,
QgsRenderContext context,
const QgsCoordinateTransform ct,
QgsGeometry clipGeometry = nullptr 
)
static

Prepares a geometry for registration with PAL.

Handles reprojection, rotation, clipping, etc.

Parameters
geometrygeometry to prepare
contextrender context
ctcoordinate transform, or invalid transform if no transformation required
clipGeometrygeometry to clip features to, if applicable
Returns
prepared geometry
Since
QGIS 2.9

Definition at line 2838 of file qgspallabeling.cpp.

◆ splitToGraphemes()

QStringList QgsPalLabeling::splitToGraphemes ( const QString &  text)
static

Splits a text string to a list of graphemes, which are the smallest allowable character divisions in the string.

This accounts for scripts were individual characters are not allowed to be split apart (e.g., Arabic and Indic based scripts)

Parameters
textstring to split
Returns
list of graphemes
Since
QGIS 2.10

Definition at line 2824 of file qgspallabeling.cpp.

◆ splitToLines()

QStringList QgsPalLabeling::splitToLines ( const QString &  text,
const QString &  wrapCharacter 
)
static

Splits a text string to a list of separate lines, using a specified wrap character.

The text string will be split on either newline characters or the wrap character.

Parameters
texttext string to split
wrapCharacteradditional character to wrap on
Returns
list of text split to lines
Since
QGIS 2.9

Definition at line 2805 of file qgspallabeling.cpp.

◆ staticWillUseLayer()

bool QgsPalLabeling::staticWillUseLayer ( QgsVectorLayer layer)
static

called to find out whether the layer is used for labeling

Since
QGIS 2.4

Definition at line 2765 of file qgspallabeling.cpp.

Friends And Related Function Documentation

◆ QgsDxfExport

friend class QgsDxfExport
friend

Definition at line 776 of file qgspallabeling.h.

◆ QgsPalLayerSettings

friend class QgsPalLayerSettings
friend

Definition at line 787 of file qgspallabeling.h.

◆ QgsVectorLayerLabelProvider

friend class QgsVectorLayerLabelProvider
friend

Definition at line 775 of file qgspallabeling.h.


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