QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
labeling
qgslabelplacementsettings.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgslabelplacementsettings.h
3
--------------------------
4
Date : May 2022
5
Copyright : (C) 2022 by Nyall Dawson
6
Email : nyall dot dawson at gmail dot com
7
***************************************************************************
8
* *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
13
* *
14
***************************************************************************/
15
16
#ifndef QGSLABELPLACEMENTSETTINGS_H
17
#define QGSLABELPLACEMENTSETTINGS_H
18
19
#include "
qgis.h
"
20
#include "qgis_core.h"
21
#include "
qgis_sip.h
"
22
23
class
QgsPropertyCollection
;
24
class
QgsExpressionContext
;
25
34
class
CORE_EXPORT
QgsLabelPlacementSettings
35
{
36
public
:
41
Qgis::LabelOverlapHandling
overlapHandling
()
const
{
return
mOverlapHandling; }
42
47
void
setOverlapHandling
(
Qgis::LabelOverlapHandling
handling ) { mOverlapHandling = handling; }
48
58
bool
allowDegradedPlacement
()
const
{
return
mAllowDegradedPlacement; }
59
69
void
setAllowDegradedPlacement
(
bool
allow ) { mAllowDegradedPlacement = allow; }
70
78
Qgis::LabelPrioritization
prioritization
()
const
{
return
mPrioritization; }
79
87
void
setPrioritization
(
Qgis::LabelPrioritization
prioritization
) { mPrioritization =
prioritization
; }
88
96
Qgis::MultiPartLabelingBehavior
multiPartBehavior
()
const
{
return
mMultiPartBehavior; }
97
105
void
setMultiPartBehavior
(
Qgis::MultiPartLabelingBehavior
behavior ) { mMultiPartBehavior = behavior; }
106
114
Qgis::LabelWhitespaceCollisionHandling
whitespaceCollisionHandling
()
const
{
return
mWhitespaceCollisionHandling; }
115
123
void
setWhitespaceCollisionHandling
(
Qgis::LabelWhitespaceCollisionHandling
handling ) { mWhitespaceCollisionHandling = handling; }
124
129
void
updateDataDefinedProperties(
const
QgsPropertyCollection
&properties,
QgsExpressionContext
&context );
130
131
private
:
132
Qgis::LabelOverlapHandling
mOverlapHandling =
Qgis::LabelOverlapHandling::PreventOverlap
;
133
Qgis::LabelPrioritization
mPrioritization =
Qgis::LabelPrioritization::PreferCloser
;
134
135
bool
mAllowDegradedPlacement =
false
;
136
137
Qgis::MultiPartLabelingBehavior
mMultiPartBehavior =
Qgis::MultiPartLabelingBehavior::LabelLargestPartOnly
;
138
Qgis::LabelWhitespaceCollisionHandling
mWhitespaceCollisionHandling =
Qgis::LabelWhitespaceCollisionHandling::TreatWhitespaceAsCollision
;
139
};
140
141
#endif
// QGSLABELPLACEMENTSETTINGS_H
Qgis::MultiPartLabelingBehavior
MultiPartLabelingBehavior
Behavior modifier for labeling features with multi-part geometries.
Definition
qgis.h:1365
Qgis::MultiPartLabelingBehavior::LabelLargestPartOnly
@ LabelLargestPartOnly
Place a label only on the largest part from the geometry.
Definition
qgis.h:1366
Qgis::LabelPrioritization
LabelPrioritization
Label prioritization.
Definition
qgis.h:1293
Qgis::LabelPrioritization::PreferCloser
@ PreferCloser
Prefer closer labels, falling back to alternate positions before larger distances.
Definition
qgis.h:1294
Qgis::LabelWhitespaceCollisionHandling
LabelWhitespaceCollisionHandling
Label whitespace collision handling.
Definition
qgis.h:1281
Qgis::LabelWhitespaceCollisionHandling::TreatWhitespaceAsCollision
@ TreatWhitespaceAsCollision
Treat overlapping whitespace text in labels and whitespace overlapping obstacles as collisions.
Definition
qgis.h:1282
Qgis::LabelOverlapHandling
LabelOverlapHandling
Label overlap handling.
Definition
qgis.h:1268
Qgis::LabelOverlapHandling::PreventOverlap
@ PreventOverlap
Do not allow labels to overlap other labels.
Definition
qgis.h:1269
QgsExpressionContext
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Definition
qgsexpressioncontext.h:491
QgsLabelPlacementSettings
Contains general settings related to how labels are placed.
Definition
qgslabelplacementsettings.h:35
QgsLabelPlacementSettings::setOverlapHandling
void setOverlapHandling(Qgis::LabelOverlapHandling handling)
Sets the technique used to handle overlapping labels.
Definition
qgslabelplacementsettings.h:47
QgsLabelPlacementSettings::overlapHandling
Qgis::LabelOverlapHandling overlapHandling() const
Returns the technique used to handle overlapping labels.
Definition
qgslabelplacementsettings.h:41
QgsLabelPlacementSettings::setMultiPartBehavior
void setMultiPartBehavior(Qgis::MultiPartLabelingBehavior behavior)
Sets the multipart labeling behavior.
Definition
qgslabelplacementsettings.h:105
QgsLabelPlacementSettings::setPrioritization
void setPrioritization(Qgis::LabelPrioritization prioritization)
Sets the technique used to prioritize labels.
Definition
qgslabelplacementsettings.h:87
QgsLabelPlacementSettings::multiPartBehavior
Qgis::MultiPartLabelingBehavior multiPartBehavior() const
Returns the multipart labeling behavior.
Definition
qgslabelplacementsettings.h:96
QgsLabelPlacementSettings::allowDegradedPlacement
bool allowDegradedPlacement() const
Returns true if labels can be placed in inferior fallback positions if they cannot otherwise be place...
Definition
qgslabelplacementsettings.h:58
QgsLabelPlacementSettings::setAllowDegradedPlacement
void setAllowDegradedPlacement(bool allow)
Sets whether labels can be placed in inferior fallback positions if they cannot otherwise be placed.
Definition
qgslabelplacementsettings.h:69
QgsLabelPlacementSettings::prioritization
Qgis::LabelPrioritization prioritization() const
Returns the label prioritization technique.
Definition
qgslabelplacementsettings.h:78
QgsLabelPlacementSettings::whitespaceCollisionHandling
Qgis::LabelWhitespaceCollisionHandling whitespaceCollisionHandling() const
Returns the whitespace collision handling.
Definition
qgslabelplacementsettings.h:114
QgsLabelPlacementSettings::setWhitespaceCollisionHandling
void setWhitespaceCollisionHandling(Qgis::LabelWhitespaceCollisionHandling handling)
Sets the whitespace collision handling.
Definition
qgslabelplacementsettings.h:123
QgsPropertyCollection
A grouped map of multiple QgsProperty objects, each referenced by an integer key value.
Definition
qgspropertycollection.h:348
qgis.h
qgis_sip.h
Generated on
for QGIS API Documentation by
1.17.0