18#ifndef QGSPALLABELING_H
19#define QGSPALLABELING_H
25#include <QFontDatabase>
113 FontLetterSpacing = 28,
114 FontWordSpacing = 29,
116 FontStretchFactor = 113,
119 MultiLineWrapChar = 31,
120 AutoWrapLength = 101,
121 MultiLineHeight = 32,
122 MultiLineAlignment = 33,
123 TextOrientation = 110,
127 DirSymbPlacement = 37,
140 BufferJoinStyle = 44,
141 BufferBlendMode = 45,
145 MaskBufferSize = 105,
146 MaskBufferUnit = 106,
158 ShapeRotationType = 52,
161 ShapeOffsetUnits = 55,
163 ShapeRadiiUnits = 57,
164 ShapeTransparency = 63,
168 ShapeStrokeColor = 59,
169 ShapeStrokeWidth = 60,
170 ShapeStrokeWidthUnits = 61,
176 ShadowOffsetAngle = 67,
177 ShadowOffsetDist = 68,
178 ShadowOffsetUnits = 69,
180 ShadowRadiusUnits = 71,
181 ShadowTransparency = 72,
185 ShadowBlendMode = 75,
195 CurvedCharAngleInOut = 83,
205 RepeatDistanceUnit = 86,
207 PredefinedPositionOrder = 91,
208 LinePlacementOptions = 99,
209 OverrunDistance = 102,
211 PolygonLabelOutside = 109,
212 LineAnchorPercent = 111,
213 LineAnchorClipping = 112,
214 LineAnchorType = 115,
215 LineAnchorTextPoint = 116,
218 ScaleVisibility = 23,
231 AllowDegradedPlacement = 117,
232 OverlapHandling = 118,
283 bool containsAdvancedEffects()
const;
297 bool drawLabels =
true;
312 bool isExpression =
false;
322 Q_DECL_DEPRECATED QColor previewBkgrdColor = Qt::white;
327 bool useSubstitutions =
false;
344 int autoWrapLength = 0;
356 bool useMaxLineLengthForAutoWrap =
true;
367 bool formatNumbers =
false;
381 bool plusSign =
false;
408 bool centroidWhole =
false;
415 bool centroidInside =
false;
423 QVector< Qgis::LabelPredefinedPointPosition > predefinedPositionOrder
SIP_SKIP;
428 bool fitInPolygonOnly =
false;
459 double repeatDistance = 0;
513 double angleOffset = 0;
516 bool preserveRotation =
true;
536 double maxCurvedCharAngleIn = 25.0;
542 double maxCurvedCharAngleOut = -25.0;
557 bool scaleVisibility =
false;
569 double maximumScale = 0;
581 double minimumScale = 0;
588 bool fontLimitPixelSize =
false;
595 int fontMinPixelSize = 0;
602 int fontMaxPixelSize = 10000;
611 bool labelPerPart =
false;
623 bool geometryGeneratorEnabled =
false;
650 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,
653 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 );
885 int mFeaturesToLabel = 0;
886 int mFeatsSendingToPal = 0;
887 int mFeatsRegPal = 0;
901 void readOldDataDefinedPropertyMap(
QgsVectorLayer *layer, QDomElement *parentElem );
908 enum DataDefinedValueType
927 bool dataDefinedValEval( DataDefinedValueType valType,
931 void parseTextStyle( QFont &labelFont,
956 QMap<Property, QVariant> dataDefinedValues;
963 std::unique_ptr< QFontDatabase > mFontDB;
967 std::unique_ptr< QgsCallout > mCallout;
978 bool mRenderStarted =
false;
980 QString mLegendString = QObject::tr(
"Aa" );
987 static void initPropertyDefinitions();
1015 static bool staticWillUseLayer(
const QgsMapLayer *layer );
1053 static QStringList splitToLines(
const QString &text,
const QString &wrapCharacter,
int autoWrapLength = 0,
bool useMaxLineLengthWhenAutoWrapping =
true );
1062 static QStringList splitToGraphemes(
const QString &text );
1067 const QMap< QgsPalLayerSettings::Property, QVariant > &ddValues );
1071 const QMap< QgsPalLayerSettings::Property, QVariant > &ddValues );
1075 const QMap< QgsPalLayerSettings::Property, QVariant > &ddValues );
1079 const QMap< QgsPalLayerSettings::Property, QVariant > &ddValues );
1083 const QMap< QgsPalLayerSettings::Property, QVariant > &ddValues );
1087 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.
LabelQuadrantPosition
Label quadrant positions.
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
Polygon placement flags, which control how candidates are generated for a polygon feature.
@ 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.
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
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.
const QgsTextFormat & format() const
Returns the label text formatting settings, e.g., font settings, buffer settings, etc.
QgsLabelPlacementSettings & placementSettings()
Returns the label placement settings.
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