18#ifndef QGSPALLABELING_H
19#define QGSPALLABELING_H
25#include <QFontDatabase>
114 FontLetterSpacing = 28,
115 FontWordSpacing = 29,
117 FontStretchFactor = 113,
120 MultiLineWrapChar = 31,
121 AutoWrapLength = 101,
122 MultiLineHeight = 32,
123 MultiLineAlignment = 33,
124 TextOrientation = 110,
125 TabStopDistance = 120,
129 DirSymbPlacement = 37,
142 BufferJoinStyle = 44,
143 BufferBlendMode = 45,
147 MaskBufferSize = 105,
148 MaskBufferUnit = 106,
160 ShapeRotationType = 52,
163 ShapeOffsetUnits = 55,
165 ShapeRadiiUnits = 57,
166 ShapeTransparency = 63,
170 ShapeStrokeColor = 59,
171 ShapeStrokeWidth = 60,
172 ShapeStrokeWidthUnits = 61,
178 ShadowOffsetAngle = 67,
179 ShadowOffsetDist = 68,
180 ShadowOffsetUnits = 69,
182 ShadowRadiusUnits = 71,
183 ShadowTransparency = 72,
187 ShadowBlendMode = 75,
195 MaximumDistance = 119,
198 CurvedCharAngleInOut = 83,
208 RepeatDistanceUnit = 86,
210 PredefinedPositionOrder = 91,
211 LinePlacementOptions = 99,
212 OverrunDistance = 102,
214 PolygonLabelOutside = 109,
215 LineAnchorPercent = 111,
216 LineAnchorClipping = 112,
217 LineAnchorType = 115,
218 LineAnchorTextPoint = 116,
221 ScaleVisibility = 23,
234 AllowDegradedPlacement = 117,
235 OverlapHandling = 118,
286 bool containsAdvancedEffects()
const;
300 bool drawLabels =
true;
315 bool isExpression =
false;
325 Q_DECL_DEPRECATED QColor previewBkgrdColor = Qt::white;
330 bool useSubstitutions =
false;
347 int autoWrapLength = 0;
359 bool useMaxLineLengthForAutoWrap =
true;
370 bool formatNumbers =
false;
384 bool plusSign =
false;
411 bool centroidWhole =
false;
418 bool centroidInside =
false;
423 bool fitInPolygonOnly =
false;
454 double repeatDistance = 0;
503 double angleOffset = 0;
506 bool preserveRotation =
true;
526 double maxCurvedCharAngleIn = 25.0;
532 double maxCurvedCharAngleOut = -25.0;
547 bool scaleVisibility =
false;
559 double maximumScale = 0;
571 double minimumScale = 0;
578 bool fontLimitPixelSize =
false;
585 int fontMinPixelSize = 0;
592 int fontMaxPixelSize = 10000;
601 bool labelPerPart =
false;
613 bool geometryGeneratorEnabled =
false;
640 void calculateLabelSize(
const QFontMetricsF *fm,
const QString &text,
double &labelX,
double &labelY,
const QgsFeature *f =
nullptr,
QgsRenderContext *context =
nullptr,
double *rotatedLabelX
SIP_OUT =
nullptr,
double *rotatedLabelY
SIP_OUT =
nullptr,
643 void calculateLabelSize(
const QFontMetricsF *fm,
const QString &text,
double &labelX,
double &labelY,
const QgsFeature *f =
nullptr,
QgsRenderContext *context =
nullptr,
double *rotatedLabelX
SIP_OUT =
nullptr,
double *rotatedLabelY
SIP_OUT =
nullptr );
906 int mFeaturesToLabel = 0;
907 int mFeatsSendingToPal = 0;
908 int mFeatsRegPal = 0;
922 void readOldDataDefinedPropertyMap(
QgsVectorLayer *layer, QDomElement *parentElem );
929 enum DataDefinedValueType
948 bool dataDefinedValEval( DataDefinedValueType valType,
952 void parseTextStyle( QFont &labelFont,
977 QMap<Property, QVariant> dataDefinedValues;
984 std::unique_ptr< QFontDatabase > mFontDB;
988 std::unique_ptr< QgsCallout > mCallout;
1000 bool mRenderStarted =
false;
1002 QString mLegendString = QObject::tr(
"Aa" );
1009 static void initPropertyDefinitions();
1037 static bool staticWillUseLayer(
const QgsMapLayer *layer );
1075 static QStringList splitToLines(
const QString &text,
const QString &wrapCharacter,
int autoWrapLength = 0,
bool useMaxLineLengthWhenAutoWrapping =
true );
1084 static QStringList splitToGraphemes(
const QString &text );
1089 const QMap< QgsPalLayerSettings::Property, QVariant > &ddValues );
1093 const QMap< QgsPalLayerSettings::Property, QVariant > &ddValues );
1097 const QMap< QgsPalLayerSettings::Property, QVariant > &ddValues );
1101 const QMap< QgsPalLayerSettings::Property, QVariant > &ddValues );
1105 const QMap< QgsPalLayerSettings::Property, QVariant > &ddValues );
1109 const QMap< QgsPalLayerSettings::Property, QVariant > &ddValues );
AngleUnit
Units of angles.
LabelOffsetType
Behavior modifier for label offset and distance, only applies in some label placement modes.
@ FromPoint
Offset distance applies from point geometry.
LabelPlacement
Placement modes which determine how label candidates are generated for a feature.
@ AroundPoint
Arranges candidates in a circle around a point (or centroid of a polygon). Applies to point or polygo...
@ AllowPlacementInsideOfPolygon
Labels can be placed inside a polygon feature.
QFlags< LabelPolygonPlacementFlag > LabelPolygonPlacementFlags
Polygon placement flags, which control how candidates are generated for a polygon feature.
UnplacedLabelVisibility
Unplaced label visibility.
@ FollowEngineSetting
Respect the label engine setting.
GeometryType
The geometry types are used to group Qgis::WkbType in a coarse way.
LabelMultiLineAlignment
Text alignment for multi-line labels.
@ FollowPlacement
Alignment follows placement of label, e.g., labels to the left of a feature will be drawn with right ...
RenderUnit
Rendering size units.
@ Millimeters
Millimeters.
UpsideDownLabelHandling
Handling techniques for upside down labels.
@ FlipUpsideDownLabels
Upside-down labels (90 <= angle < 270) are shown upright.
Abstract base class for callout renderers.
This class represents a coordinate reference system (CRS).
Stores the settings for rendering of all diagrams for a layer.
Exports QGIS layers to the DXF format.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Class for parsing and evaluation of expressions (formerly called "search strings").
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Container of fields for a vector layer.
A geometry is the spatial representation of a feature.
Represents a label candidate.
QgsLabelCandidate(const QRectF &r, double c)
The QgsLabelFeature class describes a feature that should be used within the labeling engine.
Contains settings related to how the label engine places and formats labels for line features (or pol...
Contains settings related to how the label engine treats features as obstacles.
Contains general settings related to how labels are placed.
Contains settings related to how the label engine places and formats labels for point features,...
A class to query the labeling structure at a given point (small wrapper around pal RTree class)
Contains settings related to how the label engine removes candidate label positions and reduces the n...
The QgsLabelingEngine class provides map labeling functionality.
Base class for all map layer types.
The QgsMapSettings class contains configuration for rendering of the map.
Perform transforms between map coordinates and device coordinates.
Struct for storing maximum and minimum scales for measurements in map units.
Contains settings for how a map layer will be labeled.
QgsMapUnitScale labelOffsetMapUnitScale
Map unit scale for label offset.
const QgsLabelObstacleSettings & obstacleSettings() const
Returns the label obstacle settings.
void setObstacleSettings(const QgsLabelObstacleSettings &settings)
Sets the label obstacle settings.
const QgsPropertyCollection & dataDefinedProperties() const
Returns a reference to the label's property collection, used for data defined overrides.
const QgsLabelPlacementSettings & placementSettings() const
Returns the label placement settings.
void setFormat(const QgsTextFormat &format)
Sets the label text formatting settings, e.g., font settings, buffer settings, etc.
void setPolygonPlacementFlags(Qgis::LabelPolygonPlacementFlags flags)
Sets the polygon placement flags, which dictate how polygon labels can be placed.
QString wrapChar
Wrapping character string.
QgsCoordinateTransform ct
QString legendString() const
legendString
QgsLabelPointSettings & pointSettings()
Returns the label point settings, which contain settings related to how the label engine places and f...
void setLineSettings(const QgsLabelLineSettings &settings)
Sets the label line settings, which contain settings related to how the label engine places and forma...
QgsPropertyCollection & dataDefinedProperties()
Returns a reference to the label's property collection, used for data defined overrides.
QgsLabelLineSettings & lineSettings()
Returns the label line settings, which contain settings related to how the label engine places and fo...
QgsCallout * callout() const
Returns the label callout renderer, responsible for drawing label callouts.
const QgsLabelThinningSettings & thinningSettings() const
Returns the label thinning settings.
void setLegendString(const QString &legendString)
setLegendString
void setThinningSettings(const QgsLabelThinningSettings &settings)
Sets the label thinning settings.
void setDataDefinedProperties(const QgsPropertyCollection &collection)
Sets the label's property collection, used for data defined overrides.
void setPlacementSettings(const QgsLabelPlacementSettings &settings)
Sets the label placement settings.
QgsLabelThinningSettings & thinningSettings()
Returns the label thinning settings.
QString geometryGenerator
The geometry generator expression. Null if disabled.
const QgsLabelLineSettings & lineSettings() const
Returns the label line settings, which contain settings related to how the label engine places and fo...
QgsMapUnitScale distMapUnitScale
Map unit scale for label feature distance.
QgsStringReplacementCollection substitutions
Substitution collection for automatic text substitution with labels.
QgsMapUnitScale repeatDistanceMapUnitScale
Map unit scale for repeating labels for a single feature.
Property
Data definable properties.
QString fieldName
Name of field (or an expression) to use for label text.
void setPointSettings(const QgsLabelPointSettings &settings)
Sets the label point settings, which contain settings related to how the label engine places and form...
const QgsTextFormat & format() const
Returns the label text formatting settings, e.g., font settings, buffer settings, etc.
QgsLabelPlacementSettings & placementSettings()
Returns the label placement settings.
const QgsLabelPointSettings & pointSettings() const
Returns the label point settings, which contain settings related to how the label engine places and f...
Qgis::LabelPolygonPlacementFlags polygonPlacementFlags() const
Returns the polygon placement flags, which dictate how polygon labels can be placed.
QgsLabelObstacleSettings & obstacleSettings()
Returns the label obstacle settings.
A class to represent a 2D point.
A grouped map of multiple QgsProperty objects, each referenced by a integer key value.
The class is used as a container of context for various read/write operations on other objects.
A rectangle specified with double values.
Contains information about the context of a rendering operation.
Stores properties relating to a screen.
A collection of string replacements (specified using QgsStringReplacement objects).
Abstract base class for all rendered symbols.
Contains pre-calculated metrics of a QgsTextDocument.
Represents a document consisting of one or more QgsTextBlock objects.
Container for all settings relating to text rendering.
Class that adds extra information to QgsLabelFeature for text labels.
The QgsVectorLayerDiagramProvider class implements support for diagrams within the labeling engine.
The QgsVectorLayerLabelProvider class implements a label provider for vector layers.
Represents a vector layer which manages a vector based data sets.
LabelPosition is a candidate feature label position.
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into c
#define SIP_MONKEYPATCH_SCOPEENUM_UNNEST(OUTSIDE_CLASS, FORMERNAME)
QMap< int, QgsPropertyDefinition > QgsPropertiesDefinition
Definition of available properties.
const QgsCoordinateReferenceSystem & crs