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;
146 static CurvePlacementProperties *generateCurvedTextPlacement(
const QgsPrecalculatedTextMetrics &metrics,
const QgsLineString *line,
double offsetAlongLine, LabelLineDirection direction = RespectPainterOrientation,
double maxConcaveAngle = -1,
double maxConvexAngle = -1,
bool uprightOnly =
true )
SIP_FACTORY;
166 static 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,
bool uprightOnly =
true )
SIP_SKIP;
171 static CurvePlacementProperties *generateCurvedTextPlacementPrivate(
const QgsPrecalculatedTextMetrics &metrics,
const double *x,
const double *y,
int numPoints,
const std::vector< double> &pathDistances,
double offsetAlongLine, LabelLineDirection direction,
double maxConcaveAngle = -1,
double maxConvexAngle = -1,
bool uprightOnly =
true,
bool isSecondAttempt =
false )
SIP_SKIP;
174 static
bool nextCharPosition(
double charWidth,
double segmentLength, const
double *x, const
double *y,
int numPoints,
int &index,
double ¤tDistanceAlongSegment,
175 double &characterStartX,
double &characterStartY,
double &characterEndX,
double &characterEndY );
177 static
void findLineCircleIntersection(
double cx,
double cy,
double radius,
178 double x1,
double y1,
double x2,
double y2,
179 double &xRes,
double &yRes );
TextOrientation
Text orientations.
RenderUnit
Rendering size units.
Line string geometry type, with support for z-dimension and m-values.
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 ...
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)