QGIS API Documentation  3.17.0-Master (a035f434f4)
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,
192  };
193 
198  static const QgsPropertiesDefinition &propertyDefinitions();
199 
200  virtual ~QgsSymbolLayer();
201 
203  QgsSymbolLayer( const QgsSymbolLayer &other ) = delete;
204 
206  QgsSymbolLayer &operator=( const QgsSymbolLayer &other ) = delete;
207 
213  bool enabled() const { return mEnabled; }
214 
222  void setEnabled( bool enabled ) { mEnabled = enabled; }
223 
227  virtual QColor color() const { return mColor; }
228 
232  virtual void setColor( const QColor &color ) { mColor = color; }
233 
238  virtual void setStrokeColor( const QColor &color ) { Q_UNUSED( color ) }
239 
244  virtual QColor strokeColor() const { return QColor(); }
245 
250  virtual void setFillColor( const QColor &color ) { Q_UNUSED( color ) }
251 
256  virtual QColor fillColor() const { return QColor(); }
257 
262  virtual QString layerType() const = 0;
263 
276  virtual void startRender( QgsSymbolRenderContext &context ) = 0;
277 
289  virtual void stopRender( QgsSymbolRenderContext &context ) = 0;
290 
309  virtual void startFeatureRender( const QgsFeature &feature, QgsRenderContext &context );
310 
329  virtual void stopFeatureRender( const QgsFeature &feature, QgsRenderContext &context );
330 
334  virtual QgsSymbolLayer *clone() const = 0 SIP_FACTORY;
335 
336  virtual void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const
337  { Q_UNUSED( props ) element.appendChild( doc.createComment( QStringLiteral( "SymbolLayerV2 %1 not implemented yet" ).arg( layerType() ) ) ); }
338 
339  virtual QString ogrFeatureStyle( double mmScaleFactor, double mapUnitScaleFactor ) const { Q_UNUSED( mmScaleFactor ) Q_UNUSED( mapUnitScaleFactor ); return QString(); }
340 
346  virtual QgsStringMap properties() const = 0;
347 
348  virtual void drawPreviewIcon( QgsSymbolRenderContext &context, QSize size ) = 0;
349 
353  virtual QgsSymbol *subSymbol() { return nullptr; }
354 
356  virtual bool setSubSymbol( QgsSymbol *symbol SIP_TRANSFER ) { delete symbol; return false; }
357 
358  QgsSymbol::SymbolType type() const { return mType; }
359 
361  virtual bool isCompatibleWithSymbol( QgsSymbol *symbol ) const;
362 
363  void setLocked( bool locked ) { mLocked = locked; }
364  bool isLocked() const { return mLocked; }
365 
373  virtual double estimateMaxBleed( const QgsRenderContext &context ) const { Q_UNUSED( context ) return 0; }
374 
383  virtual void setOutputUnit( QgsUnitTypes::RenderUnit unit ) { Q_UNUSED( unit ) }
384 
394 
395  virtual void setMapUnitScale( const QgsMapUnitScale &scale ) { Q_UNUSED( scale ) }
396  virtual QgsMapUnitScale mapUnitScale() const { return QgsMapUnitScale(); }
397 
404  void setRenderingPass( int renderingPass );
405 
412  int renderingPass() const;
413 
418  virtual QSet<QString> usedAttributes( const QgsRenderContext &context ) const;
419 
427  virtual void setDataDefinedProperty( Property key, const QgsProperty &property );
428 
430  virtual bool writeDxf( QgsDxfExport &e, double mmMapUnitScaleFactor, const QString &layerName, QgsSymbolRenderContext &context, QPointF shift = QPointF( 0.0, 0.0 ) ) const;
431 
433  virtual double dxfWidth( const QgsDxfExport &e, QgsSymbolRenderContext &context ) const;
434 
436  virtual double dxfOffset( const QgsDxfExport &e, QgsSymbolRenderContext &context ) const;
437 
439  virtual QColor dxfColor( QgsSymbolRenderContext &context ) const;
440 
442  virtual double dxfAngle( QgsSymbolRenderContext &context ) const;
443 
445  virtual QVector<qreal> dxfCustomDashPattern( QgsUnitTypes::RenderUnit &unit ) const;
446 
448  virtual Qt::PenStyle dxfPenStyle() const;
449 
451  virtual QColor dxfBrushColor( QgsSymbolRenderContext &context ) const;
452 
454  virtual Qt::BrushStyle dxfBrushStyle() const;
455 
462  QgsPaintEffect *paintEffect() const;
463 
470  void setPaintEffect( QgsPaintEffect *effect SIP_TRANSFER );
471 
478  virtual void prepareExpressions( const QgsSymbolRenderContext &context );
479 
486  QgsPropertyCollection &dataDefinedProperties() { return mDataDefinedProperties; }
487 
493  const QgsPropertyCollection &dataDefinedProperties() const { return mDataDefinedProperties; } SIP_SKIP
494 
501  void setDataDefinedProperties( const QgsPropertyCollection &collection ) { mDataDefinedProperties = collection; }
502 
508  virtual bool hasDataDefinedProperties() const;
509 
515  virtual QgsSymbolLayerReferenceList masks() const;
516 
517  protected:
518 
519  QgsSymbolLayer( QgsSymbol::SymbolType type, bool locked = false );
520 
522 
524  bool mEnabled = true;
525 
526  bool mLocked = false;
527  QColor mColor;
528  int mRenderingPass = 0;
529 
531 
532  std::unique_ptr< QgsPaintEffect > mPaintEffect;
534 
535  // Configuration of selected symbology implementation
537  static const bool SELECTION_IS_OPAQUE = true;
539  static const bool SELECT_FILL_BORDER = false;
541  static const bool SELECT_FILL_STYLE = false;
542 
547  void restoreOldDataDefinedProperties( const QgsStringMap &stringMap );
548 
553  void copyDataDefinedProperties( QgsSymbolLayer *destLayer ) const;
554 
560  void copyPaintEffect( QgsSymbolLayer *destLayer ) const;
561 
562  private:
563  static void initPropertyDefinitions();
564 
566  static QgsPropertiesDefinition sPropertyDefinitions;
567 
568 #ifdef SIP_RUN
569  QgsSymbolLayer( const QgsSymbolLayer &other );
570 #endif
571 
572 };
573 
575 
581 class CORE_EXPORT QgsMarkerSymbolLayer : public QgsSymbolLayer
582 {
583  public:
584 
587  {
591  };
592 
595  {
596  Top,
599  };
600 
602  QgsMarkerSymbolLayer( const QgsMarkerSymbolLayer &other ) = delete;
603 
605  QgsMarkerSymbolLayer &operator=( const QgsMarkerSymbolLayer &other ) = delete;
606 
607  void startRender( QgsSymbolRenderContext &context ) override;
608 
609  void stopRender( QgsSymbolRenderContext &context ) override;
610 
617  virtual void renderPoint( QPointF point, QgsSymbolRenderContext &context ) = 0;
618 
619  void drawPreviewIcon( QgsSymbolRenderContext &context, QSize size ) override;
620 
627  void setAngle( double angle ) { mAngle = angle; }
628 
633  double angle() const { return mAngle; }
634 
644  void setLineAngle( double lineAngle ) { mLineAngle = lineAngle; }
645 
653  virtual void setSize( double size ) { mSize = size; }
654 
661  double size() const { return mSize; }
662 
670  void setSizeUnit( QgsUnitTypes::RenderUnit unit ) { mSizeUnit = unit; }
671 
678  QgsUnitTypes::RenderUnit sizeUnit() const { return mSizeUnit; }
679 
687  void setSizeMapUnitScale( const QgsMapUnitScale &scale ) { mSizeMapUnitScale = scale; }
688 
695  const QgsMapUnitScale &sizeMapUnitScale() const { return mSizeMapUnitScale; }
696 
702  void setScaleMethod( QgsSymbol::ScaleMethod scaleMethod ) { mScaleMethod = scaleMethod; }
703 
708  QgsSymbol::ScaleMethod scaleMethod() const { return mScaleMethod; }
709 
718  void setOffset( QPointF offset ) { mOffset = offset; }
719 
727  QPointF offset() const { return mOffset; }
728 
736  void setOffsetUnit( QgsUnitTypes::RenderUnit unit ) { mOffsetUnit = unit; }
737 
744  QgsUnitTypes::RenderUnit offsetUnit() const { return mOffsetUnit; }
745 
753  void setOffsetMapUnitScale( const QgsMapUnitScale &scale ) { mOffsetMapUnitScale = scale; }
754 
761  const QgsMapUnitScale &offsetMapUnitScale() const { return mOffsetMapUnitScale; }
762 
770  void setHorizontalAnchorPoint( HorizontalAnchorPoint h ) { mHorizontalAnchorPoint = h; }
771 
778  HorizontalAnchorPoint horizontalAnchorPoint() const { return mHorizontalAnchorPoint; }
779 
787  void setVerticalAnchorPoint( VerticalAnchorPoint v ) { mVerticalAnchorPoint = v; }
788 
795  VerticalAnchorPoint verticalAnchorPoint() const { return mVerticalAnchorPoint; }
796 
797  void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const override;
798 
805  virtual void writeSldMarker( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const
806  { Q_UNUSED( props ) element.appendChild( doc.createComment( QStringLiteral( "QgsMarkerSymbolLayer %1 not implemented yet" ).arg( layerType() ) ) ); }
807 
808  void setOutputUnit( QgsUnitTypes::RenderUnit unit ) override;
809  QgsUnitTypes::RenderUnit outputUnit() const override;
810  void setMapUnitScale( const QgsMapUnitScale &scale ) override;
811  QgsMapUnitScale mapUnitScale() const override;
812 
819  virtual QRectF bounds( QPointF point, QgsSymbolRenderContext &context ) = 0;
820 
821  protected:
822 
827  QgsMarkerSymbolLayer( bool locked = false );
828 
836  void markerOffset( QgsSymbolRenderContext &context, double &offsetX, double &offsetY ) const;
837 
848  void markerOffset( QgsSymbolRenderContext &context, double width, double height, double &offsetX, double &offsetY ) const SIP_PYNAME( markerOffsetWithWidthAndHeight );
849 
851  void markerOffset( QgsSymbolRenderContext &context, double width, double height,
853  double &offsetX, double &offsetY,
854  const QgsMapUnitScale &widthMapUnitScale, const QgsMapUnitScale &heightMapUnitScale ) const SIP_PYNAME( markerOffset2 );
855 
862  static QPointF _rotatedOffset( QPointF offset, double angle );
863 
865  double mAngle = 0;
867  double mLineAngle = 0;
869  double mSize = 2.0;
875  QPointF mOffset;
883  HorizontalAnchorPoint mHorizontalAnchorPoint = HCenter;
885  VerticalAnchorPoint mVerticalAnchorPoint = VCenter;
886 
887  private:
888  static QgsMarkerSymbolLayer::HorizontalAnchorPoint decodeHorizontalAnchorPoint( const QString &str );
889  static QgsMarkerSymbolLayer::VerticalAnchorPoint decodeVerticalAnchorPoint( const QString &str );
890 
891 #ifdef SIP_RUN
893 #endif
894 };
895 
900 class CORE_EXPORT QgsLineSymbolLayer : public QgsSymbolLayer
901 {
902  public:
903 
906  {
910  };
911 
913  QgsLineSymbolLayer( const QgsLineSymbolLayer &other ) = delete;
914 
916  QgsLineSymbolLayer &operator=( const QgsLineSymbolLayer &other ) = delete;
917 
918  void setOutputUnit( QgsUnitTypes::RenderUnit unit ) override;
919  QgsUnitTypes::RenderUnit outputUnit() const override;
920  void setMapUnitScale( const QgsMapUnitScale &scale ) override;
921  QgsMapUnitScale mapUnitScale() const override;
922  void drawPreviewIcon( QgsSymbolRenderContext &context, QSize size ) override;
923  double dxfWidth( const QgsDxfExport &e, QgsSymbolRenderContext &context ) const override;
924 
929  virtual void renderPolyline( const QPolygonF &points, QgsSymbolRenderContext &context ) = 0;
930 
939  virtual void renderPolygonStroke( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context );
940 
954  virtual void setWidth( double width ) { mWidth = width; }
955 
965  virtual double width() const { return mWidth; }
966 
977  virtual double width( const QgsRenderContext &context ) const;
978 
988  double offset() const { return mOffset; }
989 
999  void setOffset( double offset ) { mOffset = offset; }
1000 
1007  void setOffsetUnit( QgsUnitTypes::RenderUnit unit ) { mOffsetUnit = unit; }
1008 
1015  QgsUnitTypes::RenderUnit offsetUnit() const { return mOffsetUnit; }
1016 
1023  void setOffsetMapUnitScale( const QgsMapUnitScale &scale ) { mOffsetMapUnitScale = scale; }
1024 
1031  const QgsMapUnitScale &offsetMapUnitScale() const { return mOffsetMapUnitScale; }
1032 
1033  // TODO QGIS 4.0 - setWidthUnit(), widthUnit(), setWidthUnitScale(), widthUnitScale()
1034  // only apply to simple line symbol layers and do not belong here.
1035 
1041  void setWidthUnit( QgsUnitTypes::RenderUnit unit ) { mWidthUnit = unit; }
1042 
1047  QgsUnitTypes::RenderUnit widthUnit() const { return mWidthUnit; }
1048 
1049  void setWidthMapUnitScale( const QgsMapUnitScale &scale ) { mWidthMapUnitScale = scale; }
1050  const QgsMapUnitScale &widthMapUnitScale() const { return mWidthMapUnitScale; }
1051 
1062  RenderRingFilter ringFilter() const;
1063 
1074  void setRingFilter( QgsLineSymbolLayer::RenderRingFilter filter );
1075 
1076  protected:
1077  QgsLineSymbolLayer( bool locked = false );
1078 
1079  double mWidth = 0;
1082  double mOffset = 0;
1085 
1086  RenderRingFilter mRingFilter = AllRings;
1087 
1088  private:
1089 #ifdef SIP_RUN
1090  QgsLineSymbolLayer( const QgsLineSymbolLayer &other );
1091 #endif
1092 };
1093 
1098 class CORE_EXPORT QgsFillSymbolLayer : public QgsSymbolLayer
1099 {
1100  public:
1101 
1103  QgsFillSymbolLayer( const QgsFillSymbolLayer &other ) = delete;
1104 
1106  QgsFillSymbolLayer &operator=( const QgsFillSymbolLayer &other ) = delete;
1107 
1113  virtual void renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context ) = 0;
1114 
1115  void drawPreviewIcon( QgsSymbolRenderContext &context, QSize size ) override;
1116 
1117  void setAngle( double angle ) { mAngle = angle; }
1118  double angle() const { return mAngle; }
1119 
1120  protected:
1121  QgsFillSymbolLayer( bool locked = false );
1123  void _renderPolygon( QPainter *p, const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context );
1124 
1125  double mAngle = 0.0;
1126 
1127  private:
1128 #ifdef SIP_RUN
1129  QgsFillSymbolLayer( const QgsFillSymbolLayer &other );
1130 #endif
1131 };
1132 
1133 class QgsSymbolLayerWidget; // why does SIP fail, when this isn't here
1134 
1135 #endif
1136 
1137 
void setOffset(QPointF offset)
Sets the marker&#39;s offset, which is the horizontal and vertical displacement which the rendered marker...
Class for parsing and evaluation of expressions (formerly called "search strings").
Gradient reference point 1 is centroid.
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the symbol&#39;s offset.
void setLineAngle(double lineAngle)
Sets the line angle modification for the symbol&#39;s angle.
virtual QString ogrFeatureStyle(double mmScaleFactor, double mapUnitScaleFactor) const
void setLocked(bool locked)
Gradient reference point 1 x.
Calculate scale by the diameter.
Definition: qgssymbol.h:100
Abstract base class for all rendered symbols.
Definition: qgssymbol.h:64
virtual QgsSymbol * subSymbol()
Returns the symbol&#39;s sub symbol, if present.
virtual void setWidth(double width)
Sets the width of the line symbol layer.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the line&#39;s offset.
const QgsMapUnitScale & sizeMapUnitScale() const
Returns the map unit scale for the symbol&#39;s size.
Align to right side of symbol.
double angle() const
Render both exterior and interior rings.
void setAngle(double angle)
virtual QColor strokeColor() const
Gets stroke color.
Base class for visual effects which can be applied to QPicture drawings.
Whether markers should be clipped to polygon boundaries.
Container of fields for a vector layer.
Definition: qgsfields.h:44
Mixed or unknown units.
Definition: qgsunittypes.h:174
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the symbol&#39;s offset.
VerticalAnchorPoint verticalAnchorPoint() const
Returns the vertical anchor point for positioning the symbol.
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the symbol&#39;s offset.
QPointF mOffset
Marker offset.
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the line&#39;s offset.
virtual double dxfWidth(const QgsDxfExport &e, QgsSymbolRenderContext &context) const
Gets line width.
bool isLocked() const
Line symbol.
Definition: qgssymbol.h:89
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition: qgsfeature.h:55
void setScaleMethod(QgsSymbol::ScaleMethod scaleMethod)
Sets the method to use for scaling the marker&#39;s size.
Align to horizontal center of symbol.
QMap< QString, QString > QgsStringMap
Definition: qgis.h:759
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
virtual double width() const
Returns the estimated width for the line symbol layer.
Name, eg shape name for simple markers.
void setWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the line&#39;s width.
Gradient reference point 2 y.
virtual void setColor(const QColor &color)
The fill color.
SymbolType
Type of the symbol.
Definition: qgssymbol.h:86
HorizontalAnchorPoint horizontalAnchorPoint() const
Returns the horizontal anchor point for positioning the symbol.
virtual QgsUnitTypes::RenderUnit outputUnit() const
Returns the units to use for sizes and widths within the symbol layer.
virtual void writeSldMarker(QDomDocument &doc, QDomElement &element, const QgsStringMap &props) const
Writes the symbol layer definition as a SLD XML element.
Align to bottom of symbol.
virtual bool setSubSymbol(QgsSymbol *symbol)
Sets layer&#39;s subsymbol. takes ownership of the passed symbol.
double angle() const
Returns the rotation angle for the marker, in degrees clockwise from north.
virtual void setOutputUnit(QgsUnitTypes::RenderUnit unit)
Sets the units to use for sizes and widths within the symbol layer.
QgsUnitTypes::RenderUnit widthUnit() const
Returns the units for the line&#39;s width.
#define SIP_SKIP
Definition: qgis_sip.h:126
double size() const
Returns the symbol size.
Render the interior rings only.
QList< QgsSymbolLayerReference > QgsSymbolLayerReferenceList
QgsPropertyCollection & dataDefinedProperties()
Returns a reference to the symbol layer&#39;s property collection, used for data defined overrides...
void setHorizontalAnchorPoint(HorizontalAnchorPoint h)
Sets the horizontal anchor point for positioning the symbol.
void setSizeMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the symbol&#39;s size.
#define SIP_TRANSFER
Definition: qgis_sip.h:36
QgsMapUnitScale mOffsetMapUnitScale
virtual QColor color() const
The fill color.
Filename, eg for svg files.
#define SIP_END
Definition: qgis_sip.h:194
Align to left side of symbol.
virtual void drawPreviewIcon(QgsSymbolRenderContext &context, QSize size)=0
Shapeburst fill from edge distance.
QgsSymbol::SymbolType type() const
#define SIP_FACTORY
Definition: qgis_sip.h:76
QgsMapUnitScale mSizeMapUnitScale
Marker size map unit scale.
Character, eg for font marker symbol layers.
double offset() const
Returns the line&#39;s offset.
ScaleMethod
Scale method.
Definition: qgssymbol.h:97
QMap< QString, QString > QgsStringMap
Align to top of symbol.
void setEnabled(bool enabled)
Sets whether symbol layer is enabled and should be drawn.
A store for object properties.
Definition: qgsproperty.h:231
const QgsPropertyCollection & dataDefinedProperties() const
Returns a reference to the symbol layer&#39;s property collection, used for data defined overrides...
QgsMapUnitScale mWidthMapUnitScale
RenderRingFilter
Options for filtering rings when the line symbol layer is being used to render a polygon&#39;s rings...
std::unique_ptr< QgsPaintEffect > mPaintEffect
virtual double estimateMaxBleed(const QgsRenderContext &context) const
Returns the estimated maximum distance which the layer style will bleed outside the drawn shape when ...
HorizontalAnchorPoint
Symbol horizontal anchor points.
virtual void setStrokeColor(const QColor &color)
Set stroke color.
Gradient reference point 1 y.
QMap< int, QgsPropertyDefinition > QgsPropertiesDefinition
Definition of available properties.
VerticalAnchorPoint
Symbol vertical anchor points.
QgsSymbol::ScaleMethod scaleMethod() const
Returns the method to use for scaling the marker&#39;s size.
Line angle, or angle of hash lines for hash line symbols.
virtual void toSld(QDomDocument &doc, QDomElement &element, const QgsStringMap &props) const
void setSizeUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the symbol&#39;s size.
Marker symbol.
Definition: qgssymbol.h:88
virtual QgsMapUnitScale mapUnitScale() const
Stroke style (eg solid, dashed)
Preserve aspect ratio between width and height.
Fill symbol.
Definition: qgssymbol.h:90
Contains information about the context of a rendering operation.
Abstract base class for marker symbol layers.
virtual void setMapUnitScale(const QgsMapUnitScale &scale)
virtual void setFillColor(const QColor &color)
Set fill color.
bool enabled() const
Returns true if symbol layer is enabled and will be drawn.
virtual void stopRender(QgsSymbolRenderContext &context)=0
Called after a set of rendering operations has finished on the supplied render context.
Struct for storing maximum and minimum scales for measurements in map units.
QgsUnitTypes::RenderUnit sizeUnit() const
Returns the units for the symbol&#39;s size.
void setWidthMapUnitScale(const QgsMapUnitScale &scale)
Distance between lines, or length of lines for hash line symbols.
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the line&#39;s offset.
virtual void setSize(double size)
Sets the symbol size.
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition: qgis_sip.h:177
Align to vertical center of symbol.
QgsSymbolLayer & operator=(const QgsSymbolLayer &other)=delete
QgsSymbolLayer cannot be copied.
Secondary color (eg for gradient fills)
A grouped map of multiple QgsProperty objects, each referenced by a integer key value.
void setAngle(double angle)
Sets the rotation angle for the marker.
const QgsMapUnitScale & widthMapUnitScale() const
Length to average symbol angles over.
Render the exterior ring only.
QgsMapUnitScale mOffsetMapUnitScale
Offset map unit scale.
Shapeburst blur radius.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the line&#39;s offset.
QPointF offset() const
Returns the marker&#39;s offset, which is the horizontal and vertical displacement which the rendered mar...
Fill style (eg solid, dots)
virtual QColor fillColor() const
Gets fill color.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the symbol&#39;s offset.
QgsFields mFields
Whether symbol layer is enabled.
Hybrid symbol.
Definition: qgssymbol.h:91
Gradient reference point 2 is centroid.
QgsSymbol::SymbolType mType
Gradient reference point 2 x.
QgsPropertyCollection mDataDefinedProperties
void setDataDefinedProperties(const QgsPropertyCollection &collection)
Sets the symbol layer&#39;s property collection, used for data defined overrides.
Property
Data definable properties.
RenderUnit
Rendering size units.
Definition: qgsunittypes.h:166
void setVerticalAnchorPoint(VerticalAnchorPoint v)
Sets the vertical anchor point for positioning the symbol.
#define SIP_PYNAME(name)
Definition: qgis_sip.h:81
void setOffset(double offset)
Sets the line&#39;s offset.
virtual void startRender(QgsSymbolRenderContext &context)=0
Called before a set of rendering operations commences on the supplied render context.
Horizontal distance between points.
virtual QString layerType() const =0
Returns a string that represents this layer type.
Vertical distance between points.