QGIS API Documentation  3.14.0-Pi (9f7028fd23)
qgssymbollayer.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgssymbollayer.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 #ifndef QGSSYMBOLLAYER_H
16 #define QGSSYMBOLLAYER_H
17 
18 #define DEG2RAD(x) ((x)*M_PI/180)
19 #define DEFAULT_SCALE_METHOD QgsSymbol::ScaleDiameter
20 
21 #include "qgis_core.h"
22 // #include "qgis.h"
23 #include <QColor>
24 #include <QMap>
25 #include <QPointF>
26 #include <QSet>
27 #include <QDomDocument>
28 #include <QDomElement>
29 #include <QPainterPath>
30 
31 #include "qgssymbol.h"
32 #include "qgsfields.h"
33 #include "qgspropertycollection.h"
34 #include "qgspainteffect.h"
35 
36 class QPainter;
37 class QSize;
38 class QPolygonF;
39 
40 class QgsDxfExport;
41 class QgsExpression;
43 
44 #ifndef SIP_RUN
45 typedef QMap<QString, QString> QgsStringMap;
46 #endif
47 
52 class CORE_EXPORT QgsSymbolLayer
53 {
54 #ifdef SIP_RUN
55 #include <qgslinesymbollayer.h>
56 #endif
57 
58 
59 #ifdef SIP_RUN
61  switch ( sipCpp->type() )
62  {
63  case QgsSymbol::Marker:
64  if ( sipCpp->layerType() == "EllipseMarker" )
65  sipType = sipType_QgsEllipseSymbolLayer;
66  else if ( sipCpp->layerType() == "FontMarker" )
67  sipType = sipType_QgsFontMarkerSymbolLayer;
68  else if ( sipCpp->layerType() == "SimpleMarker" )
69  sipType = sipType_QgsSimpleMarkerSymbolLayer;
70  else if ( sipCpp->layerType() == "FilledMarker" )
71  sipType = sipType_QgsFilledMarkerSymbolLayer;
72  else if ( sipCpp->layerType() == "SvgMarker" )
73  sipType = sipType_QgsSvgMarkerSymbolLayer;
74  else if ( sipCpp->layerType() == "RasterMarker" )
75  sipType = sipType_QgsRasterMarkerSymbolLayer;
76  else if ( sipCpp->layerType() == "VectorField" )
77  sipType = sipType_QgsVectorFieldSymbolLayer;
78  else if ( sipCpp->layerType() == "MaskMarker" )
79  sipType = sipType_QgsMaskMarkerSymbolLayer;
80  else
81  sipType = sipType_QgsMarkerSymbolLayer;
82  break;
83 
84  case QgsSymbol::Line:
85  if ( sipCpp->layerType() == "MarkerLine" )
86  sipType = sipType_QgsMarkerLineSymbolLayer;
87  else if ( sipCpp->layerType() == "SimpleLine" )
88  sipType = sipType_QgsSimpleLineSymbolLayer;
89  else if ( sipCpp->layerType() == "ArrowLine" )
90  sipType = sipType_QgsArrowSymbolLayer;
91  else
92  sipType = sipType_QgsLineSymbolLayer;
93  break;
94 
95  case QgsSymbol::Fill:
96  if ( sipCpp->layerType() == "SimpleFill" )
97  sipType = sipType_QgsSimpleFillSymbolLayer;
98  else if ( sipCpp->layerType() == "LinePatternFill" )
99  sipType = sipType_QgsLinePatternFillSymbolLayer;
100  else if ( sipCpp->layerType() == "PointPatternFill" )
101  sipType = sipType_QgsPointPatternFillSymbolLayer;
102  else if ( sipCpp->layerType() == "SVGFill" )
103  sipType = sipType_QgsSVGFillSymbolLayer;
104  else if ( sipCpp->layerType() == "RasterFill" )
105  sipType = sipType_QgsRasterFillSymbolLayer;
106  else if ( sipCpp->layerType() == "CentroidFill" )
107  sipType = sipType_QgsCentroidFillSymbolLayer;
108  else if ( sipCpp->layerType() == "GradientFill" )
109  sipType = sipType_QgsGradientFillSymbolLayer;
110  else if ( sipCpp->layerType() == "ShapeburstFill" )
111  sipType = sipType_QgsShapeburstFillSymbolLayer;
112  else if ( sipCpp->layerType() == "RandomMarkerFill" )
113  sipType = sipType_QgsRandomMarkerFillSymbolLayer;
114  else
115  sipType = sipType_QgsFillSymbolLayer;
116  break;
117 
118  case QgsSymbol::Hybrid:
119  sipType = sipType_QgsGeometryGeneratorSymbolLayer;
120  break;
121  }
122  SIP_END
123 #endif
124  public:
125 
130  enum Property
131  {
132  PropertySize = 0,
188  PropertyDensityArea, //<! Density area
191  };
192 
197  static const QgsPropertiesDefinition &propertyDefinitions();
198 
199  virtual ~QgsSymbolLayer();
200 
202  QgsSymbolLayer( const QgsSymbolLayer &other ) = delete;
203 
205  QgsSymbolLayer &operator=( const QgsSymbolLayer &other ) = delete;
206 
212  bool enabled() const { return mEnabled; }
213 
221  void setEnabled( bool enabled ) { mEnabled = enabled; }
222 
226  virtual QColor color() const { return mColor; }
227 
231  virtual void setColor( const QColor &color ) { mColor = color; }
232 
236  virtual void setStrokeColor( const QColor &color ) { Q_UNUSED( color ) }
237 
241  virtual QColor strokeColor() const { return QColor(); }
242 
246  virtual void setFillColor( const QColor &color ) { Q_UNUSED( color ) }
247 
251  virtual QColor fillColor() const { return QColor(); }
252 
257  virtual QString layerType() const = 0;
258 
271  virtual void startRender( QgsSymbolRenderContext &context ) = 0;
272 
284  virtual void stopRender( QgsSymbolRenderContext &context ) = 0;
285 
304  virtual void startFeatureRender( const QgsFeature &feature, QgsRenderContext &context );
305 
324  virtual void stopFeatureRender( const QgsFeature &feature, QgsRenderContext &context );
325 
329  virtual QgsSymbolLayer *clone() const = 0 SIP_FACTORY;
330 
331  virtual void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const
332  { Q_UNUSED( props ) element.appendChild( doc.createComment( QStringLiteral( "SymbolLayerV2 %1 not implemented yet" ).arg( layerType() ) ) ); }
333 
334  virtual QString ogrFeatureStyle( double mmScaleFactor, double mapUnitScaleFactor ) const { Q_UNUSED( mmScaleFactor ) Q_UNUSED( mapUnitScaleFactor ); return QString(); }
335 
341  virtual QgsStringMap properties() const = 0;
342 
343  virtual void drawPreviewIcon( QgsSymbolRenderContext &context, QSize size ) = 0;
344 
348  virtual QgsSymbol *subSymbol() { return nullptr; }
349 
351  virtual bool setSubSymbol( QgsSymbol *symbol SIP_TRANSFER ) { delete symbol; return false; }
352 
353  QgsSymbol::SymbolType type() const { return mType; }
354 
356  virtual bool isCompatibleWithSymbol( QgsSymbol *symbol ) const;
357 
358  void setLocked( bool locked ) { mLocked = locked; }
359  bool isLocked() const { return mLocked; }
360 
367  virtual double estimateMaxBleed( const QgsRenderContext &context ) const { Q_UNUSED( context ) return 0; }
368 
377  virtual void setOutputUnit( QgsUnitTypes::RenderUnit unit ) { Q_UNUSED( unit ) }
378 
388 
389  virtual void setMapUnitScale( const QgsMapUnitScale &scale ) { Q_UNUSED( scale ) }
390  virtual QgsMapUnitScale mapUnitScale() const { return QgsMapUnitScale(); }
391 
398  void setRenderingPass( int renderingPass );
399 
406  int renderingPass() const;
407 
412  virtual QSet<QString> usedAttributes( const QgsRenderContext &context ) const;
413 
421  virtual void setDataDefinedProperty( Property key, const QgsProperty &property );
422 
424  virtual bool writeDxf( QgsDxfExport &e, double mmMapUnitScaleFactor, const QString &layerName, QgsSymbolRenderContext &context, QPointF shift = QPointF( 0.0, 0.0 ) ) const;
425 
427  virtual double dxfWidth( const QgsDxfExport &e, QgsSymbolRenderContext &context ) const;
428 
430  virtual double dxfOffset( const QgsDxfExport &e, QgsSymbolRenderContext &context ) const;
431 
433  virtual QColor dxfColor( QgsSymbolRenderContext &context ) const;
434 
436  virtual double dxfAngle( QgsSymbolRenderContext &context ) const;
437 
439  virtual QVector<qreal> dxfCustomDashPattern( QgsUnitTypes::RenderUnit &unit ) const;
440 
442  virtual Qt::PenStyle dxfPenStyle() const;
443 
445  virtual QColor dxfBrushColor( QgsSymbolRenderContext &context ) const;
446 
448  virtual Qt::BrushStyle dxfBrushStyle() const;
449 
456  QgsPaintEffect *paintEffect() const;
457 
464  void setPaintEffect( QgsPaintEffect *effect SIP_TRANSFER );
465 
472  virtual void prepareExpressions( const QgsSymbolRenderContext &context );
473 
480  QgsPropertyCollection &dataDefinedProperties() { return mDataDefinedProperties; }
481 
487  const QgsPropertyCollection &dataDefinedProperties() const { return mDataDefinedProperties; } SIP_SKIP
488 
495  void setDataDefinedProperties( const QgsPropertyCollection &collection ) { mDataDefinedProperties = collection; }
496 
502  virtual bool hasDataDefinedProperties() const;
503 
509  virtual QgsSymbolLayerReferenceList masks() const;
510 
511  protected:
512 
513  QgsSymbolLayer( QgsSymbol::SymbolType type, bool locked = false );
514 
516 
518  bool mEnabled = true;
519 
520  bool mLocked = false;
521  QColor mColor;
522  int mRenderingPass = 0;
523 
525 
526  std::unique_ptr< QgsPaintEffect > mPaintEffect;
528 
529  // Configuration of selected symbology implementation
531  static const bool SELECTION_IS_OPAQUE = true;
533  static const bool SELECT_FILL_BORDER = false;
535  static const bool SELECT_FILL_STYLE = false;
536 
541  void restoreOldDataDefinedProperties( const QgsStringMap &stringMap );
542 
547  void copyDataDefinedProperties( QgsSymbolLayer *destLayer ) const;
548 
554  void copyPaintEffect( QgsSymbolLayer *destLayer ) const;
555 
556  private:
557  static void initPropertyDefinitions();
558 
560  static QgsPropertiesDefinition sPropertyDefinitions;
561 
562 #ifdef SIP_RUN
563  QgsSymbolLayer( const QgsSymbolLayer &other );
564 #endif
565 
566 };
567 
569 
575 class CORE_EXPORT QgsMarkerSymbolLayer : public QgsSymbolLayer
576 {
577  public:
578 
581  {
585  };
586 
589  {
590  Top,
593  };
594 
596  QgsMarkerSymbolLayer( const QgsMarkerSymbolLayer &other ) = delete;
597 
599  QgsMarkerSymbolLayer &operator=( const QgsMarkerSymbolLayer &other ) = delete;
600 
601  void startRender( QgsSymbolRenderContext &context ) override;
602 
603  void stopRender( QgsSymbolRenderContext &context ) override;
604 
611  virtual void renderPoint( QPointF point, QgsSymbolRenderContext &context ) = 0;
612 
613  void drawPreviewIcon( QgsSymbolRenderContext &context, QSize size ) override;
614 
621  void setAngle( double angle ) { mAngle = angle; }
622 
627  double angle() const { return mAngle; }
628 
638  void setLineAngle( double lineAngle ) { mLineAngle = lineAngle; }
639 
647  virtual void setSize( double size ) { mSize = size; }
648 
655  double size() const { return mSize; }
656 
664  void setSizeUnit( QgsUnitTypes::RenderUnit unit ) { mSizeUnit = unit; }
665 
672  QgsUnitTypes::RenderUnit sizeUnit() const { return mSizeUnit; }
673 
681  void setSizeMapUnitScale( const QgsMapUnitScale &scale ) { mSizeMapUnitScale = scale; }
682 
689  const QgsMapUnitScale &sizeMapUnitScale() const { return mSizeMapUnitScale; }
690 
696  void setScaleMethod( QgsSymbol::ScaleMethod scaleMethod ) { mScaleMethod = scaleMethod; }
697 
702  QgsSymbol::ScaleMethod scaleMethod() const { return mScaleMethod; }
703 
712  void setOffset( QPointF offset ) { mOffset = offset; }
713 
721  QPointF offset() const { return mOffset; }
722 
730  void setOffsetUnit( QgsUnitTypes::RenderUnit unit ) { mOffsetUnit = unit; }
731 
738  QgsUnitTypes::RenderUnit offsetUnit() const { return mOffsetUnit; }
739 
747  void setOffsetMapUnitScale( const QgsMapUnitScale &scale ) { mOffsetMapUnitScale = scale; }
748 
755  const QgsMapUnitScale &offsetMapUnitScale() const { return mOffsetMapUnitScale; }
756 
764  void setHorizontalAnchorPoint( HorizontalAnchorPoint h ) { mHorizontalAnchorPoint = h; }
765 
772  HorizontalAnchorPoint horizontalAnchorPoint() const { return mHorizontalAnchorPoint; }
773 
781  void setVerticalAnchorPoint( VerticalAnchorPoint v ) { mVerticalAnchorPoint = v; }
782 
789  VerticalAnchorPoint verticalAnchorPoint() const { return mVerticalAnchorPoint; }
790 
791  void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const override;
792 
799  virtual void writeSldMarker( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const
800  { Q_UNUSED( props ) element.appendChild( doc.createComment( QStringLiteral( "QgsMarkerSymbolLayer %1 not implemented yet" ).arg( layerType() ) ) ); }
801 
802  void setOutputUnit( QgsUnitTypes::RenderUnit unit ) override;
803  QgsUnitTypes::RenderUnit outputUnit() const override;
804  void setMapUnitScale( const QgsMapUnitScale &scale ) override;
805  QgsMapUnitScale mapUnitScale() const override;
806 
813  virtual QRectF bounds( QPointF point, QgsSymbolRenderContext &context ) = 0;
814 
815  protected:
816 
821  QgsMarkerSymbolLayer( bool locked = false );
822 
830  void markerOffset( QgsSymbolRenderContext &context, double &offsetX, double &offsetY ) const;
831 
842  void markerOffset( QgsSymbolRenderContext &context, double width, double height, double &offsetX, double &offsetY ) const SIP_PYNAME( markerOffsetWithWidthAndHeight );
843 
845  void markerOffset( QgsSymbolRenderContext &context, double width, double height,
847  double &offsetX, double &offsetY,
848  const QgsMapUnitScale &widthMapUnitScale, const QgsMapUnitScale &heightMapUnitScale ) const SIP_PYNAME( markerOffset2 );
849 
856  static QPointF _rotatedOffset( QPointF offset, double angle );
857 
859  double mAngle = 0;
861  double mLineAngle = 0;
863  double mSize = 2.0;
869  QPointF mOffset;
877  HorizontalAnchorPoint mHorizontalAnchorPoint = HCenter;
879  VerticalAnchorPoint mVerticalAnchorPoint = VCenter;
880 
881  private:
882  static QgsMarkerSymbolLayer::HorizontalAnchorPoint decodeHorizontalAnchorPoint( const QString &str );
883  static QgsMarkerSymbolLayer::VerticalAnchorPoint decodeVerticalAnchorPoint( const QString &str );
884 
885 #ifdef SIP_RUN
887 #endif
888 };
889 
894 class CORE_EXPORT QgsLineSymbolLayer : public QgsSymbolLayer
895 {
896  public:
897 
900  {
904  };
905 
907  QgsLineSymbolLayer( const QgsLineSymbolLayer &other ) = delete;
908 
910  QgsLineSymbolLayer &operator=( const QgsLineSymbolLayer &other ) = delete;
911 
912  void setOutputUnit( QgsUnitTypes::RenderUnit unit ) override;
913  QgsUnitTypes::RenderUnit outputUnit() const override;
914  void setMapUnitScale( const QgsMapUnitScale &scale ) override;
915  QgsMapUnitScale mapUnitScale() const override;
916  void drawPreviewIcon( QgsSymbolRenderContext &context, QSize size ) override;
917  double dxfWidth( const QgsDxfExport &e, QgsSymbolRenderContext &context ) const override;
918 
923  virtual void renderPolyline( const QPolygonF &points, QgsSymbolRenderContext &context ) = 0;
924 
933  virtual void renderPolygonStroke( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context );
934 
948  virtual void setWidth( double width ) { mWidth = width; }
949 
959  virtual double width() const { return mWidth; }
960 
971  virtual double width( const QgsRenderContext &context ) const;
972 
982  double offset() const { return mOffset; }
983 
993  void setOffset( double offset ) { mOffset = offset; }
994 
1001  void setOffsetUnit( QgsUnitTypes::RenderUnit unit ) { mOffsetUnit = unit; }
1002 
1009  QgsUnitTypes::RenderUnit offsetUnit() const { return mOffsetUnit; }
1010 
1017  void setOffsetMapUnitScale( const QgsMapUnitScale &scale ) { mOffsetMapUnitScale = scale; }
1018 
1025  const QgsMapUnitScale &offsetMapUnitScale() const { return mOffsetMapUnitScale; }
1026 
1027  // TODO QGIS 4.0 - setWidthUnit(), widthUnit(), setWidthUnitScale(), widthUnitScale()
1028  // only apply to simple line symbol layers and do not belong here.
1029 
1035  void setWidthUnit( QgsUnitTypes::RenderUnit unit ) { mWidthUnit = unit; }
1036 
1041  QgsUnitTypes::RenderUnit widthUnit() const { return mWidthUnit; }
1042 
1043  void setWidthMapUnitScale( const QgsMapUnitScale &scale ) { mWidthMapUnitScale = scale; }
1044  const QgsMapUnitScale &widthMapUnitScale() const { return mWidthMapUnitScale; }
1045 
1056  RenderRingFilter ringFilter() const;
1057 
1068  void setRingFilter( QgsLineSymbolLayer::RenderRingFilter filter );
1069 
1070  protected:
1071  QgsLineSymbolLayer( bool locked = false );
1072 
1073  double mWidth = 0;
1076  double mOffset = 0;
1079 
1080  RenderRingFilter mRingFilter = AllRings;
1081 
1082  private:
1083 #ifdef SIP_RUN
1084  QgsLineSymbolLayer( const QgsLineSymbolLayer &other );
1085 #endif
1086 };
1087 
1092 class CORE_EXPORT QgsFillSymbolLayer : public QgsSymbolLayer
1093 {
1094  public:
1095 
1097  QgsFillSymbolLayer( const QgsFillSymbolLayer &other ) = delete;
1098 
1100  QgsFillSymbolLayer &operator=( const QgsFillSymbolLayer &other ) = delete;
1101 
1107  virtual void renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context ) = 0;
1108 
1109  void drawPreviewIcon( QgsSymbolRenderContext &context, QSize size ) override;
1110 
1111  void setAngle( double angle ) { mAngle = angle; }
1112  double angle() const { return mAngle; }
1113 
1114  protected:
1115  QgsFillSymbolLayer( bool locked = false );
1117  void _renderPolygon( QPainter *p, const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context );
1118 
1119  double mAngle = 0.0;
1120 
1121  private:
1122 #ifdef SIP_RUN
1123  QgsFillSymbolLayer( const QgsFillSymbolLayer &other );
1124 #endif
1125 };
1126 
1127 class QgsSymbolLayerWidget; // why does SIP fail, when this isn't here
1128 
1129 #endif
1130 
1131 
QgsLineSymbolLayer
Definition: qgssymbollayer.h:894
QgsSymbolLayer::PropertyArrowHeadType
@ PropertyArrowHeadType
Arrow head type.
Definition: qgssymbollayer.h:181
QgsSymbolLayer::setEnabled
void setEnabled(bool enabled)
Sets whether symbol layer is enabled and should be drawn.
Definition: qgssymbollayer.h:221
QgsSymbolLayer::mapUnitScale
virtual QgsMapUnitScale mapUnitScale() const
Definition: qgssymbollayer.h:390
QgsSymbolLayer::enabled
bool enabled() const
Returns true if symbol layer is enabled and will be drawn.
Definition: qgssymbollayer.h:212
QgsMarkerSymbolLayer::Right
@ Right
Align to right side of symbol.
Definition: qgssymbollayer.h:584
SIP_PYNAME
#define SIP_PYNAME(name)
Definition: qgis_sip.h:81
QgsSymbolLayer::PropertyHorizontalAnchor
@ PropertyHorizontalAnchor
Horizontal anchor point.
Definition: qgssymbollayer.h:174
qgsfields.h
QgsMarkerSymbolLayer::setSizeUnit
void setSizeUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the symbol's size.
Definition: qgssymbollayer.h:664
QgsSymbolLayer::setSubSymbol
virtual bool setSubSymbol(QgsSymbol *symbol)
Sets layer's subsymbol. takes ownership of the passed symbol.
Definition: qgssymbollayer.h:351
QgsLineSymbolLayer::setWidthUnit
void setWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the line's width.
Definition: qgssymbollayer.h:1035
QgsSymbolLayer::PropertyBlurRadius
@ PropertyBlurRadius
Shapeburst blur radius.
Definition: qgssymbollayer.h:158
QgsMarkerSymbolLayer::setHorizontalAnchorPoint
void setHorizontalAnchorPoint(HorizontalAnchorPoint h)
Sets the horizontal anchor point for positioning the symbol.
Definition: qgssymbollayer.h:764
QgsMarkerSymbolLayer::VerticalAnchorPoint
VerticalAnchorPoint
Symbol vertical anchor points.
Definition: qgssymbollayer.h:588
QgsSymbolLayer::PropertyArrowHeadThickness
@ PropertyArrowHeadThickness
Arrow head thickness.
Definition: qgssymbollayer.h:180
QgsLineSymbolLayer::RenderRingFilter
RenderRingFilter
Options for filtering rings when the line symbol layer is being used to render a polygon's rings.
Definition: qgssymbollayer.h:899
QgsSymbolLayer::PropertyLineDistance
@ PropertyLineDistance
Distance between lines, or length of lines for hash line symbols.
Definition: qgssymbollayer.h:148
QgsSymbolLayer::mColor
QColor mColor
Definition: qgssymbollayer.h:521
QgsSymbolLayer::PropertyShapeburstUseWholeShape
@ PropertyShapeburstUseWholeShape
Shapeburst use whole shape.
Definition: qgssymbollayer.h:159
QgsMarkerSymbolLayer::size
double size() const
Returns the symbol size.
Definition: qgssymbollayer.h:655
QgsSymbolLayer::dataDefinedProperties
QgsPropertyCollection & dataDefinedProperties()
Returns a reference to the symbol layer's property collection, used for data defined overrides.
Definition: qgssymbollayer.h:480
QgsProperty
A store for object properties.
Definition: qgsproperty.h:231
QgsSymbolLayer::PropertyClipPoints
@ PropertyClipPoints
Whether markers should be clipped to polygon boundaries.
Definition: qgssymbollayer.h:187
QgsSymbolLayer::PropertyGradientReference2IsCentroid
@ PropertyGradientReference2IsCentroid
Gradient reference point 2 is centroid.
Definition: qgssymbollayer.h:157
QgsUnitTypes::RenderUnit
RenderUnit
Rendering size units.
Definition: qgsunittypes.h:166
QgsMarkerSymbolLayer::mSizeMapUnitScale
QgsMapUnitScale mSizeMapUnitScale
Marker size map unit scale.
Definition: qgssymbollayer.h:867
QgsDxfExport
Definition: qgsdxfexport.h:62
QgsLineSymbolLayer::widthMapUnitScale
const QgsMapUnitScale & widthMapUnitScale() const
Definition: qgssymbollayer.h:1044
QgsSymbolLayer::PropertyAverageAngleLength
@ PropertyAverageAngleLength
Length to average symbol angles over.
Definition: qgssymbollayer.h:173
QgsLineSymbolLayer::width
virtual double width() const
Returns the estimated width for the line symbol layer.
Definition: qgssymbollayer.h:959
QgsSymbolLayer::PropertyArrowStartWidth
@ PropertyArrowStartWidth
Arrow tail start width.
Definition: qgssymbollayer.h:178
QgsSymbolLayer::mType
QgsSymbol::SymbolType mType
Definition: qgssymbollayer.h:515
QgsSymbolLayer::PropertyFontFamily
@ PropertyFontFamily
Font family.
Definition: qgssymbollayer.h:189
QgsSymbolLayer::setColor
virtual void setColor(const QColor &color)
The fill color.
Definition: qgssymbollayer.h:231
QgsSymbolLayer::PropertyFillStyle
@ PropertyFillStyle
Fill style (eg solid, dots)
Definition: qgssymbollayer.h:144
QgsSymbolLayer::PropertyGradientReference2Y
@ PropertyGradientReference2Y
Gradient reference point 2 y.
Definition: qgssymbollayer.h:155
QgsSymbolLayer::color
virtual QColor color() const
The fill color.
Definition: qgssymbollayer.h:226
QgsSymbolLayer::PropertyFillColor
@ PropertyFillColor
Fill color.
Definition: qgssymbollayer.h:135
QgsLineSymbolLayer::setWidth
virtual void setWidth(double width)
Sets the width of the line symbol layer.
Definition: qgssymbollayer.h:948
QgsLineSymbolLayer::mWidthMapUnitScale
QgsMapUnitScale mWidthMapUnitScale
Definition: qgssymbollayer.h:1075
QgsMarkerSymbolLayer::setAngle
void setAngle(double angle)
Sets the rotation angle for the marker.
Definition: qgssymbollayer.h:621
QgsFields
Definition: qgsfields.h:44
QgsSymbolLayer::mPaintEffect
std::unique_ptr< QgsPaintEffect > mPaintEffect
Definition: qgssymbollayer.h:526
QgsSymbolLayerWidget
Definition: qgssymbollayerwidget.h:34
QgsMarkerSymbolLayer::scaleMethod
QgsSymbol::ScaleMethod scaleMethod() const
Returns the method to use for scaling the marker's size.
Definition: qgssymbollayer.h:702
QgsSymbolLayer::PropertyGradientReference1IsCentroid
@ PropertyGradientReference1IsCentroid
Gradient reference point 1 is centroid.
Definition: qgssymbollayer.h:156
QgsSymbolLayer::isLocked
bool isLocked() const
Definition: qgssymbollayer.h:359
QgsSymbolLayer::PropertyDisplacementX
@ PropertyDisplacementX
Horizontal displacement.
Definition: qgssymbollayer.h:165
QgsLineSymbolLayer::offsetUnit
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the line's offset.
Definition: qgssymbollayer.h:1009
QgsSymbol::ScaleDiameter
@ ScaleDiameter
Calculate scale by the diameter.
Definition: qgssymbol.h:99
QgsRenderContext
Definition: qgsrendercontext.h:57
QgsUnitTypes::RenderMillimeters
@ RenderMillimeters
Millimeters.
Definition: qgsunittypes.h:168
QgsMarkerSymbolLayer
Abstract base class for marker symbol layers.
Definition: qgssymbollayer.h:575
QgsSymbolLayer::drawPreviewIcon
virtual void drawPreviewIcon(QgsSymbolRenderContext &context, QSize size)=0
QgsSymbolLayer::PropertyInterval
@ PropertyInterval
Line marker interval.
Definition: qgssymbollayer.h:171
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
QgsSymbol::ScaleMethod
ScaleMethod
Scale method.
Definition: qgssymbol.h:96
QgsSymbolLayer::PropertyCapStyle
@ PropertyCapStyle
Line cap style.
Definition: qgssymbollayer.h:169
QgsSymbol
Definition: qgssymbol.h:63
qgspainteffect.h
QgsSymbolLayer::PropertyStrokeColor
@ PropertyStrokeColor
Stroke color.
Definition: qgssymbollayer.h:136
QgsSymbolLayer::ogrFeatureStyle
virtual QString ogrFeatureStyle(double mmScaleFactor, double mapUnitScaleFactor) const
Definition: qgssymbollayer.h:334
QgsStringMap
QMap< QString, QString > QgsStringMap
Definition: qgssymbollayer.h:42
QgsLineSymbolLayer::setOffset
void setOffset(double offset)
Sets the line's offset.
Definition: qgssymbollayer.h:993
QgsLineSymbolLayer::setOffsetMapUnitScale
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the line's offset.
Definition: qgssymbollayer.h:1017
SIP_FACTORY
#define SIP_FACTORY
Definition: qgis_sip.h:76
QgsSymbolLayer::PropertyFontStyle
@ PropertyFontStyle
Font style.
Definition: qgssymbollayer.h:190
QgsMarkerSymbolLayer::sizeUnit
QgsUnitTypes::RenderUnit sizeUnit() const
Returns the units for the symbol's size.
Definition: qgssymbollayer.h:672
QgsSymbolLayer::PropertyArrowHeadLength
@ PropertyArrowHeadLength
Arrow head length.
Definition: qgssymbollayer.h:179
QgsSymbolLayer::PropertyGradientSpread
@ PropertyGradientSpread
Gradient spread mode.
Definition: qgssymbollayer.h:151
QgsSymbolRenderContext
Definition: qgssymbol.h:681
QgsMarkerSymbolLayer::HorizontalAnchorPoint
HorizontalAnchorPoint
Symbol horizontal anchor points.
Definition: qgssymbollayer.h:580
QgsSymbolLayer::setFillColor
virtual void setFillColor(const QColor &color)
Set fill color.
Definition: qgssymbollayer.h:246
SIP_CONVERT_TO_SUBCLASS_CODE
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition: qgis_sip.h:172
QgsPropertiesDefinition
QMap< int, QgsPropertyDefinition > QgsPropertiesDefinition
Definition of available properties.
Definition: qgspropertycollection.h:29
QgsSymbolLayer::PropertyOffset
@ PropertyOffset
Symbol offset.
Definition: qgssymbollayer.h:139
QgsSymbolLayer::PropertyCharacter
@ PropertyCharacter
Character, eg for font marker symbol layers.
Definition: qgssymbollayer.h:140
QgsSymbolLayer
Definition: qgssymbollayer.h:52
SIP_SKIP
#define SIP_SKIP
Definition: qgis_sip.h:126
QgsSymbolLayer::PropertyGradientType
@ PropertyGradientType
Gradient fill type.
Definition: qgssymbollayer.h:149
QgsSymbolLayer::PropertyArrowWidth
@ PropertyArrowWidth
Arrow tail width.
Definition: qgssymbollayer.h:177
QgsMarkerSymbolLayer::Top
@ Top
Align to top of symbol.
Definition: qgssymbollayer.h:590
QgsSymbolLayer::PropertyRandomSeed
@ PropertyRandomSeed
Random number seed.
Definition: qgssymbollayer.h:186
QgsMarkerSymbolLayer::HCenter
@ HCenter
Align to horizontal center of symbol.
Definition: qgssymbollayer.h:583
QgsSymbolLayer::PropertyVerticalAnchor
@ PropertyVerticalAnchor
Vertical anchor point.
Definition: qgssymbollayer.h:175
QgsLineSymbolLayer::setOffsetUnit
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the line's offset.
Definition: qgssymbollayer.h:1001
QgsSymbolLayer::PropertyGradientReference1Y
@ PropertyGradientReference1Y
Gradient reference point 1 y.
Definition: qgssymbollayer.h:153
QgsSymbolLayer::dataDefinedProperties
const QgsPropertyCollection & dataDefinedProperties() const
Returns a reference to the symbol layer's property collection, used for data defined overrides.
Definition: qgssymbollayer.h:487
QgsSymbolLayer::PropertyStrokeStyle
@ PropertyStrokeStyle
Stroke style (eg solid, dashed)
Definition: qgssymbollayer.h:138
QgsSymbolLayer::setOutputUnit
virtual void setOutputUnit(QgsUnitTypes::RenderUnit unit)
Sets the units to use for sizes and widths within the symbol layer.
Definition: qgssymbollayer.h:377
SIP_TRANSFER
#define SIP_TRANSFER
Definition: qgis_sip.h:36
QgsMarkerSymbolLayer::verticalAnchorPoint
VerticalAnchorPoint verticalAnchorPoint() const
Returns the vertical anchor point for positioning the symbol.
Definition: qgssymbollayer.h:789
QgsMarkerSymbolLayer::Bottom
@ Bottom
Align to bottom of symbol.
Definition: qgssymbollayer.h:592
QgsSymbolLayer::PropertyDensityArea
@ PropertyDensityArea
Definition: qgssymbollayer.h:188
QgsSymbolLayer::mFields
QgsFields mFields
Definition: qgssymbollayer.h:527
QgsMarkerSymbolLayer::Left
@ Left
Align to left side of symbol.
Definition: qgssymbollayer.h:582
QgsSymbolLayer::PropertyName
@ PropertyName
Name, eg shape name for simple markers.
Definition: qgssymbollayer.h:134
QgsMarkerSymbolLayer::setOffset
void setOffset(QPointF offset)
Sets the marker's offset, which is the horizontal and vertical displacement which the rendered marker...
Definition: qgssymbollayer.h:712
QgsSymbol::Fill
@ Fill
Fill symbol.
Definition: qgssymbol.h:89
QgsMapUnitScale
Struct for storing maximum and minimum scales for measurements in map units.
Definition: qgsmapunitscale.h:37
QgsSymbolLayer::PropertyPointCount
@ PropertyPointCount
Point count.
Definition: qgssymbollayer.h:185
QgsSymbolLayer::mDataDefinedProperties
QgsPropertyCollection mDataDefinedProperties
Definition: qgssymbollayer.h:524
QgsSymbolLayer::PropertyStrokeWidth
@ PropertyStrokeWidth
Stroke width.
Definition: qgssymbollayer.h:137
QgsMarkerSymbolLayer::setOffsetUnit
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the symbol's offset.
Definition: qgssymbollayer.h:730
QgsSymbolLayer::PropertyShapeburstIgnoreRings
@ PropertyShapeburstIgnoreRings
Shapeburst ignore rings.
Definition: qgssymbollayer.h:161
QgsSymbolLayer::fillColor
virtual QColor fillColor() const
Gets fill color.
Definition: qgssymbollayer.h:251
QgsMarkerSymbolLayer::VCenter
@ VCenter
Align to vertical center of symbol.
Definition: qgssymbollayer.h:591
QgsMarkerSymbolLayer::setLineAngle
void setLineAngle(double lineAngle)
Sets the line angle modification for the symbol's angle.
Definition: qgssymbollayer.h:638
QgsSymbolLayer::subSymbol
virtual QgsSymbol * subSymbol()
Returns the symbol's sub symbol, if present.
Definition: qgssymbollayer.h:348
QgsLineSymbolLayer::InteriorRingsOnly
@ InteriorRingsOnly
Render the interior rings only.
Definition: qgssymbollayer.h:903
QgsSymbolLayer::PropertyLayerEnabled
@ PropertyLayerEnabled
Whether symbol layer is enabled.
Definition: qgssymbollayer.h:176
QgsSymbolLayer::PropertyOffsetY
@ PropertyOffsetY
Vertical offset.
Definition: qgssymbollayer.h:184
QgsSymbolLayer::PropertyOffsetAlongLine
@ PropertyOffsetAlongLine
Offset along line.
Definition: qgssymbollayer.h:172
QgsSymbolLayer::outputUnit
virtual QgsUnitTypes::RenderUnit outputUnit() const
Returns the units to use for sizes and widths within the symbol layer.
Definition: qgssymbollayer.h:387
QgsPropertyCollection
A grouped map of multiple QgsProperty objects, each referenced by a integer key value.
Definition: qgspropertycollection.h:318
QgsMarkerSymbolLayer::setOffsetMapUnitScale
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the symbol's offset.
Definition: qgssymbollayer.h:747
QgsStringMap
QMap< QString, QString > QgsStringMap
Definition: qgis.h:714
QgsMarkerSymbolLayer::mOffset
QPointF mOffset
Marker offset.
Definition: qgssymbollayer.h:869
QgsSymbolLayer::setDataDefinedProperties
void setDataDefinedProperties(const QgsPropertyCollection &collection)
Sets the symbol layer's property collection, used for data defined overrides.
Definition: qgssymbollayer.h:495
QgsSymbolLayer::PropertyGradientReference2X
@ PropertyGradientReference2X
Gradient reference point 2 x.
Definition: qgssymbollayer.h:154
QgsLineSymbolLayer::offsetMapUnitScale
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the line's offset.
Definition: qgssymbollayer.h:1025
qgslinesymbollayer.h
QgsSymbolLayer::PropertyCoordinateMode
@ PropertyCoordinateMode
Gradient coordinate mode.
Definition: qgssymbollayer.h:150
QgsFillSymbolLayer::angle
double angle() const
Definition: qgssymbollayer.h:1112
QgsSymbolLayer::setStrokeColor
virtual void setStrokeColor(const QColor &color)
Set stroke color.
Definition: qgssymbollayer.h:236
QgsSymbolLayerReferenceList
QList< QgsSymbolLayerReference > QgsSymbolLayerReferenceList
Definition: qgssymbollayerreference.h:160
QgsSymbolLayer::PropertyDistanceY
@ PropertyDistanceY
Vertical distance between points.
Definition: qgssymbollayer.h:164
QgsLineSymbolLayer::mOffsetMapUnitScale
QgsMapUnitScale mOffsetMapUnitScale
Definition: qgssymbollayer.h:1078
QgsSymbolLayer::PropertyDistanceX
@ PropertyDistanceX
Horizontal distance between points.
Definition: qgssymbollayer.h:163
QgsFillSymbolLayer
Definition: qgssymbollayer.h:1092
QgsSymbolLayer::operator=
QgsSymbolLayer & operator=(const QgsSymbolLayer &other)=delete
QgsSymbolLayer cannot be copied.
QgsSymbolLayer::PropertyFile
@ PropertyFile
Filename, eg for svg files.
Definition: qgssymbollayer.h:162
QgsSymbolLayer::PropertyCustomDash
@ PropertyCustomDash
Custom dash pattern.
Definition: qgssymbollayer.h:168
QgsPaintEffect
Base class for visual effects which can be applied to QPicture drawings.
Definition: qgspainteffect.h:53
QgsSymbolLayer::PropertyAngle
@ PropertyAngle
Symbol angle.
Definition: qgssymbollayer.h:133
QgsSymbol::Line
@ Line
Line symbol.
Definition: qgssymbol.h:88
QgsSymbolLayer::setLocked
void setLocked(bool locked)
Definition: qgssymbollayer.h:358
QgsSymbolLayer::PropertyArrowType
@ PropertyArrowType
Arrow type.
Definition: qgssymbollayer.h:182
QgsUnitTypes::RenderUnknownUnit
@ RenderUnknownUnit
Mixed or unknown units.
Definition: qgsunittypes.h:174
QgsLineSymbolLayer::AllRings
@ AllRings
Render both exterior and interior rings.
Definition: qgssymbollayer.h:901
QgsSymbolLayer::stopRender
virtual void stopRender(QgsSymbolRenderContext &context)=0
Called after a set of rendering operations has finished on the supplied render context.
qgspropertycollection.h
QgsSymbolLayer::PropertyShapeburstMaxDistance
@ PropertyShapeburstMaxDistance
Shapeburst fill from edge distance.
Definition: qgssymbollayer.h:160
QgsMarkerSymbolLayer::horizontalAnchorPoint
HorizontalAnchorPoint horizontalAnchorPoint() const
Returns the horizontal anchor point for positioning the symbol.
Definition: qgssymbollayer.h:772
QgsSymbol::Marker
@ Marker
Marker symbol.
Definition: qgssymbol.h:87
QgsMarkerSymbolLayer::writeSldMarker
virtual void writeSldMarker(QDomDocument &doc, QDomElement &element, const QgsStringMap &props) const
Writes the symbol layer definition as a SLD XML element.
Definition: qgssymbollayer.h:799
QgsSymbolLayer::setMapUnitScale
virtual void setMapUnitScale(const QgsMapUnitScale &scale)
Definition: qgssymbollayer.h:389
QgsSymbolLayer::Property
Property
Data definable properties.
Definition: qgssymbollayer.h:130
QgsMarkerSymbolLayer::setSize
virtual void setSize(double size)
Sets the symbol size.
Definition: qgssymbollayer.h:647
QgsMarkerSymbolLayer::offset
QPointF offset() const
Returns the marker's offset, which is the horizontal and vertical displacement which the rendered mar...
Definition: qgssymbollayer.h:721
QgsMarkerSymbolLayer::setSizeMapUnitScale
void setSizeMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the symbol's size.
Definition: qgssymbollayer.h:681
QgsMarkerSymbolLayer::setVerticalAnchorPoint
void setVerticalAnchorPoint(VerticalAnchorPoint v)
Sets the vertical anchor point for positioning the symbol.
Definition: qgssymbollayer.h:781
QgsSymbolLayer::type
QgsSymbol::SymbolType type() const
Definition: qgssymbollayer.h:353
QgsSymbolLayer::layerType
virtual QString layerType() const =0
Returns a string that represents this layer type.
QgsSymbolLayer::PropertyGradientReference1X
@ PropertyGradientReference1X
Gradient reference point 1 x.
Definition: qgssymbollayer.h:152
QgsFeature
Definition: qgsfeature.h:55
QgsSymbolLayer::PropertyOpacity
@ PropertyOpacity
Opacity.
Definition: qgssymbollayer.h:167
QgsLineSymbolLayer::setWidthMapUnitScale
void setWidthMapUnitScale(const QgsMapUnitScale &scale)
Definition: qgssymbollayer.h:1043
QgsLineSymbolLayer::offset
double offset() const
Returns the line's offset.
Definition: qgssymbollayer.h:982
QgsMarkerSymbolLayer::offsetMapUnitScale
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the symbol's offset.
Definition: qgssymbollayer.h:755
QgsSymbol::SymbolType
SymbolType
Type of the symbol.
Definition: qgssymbol.h:85
QgsSymbolLayer::PropertyHeight
@ PropertyHeight
Symbol height.
Definition: qgssymbollayer.h:142
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.
QgsSymbol::Hybrid
@ Hybrid
Hybrid symbol.
Definition: qgssymbol.h:90
QgsLineSymbolLayer::widthUnit
QgsUnitTypes::RenderUnit widthUnit() const
Returns the units for the line's width.
Definition: qgssymbollayer.h:1041
QgsLineSymbolLayer::ExteriorRingOnly
@ ExteriorRingOnly
Render the exterior ring only.
Definition: qgssymbollayer.h:902
QgsSymbolLayer::PropertyOffsetX
@ PropertyOffsetX
Horizontal offset.
Definition: qgssymbollayer.h:183
QgsExpression
Definition: qgsexpression.h:113
QgsSymbolLayer::dxfWidth
virtual double dxfWidth(const QgsDxfExport &e, QgsSymbolRenderContext &context) const
Gets line width.
Definition: qgssymbollayer.cpp:137
QgsMarkerSymbolLayer::mOffsetMapUnitScale
QgsMapUnitScale mOffsetMapUnitScale
Offset map unit scale.
Definition: qgssymbollayer.h:873
QgsSymbolLayer::PropertyDisplacementY
@ PropertyDisplacementY
Vertical displacement.
Definition: qgssymbollayer.h:166
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
SIP_END
#define SIP_END
Definition: qgis_sip.h:189
QgsFillSymbolLayer::setAngle
void setAngle(double angle)
Definition: qgssymbollayer.h:1111
QgsSymbolLayer::PropertyPlacement
@ PropertyPlacement
Line marker placement.
Definition: qgssymbollayer.h:170
QgsSymbolLayer::PropertyPreserveAspectRatio
@ PropertyPreserveAspectRatio
Preserve aspect ratio between width and height.
Definition: qgssymbollayer.h:143
QgsSymbolLayer::strokeColor
virtual QColor strokeColor() const
Gets stroke color.
Definition: qgssymbollayer.h:241
qgssymbol.h
QgsSymbolLayer::PropertyLineAngle
@ PropertyLineAngle
Line angle, or angle of hash lines for hash line symbols.
Definition: qgssymbollayer.h:147
QgsMarkerSymbolLayer::offsetUnit
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the symbol's offset.
Definition: qgssymbollayer.h:738
QgsMarkerSymbolLayer::angle
double angle() const
Returns the rotation angle for the marker, in degrees clockwise from north.
Definition: qgssymbollayer.h:627
QgsSymbolLayer::PropertySecondaryColor
@ PropertySecondaryColor
Secondary color (eg for gradient fills)
Definition: qgssymbollayer.h:146
QgsMarkerSymbolLayer::setScaleMethod
void setScaleMethod(QgsSymbol::ScaleMethod scaleMethod)
Sets the method to use for scaling the marker's size.
Definition: qgssymbollayer.h:696
QgsSymbolLayer::PropertyJoinStyle
@ PropertyJoinStyle
Line join style.
Definition: qgssymbollayer.h:145
QgsSymbolLayer::PropertyWidth
@ PropertyWidth
Symbol width.
Definition: qgssymbollayer.h:141
QgsMarkerSymbolLayer::sizeMapUnitScale
const QgsMapUnitScale & sizeMapUnitScale() const
Returns the map unit scale for the symbol's size.
Definition: qgssymbollayer.h:689