32 mSymbol.reset( static_cast<QgsFillSymbol *>( symbol ) );
43 if ( props.contains( QStringLiteral(
"arrow_width" ) ) )
44 l->
setArrowWidth( props[QStringLiteral(
"arrow_width" )].toDouble() );
46 if ( props.contains( QStringLiteral(
"arrow_width_unit" ) ) )
49 if ( props.contains( QStringLiteral(
"arrow_width_unit_scale" ) ) )
52 if ( props.contains( QStringLiteral(
"arrow_start_width" ) ) )
55 if ( props.contains( QStringLiteral(
"arrow_start_width_unit" ) ) )
58 if ( props.contains( QStringLiteral(
"arrow_start_width_unit_scale" ) ) )
61 if ( props.contains( QStringLiteral(
"is_curved" ) ) )
62 l->
setIsCurved( props[QStringLiteral(
"is_curved" )].toInt() == 1 );
64 if ( props.contains( QStringLiteral(
"is_repeated" ) ) )
65 l->
setIsRepeated( props[QStringLiteral(
"is_repeated" )].toInt() == 1 );
67 if ( props.contains( QStringLiteral(
"head_length" ) ) )
68 l->
setHeadLength( props[QStringLiteral(
"head_length" )].toDouble() );
70 if ( props.contains( QStringLiteral(
"head_length_unit" ) ) )
73 if ( props.contains( QStringLiteral(
"head_length_unit_scale" ) ) )
76 if ( props.contains( QStringLiteral(
"head_thickness" ) ) )
79 if ( props.contains( QStringLiteral(
"head_thickness_unit" ) ) )
82 if ( props.contains( QStringLiteral(
"head_thickness_unit_scale" ) ) )
85 if ( props.contains( QStringLiteral(
"head_type" ) ) )
86 l->
setHeadType( static_cast<HeadType>( props[QStringLiteral(
"head_type" )].toInt() ) );
88 if ( props.contains( QStringLiteral(
"arrow_type" ) ) )
89 l->
setArrowType( static_cast<ArrowType>( props[QStringLiteral(
"arrow_type" )].toInt() ) );
91 if ( props.contains( QStringLiteral(
"offset" ) ) )
92 l->
setOffset( props[QStringLiteral(
"offset" )].toDouble() );
94 if ( props.contains( QStringLiteral(
"offset_unit" ) ) )
97 if ( props.contains( QStringLiteral(
"offset_unit_scale" ) ) )
100 if ( props.contains( QStringLiteral(
"ring_filter" ) ) )
101 l->
setRingFilter( static_cast< RenderRingFilter>( props[QStringLiteral(
"ring_filter" )].toInt() ) );
121 return QStringLiteral(
"ArrowLine" );
128 map[QStringLiteral(
"arrow_width" )] = QString::number(
arrowWidth() );
132 map[QStringLiteral(
"arrow_start_width" )] = QString::number(
arrowStartWidth() );
136 map[QStringLiteral(
"is_curved" )] = QString::number(
isCurved() ? 1 : 0 );
137 map[QStringLiteral(
"is_repeated" )] = QString::number(
isRepeated() ? 1 : 0 );
139 map[QStringLiteral(
"head_length" )] = QString::number(
headLength() );
143 map[QStringLiteral(
"head_thickness" )] = QString::number(
headThickness() );
147 map[QStringLiteral(
"head_type" )] = QString::number(
headType() );
148 map[QStringLiteral(
"arrow_type" )] = QString::number(
arrowType() );
150 map[QStringLiteral(
"offset" )] = QString::number(
offset() );
154 map[QStringLiteral(
"ring_filter" )] = QString::number( static_cast< int >(
mRingFilter ) );
163 attributes.unite( mSymbol->usedAttributes( context ) );
172 if ( mSymbol && mSymbol->hasDataDefinedProperties() )
198 return std::sqrt( ( po.x() - pd.x() ) * ( po.x() - pd.x() ) + ( po.y() - pd.y() ) * ( po.y() - pd.y() ) );
202 qreal startWidth, qreal
width,
203 qreal headWidth, qreal headHeight,
214 po = pd - ( pd - po ) / length * headWidth;
219 pd = po + ( pd - po ) / length * headWidth;
224 QPointF v = ( pd - po ) / length * headWidth;
225 QPointF npo = ( po + pd ) / 2.0 - v;
226 QPointF npd = ( po + pd ) / 2.0 + v;
229 length = 2 * headWidth;
232 qreal bodyLength = length - headWidth;
235 QPointF unitVec = ( pd - po ) / length;
237 QPointF perpVec( -unitVec.y(), unitVec.x() );
249 polygon << po + unitVec *headWidth + perpVec *headHeight;
250 polygon << po + unitVec *headWidth + perpVec * ( width * 0.5 );
252 polygon << po + unitVec *bodyLength + perpVec * ( width * 0.5 );
255 polygon << po + unitVec *bodyLength + perpVec *headHeight;
261 polygon << po + unitVec *bodyLength - perpVec *headHeight;
262 polygon << po + unitVec *bodyLength - perpVec * ( width * 0.5 );
265 polygon << po + unitVec *headWidth - perpVec * ( width * 0.5 );
266 polygon << po + unitVec *headWidth - perpVec *headHeight;
273 polygon << po + perpVec * ( startWidth * 0.5 );
274 polygon << po + unitVec *bodyLength + perpVec * ( width * 0.5 );
275 polygon << po + unitVec *bodyLength + perpVec *headHeight;
284 polygon << po + unitVec *bodyLength - perpVec *headHeight;
285 polygon << po + unitVec *bodyLength - perpVec * ( width * 0.5 );
286 polygon << po - perpVec * ( startWidth * 0.5 );
298 polygon << po + unitVec *headWidth + perpVec *headHeight;
299 polygon << po + unitVec *headWidth + perpVec * ( width * 0.5 );
301 polygon << pd + perpVec * ( startWidth * 0.5 );
309 polygon << pd - perpVec * ( startWidth * 0.5 );
311 polygon << po + unitVec *headWidth - perpVec * ( width * 0.5 );
312 polygon << po + unitVec *headWidth - perpVec *headHeight;
320 polygon << polygon.first();
339 bool pointsToCircle( QPointF a, QPointF b, QPointF
c, QPointF ¢er, qreal &radius )
348 QPointF ab2 = ( a + b ) / 2.0;
349 QPointF bc2 = ( b +
c ) / 2.0;
352 if ( std::fabs( ab.x() * bc.y() - ab.y() * bc.x() ) < 0.001 )
359 cy = bc2.y() - ( cx - bc2.x() ) * bc.x() / bc.y();
362 else if ( bc.y() == 0 )
365 cy = ab2.y() - ( cx - ab2.x() ) * ab.x() / ab.y();
370 cx = ( bc2.y() - ab2.y() + bc.x() * bc2.x() / bc.y() - ab.x() * ab2.x() / ab.y() ) / ( bc.x() / bc.y() - ab.x() / ab.y() );
371 cy = bc2.y() - ( cx - bc2.x() ) * bc.x() / bc.y();
374 radius = std::sqrt( ( a.x() - cx ) * ( a.x() - cx ) + ( a.y() - cy ) * ( a.y() - cy ) );
384 return QPointF( std::cos( -angle ) * radius + center.x(), std::sin( -angle ) * radius + center.y() );
387 void pathArcTo( QPainterPath &path, QPointF circleCenter, qreal circleRadius, qreal angle_o, qreal angle_d,
int direction )
389 QRectF circleRect( circleCenter - QPointF( circleRadius, circleRadius ), circleCenter + QPointF( circleRadius, circleRadius ) );
390 if ( direction == 1 )
392 if ( angle_o < angle_d )
393 path.arcTo( circleRect, angle_o / M_PI * 180.0, ( angle_d - angle_o ) / M_PI * 180.0 );
395 path.arcTo( circleRect, angle_o / M_PI * 180.0, 360.0 - ( angle_o - angle_d ) / M_PI * 180.0 );
399 if ( angle_o < angle_d )
400 path.arcTo( circleRect, angle_o / M_PI * 180.0, - ( 360.0 - ( angle_d - angle_o ) / M_PI * 180.0 ) );
402 path.arcTo( circleRect, angle_o / M_PI * 180.0, ( angle_d - angle_o ) / M_PI * 180.0 );
407 void spiralArcTo( QPainterPath &path, QPointF center, qreal startAngle, qreal startRadius, qreal endAngle, qreal endRadius,
int direction )
410 QPointF A =
circlePoint( center, startRadius, startAngle );
412 QPointF B =
circlePoint( center, endRadius, endAngle );
416 deltaAngle = endAngle - startAngle;
417 if ( direction * deltaAngle < 0.0 )
418 deltaAngle = deltaAngle + direction * 2 * M_PI;
420 QPointF I1 =
circlePoint( center, 0.75 * startRadius + 0.25 * endRadius, startAngle + 0.25 * deltaAngle );
421 QPointF I2 =
circlePoint( center, 0.50 * startRadius + 0.50 * endRadius, startAngle + 0.50 * deltaAngle );
422 QPointF I3 =
circlePoint( center, 0.25 * startRadius + 0.75 * endRadius, startAngle + 0.75 * deltaAngle );
435 qreal a1 = std::atan2( cCenter.y() - A.y(), A.x() - cCenter.x() );
436 qreal a2 = std::atan2( cCenter.y() - I2.y(), I2.x() - cCenter.x() );
437 pathArcTo( path, cCenter, cRadius, a1, a2, direction );
449 qreal a1 = std::atan2( cCenter.y() - I2.y(), I2.x() - cCenter.x() );
450 qreal a2 = std::atan2( cCenter.y() - B.y(), B.x() - cCenter.x() );
451 pathArcTo( path, cCenter, cRadius, a1, a2, direction );
456 qreal startWidth, qreal
width,
457 qreal headWidth, qreal headHeight,
462 QPointF circleCenter;
466 return straightArrow( po, pd, startWidth, width, headWidth, headHeight, headType, arrowType, offset );
470 qreal angle_o =
clampAngle( std::atan2( circleCenter.y() - po.y(), po.x() - circleCenter.x() ) );
471 qreal angle_m =
clampAngle( std::atan2( circleCenter.y() - pm.y(), pm.x() - circleCenter.x() ) );
472 qreal angle_d =
clampAngle( std::atan2( circleCenter.y() - pd.y(), pd.x() - circleCenter.x() ) );
484 qreal deltaAngle = angle_d - angle_o;
485 if ( direction * deltaAngle < 0.0 )
486 deltaAngle = deltaAngle + direction * 2 * M_PI;
494 return straightArrow( po, pd, startWidth, width, headWidth, headHeight, headType, arrowType, offset );
499 po =
circlePoint( circleCenter, circleRadius, angle_o );
500 pm =
circlePoint( circleCenter, circleRadius, angle_m );
501 pd =
circlePoint( circleCenter, circleRadius, angle_d );
503 qreal headAngle = direction * std::atan( headWidth / circleRadius );
513 path.lineTo(
circlePoint( circleCenter, circleRadius + direction * headHeight, angle_o + headAngle ) );
515 pathArcTo( path, circleCenter, circleRadius + direction * width / 2, angle_o + headAngle, angle_d - headAngle, direction );
518 path.lineTo(
circlePoint( circleCenter, circleRadius + direction * headHeight, angle_d - headAngle ) );
523 pathArcTo( path, circleCenter, circleRadius, angle_o, angle_d, direction );
527 path.lineTo(
circlePoint( circleCenter, circleRadius - direction * headHeight, angle_d - headAngle ) );
529 pathArcTo( path, circleCenter, circleRadius - direction * width / 2, angle_d - headAngle, angle_o + headAngle, -direction );
532 path.lineTo(
circlePoint( circleCenter, circleRadius - direction * headHeight, angle_o + headAngle ) );
537 pathArcTo( path, circleCenter, circleRadius, angle_d, angle_o, -direction );
544 path.moveTo(
circlePoint( circleCenter, circleRadius + direction * startWidth / 2, angle_o ) );
546 spiralArcTo( path, circleCenter, angle_o, circleRadius + direction * startWidth / 2, angle_d - headAngle, circleRadius + direction * width / 2, direction );
549 path.lineTo(
circlePoint( circleCenter, circleRadius + direction * headHeight, angle_d - headAngle ) );
555 pathArcTo( path, circleCenter, circleRadius, angle_o, angle_d, direction );
559 path.lineTo(
circlePoint( circleCenter, circleRadius - direction * headHeight, angle_d - headAngle ) );
561 spiralArcTo( path, circleCenter, angle_d - headAngle, circleRadius - direction * width / 2, angle_o, circleRadius - direction * startWidth / 2, -direction );
563 path.lineTo(
circlePoint( circleCenter, circleRadius + direction * startWidth / 2, angle_o ) );
567 pathArcTo( path, circleCenter, circleRadius, angle_d, angle_o, -direction );
568 path.lineTo(
circlePoint( circleCenter, circleRadius + direction * startWidth / 2, angle_o ) );
576 path.lineTo(
circlePoint( circleCenter, circleRadius + direction * headHeight, angle_o + headAngle ) );
577 path.lineTo(
circlePoint( circleCenter, circleRadius + direction * width / 2, angle_o + headAngle ) );
579 spiralArcTo( path, circleCenter, angle_o + headAngle, circleRadius + direction * width / 2, angle_d, circleRadius + direction * startWidth / 2, direction );
583 pathArcTo( path, circleCenter, circleRadius, angle_o, angle_d, direction );
587 path.lineTo(
circlePoint( circleCenter, circleRadius - direction * startWidth / 2, angle_d ) );
589 spiralArcTo( path, circleCenter, angle_d, circleRadius - direction * startWidth / 2, angle_o + headAngle, circleRadius - direction * width / 2, - direction );
591 path.lineTo(
circlePoint( circleCenter, circleRadius - direction * headHeight, angle_o + headAngle ) );
597 pathArcTo( path, circleCenter, circleRadius, angle_d, angle_o, -direction );
601 return path.toSubpathPolygons().at( 0 );
614 double w = exprVal.toDouble( &ok );
624 double w = exprVal.toDouble( &ok );
634 double w = exprVal.toDouble( &ok );
644 double w = exprVal.toDouble( &ok );
654 double w = exprVal.toDouble( &ok );
668 mComputedHeadType = h;
679 mComputedArrowType = h;
698 _resolveDataDefined( context );
702 if ( points.size() >= 3 )
705 QPointF po( points.at( 0 ) );
707 QPointF pm( points.at( points.size() / 2 ) );
709 QPointF pd( points.back() );
711 QPolygonF poly =
curvedArrow( po, pm, pd, mScaledArrowStartWidth, mScaledArrowWidth, mScaledHeadLength, mScaledHeadThickness, mComputedHeadType, mComputedArrowType, mScaledOffset );
715 else if ( points.size() == 2 )
718 QPointF po( points.at( 0 ) );
720 QPointF pd( points.at( 1 ) );
722 QPolygonF poly =
straightArrow( po, pd, mScaledArrowStartWidth, mScaledArrowWidth, mScaledHeadLength, mScaledHeadThickness, mComputedHeadType, mComputedArrowType, mScaledOffset );
728 for (
int pIdx = 0; pIdx < points.size() - 1; pIdx += 2 )
731 _resolveDataDefined( context );
733 if ( points.size() - pIdx >= 3 )
736 QPointF po( points.at( pIdx ) );
738 QPointF pm( points.at( pIdx + 1 ) );
740 QPointF pd( points.at( pIdx + 2 ) );
742 QPolygonF poly =
curvedArrow( po, pm, pd, mScaledArrowStartWidth, mScaledArrowWidth, mScaledHeadLength, mScaledHeadThickness, mComputedHeadType, mComputedArrowType, mScaledOffset );
746 else if ( points.size() - pIdx == 2 )
749 QPointF po( points.at( pIdx ) );
751 QPointF pd( points.at( pIdx + 1 ) );
753 QPolygonF poly =
straightArrow( po, pd, mScaledArrowStartWidth, mScaledArrowWidth, mScaledHeadLength, mScaledHeadThickness, mComputedHeadType, mComputedArrowType, mScaledOffset );
763 _resolveDataDefined( context );
765 if ( !points.isEmpty() )
768 QPointF po( points.at( 0 ) );
770 QPointF pd( points.back() );
772 QPolygonF poly =
straightArrow( po, pd, mScaledArrowStartWidth, mScaledArrowWidth, mScaledHeadLength, mScaledHeadThickness, mComputedHeadType, mComputedArrowType, mScaledOffset );
779 for (
int pIdx = 0; pIdx < points.size() - 1; pIdx++ )
782 _resolveDataDefined( context );
785 QPointF po( points.at( pIdx ) );
787 QPointF pd( points.at( pIdx + 1 ) );
789 QPolygonF poly =
straightArrow( po, pd, mScaledArrowStartWidth, mScaledArrowWidth, mScaledHeadLength, mScaledHeadThickness, mComputedHeadType, mComputedArrowType, mScaledOffset );
800 mSymbol->setColor( c );
807 return mSymbol.get() ? mSymbol->color() :
mColor;
void setHeadThicknessUnitScale(const QgsMapUnitScale &scale)
Sets the scale for the head height.
void setHeadLengthUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the head length.
void stopRender(QgsSymbolRenderContext &context) override
Single variable definition for use within a QgsExpressionContextScope.
static const QString EXPR_GEOMETRY_POINT_COUNT
Inbuilt variable name for point count variable.
QgsUnitTypes::RenderUnit headThicknessUnit() const
Gets the unit for the head height.
Abstract base class for all rendered symbols.
static QgsArrowSymbolLayer::ArrowType decodeArrowType(const QVariant &value, bool *ok=nullptr)
Decodes a value representing an arrow type.
double arrowStartWidth() const
Gets current arrow start width. Only meaningful for single headed arrows.
double arrowWidth() const
Gets current arrow width.
void setArrowWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the arrow width.
const QgsMapUnitScale & offsetMapUnitScale() const
QSet< QString > usedAttributes(const QgsRenderContext &context) const override
Returns the set of attributes referenced by the layer.
static QgsFillSymbol * createSimple(const QgsStringMap &properties)
Create a fill symbol with one symbol layer: SimpleFill with specified properties. ...
QPolygonF straightArrow(QPointF po, QPointF pd, qreal startWidth, qreal width, qreal headWidth, qreal headHeight, QgsArrowSymbolLayer::HeadType headType, QgsArrowSymbolLayer::ArrowType arrowType, qreal offset)
QgsMapUnitScale arrowStartWidthUnitScale() const
Gets the scale for the arrow start width.
QgsMapUnitScale headLengthUnitScale() const
Gets the scale for the head length.
void copyPaintEffect(QgsSymbolLayer *destLayer) const
Copies paint effect of this layer to another symbol layer.
QString layerType() const override
Returns a string that represents this layer type.
void pathArcTo(QPainterPath &path, QPointF circleCenter, qreal circleRadius, qreal angle_o, qreal angle_d, int direction)
static QString encodeMapUnitScale(const QgsMapUnitScale &mapUnitScale)
void setHeadThicknessUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the head height.
void restoreOldDataDefinedProperties(const QgsStringMap &stringMap)
Restores older data defined properties from string map.
void setColor(const QColor &c) override
The fill color.
qreal clampAngle(qreal a)
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the line's offset.
QPolygonF curvedArrow(QPointF po, QPointF pm, QPointF pd, qreal startWidth, qreal width, qreal headWidth, qreal headHeight, QgsArrowSymbolLayer::HeadType headType, QgsArrowSymbolLayer::ArrowType arrowType, qreal offset)
ArrowType arrowType() const
Gets the current arrow type.
static QgsArrowSymbolLayer::HeadType decodeArrowHeadType(const QVariant &value, bool *ok=nullptr)
Decodes a value representing an arrow head type.
bool setSubSymbol(QgsSymbol *symbol) override
Sets layer's subsymbol. takes ownership of the passed symbol.
QMap< QString, QString > QgsStringMap
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)
virtual double width() const
Returns the estimated width for the line symbol layer.
bool isActive(int key) const override
Returns true if the collection contains an active property with the specified key.
virtual bool hasDataDefinedProperties() const
Returns true if the symbol layer (or any of its sub-symbols) contains data defined properties...
QPointF circlePoint(QPointF center, qreal radius, qreal angle)
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
bool isRepeated() const
Returns whether the arrow is repeated along the line or not.
QVariant value(int key, const QgsExpressionContext &context, const QVariant &defaultValue=QVariant()) const override
Returns the calculated value of the property with the specified key from within the collection...
void setOriginalValueVariable(const QVariant &value)
Sets the original value variable value for data defined symbology.
bool pointsToCircle(QPointF a, QPointF b, QPointF c, QPointF ¢er, qreal &radius)
Compute the circumscribed circle from three points.
QgsArrowSymbolLayer * clone() const override
Shall be reimplemented by subclasses to create a deep copy of the instance.
void setHeadLength(double length)
Sets the arrow head length.
void setHeadThickness(double thickness)
Sets the arrow head height.
QgsUnitTypes::RenderUnit arrowStartWidthUnit() const
Gets the unit for the arrow start width.
void spiralArcTo(QPainterPath &path, QPointF center, qreal startAngle, qreal startRadius, qreal endAngle, qreal endRadius, int direction)
QgsPropertyCollection & dataDefinedProperties()
Returns a reference to the symbol layer's property collection, used for data defined overrides...
void setArrowWidth(double width)
Sets the arrow width.
ArrowType
Possible arrow types.
bool isCurved() const
Returns whether it is a curved arrow or a straight one.
qreal euclidian_distance(QPointF po, QPointF pd)
double headLength() const
Gets the current arrow head length.
void setIsRepeated(bool isRepeated)
Sets whether the arrow is repeated along the line.
QgsArrowSymbolLayer()
Simple constructor.
QgsMapUnitScale arrowWidthUnitScale() const
Gets the scale for the arrow width.
static Q_INVOKABLE QgsUnitTypes::RenderUnit decodeRenderUnit(const QString &string, bool *ok=nullptr)
Decodes a render unit from a string.
Single scope for storing variables and functions for use within a QgsExpressionContext.
QgsRenderContext & renderContext()
Returns a reference to the context's render context.
static Q_INVOKABLE QString encodeUnit(QgsUnitTypes::DistanceUnit unit)
Encodes a distance unit to a string.
QgsExpressionContext & expressionContext()
Gets the expression context.
QgsUnitTypes::RenderUnit arrowWidthUnit() const
Gets the unit for the arrow width.
QgsStringMap properties() const override
Should be reimplemented by subclasses to return a string map that contains the configuration informat...
void setIsCurved(bool isCurved)
Sets whether it is a curved arrow or a straight one.
void renderPolyline(const QPolygonF &points, QgsSymbolRenderContext &context) override
virtual QSet< QString > usedAttributes(const QgsRenderContext &context) const
Returns the set of attributes referenced by the layer.
Contains information about the context of a rendering operation.
double convertToPainterUnits(double size, QgsUnitTypes::RenderUnit unit, const QgsMapUnitScale &scale=QgsMapUnitScale()) const
Converts a size from the specified units to painter units (pixels).
QPainter * painter()
Returns the destination QPainter for the render operation.
void setHeadLengthUnitScale(const QgsMapUnitScale &scale)
Sets the scale for the head length.
RenderRingFilter mRingFilter
void setArrowType(ArrowType type)
Sets the arrow type.
SymbolType type() const
Returns the symbol's type.
void setArrowWidthUnitScale(const QgsMapUnitScale &scale)
Sets the scale for the arrow width.
QgsUnitTypes::RenderUnit headLengthUnit() const
Gets the unit for the head length.
void setHeadType(HeadType type)
Sets the head type.
void appendScope(QgsExpressionContextScope *scope)
Appends a scope to the end of the context.
const QgsFeature * feature() const
Current feature being rendered - may be null.
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the line's offset.
void setRingFilter(QgsLineSymbolLayer::RenderRingFilter filter)
Sets the line symbol layer's ring filter, which controls which rings are rendered when the line symbo...
static QgsSymbolLayer * create(const QgsStringMap &properties=QgsStringMap())
Create a new QgsArrowSymbolLayer.
static const QString EXPR_GEOMETRY_POINT_NUM
Inbuilt variable name for point number variable.
QColor color() const override
The fill color.
static QgsMapUnitScale decodeMapUnitScale(const QString &str)
bool hasDataDefinedProperties() const override
Returns true if the symbol layer (or any of its sub-symbols) contains data defined properties...
QgsMapUnitScale headThicknessUnitScale() const
Gets the scale for the head height.
Line symbol layer used for representing lines as arrows.
QgsExpressionContextScope * popScope()
Removes the last scope from the expression context and return it.
HeadType
Possible head types.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
void setArrowStartWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the arrow start width.
HeadType headType() const
Gets the current head type.
QgsPropertyCollection mDataDefinedProperties
void setArrowStartWidth(double width)
Sets the arrow start width.
void copyDataDefinedProperties(QgsSymbolLayer *destLayer) const
Copies all data defined properties of this layer to another symbol layer.
void setArrowStartWidthUnitScale(const QgsMapUnitScale &scale)
Sets the scale for the arrow start width.
void setOffset(double offset)
void startRender(QgsSymbolRenderContext &context) override
double headThickness() const
Gets the current arrow head height.