QGIS API Documentation  3.12.1-BucureČ™ti (121cc00ff0)
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 
30 #include "qgssymbol.h"
31 #include "qgsfields.h"
32 #include "qgspropertycollection.h"
33 #include "qgspainteffect.h"
34 
35 class QPainter;
36 class QSize;
37 class QPolygonF;
38 
39 class QgsDxfExport;
40 class QgsExpression;
42 
43 #ifndef SIP_RUN
44 typedef QMap<QString, QString> QgsStringMap;
45 #endif
46 
51 class CORE_EXPORT QgsSymbolLayer
52 {
53 #ifdef SIP_RUN
54 #include <qgslinesymbollayer.h>
55 #endif
56 
57 
58 #ifdef SIP_RUN
60  switch ( sipCpp->type() )
61  {
62  case QgsSymbol::Marker:
63  if ( sipCpp->layerType() == "EllipseMarker" )
64  sipType = sipType_QgsEllipseSymbolLayer;
65  else if ( sipCpp->layerType() == "FontMarker" )
66  sipType = sipType_QgsFontMarkerSymbolLayer;
67  else if ( sipCpp->layerType() == "SimpleMarker" )
68  sipType = sipType_QgsSimpleMarkerSymbolLayer;
69  else if ( sipCpp->layerType() == "FilledMarker" )
70  sipType = sipType_QgsFilledMarkerSymbolLayer;
71  else if ( sipCpp->layerType() == "SvgMarker" )
72  sipType = sipType_QgsSvgMarkerSymbolLayer;
73  else if ( sipCpp->layerType() == "RasterMarker" )
74  sipType = sipType_QgsRasterMarkerSymbolLayer;
75  else if ( sipCpp->layerType() == "VectorField" )
76  sipType = sipType_QgsVectorFieldSymbolLayer;
77  else if ( sipCpp->layerType() == "MaskMarker" )
78  sipType = sipType_QgsMaskMarkerSymbolLayer;
79  else
80  sipType = sipType_QgsMarkerSymbolLayer;
81  break;
82 
83  case QgsSymbol::Line:
84  if ( sipCpp->layerType() == "MarkerLine" )
85  sipType = sipType_QgsMarkerLineSymbolLayer;
86  else if ( sipCpp->layerType() == "SimpleLine" )
87  sipType = sipType_QgsSimpleLineSymbolLayer;
88  else if ( sipCpp->layerType() == "ArrowLine" )
89  sipType = sipType_QgsArrowSymbolLayer;
90  else
91  sipType = sipType_QgsLineSymbolLayer;
92  break;
93 
94  case QgsSymbol::Fill:
95  if ( sipCpp->layerType() == "SimpleFill" )
96  sipType = sipType_QgsSimpleFillSymbolLayer;
97  else if ( sipCpp->layerType() == "LinePatternFill" )
98  sipType = sipType_QgsLinePatternFillSymbolLayer;
99  else if ( sipCpp->layerType() == "PointPatternFill" )
100  sipType = sipType_QgsPointPatternFillSymbolLayer;
101  else if ( sipCpp->layerType() == "SVGFill" )
102  sipType = sipType_QgsSVGFillSymbolLayer;
103  else if ( sipCpp->layerType() == "RasterFill" )
104  sipType = sipType_QgsRasterFillSymbolLayer;
105  else if ( sipCpp->layerType() == "CentroidFill" )
106  sipType = sipType_QgsCentroidFillSymbolLayer;
107  else if ( sipCpp->layerType() == "GradientFill" )
108  sipType = sipType_QgsGradientFillSymbolLayer;
109  else if ( sipCpp->layerType() == "ShapeburstFill" )
110  sipType = sipType_QgsShapeburstFillSymbolLayer;
111  else if ( sipCpp->layerType() == "RandomMarkerFill" )
112  sipType = sipType_QgsRandomMarkerFillSymbolLayer;
113  else
114  sipType = sipType_QgsFillSymbolLayer;
115  break;
116 
117  case QgsSymbol::Hybrid:
118  sipType = sipType_QgsGeometryGeneratorSymbolLayer;
119  break;
120  }
121  SIP_END
122 #endif
123  public:
124 
129  enum Property
130  {
131  PropertySize = 0,
187  PropertyDensityArea, //<! Density area
188  };
189 
194  static const QgsPropertiesDefinition &propertyDefinitions();
195 
196  virtual ~QgsSymbolLayer();
197 
199  QgsSymbolLayer( const QgsSymbolLayer &other ) = delete;
200 
202  QgsSymbolLayer &operator=( const QgsSymbolLayer &other ) = delete;
203 
209  bool enabled() const { return mEnabled; }
210 
218  void setEnabled( bool enabled ) { mEnabled = enabled; }
219 
223  virtual QColor color() const { return mColor; }
224 
228  virtual void setColor( const QColor &color ) { mColor = color; }
229 
233  virtual void setStrokeColor( const QColor &color ) { Q_UNUSED( color ) }
234 
238  virtual QColor strokeColor() const { return QColor(); }
239 
243  virtual void setFillColor( const QColor &color ) { Q_UNUSED( color ) }
244 
248  virtual QColor fillColor() const { return QColor(); }
249 
254  virtual QString layerType() const = 0;
255 
268  virtual void startRender( QgsSymbolRenderContext &context ) = 0;
269 
281  virtual void stopRender( QgsSymbolRenderContext &context ) = 0;
282 
301  virtual void startFeatureRender( const QgsFeature &feature, QgsRenderContext &context );
302 
321  virtual void stopFeatureRender( const QgsFeature &feature, QgsRenderContext &context );
322 
326  virtual QgsSymbolLayer *clone() const = 0 SIP_FACTORY;
327 
328  virtual void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const
329  { Q_UNUSED( props ) element.appendChild( doc.createComment( QStringLiteral( "SymbolLayerV2 %1 not implemented yet" ).arg( layerType() ) ) ); }
330 
331  virtual QString ogrFeatureStyle( double mmScaleFactor, double mapUnitScaleFactor ) const { Q_UNUSED( mmScaleFactor ) Q_UNUSED( mapUnitScaleFactor ); return QString(); }
332 
338  virtual QgsStringMap properties() const = 0;
339 
340  virtual void drawPreviewIcon( QgsSymbolRenderContext &context, QSize size ) = 0;
341 
345  virtual QgsSymbol *subSymbol() { return nullptr; }
346 
348  virtual bool setSubSymbol( QgsSymbol *symbol SIP_TRANSFER ) { delete symbol; return false; }
349 
350  QgsSymbol::SymbolType type() const { return mType; }
351 
353  virtual bool isCompatibleWithSymbol( QgsSymbol *symbol ) const;
354 
355  void setLocked( bool locked ) { mLocked = locked; }
356  bool isLocked() const { return mLocked; }
357 
364  virtual double estimateMaxBleed( const QgsRenderContext &context ) const { Q_UNUSED( context ) return 0; }
365 
374  virtual void setOutputUnit( QgsUnitTypes::RenderUnit unit ) { Q_UNUSED( unit ) }
375 
385 
386  virtual void setMapUnitScale( const QgsMapUnitScale &scale ) { Q_UNUSED( scale ) }
387  virtual QgsMapUnitScale mapUnitScale() const { return QgsMapUnitScale(); }
388 
395  void setRenderingPass( int renderingPass );
396 
403  int renderingPass() const;
404 
409  virtual QSet<QString> usedAttributes( const QgsRenderContext &context ) const;
410 
418  virtual void setDataDefinedProperty( Property key, const QgsProperty &property );
419 
421  virtual bool writeDxf( QgsDxfExport &e, double mmMapUnitScaleFactor, const QString &layerName, QgsSymbolRenderContext &context, QPointF shift = QPointF( 0.0, 0.0 ) ) const;
422 
424  virtual double dxfWidth( const QgsDxfExport &e, QgsSymbolRenderContext &context ) const;
425 
427  virtual double dxfOffset( const QgsDxfExport &e, QgsSymbolRenderContext &context ) const;
428 
430  virtual QColor dxfColor( QgsSymbolRenderContext &context ) const;
431 
433  virtual double dxfAngle( QgsSymbolRenderContext &context ) const;
434 
436  virtual QVector<qreal> dxfCustomDashPattern( QgsUnitTypes::RenderUnit &unit ) const;
437 
439  virtual Qt::PenStyle dxfPenStyle() const;
440 
442  virtual QColor dxfBrushColor( QgsSymbolRenderContext &context ) const;
443 
445  virtual Qt::BrushStyle dxfBrushStyle() const;
446 
453  QgsPaintEffect *paintEffect() const;
454 
461  void setPaintEffect( QgsPaintEffect *effect SIP_TRANSFER );
462 
469  virtual void prepareExpressions( const QgsSymbolRenderContext &context );
470 
477  QgsPropertyCollection &dataDefinedProperties() { return mDataDefinedProperties; }
478 
484  const QgsPropertyCollection &dataDefinedProperties() const { return mDataDefinedProperties; } SIP_SKIP
485 
492  void setDataDefinedProperties( const QgsPropertyCollection &collection ) { mDataDefinedProperties = collection; }
493 
499  virtual bool hasDataDefinedProperties() const;
500 
506  virtual QgsSymbolLayerReferenceList masks() const;
507 
508  protected:
509 
510  QgsSymbolLayer( QgsSymbol::SymbolType type, bool locked = false );
511 
513 
515  bool mEnabled = true;
516 
517  bool mLocked = false;
518  QColor mColor;
519  int mRenderingPass = 0;
520 
522 
523  std::unique_ptr< QgsPaintEffect > mPaintEffect;
525 
526  // Configuration of selected symbology implementation
528  static const bool SELECTION_IS_OPAQUE = true;
530  static const bool SELECT_FILL_BORDER = false;
532  static const bool SELECT_FILL_STYLE = false;
533 
538  void restoreOldDataDefinedProperties( const QgsStringMap &stringMap );
539 
544  void copyDataDefinedProperties( QgsSymbolLayer *destLayer ) const;
545 
551  void copyPaintEffect( QgsSymbolLayer *destLayer ) const;
552 
553  private:
554  static void initPropertyDefinitions();
555 
557  static QgsPropertiesDefinition sPropertyDefinitions;
558 
559 #ifdef SIP_RUN
560  QgsSymbolLayer( const QgsSymbolLayer &other );
561 #endif
562 
563 };
564 
566 
572 class CORE_EXPORT QgsMarkerSymbolLayer : public QgsSymbolLayer
573 {
574  public:
575 
578  {
582  };
583 
586  {
587  Top,
590  };
591 
593  QgsMarkerSymbolLayer( const QgsMarkerSymbolLayer &other ) = delete;
594 
596  QgsMarkerSymbolLayer &operator=( const QgsMarkerSymbolLayer &other ) = delete;
597 
598  void startRender( QgsSymbolRenderContext &context ) override;
599 
600  void stopRender( QgsSymbolRenderContext &context ) override;
601 
608  virtual void renderPoint( QPointF point, QgsSymbolRenderContext &context ) = 0;
609 
610  void drawPreviewIcon( QgsSymbolRenderContext &context, QSize size ) override;
611 
618  void setAngle( double angle ) { mAngle = angle; }
619 
624  double angle() const { return mAngle; }
625 
635  void setLineAngle( double lineAngle ) { mLineAngle = lineAngle; }
636 
644  virtual void setSize( double size ) { mSize = size; }
645 
652  double size() const { return mSize; }
653 
661  void setSizeUnit( QgsUnitTypes::RenderUnit unit ) { mSizeUnit = unit; }
662 
669  QgsUnitTypes::RenderUnit sizeUnit() const { return mSizeUnit; }
670 
678  void setSizeMapUnitScale( const QgsMapUnitScale &scale ) { mSizeMapUnitScale = scale; }
679 
686  const QgsMapUnitScale &sizeMapUnitScale() const { return mSizeMapUnitScale; }
687 
693  void setScaleMethod( QgsSymbol::ScaleMethod scaleMethod ) { mScaleMethod = scaleMethod; }
694 
699  QgsSymbol::ScaleMethod scaleMethod() const { return mScaleMethod; }
700 
709  void setOffset( QPointF offset ) { mOffset = offset; }
710 
718  QPointF offset() const { return mOffset; }
719 
727  void setOffsetUnit( QgsUnitTypes::RenderUnit unit ) { mOffsetUnit = unit; }
728 
735  QgsUnitTypes::RenderUnit offsetUnit() const { return mOffsetUnit; }
736 
744  void setOffsetMapUnitScale( const QgsMapUnitScale &scale ) { mOffsetMapUnitScale = scale; }
745 
752  const QgsMapUnitScale &offsetMapUnitScale() const { return mOffsetMapUnitScale; }
753 
761  void setHorizontalAnchorPoint( HorizontalAnchorPoint h ) { mHorizontalAnchorPoint = h; }
762 
769  HorizontalAnchorPoint horizontalAnchorPoint() const { return mHorizontalAnchorPoint; }
770 
778  void setVerticalAnchorPoint( VerticalAnchorPoint v ) { mVerticalAnchorPoint = v; }
779 
786  VerticalAnchorPoint verticalAnchorPoint() const { return mVerticalAnchorPoint; }
787 
788  void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const override;
789 
796  virtual void writeSldMarker( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const
797  { Q_UNUSED( props ) element.appendChild( doc.createComment( QStringLiteral( "QgsMarkerSymbolLayer %1 not implemented yet" ).arg( layerType() ) ) ); }
798 
799  void setOutputUnit( QgsUnitTypes::RenderUnit unit ) override;
800  QgsUnitTypes::RenderUnit outputUnit() const override;
801  void setMapUnitScale( const QgsMapUnitScale &scale ) override;
802  QgsMapUnitScale mapUnitScale() const override;
803 
810  virtual QRectF bounds( QPointF point, QgsSymbolRenderContext &context ) = 0;
811 
812  protected:
813 
818  QgsMarkerSymbolLayer( bool locked = false );
819 
827  void markerOffset( QgsSymbolRenderContext &context, double &offsetX, double &offsetY ) const;
828 
839  void markerOffset( QgsSymbolRenderContext &context, double width, double height, double &offsetX, double &offsetY ) const SIP_PYNAME( markerOffsetWithWidthAndHeight );
840 
842  void markerOffset( QgsSymbolRenderContext &context, double width, double height,
844  double &offsetX, double &offsetY,
845  const QgsMapUnitScale &widthMapUnitScale, const QgsMapUnitScale &heightMapUnitScale ) const SIP_PYNAME( markerOffset2 );
846 
853  static QPointF _rotatedOffset( QPointF offset, double angle );
854 
856  double mAngle = 0;
858  double mLineAngle = 0;
860  double mSize = 2.0;
866  QPointF mOffset;
874  HorizontalAnchorPoint mHorizontalAnchorPoint = HCenter;
876  VerticalAnchorPoint mVerticalAnchorPoint = VCenter;
877 
878  private:
879  static QgsMarkerSymbolLayer::HorizontalAnchorPoint decodeHorizontalAnchorPoint( const QString &str );
880  static QgsMarkerSymbolLayer::VerticalAnchorPoint decodeVerticalAnchorPoint( const QString &str );
881 
882 #ifdef SIP_RUN
884 #endif
885 };
886 
891 class CORE_EXPORT QgsLineSymbolLayer : public QgsSymbolLayer
892 {
893  public:
894 
897  {
901  };
902 
904  QgsLineSymbolLayer( const QgsLineSymbolLayer &other ) = delete;
905 
907  QgsLineSymbolLayer &operator=( const QgsLineSymbolLayer &other ) = delete;
908 
909  void setOutputUnit( QgsUnitTypes::RenderUnit unit ) override;
910  QgsUnitTypes::RenderUnit outputUnit() const override;
911  void setMapUnitScale( const QgsMapUnitScale &scale ) override;
912  QgsMapUnitScale mapUnitScale() const override;
913  void drawPreviewIcon( QgsSymbolRenderContext &context, QSize size ) override;
914  double dxfWidth( const QgsDxfExport &e, QgsSymbolRenderContext &context ) const override;
915 
920  virtual void renderPolyline( const QPolygonF &points, QgsSymbolRenderContext &context ) = 0;
921 
930  virtual void renderPolygonStroke( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context );
931 
945  virtual void setWidth( double width ) { mWidth = width; }
946 
956  virtual double width() const { return mWidth; }
957 
968  virtual double width( const QgsRenderContext &context ) const;
969 
979  double offset() const { return mOffset; }
980 
990  void setOffset( double offset ) { mOffset = offset; }
991 
998  void setOffsetUnit( QgsUnitTypes::RenderUnit unit ) { mOffsetUnit = unit; }
999 
1006  QgsUnitTypes::RenderUnit offsetUnit() const { return mOffsetUnit; }
1007 
1014  void setOffsetMapUnitScale( const QgsMapUnitScale &scale ) { mOffsetMapUnitScale = scale; }
1015 
1022  const QgsMapUnitScale &offsetMapUnitScale() const { return mOffsetMapUnitScale; }
1023 
1024  // TODO QGIS 4.0 - setWidthUnit(), widthUnit(), setWidthUnitScale(), widthUnitScale()
1025  // only apply to simple line symbol layers and do not belong here.
1026 
1032  void setWidthUnit( QgsUnitTypes::RenderUnit unit ) { mWidthUnit = unit; }
1033 
1038  QgsUnitTypes::RenderUnit widthUnit() const { return mWidthUnit; }
1039 
1040  void setWidthMapUnitScale( const QgsMapUnitScale &scale ) { mWidthMapUnitScale = scale; }
1041  const QgsMapUnitScale &widthMapUnitScale() const { return mWidthMapUnitScale; }
1042 
1053  RenderRingFilter ringFilter() const;
1054 
1065  void setRingFilter( QgsLineSymbolLayer::RenderRingFilter filter );
1066 
1067  protected:
1068  QgsLineSymbolLayer( bool locked = false );
1069 
1070  double mWidth = 0;
1073  double mOffset = 0;
1076 
1077  RenderRingFilter mRingFilter = AllRings;
1078 
1079  private:
1080 #ifdef SIP_RUN
1081  QgsLineSymbolLayer( const QgsLineSymbolLayer &other );
1082 #endif
1083 };
1084 
1089 class CORE_EXPORT QgsFillSymbolLayer : public QgsSymbolLayer
1090 {
1091  public:
1092 
1094  QgsFillSymbolLayer( const QgsFillSymbolLayer &other ) = delete;
1095 
1097  QgsFillSymbolLayer &operator=( const QgsFillSymbolLayer &other ) = delete;
1098 
1099  virtual void renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context ) = 0;
1100 
1101  void drawPreviewIcon( QgsSymbolRenderContext &context, QSize size ) override;
1102 
1103  void setAngle( double angle ) { mAngle = angle; }
1104  double angle() const { return mAngle; }
1105 
1106  protected:
1107  QgsFillSymbolLayer( bool locked = false );
1109  void _renderPolygon( QPainter *p, const QPolygonF &points, const QList<QPolygonF> *rings, QgsSymbolRenderContext &context );
1110 
1111  double mAngle = 0.0;
1112 
1113  private:
1114 #ifdef SIP_RUN
1115  QgsFillSymbolLayer( const QgsFillSymbolLayer &other );
1116 #endif
1117 };
1118 
1119 class QgsSymbolLayerWidget; // why does SIP fail, when this isn't here
1120 
1121 #endif
1122 
1123 
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:98
Abstract base class for all rendered symbols.
Definition: qgssymbol.h:62
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:42
Mixed or unknown units.
Definition: qgsunittypes.h:153
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:87
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:694
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:84
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:189
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:95
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:229
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:86
virtual QgsMapUnitScale mapUnitScale() const
Stroke style (eg solid, dashed)
Preserve aspect ratio between width and height.
Fill symbol.
Definition: qgssymbol.h:88
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:172
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:89
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:145
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.