15#ifndef QGSLABELINGENGINESETTINGS_H
16#define QGSLABELINGENGINESETTINGS_H
37 UseAllLabels = 1 << 1,
38 UsePartialCandidates = 1 << 2,
40 RenderOutlineLabels = 1 << 3,
41 DrawLabelRectOnly = 1 << 4,
42 DrawCandidates = 1 << 5,
43 DrawUnplacedLabels = 1 << 6,
44 CollectUnplacedLabels = 1 << 7,
46 Q_DECLARE_FLAGS( Flags, Flag )
80 void setFlags( Flags flags ) { mFlags = flags; }
82 Flags
flags()
const {
return mFlags; }
86 void setFlag(
Flag f,
bool enabled =
true ) {
if ( enabled ) mFlags |= f;
else mFlags &= ~f; }
126 Q_UNUSED( candPoint )
128 Q_UNUSED( candPolygon )
137 Q_UNUSED( candPoint )
139 Q_UNUSED( candPolygon )
155 void readSettingsFromProject(
QgsProject *project );
157 void writeSettingsToProject(
QgsProject *project );
171 return mDefaultTextRenderFormat;
182 mDefaultTextRenderFormat = format;
191 QColor unplacedLabelColor()
const;
199 void setUnplacedLabelColor(
const QColor &color );
207 PlacementEngineVersion placementVersion()
const;
215 void setPlacementVersion( PlacementEngineVersion version );
221 Search mSearchMethod = Chain;
224 double mMaxLineCandidatesPerCm = 5;
225 double mMaxPolygonCandidatesPerCmSquared = 2.5;
227 QColor mUnplacedLabelColor = QColor( 255, 0, 0 );
229 PlacementEngineVersion mPlacementVersion = PlacementEngineVersion2;
TextRenderFormat
Options for rendering text.
Stores global configuration for labeling engine.
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.
Qgis::TextRenderFormat defaultTextRenderFormat() const
Returns the default text rendering format for the labels.
void setDefaultTextRenderFormat(Qgis::TextRenderFormat format)
Sets the default text rendering format for the labels.
bool testFlag(Flag f) const
Test whether a particular flag is enabled.
Flags flags() const
Gets flags of the labeling engine.
Flag
Various flags that affect drawing and placement of labels.
Q_DECL_DEPRECATED Search searchMethod() const
Which search method to use for removal collisions between labels.
void setFlag(Flag f, bool enabled=true)
Sets whether a particual flag is enabled.
Search
Search methods in the PAL library to remove colliding labels (methods have different processing speed...
void setMaximumPolygonCandidatesPerCmSquared(double candidates)
Sets the maximum number of polygon label candidates per centimeter squared.
PlacementEngineVersion
Placement engine version.
@ PlacementEngineVersion1
Version 1, matches placement from QGIS <= 3.10.1.
@ PlacementEngineVersion2
Version 2 (default for new projects since QGIS 3.12)
void setFlags(Flags flags)
Sets flags of the labeling engine.
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.
double maximumPolygonCandidatesPerCmSquared() const
Returns the maximum number of polygon label candidate positions per centimeter squared.
Q_DECL_DEPRECATED void setSearchMethod(Search s)
Used to set which search method to use for removal collisions between labels.
void setMaximumLineCandidatesPerCm(double candidates)
Sets the maximum number of line label candidates per centimeter.
double maximumLineCandidatesPerCm() const
Returns the maximum number of line label candidate positions per centimeter.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsField::ConfigurationFlags) CORE_EXPORT QDataStream &operator<<(QDataStream &out
Writes the field to stream out. QGIS version compatibility is not guaranteed.