15 #ifndef QGSTEXTLABELFEATURE_H
16 #define QGSTEXTLABELFEATURE_H
48 QString text(
int partId )
const;
65 bool hasCharacterFormat(
int partId )
const;
68 const QMap< QgsPalLayerSettings::Property, QVariant > &
dataDefinedValues()
const {
return mDataDefinedValues; }
70 void setDataDefinedValues(
const QMap< QgsPalLayerSettings::Property, QVariant > &values ) { mDataDefinedValues = values; }
82 QFontMetricsF *
labelFontMetrics() {
return mFontMetrics.has_value() ? &mFontMetrics.value() :
nullptr; }
87 void setFontMetrics(
const QFontMetricsF &metrics );
113 double wordSpacing,
const QString &text = QString(),
QgsTextDocument *document =
nullptr );
174 double mMaximumCharacterAngleInside = 0;
175 double mMaximumCharacterAngleOutside = 0;
The QgsLabelFeature class describes a feature that should be used within the labeling engine.
Perform transforms between map coordinates and device coordinates.
Contains precalculated properties regarding text metrics for text to be renderered at a later stage.
Stores information relating to individual character formatting.
Represents a document consisting of one or more QgsTextBlock objects.
Class that adds extra information to QgsLabelFeature for text labels.
const QMap< QgsPalLayerSettings::Property, QVariant > & dataDefinedValues() const
Gets data-defined values.
void setMaximumCharacterAngleInside(double angle)
Sets the maximum angle (in radians) between inside curved label characters.
double maximumCharacterAngleInside() const
Returns the maximum angle (in radians) between inside curved label characters.
void setDefinedFont(const QFont &f)
Sets font to be used for rendering.
void setTextMetrics(const QgsPrecalculatedTextMetrics &metrics)
Sets additional text metrics required for curved label placement.
QgsTextDocument mDocument
QFont definedFont()
Font to be used for rendering.
~QgsTextLabelFeature() override
Clean up.
void setMaximumCharacterAngleOutside(double angle)
Sets the maximum angle (in radians) between outside curved label characters.
void setDataDefinedValues(const QMap< QgsPalLayerSettings::Property, QVariant > &values)
Sets data-defined values.
QFont mDefinedFont
Font for rendering.
QMap< QgsPalLayerSettings::Property, QVariant > mDataDefinedValues
Stores attribute values for data defined properties.
const QgsPrecalculatedTextMetrics * textMetrics() const
Returns additional info required for curved label placement.
double maximumCharacterAngleOutside() const
Returns the maximum angle (in radians) between outside curved label characters.
std::optional< QFontMetricsF > mFontMetrics
Metrics of the font for rendering.
QFontMetricsF * labelFontMetrics()
Metrics of the font for rendering.
std::optional< QgsPrecalculatedTextMetrics > mTextMetrics
double ANALYSIS_EXPORT angle(QgsPoint *p1, QgsPoint *p2, QgsPoint *p3, QgsPoint *p4)
Calculates the angle between two segments (in 2 dimension, z-values are ignored)
std::unique_ptr< GEOSGeometry, GeosDeleter > unique_ptr
Scoped GEOS pointer.
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features