QGIS API Documentation 3.41.0-Master (af5edcb665c)
|
Stores global configuration for labeling engine. More...
#include <qgslabelingenginesettings.h>
Public Types | |
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 () | |
QgsLabelingEngineSettings (const QgsLabelingEngineSettings &other) | |
~QgsLabelingEngineSettings () | |
void | addRule (QgsAbstractLabelingEngineRule *rule) |
Adds a labeling engine rule which must be satisfied while placing labels. | |
void | clear () |
Returns the configuration to the defaults. | |
Qgis::TextRenderFormat | defaultTextRenderFormat () const |
Returns the default text rendering format for the labels. | |
Qgis::LabelingFlags | flags () const |
Gets flags of the labeling engine. | |
double | maximumLineCandidatesPerCm () const |
Returns the maximum number of line label candidate positions per centimeter. | |
double | maximumPolygonCandidatesPerCmSquared () const |
Returns the maximum number of polygon label candidate positions per centimeter squared. | |
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. | |
QgsLabelingEngineSettings & | operator= (const QgsLabelingEngineSettings &other) |
Qgis::LabelPlacementEngineVersion | placementVersion () const |
Returns the placement engine version, which dictates how the label placement problem is solved. | |
void | readSettingsFromProject (QgsProject *project) |
Read configuration of the labeling engine from a project. | |
void | readXml (const QDomElement &element, const QgsReadWriteContext &context) |
Reads the label engine settings from an XML element. | |
void | resolveReferences (const QgsProject *project) |
Resolves reference to layers from stored layer ID. | |
QList< QgsAbstractLabelingEngineRule * > | rules () |
Returns a list of labeling engine rules which must be satisfied while placing labels. | |
QList< const QgsAbstractLabelingEngineRule * > | rules () const |
Returns a list of labeling engine rules which must be satisfied while placing labels. | |
Q_DECL_DEPRECATED Search | searchMethod () const |
Which search method to use for removal collisions between labels. | |
void | setDefaultTextRenderFormat (Qgis::TextRenderFormat format) |
Sets the default text rendering format for the labels. | |
void | setFlag (Qgis::LabelingFlag f, bool enabled=true) |
Sets whether a particual flag is enabled. | |
void | setFlags (Qgis::LabelingFlags flags) |
Sets flags of the labeling engine. | |
void | setMaximumLineCandidatesPerCm (double candidates) |
Sets the maximum number of line label candidates per centimeter. | |
void | setMaximumPolygonCandidatesPerCmSquared (double candidates) |
Sets the maximum number of polygon label candidates per centimeter squared. | |
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. | |
void | setPlacementVersion (Qgis::LabelPlacementEngineVersion version) |
Sets the placement engine version, which dictates how the label placement problem is solved. | |
void | setRules (const QList< QgsAbstractLabelingEngineRule * > &rules) |
Sets the labeling engine rules which must be satisfied while placing labels. | |
Q_DECL_DEPRECATED void | setSearchMethod (Search s) |
Used to set which search method to use for removal collisions between labels. | |
void | setUnplacedLabelColor (const QColor &color) |
Sets the color to use when rendering unplaced labels. | |
bool | testFlag (Qgis::LabelingFlag f) const |
Test whether a particular flag is enabled. | |
QColor | unplacedLabelColor () const |
Returns the color to use when rendering unplaced labels. | |
void | writeSettingsToProject (QgsProject *project) |
Write configuration of the labeling engine to a project. | |
void | writeXml (QDomDocument &doc, QDomElement &element, const QgsReadWriteContext &context) const |
Writes the label engine settings to an XML element. | |
Stores global configuration for labeling engine.
Definition at line 33 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 43 of file qgslabelingenginesettings.h.
QgsLabelingEngineSettings::QgsLabelingEngineSettings | ( | ) |
Definition at line 24 of file qgslabelingenginesettings.cpp.
|
default |
QgsLabelingEngineSettings::QgsLabelingEngineSettings | ( | const QgsLabelingEngineSettings & | other | ) |
Definition at line 30 of file qgslabelingenginesettings.cpp.
void QgsLabelingEngineSettings::addRule | ( | QgsAbstractLabelingEngineRule * | rule | ) |
Adds a labeling engine rule which must be satisfied while placing labels.
Ownership of the rule is transferred to the settings.
Definition at line 210 of file qgslabelingenginesettings.cpp.
void QgsLabelingEngineSettings::clear | ( | ) |
Returns the configuration to the defaults.
Definition at line 64 of file qgslabelingenginesettings.cpp.
|
inline |
Returns the default text rendering format for the labels.
Definition at line 197 of file qgslabelingenginesettings.h.
|
inline |
Gets flags of the labeling engine.
Definition at line 64 of file qgslabelingenginesettings.h.
|
inline |
Returns the maximum number of line label candidate positions per centimeter.
Definition at line 76 of file qgslabelingenginesettings.h.
|
inline |
Returns the maximum number of polygon label candidate positions per centimeter squared.
Definition at line 92 of file qgslabelingenginesettings.h.
|
inline |
Gets number of candidate positions that will be generated for each label feature.
Definition at line 106 of file qgslabelingenginesettings.h.
QgsLabelingEngineSettings & QgsLabelingEngineSettings::operator= | ( | const QgsLabelingEngineSettings & | other | ) |
Definition at line 46 of file qgslabelingenginesettings.cpp.
Qgis::LabelPlacementEngineVersion QgsLabelingEngineSettings::placementVersion | ( | ) | const |
Returns the placement engine version, which dictates how the label placement problem is solved.
Definition at line 180 of file qgslabelingenginesettings.cpp.
void QgsLabelingEngineSettings::readSettingsFromProject | ( | QgsProject * | project | ) |
Read configuration of the labeling engine from a project.
Definition at line 69 of file qgslabelingenginesettings.cpp.
void QgsLabelingEngineSettings::readXml | ( | const QDomElement & | element, |
const QgsReadWriteContext & | context | ||
) |
Reads the label engine settings from an XML element.
Definition at line 138 of file qgslabelingenginesettings.cpp.
void QgsLabelingEngineSettings::resolveReferences | ( | const QgsProject * | project | ) |
Resolves reference to layers from stored layer ID.
Should be called following a call readXml().
Definition at line 162 of file qgslabelingenginesettings.cpp.
QList< QgsAbstractLabelingEngineRule * > QgsLabelingEngineSettings::rules | ( | ) |
Returns a list of labeling engine rules which must be satisfied while placing labels.
Definition at line 190 of file qgslabelingenginesettings.cpp.
QList< const QgsAbstractLabelingEngineRule * > QgsLabelingEngineSettings::rules | ( | ) | const |
Returns a list of labeling engine rules which must be satisfied while placing labels.
Definition at line 200 of file qgslabelingenginesettings.cpp.
|
inline |
Which search method to use for removal collisions between labels.
Definition at line 134 of file qgslabelingenginesettings.h.
|
inline |
Sets the default text rendering format for the labels.
Definition at line 208 of file qgslabelingenginesettings.h.
|
inline |
Sets whether a particual flag is enabled.
Definition at line 68 of file qgslabelingenginesettings.h.
|
inline |
Sets flags of the labeling engine.
Definition at line 62 of file qgslabelingenginesettings.h.
|
inline |
Sets the maximum number of line label candidates per centimeter.
Definition at line 84 of file qgslabelingenginesettings.h.
|
inline |
Sets the maximum number of polygon label candidates per centimeter squared.
Definition at line 100 of file qgslabelingenginesettings.h.
|
inline |
Sets the number of candidate positions that will be generated for each label feature.
Definition at line 117 of file qgslabelingenginesettings.h.
void QgsLabelingEngineSettings::setPlacementVersion | ( | Qgis::LabelPlacementEngineVersion | version | ) |
Sets the placement engine version, which dictates how the label placement problem is solved.
Definition at line 185 of file qgslabelingenginesettings.cpp.
void QgsLabelingEngineSettings::setRules | ( | const QList< QgsAbstractLabelingEngineRule * > & | rules | ) |
Sets the labeling engine rules which must be satisfied while placing labels.
Ownership of the rules are transferred to the settings.
Definition at line 215 of file qgslabelingenginesettings.cpp.
|
inline |
Used to set which search method to use for removal collisions between labels.
Definition at line 128 of file qgslabelingenginesettings.h.
void QgsLabelingEngineSettings::setUnplacedLabelColor | ( | const QColor & | color | ) |
Sets the color to use when rendering unplaced labels.
Definition at line 175 of file qgslabelingenginesettings.cpp.
|
inline |
Test whether a particular flag is enabled.
Definition at line 66 of file qgslabelingenginesettings.h.
QColor QgsLabelingEngineSettings::unplacedLabelColor | ( | ) | const |
Returns the color to use when rendering unplaced labels.
Definition at line 170 of file qgslabelingenginesettings.cpp.
void QgsLabelingEngineSettings::writeSettingsToProject | ( | QgsProject * | project | ) |
Write configuration of the labeling engine to a project.
Definition at line 98 of file qgslabelingenginesettings.cpp.
void QgsLabelingEngineSettings::writeXml | ( | QDomDocument & | doc, |
QDomElement & | element, | ||
const QgsReadWriteContext & | context | ||
) | const |
Writes the label engine settings to an XML element.
Definition at line 118 of file qgslabelingenginesettings.cpp.