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

Represents the calculated placement of a map label. More...

#include <qgslabelposition.h>

Public Member Functions

 QgsLabelPosition ()=default
 
 QgsLabelPosition (QgsFeatureId id, double r, const QVector< QgsPointXY > &corners, const QgsRectangle &rect, double w, double h, const QString &layer, const QString &labeltext, const QFont &labelfont, bool upside_down, bool diagram=false, bool pinned=false, const QString &providerId=QString(), const QgsGeometry &labelGeometry=QgsGeometry(), bool isUnplaced=false)
 Constructor for QgsLabelPosition.
 

Public Attributes

QVector< QgsPointXYcornerPoints
 
QgsFeatureId featureId = FID_NULL
 ID of feature associated with this label.
 
long long groupedLabelId = 0
 If non zero, indicates that the label position is part of a group of label positions (i.e.
 
double height = 0
 Heeght of label bounding box, in map units.
 
bool isDiagram = false
 true if label is a diagram.
 
bool isPinned = false
 true if label position has been pinned.
 
bool isUnplaced = false
 true if label position corresponds to an unplaced label.
 
QFont labelFont
 Font which the label is rendered using.
 
QgsGeometry labelGeometry
 A polygon geometry representing the label's bounds in map coordinates.
 
QgsRectangle labelRect
 
QString labelText
 String shown in label.
 
QString layerID
 ID of associated map layer.
 
QString providerID
 ID of the associated label provider.
 
double rotation = 0
 Rotation of label, in degrees clockwise.
 
bool upsideDown = false
 true if label is upside down.
 
double width = 0
 Width of label bounding box, in map units.
 

Detailed Description

Represents the calculated placement of a map label.

Definition at line 33 of file qgslabelposition.h.

Constructor & Destructor Documentation

◆ QgsLabelPosition() [1/2]

QgsLabelPosition::QgsLabelPosition ( QgsFeatureId  id,
double  r,
const QVector< QgsPointXY > &  corners,
const QgsRectangle rect,
double  w,
double  h,
const QString &  layer,
const QString &  labeltext,
const QFont &  labelfont,
bool  upside_down,
bool  diagram = false,
bool  pinned = false,
const QString &  providerId = QString(),
const QgsGeometry labelGeometry = QgsGeometry(),
bool  isUnplaced = false 
)
inline

Constructor for QgsLabelPosition.

Parameters
idassociated feature ID
rlabel rotation in degrees clockwise
cornerscorner points of label bounding box, in map units
rectlabel bounding box, in map units
wwidth of label, in map units
hheight of label, in map units
layerID of associated map layer
labeltexttext rendered for label
labelfontfont used to render label
upside_downtrue if label is upside down
diagramtrue if label is a diagram
pinnedtrue if label has pinned placement
providerIdID of associated label provider
labelGeometrypolygon geometry of label boundary
isUnplacedset to true if label was unplaced (e.g. due to collisions with other labels)

Definition at line 55 of file qgslabelposition.h.

◆ QgsLabelPosition() [2/2]

QgsLabelPosition::QgsLabelPosition ( )
default

Member Data Documentation

◆ cornerPoints

QVector< QgsPointXY > QgsLabelPosition::cornerPoints

Definition at line 95 of file qgslabelposition.h.

◆ featureId

QgsFeatureId QgsLabelPosition::featureId = FID_NULL

ID of feature associated with this label.

Definition at line 88 of file qgslabelposition.h.

◆ groupedLabelId

long long QgsLabelPosition::groupedLabelId = 0

If non zero, indicates that the label position is part of a group of label positions (i.e.

a character in a curved label).

All other linked positions will share the same groupedLabelId.

Definition at line 160 of file qgslabelposition.h.

◆ height

double QgsLabelPosition::height = 0

Heeght of label bounding box, in map units.

Definition at line 112 of file qgslabelposition.h.

◆ isDiagram

bool QgsLabelPosition::isDiagram = false

true if label is a diagram.

Definition at line 137 of file qgslabelposition.h.

◆ isPinned

bool QgsLabelPosition::isPinned = false

true if label position has been pinned.

Definition at line 142 of file qgslabelposition.h.

◆ isUnplaced

bool QgsLabelPosition::isUnplaced = false

true if label position corresponds to an unplaced label.

Since
QGIS 3.10

Definition at line 153 of file qgslabelposition.h.

◆ labelFont

QFont QgsLabelPosition::labelFont

Font which the label is rendered using.

Definition at line 127 of file qgslabelposition.h.

◆ labelGeometry

QgsGeometry QgsLabelPosition::labelGeometry

A polygon geometry representing the label's bounds in map coordinates.

Since
QGIS 3.4.9

Definition at line 102 of file qgslabelposition.h.

◆ labelRect

QgsRectangle QgsLabelPosition::labelRect

Definition at line 96 of file qgslabelposition.h.

◆ labelText

QString QgsLabelPosition::labelText

String shown in label.

Definition at line 122 of file qgslabelposition.h.

◆ layerID

QString QgsLabelPosition::layerID

ID of associated map layer.

Definition at line 117 of file qgslabelposition.h.

◆ providerID

QString QgsLabelPosition::providerID

ID of the associated label provider.

Definition at line 147 of file qgslabelposition.h.

◆ rotation

double QgsLabelPosition::rotation = 0

Rotation of label, in degrees clockwise.

Definition at line 93 of file qgslabelposition.h.

◆ upsideDown

bool QgsLabelPosition::upsideDown = false

true if label is upside down.

Definition at line 132 of file qgslabelposition.h.

◆ width

double QgsLabelPosition::width = 0

Width of label bounding box, in map units.

Definition at line 107 of file qgslabelposition.h.


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