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,
237 LabelMarginDistance = 121,
238 RemoveDuplicateLabels = 122,
239 RemoveDuplicateLabelDistance = 123,
290 bool containsAdvancedEffects()
const;
304 bool drawLabels =
true;
319 bool isExpression =
false;
329 Q_DECL_DEPRECATED QColor previewBkgrdColor = Qt::white;
334 bool useSubstitutions =
false;
351 int autoWrapLength = 0;
363 bool useMaxLineLengthForAutoWrap =
true;
374 bool formatNumbers =
false;
388 bool plusSign =
false;
415 bool centroidWhole =
false;
422 bool centroidInside =
false;
427 bool fitInPolygonOnly =
false;
458 double repeatDistance = 0;
507 double angleOffset = 0;
510 bool preserveRotation =
true;
530 double maxCurvedCharAngleIn = 25.0;
536 double maxCurvedCharAngleOut = -25.0;
551 bool scaleVisibility =
false;
563 double maximumScale = 0;
575 double minimumScale = 0;
582 bool fontLimitPixelSize =
false;
589 int fontMinPixelSize = 0;
596 int fontMaxPixelSize = 10000;
605 bool labelPerPart =
false;
617 bool geometryGeneratorEnabled =
false;
649 Q_DECL_DEPRECATED
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 )
SIP_DEPRECATED;
912 int mFeaturesToLabel = 0;
913 int mFeatsSendingToPal = 0;
914 int mFeatsRegPal = 0;
928 void readOldDataDefinedPropertyMap(
QgsVectorLayer *layer, QDomElement *parentElem );
942 void calculateLabelSize(
const QFontMetricsF &fm,
const QString &text,
QgsRenderContext &context,
946 QSizeF &size, QSizeF &rotatedSize,
947 QRectF &outerBounds );
950 enum DataDefinedValueType
969 bool dataDefinedValEval( DataDefinedValueType valType,
973 void parseTextStyle( QFont &labelFont,
998 QMap<Property, QVariant> dataDefinedValues;
1003 std::unique_ptr<QgsExpression> expression;
1005 std::unique_ptr< QFontDatabase > mFontDB;
1009 std::unique_ptr< QgsCallout > mCallout;
1021 bool mRenderStarted =
false;
1023 QString mLegendString = QObject::tr(
"Aa" );
1030 static void initPropertyDefinitions();
1046 static bool staticWillUseLayer(
const QgsMapLayer *layer );
1081 static QStringList splitToLines(
const QString &text,
const QString &wrapCharacter,
int autoWrapLength = 0,
bool useMaxLineLengthWhenAutoWrapping =
true );
1090 static QStringList splitToGraphemes(
const QString &text );
1095 const QMap< QgsPalLayerSettings::Property, QVariant > &ddValues );
1099 const QMap< QgsPalLayerSettings::Property, QVariant > &ddValues );
1103 const QMap< QgsPalLayerSettings::Property, QVariant > &ddValues );
1107 const QMap< QgsPalLayerSettings::Property, QVariant > &ddValues );
1111 const QMap< QgsPalLayerSettings::Property, QVariant > &ddValues );
1115 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.
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...
Handles 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.
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-like features.
Queries the labeling structure at a given point.
Contains settings related to how the label engine removes candidate label positions and reduces the n...
Provides map labeling functionality.
Base class for all map layer types.
Contains configuration for rendering maps.
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 grouped map of multiple QgsProperty objects, each referenced by an integer key value.
A container for the context for various read/write operations on 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.
Adds extra information to QgsLabelFeature for text labels.
Implements support for diagrams within the labeling engine.
Implements a label provider for vector layers.
Represents a vector layer which manages a vector based dataset.
#define SIP_MONKEYPATCH_SCOPEENUM_UNNEST(OUTSIDE_CLASS, FORMERNAME)
QMap< int, QgsPropertyDefinition > QgsPropertiesDefinition
Definition of available properties.
const QgsCoordinateReferenceSystem & crs