QGIS API Documentation  3.14.0-Pi (9f7028fd23)
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 
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  {
270  };
271 
279  QgsTemplatedLineSymbolLayerBase( bool rotateSymbol = true,
280  double interval = 3 );
281 
286  bool rotateSymbols() const { return mRotateSymbols; }
287 
292  void setRotateSymbols( bool rotate ) { mRotateSymbols = rotate; }
293 
299  double interval() const { return mInterval; }
300 
307  void setInterval( double interval ) { mInterval = interval; }
308 
315  void setIntervalUnit( QgsUnitTypes::RenderUnit unit ) { mIntervalUnit = unit; }
316 
322  QgsUnitTypes::RenderUnit intervalUnit() const { return mIntervalUnit; }
323 
330  void setIntervalMapUnitScale( const QgsMapUnitScale &scale ) { mIntervalMapUnitScale = scale; }
331 
338  const QgsMapUnitScale &intervalMapUnitScale() const { return mIntervalMapUnitScale; }
339 
344  Placement placement() const { return mPlacement; }
345 
350  void setPlacement( Placement placement ) { mPlacement = placement; }
351 
362  double offsetAlongLine() const { return mOffsetAlongLine; }
363 
375  void setOffsetAlongLine( double offsetAlongLine ) { mOffsetAlongLine = offsetAlongLine; }
376 
383  QgsUnitTypes::RenderUnit offsetAlongLineUnit() const { return mOffsetAlongLineUnit; }
384 
391  void setOffsetAlongLineUnit( QgsUnitTypes::RenderUnit unit ) { mOffsetAlongLineUnit = unit; }
392 
397  const QgsMapUnitScale &offsetAlongLineMapUnitScale() const { return mOffsetAlongLineMapUnitScale; }
398 
403  void setOffsetAlongLineMapUnitScale( const QgsMapUnitScale &scale ) { mOffsetAlongLineMapUnitScale = scale; }
404 
415  double averageAngleLength() const { return mAverageAngleLength; }
416 
427  void setAverageAngleLength( double length ) { mAverageAngleLength = length; }
428 
437  void setAverageAngleUnit( QgsUnitTypes::RenderUnit unit ) { mAverageAngleLengthUnit = unit; }
438 
447  QgsUnitTypes::RenderUnit averageAngleUnit() const { return mAverageAngleLengthUnit; }
448 
457  void setAverageAngleMapUnitScale( const QgsMapUnitScale &scale ) { mAverageAngleLengthMapUnitScale = scale; }
458 
467  const QgsMapUnitScale &averageAngleMapUnitScale() const { return mAverageAngleLengthMapUnitScale; }
468 
469  void renderPolyline( const QPolygonF &points, QgsSymbolRenderContext &context ) FINAL;
470  void renderPolygonStroke( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context ) FINAL;
472  void setMapUnitScale( const QgsMapUnitScale &scale ) FINAL;
473  QgsMapUnitScale mapUnitScale() const FINAL;
474  QgsStringMap properties() const override;
475 
476  protected:
477 
484  virtual void setSymbolLineAngle( double angle ) = 0;
485 
489  virtual double symbolAngle() const = 0;
490 
494  virtual void setSymbolAngle( double angle ) = 0;
495 
508  virtual void renderSymbol( const QPointF &point, const QgsFeature *feature, QgsRenderContext &context, int layer = -1, bool selected = false ) = 0;
509 
513  void copyTemplateSymbolProperties( QgsTemplatedLineSymbolLayerBase *destLayer ) const;
514 
519  static void setCommonProperties( QgsTemplatedLineSymbolLayerBase *destLayer, const QgsStringMap &properties );
520 
521  private:
522 
523  void renderPolylineInterval( const QPolygonF &points, QgsSymbolRenderContext &context, double averageAngleOver );
524  void renderPolylineVertex( const QPolygonF &points, QgsSymbolRenderContext &context, QgsTemplatedLineSymbolLayerBase::Placement placement = QgsTemplatedLineSymbolLayerBase::Vertex );
525  void renderPolylineCentral( const QPolygonF &points, QgsSymbolRenderContext &context, double averageAngleOver );
526  double markerAngle( const QPolygonF &points, bool isRing, int vertex );
527 
539  void renderOffsetVertexAlongLine( const QPolygonF &points, int vertex, double distance, QgsSymbolRenderContext &context );
540 
541 
542  static void collectOffsetPoints( const QVector< QPointF> &points,
543  QVector< QPointF> &dest, double intervalPainterUnits, double initialOffset, double initialLag = 0,
544  int numberPointsRequired = -1 );
545 
546  bool mRotateSymbols = true;
547  double mInterval = 3;
548  QgsUnitTypes::RenderUnit mIntervalUnit = QgsUnitTypes::RenderMillimeters;
549  QgsMapUnitScale mIntervalMapUnitScale;
550  Placement mPlacement = Interval;
551  double mOffsetAlongLine = 0; //distance to offset along line before marker is drawn
552  QgsUnitTypes::RenderUnit mOffsetAlongLineUnit = QgsUnitTypes::RenderMillimeters; //unit for offset along line
553  QgsMapUnitScale mOffsetAlongLineMapUnitScale;
554  double mAverageAngleLength = 4;
555  QgsUnitTypes::RenderUnit mAverageAngleLengthUnit = QgsUnitTypes::RenderMillimeters;
556  QgsMapUnitScale mAverageAngleLengthMapUnitScale;
557 
558  friend class TestQgsMarkerLineSymbol;
559 
560 };
561 
568 {
569  public:
570 
579  double interval = DEFAULT_MARKERLINE_INTERVAL );
580 
581  // static stuff
582 
588  static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;
589 
593  static QgsSymbolLayer *createFromSld( QDomElement &element ) SIP_FACTORY;
594 
595  // implemented from base classes
596 
597  QString layerType() const override;
598  void startRender( QgsSymbolRenderContext &context ) override;
599  void stopRender( QgsSymbolRenderContext &context ) override;
600  QgsMarkerLineSymbolLayer *clone() const override SIP_FACTORY;
601  void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const override;
602  void setColor( const QColor &color ) override;
603  QColor color() const override;
604  QgsSymbol *subSymbol() override;
605  bool setSubSymbol( QgsSymbol *symbol SIP_TRANSFER ) override;
606  void setWidth( double width ) override;
607  double width() const override;
608  double width( const QgsRenderContext &context ) const override;
609  double estimateMaxBleed( const QgsRenderContext &context ) const override;
610  void setOutputUnit( QgsUnitTypes::RenderUnit unit ) override;
611  QSet<QString> usedAttributes( const QgsRenderContext &context ) const override;
612  bool hasDataDefinedProperties() const override;
613  void setDataDefinedProperty( QgsSymbolLayer::Property key, const QgsProperty &property ) override;
614 
621  Q_DECL_DEPRECATED bool rotateMarker() const SIP_DEPRECATED { return rotateSymbols(); }
622 
627  Q_DECL_DEPRECATED void setRotateMarker( bool rotate ) SIP_DEPRECATED { setRotateSymbols( rotate ); }
628 
629  protected:
630 
631  std::unique_ptr< QgsMarkerSymbol > mMarker;
632 
633  void setSymbolLineAngle( double angle ) override;
634  double symbolAngle() const override;
635  void setSymbolAngle( double angle ) override;
636  void renderSymbol( const QPointF &point, const QgsFeature *feature, QgsRenderContext &context, int layer = -1, bool selected = false ) override;
637 
638  private:
639 
640 #ifdef SIP_RUN
642 #endif
643 
644 
645 };
646 
647 
657 {
658  public:
659 
667  QgsHashedLineSymbolLayer( bool rotateSymbol = true,
668  double interval = 3 );
669 
675  static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;
676 
677  QString layerType() const override;
678  void startRender( QgsSymbolRenderContext &context ) override;
679  void stopRender( QgsSymbolRenderContext &context ) override;
680  QgsStringMap properties() const override;
681  QgsHashedLineSymbolLayer *clone() const override SIP_FACTORY;
682  void setColor( const QColor &color ) override;
683  QColor color() const override;
684  QgsSymbol *subSymbol() override;
685  bool setSubSymbol( QgsSymbol *symbol SIP_TRANSFER ) override;
686  void setWidth( double width ) override;
687  double width() const override;
688  double width( const QgsRenderContext &context ) const override;
689  double estimateMaxBleed( const QgsRenderContext &context ) const override;
690  void setOutputUnit( QgsUnitTypes::RenderUnit unit ) override;
691  QSet<QString> usedAttributes( const QgsRenderContext &context ) const override;
692  bool hasDataDefinedProperties() const override;
693  void setDataDefinedProperty( QgsSymbolLayer::Property key, const QgsProperty &property ) override;
694 
700  double hashAngle() const;
701 
707  void setHashAngle( double angle );
708 
714  double hashLength() const { return mHashLength; }
715 
721  void setHashLength( double length ) { mHashLength = length; }
722 
728  void setHashLengthUnit( QgsUnitTypes::RenderUnit unit ) { mHashLengthUnit = unit; }
729 
735  QgsUnitTypes::RenderUnit hashLengthUnit() const { return mHashLengthUnit; }
736 
743  void setHashLengthMapUnitScale( const QgsMapUnitScale &scale ) { mHashLengthMapUnitScale = scale; }
744 
751  const QgsMapUnitScale &hashLengthMapUnitScale() const { return mHashLengthMapUnitScale; }
752 
753  protected:
754 
755  void setSymbolLineAngle( double angle ) override;
756  double symbolAngle() const override;
757  void setSymbolAngle( double angle ) override;
758  void renderSymbol( const QPointF &point, const QgsFeature *feature, QgsRenderContext &context, int layer = -1, bool selected = false ) override;
759 
760  private:
761 #ifdef SIP_RUN
763 #endif
764 
765  std::unique_ptr< QgsLineSymbol > mHashSymbol;
766 
767  double mSymbolLineAngle = 0;
768  double mSymbolAngle = 0;
769 
770  double mHashAngle = 0;
771  double mHashLength = 3;
773  QgsMapUnitScale mHashLengthMapUnitScale;
774 
775 };
776 
777 #endif
778 
779 
QgsLineSymbolLayer
Definition: qgssymbollayer.h:894
QgsSymbolLayer::setSubSymbol
virtual bool setSubSymbol(QgsSymbol *symbol)
Sets layer's subsymbol. takes ownership of the passed symbol.
Definition: qgssymbollayer.h:351
QgsTemplatedLineSymbolLayerBase::setOffsetAlongLine
void setOffsetAlongLine(double offsetAlongLine)
Sets the the offset along the line for the symbol placement.
Definition: qgslinesymbollayer.h:375
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:467
QgsProperty
A store for object properties.
Definition: qgsproperty.h:231
QgsHashedLineSymbolLayer::setHashLengthUnit
void setHashLengthUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the length of hash symbols.
Definition: qgslinesymbollayer.h:728
QgsUnitTypes::RenderUnit
RenderUnit
Rendering size units.
Definition: qgsunittypes.h:166
QgsDxfExport
Definition: qgsdxfexport.h:62
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:169
QgsLineSymbolLayer::width
virtual double width() const
Returns the estimated width for the line symbol layer.
Definition: qgssymbollayer.h:959
QgsTemplatedLineSymbolLayerBase::offsetAlongLineUnit
QgsUnitTypes::RenderUnit offsetAlongLineUnit() const
Returns the unit used for calculating the offset along line for symbols.
Definition: qgslinesymbollayer.h:383
QgsTemplatedLineSymbolLayerBase::properties
QgsStringMap properties() const override
Should be reimplemented by subclasses to return a string map that contains the configuration informat...
Definition: qgslinesymbollayer.cpp:949
QgsSymbolLayer::dxfCustomDashPattern
virtual QVector< qreal > dxfCustomDashPattern(QgsUnitTypes::RenderUnit &unit) const
Gets dash pattern.
Definition: qgssymbollayer.cpp:163
QgsHashedLineSymbolLayer
Definition: qgslinesymbollayer.h:656
DEFAULT_MARKERLINE_ROTATE
#define DEFAULT_MARKERLINE_ROTATE
Definition: qgslinesymbollayer.h:242
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:231
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:226
QgsLineSymbolLayer::setWidth
virtual void setWidth(double width)
Sets the width of the line symbol layer.
Definition: qgssymbollayer.h:948
DEFAULT_MARKERLINE_INTERVAL
#define DEFAULT_MARKERLINE_INTERVAL
Definition: qgslinesymbollayer.h:243
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:215
QgsHashedLineSymbolLayer::setHashLengthMapUnitScale
void setHashLengthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the hash length.
Definition: qgslinesymbollayer.h:743
qgis.h
QgsTemplatedLineSymbolLayerBase::Vertex
@ Vertex
Place symbols on every vertex in the line.
Definition: qgslinesymbollayer.h:264
QgsRenderContext
Definition: qgsrendercontext.h:57
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:206
QgsHashedLineSymbolLayer::hashLength
double hashLength() const
Returns the length of hash symbols.
Definition: qgslinesymbollayer.h:714
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:367
QgsTemplatedLineSymbolLayerBase::placement
Placement placement() const
Returns the placement of the symbols.
Definition: qgslinesymbollayer.h:344
QgsLineSymbolLayer::outputUnit
QgsUnitTypes::RenderUnit outputUnit() const override
Returns the units to use for sizes and widths within the symbol layer.
Definition: qgssymbollayer.cpp:641
QgsSymbol
Definition: qgssymbol.h:63
QgsSimpleLineSymbolLayer::setUseCustomDashPattern
void setUseCustomDashPattern(bool b)
Sets whether the line uses a custom dash pattern.
Definition: qgslinesymbollayer.h:143
QgsMarkerLineSymbolLayer
Definition: qgslinesymbollayer.h:567
QgsTemplatedLineSymbolLayerBase::CurvePoint
@ CurvePoint
Place symbols at every virtual curve point in the line (used when rendering curved geometry types onl...
Definition: qgslinesymbollayer.h:268
QgsSymbolLayer::ogrFeatureStyle
virtual QString ogrFeatureStyle(double mmScaleFactor, double mapUnitScaleFactor) const
Definition: qgssymbollayer.h:334
FINAL
#define FINAL
Definition: qgis_sip.h:223
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:651
QgsTemplatedLineSymbolLayerBase::setPlacement
void setPlacement(Placement placement)
Sets the placement of the symbols.
Definition: qgslinesymbollayer.h:350
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:261
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:330
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:307
DEFAULT_SIMPLELINE_JOINSTYLE
#define DEFAULT_SIMPLELINE_JOINSTYLE
Definition: qgslinesymbollayer.h:31
QgsSymbolRenderContext
Definition: qgssymbol.h:681
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:52
QgsHashedLineSymbolLayer::hashLengthUnit
QgsUnitTypes::RenderUnit hashLengthUnit() const
Returns the units for the length of hash symbols.
Definition: qgslinesymbollayer.h:735
QgsTemplatedLineSymbolLayerBase::SegmentCenter
@ SegmentCenter
Place symbols at the center of every line segment.
Definition: qgslinesymbollayer.h:269
QgsSymbolLayer::dxfOffset
virtual double dxfOffset(const QgsDxfExport &e, QgsSymbolRenderContext &context) const
Gets offset.
Definition: qgssymbollayer.cpp:144
QgsTemplatedLineSymbolLayerBase::setOffsetAlongLineUnit
void setOffsetAlongLineUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit used for calculating the offset along line for symbols.
Definition: qgslinesymbollayer.h:391
QgsHashedLineSymbolLayer::setHashLength
void setHashLength(double length)
Sets the length of hash symbols.
Definition: qgslinesymbollayer.h:721
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:457
QgsSimpleLineSymbolLayer
Definition: qgslinesymbollayer.h:39
QgsTemplatedLineSymbolLayerBase::intervalMapUnitScale
const QgsMapUnitScale & intervalMapUnitScale() const
Returns the map unit scale for the interval between symbols.
Definition: qgslinesymbollayer.h:338
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:627
QgsLineSymbolLayer::dxfWidth
double dxfWidth(const QgsDxfExport &e, QgsSymbolRenderContext &context) const override
Gets line width.
Definition: qgssymbollayer.cpp:710
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:676
SIP_TRANSFER
#define SIP_TRANSFER
Definition: qgis_sip.h:36
QgsTemplatedLineSymbolLayerBase::interval
double interval() const
Returns the interval between individual symbols.
Definition: qgslinesymbollayer.h:299
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:362
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:217
QgsUnitTypes
Helper functions for various unit types.
Definition: qgsunittypes.h:38
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:397
QgsTemplatedLineSymbolLayerBase::Interval
@ Interval
Place symbols at regular intervals.
Definition: qgslinesymbollayer.h:263
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:37
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:415
QgsTemplatedLineSymbolLayerBase
Definition: qgslinesymbollayer.h:254
QgsSymbolLayer::subSymbol
virtual QgsSymbol * subSymbol()
Returns the symbol's sub symbol, if present.
Definition: qgssymbollayer.h:348
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:403
QgsSymbolLayer::usedAttributes
virtual QSet< QString > usedAttributes(const QgsRenderContext &context) const
Returns the set of attributes referenced by the layer.
Definition: qgssymbollayer.cpp:246
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:427
QgsStringMap
QMap< QString, QString > QgsStringMap
Definition: qgis.h:714
QgsHashedLineSymbolLayer::hashLengthMapUnitScale
const QgsMapUnitScale & hashLengthMapUnitScale() const
Returns the map unit scale for the hash length.
Definition: qgslinesymbollayer.h:751
QgsTemplatedLineSymbolLayerBase::setRotateSymbols
void setRotateSymbols(bool rotate)
Sets whether the repeating symbols should be rotated to match their line segment orientation.
Definition: qgslinesymbollayer.h:292
QgsTemplatedLineSymbolLayerBase::LastVertex
@ LastVertex
Place symbols on the last vertex in the line.
Definition: qgslinesymbollayer.h:265
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:286
QgsLineSymbolLayer::setOutputUnit
void setOutputUnit(QgsUnitTypes::RenderUnit unit) override
Sets the units to use for sizes and widths within the symbol layer.
Definition: qgssymbollayer.cpp:636
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:130
QgsSymbolLayer::dxfColor
virtual QColor dxfColor(QgsSymbolRenderContext &context) const
Gets color.
Definition: qgssymbollayer.cpp:151
QgsSymbolLayer::layerType
virtual QString layerType() const =0
Returns a string that represents this layer type.
QgsFeature
Definition: qgsfeature.h:55
QgsMarkerLineSymbolLayer::mMarker
std::unique_ptr< QgsMarkerSymbol > mMarker
Definition: qgslinesymbollayer.h:631
QgsTemplatedLineSymbolLayerBase::FirstVertex
@ FirstVertex
Place symbols on the first vertex in the line.
Definition: qgslinesymbollayer.h:266
QgsSymbolLayer::toSld
virtual void toSld(QDomDocument &doc, QDomElement &element, const QgsStringMap &props) const
Definition: qgssymbollayer.h:331
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:322
QgsSimpleLineSymbolLayer::setCustomDashPatternUnit
void setCustomDashPatternUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for lengths used in the custom dash pattern.
Definition: qgslinesymbollayer.h:149
QgsExpression
Definition: qgsexpression.h:113
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:267
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:437
QgsMarkerLineSymbolLayer::rotateMarker
Q_DECL_DEPRECATED bool rotateMarker() const
Shall the marker be rotated.
Definition: qgslinesymbollayer.h:621
QgsLineSymbolLayer::setMapUnitScale
void setMapUnitScale(const QgsMapUnitScale &scale) override
Definition: qgssymbollayer.cpp:646
QgsSymbolLayer::setDataDefinedProperty
virtual void setDataDefinedProperty(Property key, const QgsProperty &property)
Sets a data defined property for the layer.
Definition: qgssymbollayer.cpp:112
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:447
QgsTemplatedLineSymbolLayerBase::setIntervalUnit
void setIntervalUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the interval between symbols.
Definition: qgslinesymbollayer.h:315