QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
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, const QVector<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 
209  double dashPatternOffset() const { return mDashPatternOffset; }
210 
223  void setDashPatternOffset( double offset ) { mDashPatternOffset = offset; }
224 
234  void setDashPatternOffsetUnit( QgsUnitTypes::RenderUnit unit ) { mDashPatternOffsetUnit = unit; }
235 
245  QgsUnitTypes::RenderUnit dashPatternOffsetUnit() const { return mDashPatternOffsetUnit; }
246 
256  const QgsMapUnitScale &dashPatternOffsetMapUnitScale() const { return mDashPatternOffsetMapUnitScale; }
257 
267  void setDashPatternOffsetMapUnitScale( const QgsMapUnitScale &scale ) { mDashPatternOffsetMapUnitScale = scale; }
268 
278  bool drawInsidePolygon() const { return mDrawInsidePolygon; }
279 
289  void setDrawInsidePolygon( bool drawInsidePolygon ) { mDrawInsidePolygon = drawInsidePolygon; }
290 
300  bool alignDashPattern() const;
301 
311  void setAlignDashPattern( bool enabled );
312 
323  bool tweakDashPatternOnCorners() const;
324 
335  void setTweakDashPatternOnCorners( bool enabled );
336 
337  private:
338 
339  Qt::PenStyle mPenStyle = Qt::SolidLine;
340  Qt::PenJoinStyle mPenJoinStyle = DEFAULT_SIMPLELINE_JOINSTYLE;
341  Qt::PenCapStyle mPenCapStyle = DEFAULT_SIMPLELINE_CAPSTYLE;
342  QPen mPen;
343  QPen mSelPen;
344 
345  bool mUseCustomDashPattern = false;
347  QgsMapUnitScale mCustomDashPatternMapUnitScale;
348 
349  double mDashPatternOffset = 0;
351  QgsMapUnitScale mDashPatternOffsetMapUnitScale;
352 
354  QVector<qreal> mCustomDashVector;
355 
356  bool mAlignDashPattern = false;
357  bool mPatternCartographicTweakOnSharpCorners = false;
358 
359  bool mDrawInsidePolygon = false;
360 
361  //helper functions for data defined symbology
362  void applyDataDefinedSymbology( QgsSymbolRenderContext &context, QPen &pen, QPen &selPen, double &offset );
363  void drawPathWithDashPatternTweaks( QPainter *painter, const QPolygonF &points, QPen pen ) const;
364 };
365 
367 
368 #define DEFAULT_MARKERLINE_ROTATE true
369 #define DEFAULT_MARKERLINE_INTERVAL 3
370 
381 {
382  public:
383 
388  {
396  };
397 
405  QgsTemplatedLineSymbolLayerBase( bool rotateSymbol = true,
406  double interval = 3 );
407 
412  bool rotateSymbols() const { return mRotateSymbols; }
413 
418  void setRotateSymbols( bool rotate ) { mRotateSymbols = rotate; }
419 
425  double interval() const { return mInterval; }
426 
433  void setInterval( double interval ) { mInterval = interval; }
434 
441  void setIntervalUnit( QgsUnitTypes::RenderUnit unit ) { mIntervalUnit = unit; }
442 
448  QgsUnitTypes::RenderUnit intervalUnit() const { return mIntervalUnit; }
449 
456  void setIntervalMapUnitScale( const QgsMapUnitScale &scale ) { mIntervalMapUnitScale = scale; }
457 
464  const QgsMapUnitScale &intervalMapUnitScale() const { return mIntervalMapUnitScale; }
465 
470  Placement placement() const { return mPlacement; }
471 
476  void setPlacement( Placement placement ) { mPlacement = placement; }
477 
488  double offsetAlongLine() const { return mOffsetAlongLine; }
489 
501  void setOffsetAlongLine( double offsetAlongLine ) { mOffsetAlongLine = offsetAlongLine; }
502 
509  QgsUnitTypes::RenderUnit offsetAlongLineUnit() const { return mOffsetAlongLineUnit; }
510 
517  void setOffsetAlongLineUnit( QgsUnitTypes::RenderUnit unit ) { mOffsetAlongLineUnit = unit; }
518 
523  const QgsMapUnitScale &offsetAlongLineMapUnitScale() const { return mOffsetAlongLineMapUnitScale; }
524 
529  void setOffsetAlongLineMapUnitScale( const QgsMapUnitScale &scale ) { mOffsetAlongLineMapUnitScale = scale; }
530 
541  double averageAngleLength() const { return mAverageAngleLength; }
542 
553  void setAverageAngleLength( double length ) { mAverageAngleLength = length; }
554 
563  void setAverageAngleUnit( QgsUnitTypes::RenderUnit unit ) { mAverageAngleLengthUnit = unit; }
564 
573  QgsUnitTypes::RenderUnit averageAngleUnit() const { return mAverageAngleLengthUnit; }
574 
583  void setAverageAngleMapUnitScale( const QgsMapUnitScale &scale ) { mAverageAngleLengthMapUnitScale = scale; }
584 
593  const QgsMapUnitScale &averageAngleMapUnitScale() const { return mAverageAngleLengthMapUnitScale; }
594 
595  void renderPolyline( const QPolygonF &points, QgsSymbolRenderContext &context ) FINAL;
596  void renderPolygonStroke( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context ) FINAL;
598  void setMapUnitScale( const QgsMapUnitScale &scale ) FINAL;
599  QgsMapUnitScale mapUnitScale() const FINAL;
600  QgsStringMap properties() const override;
601 
602  protected:
603 
610  virtual void setSymbolLineAngle( double angle ) = 0;
611 
615  virtual double symbolAngle() const = 0;
616 
620  virtual void setSymbolAngle( double angle ) = 0;
621 
634  virtual void renderSymbol( const QPointF &point, const QgsFeature *feature, QgsRenderContext &context, int layer = -1, bool selected = false ) = 0;
635 
639  void copyTemplateSymbolProperties( QgsTemplatedLineSymbolLayerBase *destLayer ) const;
640 
645  static void setCommonProperties( QgsTemplatedLineSymbolLayerBase *destLayer, const QgsStringMap &properties );
646 
647  private:
648 
649  void renderPolylineInterval( const QPolygonF &points, QgsSymbolRenderContext &context, double averageAngleOver );
650  void renderPolylineVertex( const QPolygonF &points, QgsSymbolRenderContext &context, QgsTemplatedLineSymbolLayerBase::Placement placement = QgsTemplatedLineSymbolLayerBase::Vertex );
651  void renderPolylineCentral( const QPolygonF &points, QgsSymbolRenderContext &context, double averageAngleOver );
652  double markerAngle( const QPolygonF &points, bool isRing, int vertex );
653 
665  void renderOffsetVertexAlongLine( const QPolygonF &points, int vertex, double distance, QgsSymbolRenderContext &context );
666 
667 
668  static void collectOffsetPoints( const QVector< QPointF> &points,
669  QVector< QPointF> &dest, double intervalPainterUnits, double initialOffset, double initialLag = 0,
670  int numberPointsRequired = -1 );
671 
672  bool mRotateSymbols = true;
673  double mInterval = 3;
674  QgsUnitTypes::RenderUnit mIntervalUnit = QgsUnitTypes::RenderMillimeters;
675  QgsMapUnitScale mIntervalMapUnitScale;
676  Placement mPlacement = Interval;
677  double mOffsetAlongLine = 0; //distance to offset along line before marker is drawn
678  QgsUnitTypes::RenderUnit mOffsetAlongLineUnit = QgsUnitTypes::RenderMillimeters; //unit for offset along line
679  QgsMapUnitScale mOffsetAlongLineMapUnitScale;
680  double mAverageAngleLength = 4;
681  QgsUnitTypes::RenderUnit mAverageAngleLengthUnit = QgsUnitTypes::RenderMillimeters;
682  QgsMapUnitScale mAverageAngleLengthMapUnitScale;
683 
684  friend class TestQgsMarkerLineSymbol;
685 
686 };
687 
694 {
695  public:
696 
705  double interval = DEFAULT_MARKERLINE_INTERVAL );
706 
707  // static stuff
708 
714  static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;
715 
719  static QgsSymbolLayer *createFromSld( QDomElement &element ) SIP_FACTORY;
720 
721  // implemented from base classes
722 
723  QString layerType() const override;
724  void startRender( QgsSymbolRenderContext &context ) override;
725  void stopRender( QgsSymbolRenderContext &context ) override;
726  QgsMarkerLineSymbolLayer *clone() const override SIP_FACTORY;
727  void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const override;
728  void setColor( const QColor &color ) override;
729  QColor color() const override;
730  QgsSymbol *subSymbol() override;
731  bool setSubSymbol( QgsSymbol *symbol SIP_TRANSFER ) override;
732  void setWidth( double width ) override;
733  double width() const override;
734  double width( const QgsRenderContext &context ) const override;
735  double estimateMaxBleed( const QgsRenderContext &context ) const override;
736  void setOutputUnit( QgsUnitTypes::RenderUnit unit ) override;
737  QSet<QString> usedAttributes( const QgsRenderContext &context ) const override;
738  bool hasDataDefinedProperties() const override;
739  void setDataDefinedProperty( QgsSymbolLayer::Property key, const QgsProperty &property ) override;
740 
747  Q_DECL_DEPRECATED bool rotateMarker() const SIP_DEPRECATED { return rotateSymbols(); }
748 
753  Q_DECL_DEPRECATED void setRotateMarker( bool rotate ) SIP_DEPRECATED { setRotateSymbols( rotate ); }
754 
755  protected:
756 
757  std::unique_ptr< QgsMarkerSymbol > mMarker;
758 
759  void setSymbolLineAngle( double angle ) override;
760  double symbolAngle() const override;
761  void setSymbolAngle( double angle ) override;
762  void renderSymbol( const QPointF &point, const QgsFeature *feature, QgsRenderContext &context, int layer = -1, bool selected = false ) override;
763 
764  private:
765 
766 #ifdef SIP_RUN
768 #endif
769 
770 
771 };
772 
773 
783 {
784  public:
785 
793  QgsHashedLineSymbolLayer( bool rotateSymbol = true,
794  double interval = 3 );
795 
801  static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;
802 
803  QString layerType() const override;
804  void startRender( QgsSymbolRenderContext &context ) override;
805  void stopRender( QgsSymbolRenderContext &context ) override;
806  QgsStringMap properties() const override;
807  QgsHashedLineSymbolLayer *clone() const override SIP_FACTORY;
808  void setColor( const QColor &color ) override;
809  QColor color() const override;
810  QgsSymbol *subSymbol() override;
811  bool setSubSymbol( QgsSymbol *symbol SIP_TRANSFER ) override;
812  void setWidth( double width ) override;
813  double width() const override;
814  double width( const QgsRenderContext &context ) const override;
815  double estimateMaxBleed( const QgsRenderContext &context ) const override;
816  void setOutputUnit( QgsUnitTypes::RenderUnit unit ) override;
817  QSet<QString> usedAttributes( const QgsRenderContext &context ) const override;
818  bool hasDataDefinedProperties() const override;
819  void setDataDefinedProperty( QgsSymbolLayer::Property key, const QgsProperty &property ) override;
820 
826  double hashAngle() const;
827 
833  void setHashAngle( double angle );
834 
840  double hashLength() const { return mHashLength; }
841 
847  void setHashLength( double length ) { mHashLength = length; }
848 
854  void setHashLengthUnit( QgsUnitTypes::RenderUnit unit ) { mHashLengthUnit = unit; }
855 
861  QgsUnitTypes::RenderUnit hashLengthUnit() const { return mHashLengthUnit; }
862 
869  void setHashLengthMapUnitScale( const QgsMapUnitScale &scale ) { mHashLengthMapUnitScale = scale; }
870 
877  const QgsMapUnitScale &hashLengthMapUnitScale() const { return mHashLengthMapUnitScale; }
878 
879  protected:
880 
881  void setSymbolLineAngle( double angle ) override;
882  double symbolAngle() const override;
883  void setSymbolAngle( double angle ) override;
884  void renderSymbol( const QPointF &point, const QgsFeature *feature, QgsRenderContext &context, int layer = -1, bool selected = false ) override;
885 
886  private:
887 #ifdef SIP_RUN
889 #endif
890 
891  std::unique_ptr< QgsLineSymbol > mHashSymbol;
892 
893  double mSymbolLineAngle = 0;
894  double mSymbolAngle = 0;
895 
896  double mHashAngle = 0;
897  double mHashLength = 3;
899  QgsMapUnitScale mHashLengthMapUnitScale;
900 
901 };
902 
903 #endif
904 
905 
QgsLineSymbolLayer
Definition: qgssymbollayer.h:901
QgsSymbolLayer::setSubSymbol
virtual bool setSubSymbol(QgsSymbol *symbol)
Sets layer's subsymbol. takes ownership of the passed symbol.
Definition: qgssymbollayer.h:356
QgsSimpleLineSymbolLayer::dashPatternOffsetMapUnitScale
const QgsMapUnitScale & dashPatternOffsetMapUnitScale() const
Returns the map unit scale the dash pattern offset value.
Definition: qgslinesymbollayer.h:256
QgsSimpleLineSymbolLayer::dashPatternOffset
double dashPatternOffset() const
Returns the dash pattern offset, which dictates how far along the dash pattern the pattern should sta...
Definition: qgslinesymbollayer.h:209
QgsTemplatedLineSymbolLayerBase::setOffsetAlongLine
void setOffsetAlongLine(double offsetAlongLine)
Sets the the offset along the line for the symbol placement.
Definition: qgslinesymbollayer.h:501
QgsTemplatedLineSymbolLayerBase::averageAngleMapUnitScale
const QgsMapUnitScale & averageAngleMapUnitScale() const
Returns the map unit scale for the length over which the line's direction is averaged when calculatin...
Definition: qgslinesymbollayer.h:593
QgsProperty
A store for object properties.
Definition: qgsproperty.h:232
QgsHashedLineSymbolLayer::setHashLengthUnit
void setHashLengthUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the length of hash symbols.
Definition: qgslinesymbollayer.h:854
QgsUnitTypes::RenderUnit
RenderUnit
Rendering size units.
Definition: qgsunittypes.h:167
QgsDxfExport
Definition: qgsdxfexport.h:63
QgsLineSymbolLayer::renderPolyline
virtual void renderPolyline(const QPolygonF &points, QgsSymbolRenderContext &context)=0
Renders the line symbol layer along the line joining points, using the given render context.
QgsSimpleLineSymbolLayer::penCapStyle
Qt::PenCapStyle penCapStyle() const
Returns the pen cap style used to render the line (e.g.
Definition: qgslinesymbollayer.h:120
QgsSymbolLayer::dxfPenStyle
virtual Qt::PenStyle dxfPenStyle() const
Gets pen style.
Definition: qgssymbollayer.cpp:170
QgsLineSymbolLayer::width
virtual double width() const
Returns the estimated width for the line symbol layer.
Definition: qgssymbollayer.h:965
QgsTemplatedLineSymbolLayerBase::offsetAlongLineUnit
QgsUnitTypes::RenderUnit offsetAlongLineUnit() const
Returns the unit used for calculating the offset along line for symbols.
Definition: qgslinesymbollayer.h:509
QgsTemplatedLineSymbolLayerBase::properties
QgsStringMap properties() const override
Should be reimplemented by subclasses to return a string map that contains the configuration informat...
Definition: qgslinesymbollayer.cpp:1295
QgsSymbolLayer::dxfCustomDashPattern
virtual QVector< qreal > dxfCustomDashPattern(QgsUnitTypes::RenderUnit &unit) const
Gets dash pattern.
Definition: qgssymbollayer.cpp:164
QgsHashedLineSymbolLayer
Line symbol layer type which draws repeating line sections along a line feature.
Definition: qgslinesymbollayer.h:783
DEFAULT_MARKERLINE_ROTATE
#define DEFAULT_MARKERLINE_ROTATE
Definition: qgslinesymbollayer.h:368
QgsSimpleLineSymbolLayer::setCustomDashPatternMapUnitScale
void setCustomDashPatternMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for lengths used in the custom dash pattern.
Definition: qgslinesymbollayer.h:167
QgsSimpleLineSymbolLayer::setPenJoinStyle
void setPenJoinStyle(Qt::PenJoinStyle style)
Sets the pen join style used to render the line (e.g.
Definition: qgslinesymbollayer.h:113
QgsSymbolLayer::setColor
virtual void setColor(const QColor &color)
The fill color.
Definition: qgssymbollayer.h:232
QgsSimpleLineSymbolLayer::penJoinStyle
Qt::PenJoinStyle penJoinStyle() const
Returns the pen join style used to render the line (e.g.
Definition: qgslinesymbollayer.h:106
QgsSymbolLayer::color
virtual QColor color() const
The fill color.
Definition: qgssymbollayer.h:227
QgsLineSymbolLayer::setWidth
virtual void setWidth(double width)
Sets the width of the line symbol layer.
Definition: qgssymbollayer.h:954
DEFAULT_MARKERLINE_INTERVAL
#define DEFAULT_MARKERLINE_INTERVAL
Definition: qgslinesymbollayer.h:369
QgsTemplatedLineSymbolLayerBase::renderSymbol
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.
QgsSymbolLayer::hasDataDefinedProperties
virtual bool hasDataDefinedProperties() const
Returns true if the symbol layer (or any of its sub-symbols) contains data defined properties.
Definition: qgssymbollayer.cpp:216
QgsHashedLineSymbolLayer::setHashLengthMapUnitScale
void setHashLengthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the hash length.
Definition: qgslinesymbollayer.h:869
qgis.h
QgsTemplatedLineSymbolLayerBase::Vertex
@ Vertex
Place symbols on every vertex in the line.
Definition: qgslinesymbollayer.h:390
QgsRenderContext
Contains information about the context of a rendering operation.
Definition: qgsrendercontext.h:58
QgsSimpleLineSymbolLayer::drawInsidePolygon
bool drawInsidePolygon() const
Returns true if the line should only be drawn inside polygons, and any portion of the line which fall...
Definition: qgslinesymbollayer.h:278
QgsHashedLineSymbolLayer::hashLength
double hashLength() const
Returns the length of hash symbols.
Definition: qgslinesymbollayer.h:840
QgsSimpleLineSymbolLayer::useCustomDashPattern
bool useCustomDashPattern() const
Returns true if the line uses a custom dash pattern.
Definition: qgslinesymbollayer.h:135
QgsUnitTypes::RenderMillimeters
@ RenderMillimeters
Millimeters.
Definition: qgsunittypes.h:168
QgsSymbolLayer::estimateMaxBleed
virtual double estimateMaxBleed(const QgsRenderContext &context) const
Returns the estimated maximum distance which the layer style will bleed outside the drawn shape when ...
Definition: qgssymbollayer.h:373
QgsTemplatedLineSymbolLayerBase::placement
Placement placement() const
Returns the placement of the symbols.
Definition: qgslinesymbollayer.h:470
QgsSimpleLineSymbolLayer::setDashPatternOffsetUnit
void setDashPatternOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the dash pattern offset.
Definition: qgslinesymbollayer.h:234
QgsLineSymbolLayer::outputUnit
QgsUnitTypes::RenderUnit outputUnit() const override
Returns the units to use for sizes and widths within the symbol layer.
Definition: qgssymbollayer.cpp:645
QgsSymbol
Abstract base class for all rendered symbols.
Definition: qgssymbol.h:64
QgsSimpleLineSymbolLayer::setUseCustomDashPattern
void setUseCustomDashPattern(bool b)
Sets whether the line uses a custom dash pattern.
Definition: qgslinesymbollayer.h:143
QgsMarkerLineSymbolLayer
Line symbol layer type which draws repeating marker symbols along a line feature.
Definition: qgslinesymbollayer.h:694
QgsTemplatedLineSymbolLayerBase::CurvePoint
@ CurvePoint
Place symbols at every virtual curve point in the line (used when rendering curved geometry types onl...
Definition: qgslinesymbollayer.h:394
QgsSymbolLayer::ogrFeatureStyle
virtual QString ogrFeatureStyle(double mmScaleFactor, double mapUnitScaleFactor) const
Definition: qgssymbollayer.h:339
FINAL
#define FINAL
Definition: qgis_sip.h:228
QgsSimpleLineSymbolLayer::customDashVector
QVector< qreal > customDashVector() const
Returns the custom dash vector, which is the pattern of alternating drawn/skipped lengths used while ...
Definition: qgslinesymbollayer.h:181
QgsLineSymbolLayer::mapUnitScale
QgsMapUnitScale mapUnitScale() const override
Definition: qgssymbollayer.cpp:655
QgsTemplatedLineSymbolLayerBase::setPlacement
void setPlacement(Placement placement)
Sets the placement of the symbols.
Definition: qgslinesymbollayer.h:476
QgsSymbolLayer::properties
virtual QgsStringMap properties() const =0
Should be reimplemented by subclasses to return a string map that contains the configuration informat...
DEFAULT_SIMPLELINE_CAPSTYLE
#define DEFAULT_SIMPLELINE_CAPSTYLE
Definition: qgslinesymbollayer.h:32
QgsTemplatedLineSymbolLayerBase::Placement
Placement
Defines how/where the templated symbol should be placed on the line.
Definition: qgslinesymbollayer.h:388
SIP_FACTORY
#define SIP_FACTORY
Definition: qgis_sip.h:76
DEFAULT_SIMPLELINE_COLOR
#define DEFAULT_SIMPLELINE_COLOR
Definition: qgslinesymbollayer.h:28
QgsSimpleLineSymbolLayer::setCustomDashVector
void setCustomDashVector(const QVector< qreal > &vector)
Sets the custom dash vector, which is the pattern of alternating drawn/skipped lengths used while ren...
Definition: qgslinesymbollayer.h:195
QgsTemplatedLineSymbolLayerBase::setIntervalMapUnitScale
void setIntervalMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the interval between symbols.
Definition: qgslinesymbollayer.h:456
QgsSimpleLineSymbolLayer::penStyle
Qt::PenStyle penStyle() const
Returns the pen style used to render the line (e.g.
Definition: qgslinesymbollayer.h:92
QgsTemplatedLineSymbolLayerBase::setInterval
void setInterval(double interval)
Sets the interval between individual symbols.
Definition: qgslinesymbollayer.h:433
DEFAULT_SIMPLELINE_JOINSTYLE
#define DEFAULT_SIMPLELINE_JOINSTYLE
Definition: qgslinesymbollayer.h:31
QgsSymbolRenderContext
Definition: qgssymbol.h:695
SIP_DEPRECATED
#define SIP_DEPRECATED
Definition: qgis_sip.h:106
QgsSimpleLineSymbolLayer::customDashPatternMapUnitScale
const QgsMapUnitScale & customDashPatternMapUnitScale() const
Returns the map unit scale for lengths used in the custom dash pattern.
Definition: qgslinesymbollayer.h:161
QgsSymbolLayer::clone
virtual QgsSymbolLayer * clone() const =0
Shall be reimplemented by subclasses to create a deep copy of the instance.
QgsSimpleLineSymbolLayer::setPenStyle
void setPenStyle(Qt::PenStyle style)
Sets the pen style used to render the line (e.g.
Definition: qgslinesymbollayer.h:99
QgsSymbolLayer
Definition: qgssymbollayer.h:53
QgsHashedLineSymbolLayer::hashLengthUnit
QgsUnitTypes::RenderUnit hashLengthUnit() const
Returns the units for the length of hash symbols.
Definition: qgslinesymbollayer.h:861
QgsTemplatedLineSymbolLayerBase::SegmentCenter
@ SegmentCenter
Place symbols at the center of every line segment.
Definition: qgslinesymbollayer.h:395
QgsSymbolLayer::dxfOffset
virtual double dxfOffset(const QgsDxfExport &e, QgsSymbolRenderContext &context) const
Gets offset.
Definition: qgssymbollayer.cpp:145
QgsTemplatedLineSymbolLayerBase::setOffsetAlongLineUnit
void setOffsetAlongLineUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit used for calculating the offset along line for symbols.
Definition: qgslinesymbollayer.h:517
QgsHashedLineSymbolLayer::setHashLength
void setHashLength(double length)
Sets the length of hash symbols.
Definition: qgslinesymbollayer.h:847
QgsTemplatedLineSymbolLayerBase::setAverageAngleMapUnitScale
void setAverageAngleMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the length over which the line's direction is averaged when calculating i...
Definition: qgslinesymbollayer.h:583
QgsSimpleLineSymbolLayer
A simple line symbol layer, which renders lines using a line in a variety of styles (e....
Definition: qgslinesymbollayer.h:40
QgsTemplatedLineSymbolLayerBase::intervalMapUnitScale
const QgsMapUnitScale & intervalMapUnitScale() const
Returns the map unit scale for the interval between symbols.
Definition: qgslinesymbollayer.h:464
QgsSimpleLineSymbolLayer::customDashPatternUnit
QgsUnitTypes::RenderUnit customDashPatternUnit() const
Returns the units for lengths used in the custom dash pattern.
Definition: qgslinesymbollayer.h:155
QgsMarkerLineSymbolLayer::setRotateMarker
Q_DECL_DEPRECATED void setRotateMarker(bool rotate)
Shall the marker be rotated.
Definition: qgslinesymbollayer.h:753
QgsLineSymbolLayer::dxfWidth
double dxfWidth(const QgsDxfExport &e, QgsSymbolRenderContext &context) const override
Gets line width.
Definition: qgssymbollayer.cpp:714
QgsLineSymbolLayer::renderPolygonStroke
virtual void renderPolygonStroke(const QPolygonF &points, const QVector< QPolygonF > *rings, QgsSymbolRenderContext &context)
Renders the line symbol layer along the outline of polygon, using the given render context.
Definition: qgssymbollayer.cpp:680
SIP_TRANSFER
#define SIP_TRANSFER
Definition: qgis_sip.h:36
QgsTemplatedLineSymbolLayerBase::interval
double interval() const
Returns the interval between individual symbols.
Definition: qgslinesymbollayer.h:425
QgsSimpleLineSymbolLayer::setPenCapStyle
void setPenCapStyle(Qt::PenCapStyle style)
Sets the pen cap style used to render the line (e.g.
Definition: qgslinesymbollayer.h:127
QgsTemplatedLineSymbolLayerBase::offsetAlongLine
double offsetAlongLine() const
Returns the offset along the line for the symbol placement.
Definition: qgslinesymbollayer.h:488
QgsTemplatedLineSymbolLayerBase::setSymbolAngle
virtual void setSymbolAngle(double angle)=0
Sets the symbol's angle, in degrees clockwise.
QgsSimpleLineSymbolLayer::setDrawInsidePolygon
void setDrawInsidePolygon(bool drawInsidePolygon)
Sets whether the line should only be drawn inside polygons, and any portion of the line which falls o...
Definition: qgslinesymbollayer.h:289
QgsUnitTypes
Helper functions for various unit types.
Definition: qgsunittypes.h:39
DEFAULT_SIMPLELINE_WIDTH
#define DEFAULT_SIMPLELINE_WIDTH
Definition: qgslinesymbollayer.h:29
QgsTemplatedLineSymbolLayerBase::offsetAlongLineMapUnitScale
const QgsMapUnitScale & offsetAlongLineMapUnitScale() const
Returns the map unit scale used for calculating the offset in map units along line for symbols.
Definition: qgslinesymbollayer.h:523
QgsTemplatedLineSymbolLayerBase::Interval
@ Interval
Place symbols at regular intervals.
Definition: qgslinesymbollayer.h:389
qgssymbollayer.h
DEFAULT_SIMPLELINE_PENSTYLE
#define DEFAULT_SIMPLELINE_PENSTYLE
Definition: qgslinesymbollayer.h:30
QgsMapUnitScale
Struct for storing maximum and minimum scales for measurements in map units.
Definition: qgsmapunitscale.h:38
QgsTemplatedLineSymbolLayerBase::averageAngleLength
double averageAngleLength() const
Returns the length of line over which the line's direction is averaged when calculating individual sy...
Definition: qgslinesymbollayer.h:541
QgsTemplatedLineSymbolLayerBase
Base class for templated line symbols, e.g.
Definition: qgslinesymbollayer.h:381
QgsSimpleLineSymbolLayer::setDashPatternOffset
void setDashPatternOffset(double offset)
Sets the dash pattern offset, which dictates how far along the dash pattern the pattern should start ...
Definition: qgslinesymbollayer.h:223
QgsSymbolLayer::subSymbol
virtual QgsSymbol * subSymbol()
Returns the symbol's sub symbol, if present.
Definition: qgssymbollayer.h:353
QgsTemplatedLineSymbolLayerBase::setOffsetAlongLineMapUnitScale
void setOffsetAlongLineMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale used for calculating the offset in map units along line for symbols.
Definition: qgslinesymbollayer.h:529
QgsSymbolLayer::usedAttributes
virtual QSet< QString > usedAttributes(const QgsRenderContext &context) const
Returns the set of attributes referenced by the layer.
Definition: qgssymbollayer.cpp:247
QgsTemplatedLineSymbolLayerBase::setAverageAngleLength
void setAverageAngleLength(double length)
Sets the length of line over which the line's direction is averaged when calculating individual symbo...
Definition: qgslinesymbollayer.h:553
QgsStringMap
QMap< QString, QString > QgsStringMap
Definition: qgis.h:758
QgsSimpleLineSymbolLayer::setDashPatternOffsetMapUnitScale
void setDashPatternOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the dash pattern offset.
Definition: qgslinesymbollayer.h:267
QgsHashedLineSymbolLayer::hashLengthMapUnitScale
const QgsMapUnitScale & hashLengthMapUnitScale() const
Returns the map unit scale for the hash length.
Definition: qgslinesymbollayer.h:877
QgsTemplatedLineSymbolLayerBase::setRotateSymbols
void setRotateSymbols(bool rotate)
Sets whether the repeating symbols should be rotated to match their line segment orientation.
Definition: qgslinesymbollayer.h:418
QgsTemplatedLineSymbolLayerBase::LastVertex
@ LastVertex
Place symbols on the last vertex in the line.
Definition: qgslinesymbollayer.h:391
QgsTemplatedLineSymbolLayerBase::setSymbolLineAngle
virtual void setSymbolLineAngle(double angle)=0
Sets the line angle modification for the symbol's angle.
QgsTemplatedLineSymbolLayerBase::rotateSymbols
bool rotateSymbols() const
Returns true if the repeating symbols be rotated to match their line segment orientation.
Definition: qgslinesymbollayer.h:412
QgsLineSymbolLayer::setOutputUnit
void setOutputUnit(QgsUnitTypes::RenderUnit unit) override
Sets the units to use for sizes and widths within the symbol layer.
Definition: qgssymbollayer.cpp:640
QgsSymbolLayer::stopRender
virtual void stopRender(QgsSymbolRenderContext &context)=0
Called after a set of rendering operations has finished on the supplied render context.
QgsSymbolLayer::Property
Property
Data definable properties.
Definition: qgssymbollayer.h:131
QgsSymbolLayer::dxfColor
virtual QColor dxfColor(QgsSymbolRenderContext &context) const
Gets color.
Definition: qgssymbollayer.cpp:152
QgsSymbolLayer::layerType
virtual QString layerType() const =0
Returns a string that represents this layer type.
QgsFeature
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition: qgsfeature.h:56
QgsMarkerLineSymbolLayer::mMarker
std::unique_ptr< QgsMarkerSymbol > mMarker
Definition: qgslinesymbollayer.h:757
QgsLineSymbolLayer::offset
double offset() const
Returns the line's offset.
Definition: qgssymbollayer.h:988
QgsTemplatedLineSymbolLayerBase::FirstVertex
@ FirstVertex
Place symbols on the first vertex in the line.
Definition: qgslinesymbollayer.h:392
QgsSymbolLayer::toSld
virtual void toSld(QDomDocument &doc, QDomElement &element, const QgsStringMap &props) const
Definition: qgssymbollayer.h:336
QgsSymbolLayer::startRender
virtual void startRender(QgsSymbolRenderContext &context)=0
Called before a set of rendering operations commences on the supplied render context.
QgsTemplatedLineSymbolLayerBase::intervalUnit
QgsUnitTypes::RenderUnit intervalUnit() const
Returns the units for the interval between symbols.
Definition: qgslinesymbollayer.h:448
QgsSimpleLineSymbolLayer::setCustomDashPatternUnit
void setCustomDashPatternUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for lengths used in the custom dash pattern.
Definition: qgslinesymbollayer.h:149
QgsExpression
Class for parsing and evaluation of expressions (formerly called "search strings").
Definition: qgsexpression.h:105
MathUtils::angle
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
QgsTemplatedLineSymbolLayerBase::symbolAngle
virtual double symbolAngle() const =0
Returns the symbol's current angle, in degrees clockwise.
QgsTemplatedLineSymbolLayerBase::CentralPoint
@ CentralPoint
Place symbols at the mid point of the line.
Definition: qgslinesymbollayer.h:393
QgsTemplatedLineSymbolLayerBase::setAverageAngleUnit
void setAverageAngleUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the length over which the line's direction is averaged when calculating individual ...
Definition: qgslinesymbollayer.h:563
QgsMarkerLineSymbolLayer::rotateMarker
Q_DECL_DEPRECATED bool rotateMarker() const
Shall the marker be rotated.
Definition: qgslinesymbollayer.h:747
QgsLineSymbolLayer::setMapUnitScale
void setMapUnitScale(const QgsMapUnitScale &scale) override
Definition: qgssymbollayer.cpp:650
QgsSymbolLayer::setDataDefinedProperty
virtual void setDataDefinedProperty(Property key, const QgsProperty &property)
Sets a data defined property for the layer.
Definition: qgssymbollayer.cpp:113
QgsSimpleLineSymbolLayer::dashPatternOffsetUnit
QgsUnitTypes::RenderUnit dashPatternOffsetUnit() const
Returns the units for the dash pattern offset.
Definition: qgslinesymbollayer.h:245
QgsTemplatedLineSymbolLayerBase::averageAngleUnit
QgsUnitTypes::RenderUnit averageAngleUnit() const
Returns the unit for the length over which the line's direction is averaged when calculating individu...
Definition: qgslinesymbollayer.h:573
QgsTemplatedLineSymbolLayerBase::setIntervalUnit
void setIntervalUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the interval between symbols.
Definition: qgslinesymbollayer.h:441