QGIS API Documentation
3.24.2-Tisler (13c1a02865)
|
Stores global configuration for labeling engine. More...
#include <qgslabelingenginesettings.h>
Public Types | |
enum | Flag { UseAllLabels = 1 << 1 , UsePartialCandidates = 1 << 2 , RenderOutlineLabels = 1 << 3 , DrawLabelRectOnly = 1 << 4 , DrawCandidates = 1 << 5 , DrawUnplacedLabels = 1 << 6 , CollectUnplacedLabels = 1 << 7 } |
Various flags that affect drawing and placement of labels. More... | |
enum | PlacementEngineVersion { PlacementEngineVersion1 , PlacementEngineVersion2 } |
Placement engine version. More... | |
enum | Search { Chain , Popmusic_Tabu , Popmusic_Chain , Popmusic_Tabu_Chain , Falp } |
Search methods in the PAL library to remove colliding labels (methods have different processing speed and number of labels placed) More... | |
Public Member Functions | |
QgsLabelingEngineSettings () | |
void | clear () |
Returns the configuration to the defaults. More... | |
Qgis::TextRenderFormat | defaultTextRenderFormat () const |
Returns the default text rendering format for the labels. More... | |
Flags | flags () const |
Gets flags of the labeling engine. More... | |
double | maximumLineCandidatesPerCm () const |
Returns the maximum number of line label candidate positions per centimeter. More... | |
double | maximumPolygonCandidatesPerCmSquared () const |
Returns the maximum number of polygon label candidate positions per centimeter squared. More... | |
Q_DECL_DEPRECATED void | numCandidatePositions (int &candPoint, int &candLine, int &candPolygon) const |
Gets number of candidate positions that will be generated for each label feature. More... | |
PlacementEngineVersion | placementVersion () const |
Returns the placement engine version, which dictates how the label placement problem is solved. More... | |
void | readSettingsFromProject (QgsProject *project) |
Read configuration of the labeling engine from a project. More... | |
Q_DECL_DEPRECATED Search | searchMethod () const |
Which search method to use for removal collisions between labels. More... | |
void | setDefaultTextRenderFormat (Qgis::TextRenderFormat format) |
Sets the default text rendering format for the labels. More... | |
void | setFlag (Flag f, bool enabled=true) |
Sets whether a particual flag is enabled. More... | |
void | setFlags (Flags flags) |
Sets flags of the labeling engine. More... | |
void | setMaximumLineCandidatesPerCm (double candidates) |
Sets the maximum number of line label candidates per centimeter. More... | |
void | setMaximumPolygonCandidatesPerCmSquared (double candidates) |
Sets the maximum number of polygon label candidates per centimeter squared. More... | |
Q_DECL_DEPRECATED void | setNumCandidatePositions (int candPoint, int candLine, int candPolygon) |
Sets the number of candidate positions that will be generated for each label feature. More... | |
void | setPlacementVersion (PlacementEngineVersion version) |
Sets the placement engine version, which dictates how the label placement problem is solved. More... | |
Q_DECL_DEPRECATED void | setSearchMethod (Search s) |
Used to set which search method to use for removal collisions between labels. More... | |
void | setUnplacedLabelColor (const QColor &color) |
Sets the color to use when rendering unplaced labels. More... | |
bool | testFlag (Flag f) const |
Test whether a particular flag is enabled. More... | |
QColor | unplacedLabelColor () const |
Returns the color to use when rendering unplaced labels. More... | |
void | writeSettingsToProject (QgsProject *project) |
Write configuration of the labeling engine to a project. More... | |
Stores global configuration for labeling engine.
Definition at line 31 of file qgslabelingenginesettings.h.
Various flags that affect drawing and placement of labels.
Enumerator | |
---|---|
UseAllLabels | Whether to draw all labels even if there would be collisions. |
UsePartialCandidates | Whether to use also label candidates that are partially outside of the map view. |
RenderOutlineLabels | Whether to render labels as text or outlines. Deprecated and of QGIS 3.4.3 - use defaultTextRenderFormat() instead. |
DrawLabelRectOnly | Whether to only draw the label rect and not the actual label text (used for unit tests) |
DrawCandidates | Whether to draw rectangles of generated candidates (good for debugging) |
DrawUnplacedLabels | Whether to render unplaced labels as an indicator/warning for users. |
CollectUnplacedLabels | Whether unplaced labels should be collected in the labeling results (regardless of whether they are being rendered). Since QGIS 3.20. |
Definition at line 35 of file qgslabelingenginesettings.h.
Placement engine version.
Enumerator | |
---|---|
PlacementEngineVersion1 | Version 1, matches placement from QGIS <= 3.10.1. |
PlacementEngineVersion2 | Version 2 (default for new projects since QGIS 3.12) |
Definition at line 68 of file qgslabelingenginesettings.h.
Search methods in the PAL library to remove colliding labels (methods have different processing speed and number of labels placed)
Enumerator | |
---|---|
Chain | |
Popmusic_Tabu | |
Popmusic_Chain | |
Popmusic_Tabu_Chain | |
Falp |
Definition at line 54 of file qgslabelingenginesettings.h.
QgsLabelingEngineSettings::QgsLabelingEngineSettings | ( | ) |
Definition at line 21 of file qgslabelingenginesettings.cpp.
void QgsLabelingEngineSettings::clear | ( | ) |
Returns the configuration to the defaults.
Definition at line 26 of file qgslabelingenginesettings.cpp.
|
inline |
Returns the default text rendering format for the labels.
Definition at line 169 of file qgslabelingenginesettings.h.
|
inline |
Gets flags of the labeling engine.
Definition at line 82 of file qgslabelingenginesettings.h.
|
inline |
Returns the maximum number of line label candidate positions per centimeter.
Definition at line 94 of file qgslabelingenginesettings.h.
|
inline |
Returns the maximum number of polygon label candidate positions per centimeter squared.
Definition at line 110 of file qgslabelingenginesettings.h.
|
inline |
Gets number of candidate positions that will be generated for each label feature.
Definition at line 124 of file qgslabelingenginesettings.h.
QgsLabelingEngineSettings::PlacementEngineVersion QgsLabelingEngineSettings::placementVersion | ( | ) | const |
Returns the placement engine version, which dictates how the label placement problem is solved.
Definition at line 88 of file qgslabelingenginesettings.cpp.
void QgsLabelingEngineSettings::readSettingsFromProject | ( | QgsProject * | project | ) |
Read configuration of the labeling engine from a project.
Definition at line 31 of file qgslabelingenginesettings.cpp.
|
inline |
Which search method to use for removal collisions between labels.
Definition at line 152 of file qgslabelingenginesettings.h.
|
inline |
Sets the default text rendering format for the labels.
Definition at line 180 of file qgslabelingenginesettings.h.
|
inline |
Sets whether a particual flag is enabled.
Definition at line 86 of file qgslabelingenginesettings.h.
|
inline |
Sets flags of the labeling engine.
Definition at line 80 of file qgslabelingenginesettings.h.
|
inline |
Sets the maximum number of line label candidates per centimeter.
Definition at line 102 of file qgslabelingenginesettings.h.
|
inline |
Sets the maximum number of polygon label candidates per centimeter squared.
Definition at line 118 of file qgslabelingenginesettings.h.
|
inline |
Sets the number of candidate positions that will be generated for each label feature.
Definition at line 135 of file qgslabelingenginesettings.h.
void QgsLabelingEngineSettings::setPlacementVersion | ( | PlacementEngineVersion | version | ) |
Sets the placement engine version, which dictates how the label placement problem is solved.
Definition at line 93 of file qgslabelingenginesettings.cpp.
|
inline |
Used to set which search method to use for removal collisions between labels.
Definition at line 146 of file qgslabelingenginesettings.h.
void QgsLabelingEngineSettings::setUnplacedLabelColor | ( | const QColor & | color | ) |
Sets the color to use when rendering unplaced labels.
Definition at line 83 of file qgslabelingenginesettings.cpp.
|
inline |
Test whether a particular flag is enabled.
Definition at line 84 of file qgslabelingenginesettings.h.
QColor QgsLabelingEngineSettings::unplacedLabelColor | ( | ) | const |
Returns the color to use when rendering unplaced labels.
Definition at line 78 of file qgslabelingenginesettings.cpp.
void QgsLabelingEngineSettings::writeSettingsToProject | ( | QgsProject * | project | ) |
Write configuration of the labeling engine to a project.
Definition at line 59 of file qgslabelingenginesettings.cpp.