QGIS API Documentation  3.8.0-Zanzibar (11aff65)
qgslinesymbollayer.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgslinesymbollayer.h
3  ---------------------
4  begin : November 2009
5  copyright : (C) 2009 by Martin Dobias
6  email : wonder dot sk at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #ifndef QGSLINESYMBOLLAYER_H
17 #define QGSLINESYMBOLLAYER_H
18 
19 #include "qgis_core.h"
20 #include "qgis.h"
21 #include "qgssymbollayer.h"
22 
23 #include <QPen>
24 #include <QVector>
25 
26 class QgsExpression;
27 
28 #define DEFAULT_SIMPLELINE_COLOR QColor(35,35,35)
29 #define DEFAULT_SIMPLELINE_WIDTH DEFAULT_LINE_WIDTH
30 #define DEFAULT_SIMPLELINE_PENSTYLE Qt::SolidLine
31 #define DEFAULT_SIMPLELINE_JOINSTYLE Qt::BevelJoin
32 #define DEFAULT_SIMPLELINE_CAPSTYLE Qt::SquareCap
33 
39 class CORE_EXPORT QgsSimpleLineSymbolLayer : public QgsLineSymbolLayer
40 {
41  public:
42 
49  double width = DEFAULT_SIMPLELINE_WIDTH,
50  Qt::PenStyle penStyle = DEFAULT_SIMPLELINE_PENSTYLE );
51 
52  // static stuff
53 
59  static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;
60 
64  static QgsSymbolLayer *createFromSld( QDomElement &element ) SIP_FACTORY;
65 
66  QString layerType() const override;
67  void startRender( QgsSymbolRenderContext &context ) override;
68  void stopRender( QgsSymbolRenderContext &context ) override;
69  void renderPolyline( const QPolygonF &points, QgsSymbolRenderContext &context ) override;
70  //overridden so that clip path can be set when using draw inside polygon option
71  void renderPolygonStroke( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context ) override;
72  QgsStringMap properties() const override;
73  QgsSimpleLineSymbolLayer *clone() const override SIP_FACTORY;
74  void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const override;
75  QString ogrFeatureStyle( double mmScaleFactor, double mapUnitScaleFactor ) const override;
76  void setOutputUnit( QgsUnitTypes::RenderUnit unit ) override;
77  QgsUnitTypes::RenderUnit outputUnit() const override;
78  void setMapUnitScale( const QgsMapUnitScale &scale ) override;
79  QgsMapUnitScale mapUnitScale() const override;
80  double estimateMaxBleed( const QgsRenderContext &context ) const override;
81  QVector<qreal> dxfCustomDashPattern( QgsUnitTypes::RenderUnit &unit ) const override;
82  Qt::PenStyle dxfPenStyle() const override;
83  double dxfWidth( const QgsDxfExport &e, QgsSymbolRenderContext &context ) const override;
84  double dxfOffset( const QgsDxfExport &e, QgsSymbolRenderContext &context ) const override;
85  QColor dxfColor( QgsSymbolRenderContext &context ) const override;
86 
92  Qt::PenStyle penStyle() const { return mPenStyle; }
93 
99  void setPenStyle( Qt::PenStyle style ) { mPenStyle = style; }
100 
106  Qt::PenJoinStyle penJoinStyle() const { return mPenJoinStyle; }
107 
113  void setPenJoinStyle( Qt::PenJoinStyle style ) { mPenJoinStyle = style; }
114 
120  Qt::PenCapStyle penCapStyle() const { return mPenCapStyle; }
121 
127  void setPenCapStyle( Qt::PenCapStyle style ) { mPenCapStyle = style; }
128 
135  bool useCustomDashPattern() const { return mUseCustomDashPattern; }
136 
143  void setUseCustomDashPattern( bool b ) { mUseCustomDashPattern = b; }
144 
149  void setCustomDashPatternUnit( QgsUnitTypes::RenderUnit unit ) { mCustomDashPatternUnit = unit; }
150 
155  QgsUnitTypes::RenderUnit customDashPatternUnit() const { return mCustomDashPatternUnit; }
156 
161  const QgsMapUnitScale &customDashPatternMapUnitScale() const { return mCustomDashPatternMapUnitScale; }
162 
167  void setCustomDashPatternMapUnitScale( const QgsMapUnitScale &scale ) { mCustomDashPatternMapUnitScale = scale; }
168 
181  QVector<qreal> customDashVector() const { return mCustomDashVector; }
182 
195  void setCustomDashVector( const QVector<qreal> &vector ) { mCustomDashVector = vector; }
196 
206  bool drawInsidePolygon() const { return mDrawInsidePolygon; }
207 
217  void setDrawInsidePolygon( bool drawInsidePolygon ) { mDrawInsidePolygon = drawInsidePolygon; }
218 
219  private:
220 
221  Qt::PenStyle mPenStyle = Qt::SolidLine;
222  Qt::PenJoinStyle mPenJoinStyle = DEFAULT_SIMPLELINE_JOINSTYLE;
223  Qt::PenCapStyle mPenCapStyle = DEFAULT_SIMPLELINE_CAPSTYLE;
224  QPen mPen;
225  QPen mSelPen;
226 
227  bool mUseCustomDashPattern = false;
229  QgsMapUnitScale mCustomDashPatternMapUnitScale;
230 
232  QVector<qreal> mCustomDashVector;
233 
234  bool mDrawInsidePolygon = false;
235 
236  //helper functions for data defined symbology
237  void applyDataDefinedSymbology( QgsSymbolRenderContext &context, QPen &pen, QPen &selPen, double &offset );
238 };
239 
241 
242 #define DEFAULT_MARKERLINE_ROTATE true
243 #define DEFAULT_MARKERLINE_INTERVAL 3
244 
255 {
256  public:
257 
262  {
269  };
270 
278  QgsTemplatedLineSymbolLayerBase( bool rotateSymbol = true,
279  double interval = 3 );
280 
285  bool rotateSymbols() const { return mRotateSymbols; }
286 
291  void setRotateSymbols( bool rotate ) { mRotateSymbols = rotate; }
292 
298  double interval() const { return mInterval; }
299 
306  void setInterval( double interval ) { mInterval = interval; }
307 
314  void setIntervalUnit( QgsUnitTypes::RenderUnit unit ) { mIntervalUnit = unit; }
315 
321  QgsUnitTypes::RenderUnit intervalUnit() const { return mIntervalUnit; }
322 
329  void setIntervalMapUnitScale( const QgsMapUnitScale &scale ) { mIntervalMapUnitScale = scale; }
330 
337  const QgsMapUnitScale &intervalMapUnitScale() const { return mIntervalMapUnitScale; }
338 
343  Placement placement() const { return mPlacement; }
344 
349  void setPlacement( Placement placement ) { mPlacement = placement; }
350 
361  double offsetAlongLine() const { return mOffsetAlongLine; }
362 
374  void setOffsetAlongLine( double offsetAlongLine ) { mOffsetAlongLine = offsetAlongLine; }
375 
382  QgsUnitTypes::RenderUnit offsetAlongLineUnit() const { return mOffsetAlongLineUnit; }
383 
390  void setOffsetAlongLineUnit( QgsUnitTypes::RenderUnit unit ) { mOffsetAlongLineUnit = unit; }
391 
396  const QgsMapUnitScale &offsetAlongLineMapUnitScale() const { return mOffsetAlongLineMapUnitScale; }
397 
402  void setOffsetAlongLineMapUnitScale( const QgsMapUnitScale &scale ) { mOffsetAlongLineMapUnitScale = scale; }
403 
414  double averageAngleLength() const { return mAverageAngleLength; }
415 
426  void setAverageAngleLength( double length ) { mAverageAngleLength = length; }
427 
436  void setAverageAngleUnit( QgsUnitTypes::RenderUnit unit ) { mAverageAngleLengthUnit = unit; }
437 
446  QgsUnitTypes::RenderUnit averageAngleUnit() const { return mAverageAngleLengthUnit; }
447 
456  void setAverageAngleMapUnitScale( const QgsMapUnitScale &scale ) { mAverageAngleLengthMapUnitScale = scale; }
457 
466  const QgsMapUnitScale &averageAngleMapUnitScale() const { return mAverageAngleLengthMapUnitScale; }
467 
468  void renderPolyline( const QPolygonF &points, QgsSymbolRenderContext &context ) FINAL;
469  void renderPolygonStroke( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context ) FINAL;
471  void setMapUnitScale( const QgsMapUnitScale &scale ) FINAL;
473  QgsStringMap properties() const override;
474 
475  protected:
476 
483  virtual void setSymbolLineAngle( double angle ) = 0;
484 
488  virtual double symbolAngle() const = 0;
489 
493  virtual void setSymbolAngle( double angle ) = 0;
494 
507  virtual void renderSymbol( const QPointF &point, const QgsFeature *feature, QgsRenderContext &context, int layer = -1, bool selected = false ) = 0;
508 
512  void copyTemplateSymbolProperties( QgsTemplatedLineSymbolLayerBase *destLayer ) const;
513 
518  static void setCommonProperties( QgsTemplatedLineSymbolLayerBase *destLayer, const QgsStringMap &properties );
519 
520  private:
521 
522  void renderPolylineInterval( const QPolygonF &points, QgsSymbolRenderContext &context, double averageAngleOver );
523  void renderPolylineVertex( const QPolygonF &points, QgsSymbolRenderContext &context, QgsTemplatedLineSymbolLayerBase::Placement placement = QgsTemplatedLineSymbolLayerBase::Vertex );
524  void renderPolylineCentral( const QPolygonF &points, QgsSymbolRenderContext &context, double averageAngleOver );
525  double markerAngle( const QPolygonF &points, bool isRing, int vertex );
526 
538  void renderOffsetVertexAlongLine( const QPolygonF &points, int vertex, double distance, QgsSymbolRenderContext &context );
539 
540 
541  static void collectOffsetPoints( const QVector< QPointF> &points,
542  QVector< QPointF> &dest, double intervalPainterUnits, double initialOffset, double initialLag = 0,
543  int numberPointsRequired = -1 );
544 
545  bool mRotateSymbols = true;
546  double mInterval = 3;
548  QgsMapUnitScale mIntervalMapUnitScale;
549  Placement mPlacement = Interval;
550  double mOffsetAlongLine = 0; //distance to offset along line before marker is drawn
551  QgsUnitTypes::RenderUnit mOffsetAlongLineUnit = QgsUnitTypes::RenderMillimeters; //unit for offset along line
552  QgsMapUnitScale mOffsetAlongLineMapUnitScale;
553  double mAverageAngleLength = 4;
555  QgsMapUnitScale mAverageAngleLengthMapUnitScale;
556 
557  friend class TestQgsMarkerLineSymbol;
558 
559 };
560 
567 {
568  public:
569 
578  double interval = DEFAULT_MARKERLINE_INTERVAL );
579 
580  // static stuff
581 
587  static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;
588 
592  static QgsSymbolLayer *createFromSld( QDomElement &element ) SIP_FACTORY;
593 
594  // implemented from base classes
595 
596  QString layerType() const override;
597  void startRender( QgsSymbolRenderContext &context ) override;
598  void stopRender( QgsSymbolRenderContext &context ) override;
599  QgsMarkerLineSymbolLayer *clone() const override SIP_FACTORY;
600  void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const override;
601  void setColor( const QColor &color ) override;
602  QColor color() const override;
603  QgsSymbol *subSymbol() override;
604  bool setSubSymbol( QgsSymbol *symbol SIP_TRANSFER ) override;
605  void setWidth( double width ) override;
606  double width() const override;
607  double width( const QgsRenderContext &context ) const override;
608  double estimateMaxBleed( const QgsRenderContext &context ) const override;
609  void setOutputUnit( QgsUnitTypes::RenderUnit unit ) override;
610  QSet<QString> usedAttributes( const QgsRenderContext &context ) const override;
611  bool hasDataDefinedProperties() const override;
612  void setDataDefinedProperty( QgsSymbolLayer::Property key, const QgsProperty &property ) override;
613 
620  Q_DECL_DEPRECATED bool rotateMarker() const SIP_DEPRECATED { return rotateSymbols(); }
621 
626  Q_DECL_DEPRECATED void setRotateMarker( bool rotate ) SIP_DEPRECATED { setRotateSymbols( rotate ); }
627 
628  protected:
629 
630  std::unique_ptr< QgsMarkerSymbol > mMarker;
631 
632  void setSymbolLineAngle( double angle ) override;
633  double symbolAngle() const override;
634  void setSymbolAngle( double angle ) override;
635  void renderSymbol( const QPointF &point, const QgsFeature *feature, QgsRenderContext &context, int layer = -1, bool selected = false ) override;
636 
637  private:
638 
639 #ifdef SIP_RUN
641 #endif
642 
643 
644 };
645 
646 
656 {
657  public:
658 
666  QgsHashedLineSymbolLayer( bool rotateSymbol = true,
667  double interval = 3 );
668 
674  static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;
675 
676  QString layerType() const override;
677  void startRender( QgsSymbolRenderContext &context ) override;
678  void stopRender( QgsSymbolRenderContext &context ) override;
679  QgsStringMap properties() const override;
680  QgsHashedLineSymbolLayer *clone() const override SIP_FACTORY;
681  void setColor( const QColor &color ) override;
682  QColor color() const override;
683  QgsSymbol *subSymbol() override;
684  bool setSubSymbol( QgsSymbol *symbol SIP_TRANSFER ) override;
685  void setWidth( double width ) override;
686  double width() const override;
687  double width( const QgsRenderContext &context ) const override;
688  double estimateMaxBleed( const QgsRenderContext &context ) const override;
689  void setOutputUnit( QgsUnitTypes::RenderUnit unit ) override;
690  QSet<QString> usedAttributes( const QgsRenderContext &context ) const override;
691  bool hasDataDefinedProperties() const override;
692  void setDataDefinedProperty( QgsSymbolLayer::Property key, const QgsProperty &property ) override;
693 
699  double hashAngle() const;
700 
706  void setHashAngle( double angle );
707 
713  double hashLength() const { return mHashLength; }
714 
720  void setHashLength( double length ) { mHashLength = length; }
721 
727  void setHashLengthUnit( QgsUnitTypes::RenderUnit unit ) { mHashLengthUnit = unit; }
728 
734  QgsUnitTypes::RenderUnit hashLengthUnit() const { return mHashLengthUnit; }
735 
742  void setHashLengthMapUnitScale( const QgsMapUnitScale &scale ) { mHashLengthMapUnitScale = scale; }
743 
750  const QgsMapUnitScale &hashLengthMapUnitScale() const { return mHashLengthMapUnitScale; }
751 
752  protected:
753 
754  void setSymbolLineAngle( double angle ) override;
755  double symbolAngle() const override;
756  void setSymbolAngle( double angle ) override;
757  void renderSymbol( const QPointF &point, const QgsFeature *feature, QgsRenderContext &context, int layer = -1, bool selected = false ) override;
758 
759  private:
760 #ifdef SIP_RUN
762 #endif
763 
764  std::unique_ptr< QgsLineSymbol > mHashSymbol;
765 
766  double mSymbolLineAngle = 0;
767  double mSymbolAngle = 0;
768 
769  double mHashAngle = 0;
770  double mHashLength = 3;
772  QgsMapUnitScale mHashLengthMapUnitScale;
773 
774 };
775 
776 #endif
777 
778 
Class for parsing and evaluation of expressions (formerly called "search strings").
void setOffsetAlongLine(double offsetAlongLine)
Sets the the offset along the line for the symbol placement.
double hashLength() const
Returns the length of hash symbols.
virtual QVector< qreal > dxfCustomDashPattern(QgsUnitTypes::RenderUnit &unit) const
Gets dash pattern.
QgsUnitTypes::RenderUnit customDashPatternUnit() const
Returns the units for lengths used in the custom dash pattern.
Place symbols on the first vertex in the line.
void setMapUnitScale(const QgsMapUnitScale &scale) override
virtual QString ogrFeatureStyle(double mmScaleFactor, double mapUnitScaleFactor) const
void setPlacement(Placement placement)
Sets the placement of the symbols.
Abstract base class for all rendered symbols.
Definition: qgssymbol.h:61
void setUseCustomDashPattern(bool b)
Sets whether the line uses a custom dash pattern.
virtual QgsSymbol * subSymbol()
Returns the symbol&#39;s sub symbol, if present.
virtual double dxfOffset(const QgsDxfExport &e, QgsSymbolRenderContext &context) const
Gets offset.
Q_DECL_DEPRECATED void setRotateMarker(bool rotate)
Shall the marker be rotated.
virtual void setWidth(double width)
Sets the width of the line symbol layer.
A simple line symbol layer, which renders lines using a line in a variety of styles (e...
double averageAngleLength() const
Returns the length of line over which the line&#39;s direction is averaged when calculating individual sy...
virtual void setSymbolLineAngle(double angle)=0
Sets the line angle modification for the symbol&#39;s angle.
#define DEFAULT_MARKERLINE_INTERVAL
const QgsMapUnitScale & hashLengthMapUnitScale() const
Returns the map unit scale for the hash length.
QgsUnitTypes::RenderUnit averageAngleUnit() const
Returns the unit for the length over which the line&#39;s direction is averaged when calculating individu...
#define DEFAULT_SIMPLELINE_JOINSTYLE
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition: qgsfeature.h:55
Place symbols on every vertex in the line.
const QgsMapUnitScale & averageAngleMapUnitScale() const
Returns the map unit scale for the length over which the line&#39;s direction is averaged when calculatin...
virtual QgsStringMap properties() const =0
Should be reimplemented by subclasses to return a string map that contains the configuration informat...
QgsUnitTypes::RenderUnit intervalUnit() const
Returns the units for the interval between symbols.
double interval() const
Returns the interval between individual symbols.
double dxfWidth(const QgsDxfExport &e, QgsSymbolRenderContext &context) const override
Gets line width.
QMap< QString, QString > QgsStringMap
Definition: qgis.h:587
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)
Definition: MathUtils.cpp:786
void setInterval(double interval)
Sets the interval between individual symbols.
virtual double width() const
Returns the estimated width for the line symbol layer.
virtual void renderPolyline(const QPolygonF &points, QgsSymbolRenderContext &context)=0
Renders the line symbol layer along the line joining points, using the given render context...
Place symbols at every virtual curve point in the line (used when rendering curved geometry types onl...
void setCustomDashPatternUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for lengths used in the custom dash pattern.
virtual bool hasDataDefinedProperties() const
Returns true if the symbol layer (or any of its sub-symbols) contains data defined properties...
virtual void setColor(const QColor &color)
The fill color.
QgsStringMap properties() const override
Should be reimplemented by subclasses to return a string map that contains the configuration informat...
void setAverageAngleUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the length over which the line&#39;s direction is averaged when calculating individual ...
std::unique_ptr< QgsMarkerSymbol > mMarker
virtual bool setSubSymbol(QgsSymbol *symbol)
Sets layer&#39;s subsymbol. takes ownership of the passed symbol.
void setOffsetAlongLineMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale used for calculating the offset in map units along line for symbols...
void setIntervalUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the interval between symbols.
QgsUnitTypes::RenderUnit outputUnit() const override
Returns the units to use for sizes and widths within the symbol layer.
QVector< qreal > customDashVector() const
Returns the custom dash vector, which is the pattern of alternating drawn/skipped lengths used while ...
#define DEFAULT_SIMPLELINE_CAPSTYLE
void setHashLengthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the hash length.
Line symbol layer type which draws repeating line sections along a line feature.
virtual QgsSymbolLayer * clone() const =0
Shall be reimplemented by subclasses to create a deep copy of the instance.
#define DEFAULT_SIMPLELINE_PENSTYLE
#define SIP_TRANSFER
Definition: qgis_sip.h:36
virtual QColor color() const
The fill color.
void setRotateSymbols(bool rotate)
Sets whether the repeating symbols should be rotated to match their line segment orientation.
virtual double symbolAngle() const =0
Returns the symbol&#39;s current angle, in degrees clockwise.
#define DEFAULT_SIMPLELINE_COLOR
QgsUnitTypes::RenderUnit offsetAlongLineUnit() const
Returns the unit used for calculating the offset along line for symbols.
Qt::PenJoinStyle penJoinStyle() const
Returns the pen join style used to render the line (e.g.
#define SIP_FACTORY
Definition: qgis_sip.h:69
bool useCustomDashPattern() const
Returns true if the line uses a custom dash pattern.
Base class for templated line symbols, e.g.
Q_DECL_DEPRECATED bool rotateMarker() const
Shall the marker be rotated.
A store for object properties.
Definition: qgsproperty.h:229
#define SIP_DEPRECATED
Definition: qgis_sip.h:99
const QgsMapUnitScale & offsetAlongLineMapUnitScale() const
Returns the map unit scale used for calculating the offset in map units along line for symbols...
void setPenStyle(Qt::PenStyle style)
Sets the pen style used to render the line (e.g.
virtual double estimateMaxBleed(const QgsRenderContext &context) const
Returns the estimated maximum distance which the layer style will bleed outside the drawn shape when ...
void setHashLengthUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the length of hash symbols.
Place symbols at regular intervals.
void setPenCapStyle(Qt::PenCapStyle style)
Sets the pen cap style used to render the line (e.g.
virtual Qt::PenStyle dxfPenStyle() const
Gets pen style.
#define DEFAULT_SIMPLELINE_WIDTH
virtual void toSld(QDomDocument &doc, QDomElement &element, const QgsStringMap &props) const
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.
#define FINAL
Definition: qgis_sip.h:216
const QgsMapUnitScale & intervalMapUnitScale() const
Returns the map unit scale for the interval between symbols.
bool drawInsidePolygon() const
Returns true if the line should only be drawn inside polygons, and any portion of the line which fall...
Line symbol layer type which draws repeating marker symbols along a line feature. ...
Struct for storing maximum and minimum scales for measurements in map units.
virtual void stopRender(QgsSymbolRenderContext &context)=0
void setCustomDashPatternMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for lengths used in the custom dash pattern.
Placement
Defines how/where the templated symbol should be placed on the line.
virtual QColor dxfColor(QgsSymbolRenderContext &context) const
Gets color.
void setIntervalMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the interval between symbols.
Qt::PenStyle penStyle() const
Returns the pen style used to render the line (e.g.
virtual void setSymbolAngle(double angle)=0
Sets the symbol&#39;s angle, in degrees clockwise.
void setDrawInsidePolygon(bool drawInsidePolygon)
Sets whether the line should only be drawn inside polygons, and any portion of the line which falls o...
void setCustomDashVector(const QVector< qreal > &vector)
Sets the custom dash vector, which is the pattern of alternating drawn/skipped lengths used while ren...
virtual void renderPolygonStroke(const QPolygonF &points, QList< QPolygonF > *rings, QgsSymbolRenderContext &context)
Renders the line symbol layer along the outline of polygon, using the given render context...
Placement placement() const
Returns the placement of the symbols.
Place symbols on the last vertex in the line.
const QgsMapUnitScale & customDashPatternMapUnitScale() const
Returns the map unit scale for lengths used in the custom dash pattern.
void setOffsetAlongLineUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit used for calculating the offset along line for symbols.
void setAverageAngleLength(double length)
Sets the length of line over which the line&#39;s direction is averaged when calculating individual symbo...
Place symbols at the mid point of the line.
void setAverageAngleMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the length over which the line&#39;s direction is averaged when calculating i...
void setHashLength(double length)
Sets the length of hash symbols.
Qt::PenCapStyle penCapStyle() const
Returns the pen cap style used to render the line (e.g.
#define DEFAULT_MARKERLINE_ROTATE
double offsetAlongLine() const
Returns the offset along the line for the symbol placement.
virtual void renderSymbol(const QPointF &point, const QgsFeature *feature, QgsRenderContext &context, int layer=-1, bool selected=false)=0
Renders the templated symbol at the specified point, using the given render context.
QgsMapUnitScale mapUnitScale() const override
void setOutputUnit(QgsUnitTypes::RenderUnit unit) override
Sets the units to use for sizes and widths within the symbol layer.
Property
Data definable properties.
RenderUnit
Rendering size units.
Definition: qgsunittypes.h:111
virtual void setDataDefinedProperty(Property key, const QgsProperty &property)
Sets a data defined property for the layer.
void setPenJoinStyle(Qt::PenJoinStyle style)
Sets the pen join style used to render the line (e.g.
QgsUnitTypes::RenderUnit hashLengthUnit() const
Returns the units for the length of hash symbols.
virtual void startRender(QgsSymbolRenderContext &context)=0
virtual QString layerType() const =0
Returns a string that represents this layer type.
bool rotateSymbols() const
Returns true if the repeating symbols be rotated to match their line segment orientation.