16#ifndef QGSTEXTRENDERERUTILS_H
17#define QGSTEXTRENDERERUTILS_H
85 static QColor readColor(
QgsVectorLayer *layer,
const QString &property,
const QColor &defaultColor = Qt::black,
bool withAlpha =
true )
SIP_SKIP;
111 int graphemeIndex = 0;
128 int upsideDownCharCount = 0;
130 bool labeledLineSegmentIsRightToLeft =
false;
132 bool flippedCharacterPlacementToGetUprightLabels =
false;
151 TruncateStringWhenLineIsTooShort = 1 << 0,
152 UseBaselinePlacement = 1 << 1,
153 UprightCharactersOnly = 1 << 2,
161 Q_DECLARE_FLAGS( CurvedTextFlags, CurvedTextFlag )
177 static std::unique_ptr< CurvePlacementProperties > generateCurvedTextPlacement(
const QgsPrecalculatedTextMetrics &metrics,
const QPolygonF &line,
double offsetAlongLine, LabelLineDirection direction = RespectPainterOrientation,
double maxConcaveAngle = -1,
double maxConvexAngle = -1, CurvedTextFlags flags = CurvedTextFlags() )
SIP_SKIP;
196 static std::
unique_ptr< CurvePlacementProperties > generateCurvedTextPlacement( const
QgsPrecalculatedTextMetrics &metrics, const
double *x, const
double *y,
int numPoints, const std::vector<
double> &pathDistances,
double offsetAlongLine, LabelLineDirection direction = RespectPainterOrientation,
double maxConcaveAngle = -1,
double maxConvexAngle = -1, CurvedTextFlags flags = CurvedTextFlags() )
SIP_SKIP;
201 static std::unique_ptr< CurvePlacementProperties > generateCurvedTextPlacementPrivate(
const QgsPrecalculatedTextMetrics &metrics,
const double *x,
const double *y,
int numPoints,
const std::vector< double> &pathDistances,
double offsetAlongLine, LabelLineDirection direction, CurvedTextFlags flags,
double maxConcaveAngle = -1,
double maxConvexAngle = -1,
bool isSecondAttempt =
false )
SIP_SKIP;
204 static
bool nextCharPosition(
double charWidth,
double segmentLength, const
double *x, const
double *y,
int numPoints,
int &index,
double ¤tDistanceAlongSegment,
205 double &characterStartX,
double &characterStartY,
double &characterEndX,
double &characterEndY );
207 static
void findLineCircleIntersection(
double cx,
double cy,
double radius,
208 double x1,
double y1,
double x2,
double y2,
209 double &xRes,
double &yRes );
TextOrientation
Text orientations.
RenderUnit
Rendering size units.
Contains precalculated properties regarding text metrics for text to be renderered at a later stage.
SizeType
Methods for determining the background shape size.
ShapeType
Background shape types.
RotationType
Methods for determining the rotation of the background shape.
Contains placement information for a curved text layout.
QVector< QgsTextRendererUtils::CurvedGraphemePlacement > graphemePlacement
Placement information for all graphemes in text.
Contains placement information for a single grapheme in a curved text layout.
Utility functions for text rendering.
LabelLineDirection
Controls behavior of curved text with respect to line directions.
@ RespectPainterOrientation
Curved text will be placed respecting the painter orientation, and the actual line direction will be ...
CurvedTextFlag
Flags controlling behavior of curved text generation.
ShadowPlacement
Placement positions for text shadow.
Represents a vector layer which manages a vector based data sets.
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.
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsTextRendererUtils::CurvedTextFlags)