QGIS API Documentation  3.10.0-A Coruña (6c816b4204)
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 
34 class QPainter;
35 class QSize;
36 class QPolygonF;
37 
38 class QgsDxfExport;
39 class QgsExpression;
40 class QgsRenderContext;
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
78  sipType = sipType_QgsMarkerSymbolLayer;
79  break;
80 
81  case QgsSymbol::Line:
82  if ( sipCpp->layerType() == "MarkerLine" )
83  sipType = sipType_QgsMarkerLineSymbolLayer;
84  else if ( sipCpp->layerType() == "SimpleLine" )
85  sipType = sipType_QgsSimpleLineSymbolLayer;
86  else if ( sipCpp->layerType() == "ArrowLine" )
87  sipType = sipType_QgsArrowSymbolLayer;
88  else
89  sipType = sipType_QgsLineSymbolLayer;
90  break;
91 
92  case QgsSymbol::Fill:
93  if ( sipCpp->layerType() == "SimpleFill" )
94  sipType = sipType_QgsSimpleFillSymbolLayer;
95  else if ( sipCpp->layerType() == "LinePatternFill" )
96  sipType = sipType_QgsLinePatternFillSymbolLayer;
97  else if ( sipCpp->layerType() == "PointPatternFill" )
98  sipType = sipType_QgsPointPatternFillSymbolLayer;
99  else if ( sipCpp->layerType() == "SVGFill" )
100  sipType = sipType_QgsSVGFillSymbolLayer;
101  else if ( sipCpp->layerType() == "RasterFill" )
102  sipType = sipType_QgsRasterFillSymbolLayer;
103  else if ( sipCpp->layerType() == "CentroidFill" )
104  sipType = sipType_QgsCentroidFillSymbolLayer;
105  else if ( sipCpp->layerType() == "GradientFill" )
106  sipType = sipType_QgsGradientFillSymbolLayer;
107  else if ( sipCpp->layerType() == "ShapeburstFill" )
108  sipType = sipType_QgsShapeburstFillSymbolLayer;
109  else
110  sipType = sipType_QgsFillSymbolLayer;
111  break;
112 
113  case QgsSymbol::Hybrid:
114  sipType = sipType_QgsGeometryGeneratorSymbolLayer;
115  break;
116  }
117  SIP_END
118 #endif
119  public:
120 
125  enum Property
126  {
127  PropertySize = 0,
180  };
181 
186  static const QgsPropertiesDefinition &propertyDefinitions();
187 
188  virtual ~QgsSymbolLayer();
189 
191  QgsSymbolLayer( const QgsSymbolLayer &other ) = delete;
192 
194  QgsSymbolLayer &operator=( const QgsSymbolLayer &other ) = delete;
195 
201  bool enabled() const { return mEnabled; }
202 
210  void setEnabled( bool enabled ) { mEnabled = enabled; }
211 
215  virtual QColor color() const { return mColor; }
216 
220  virtual void setColor( const QColor &color ) { mColor = color; }
221 
225  virtual void setStrokeColor( const QColor &color ) { Q_UNUSED( color ) }
226 
230  virtual QColor strokeColor() const { return QColor(); }
231 
235  virtual void setFillColor( const QColor &color ) { Q_UNUSED( color ) }
236 
240  virtual QColor fillColor() const { return QColor(); }
241 
246  virtual QString layerType() const = 0;
247 
248  virtual void startRender( QgsSymbolRenderContext &context ) = 0;
249  virtual void stopRender( QgsSymbolRenderContext &context ) = 0;
250 
254  virtual QgsSymbolLayer *clone() const = 0 SIP_FACTORY;
255 
256  virtual void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const
257  { Q_UNUSED( props ) element.appendChild( doc.createComment( QStringLiteral( "SymbolLayerV2 %1 not implemented yet" ).arg( layerType() ) ) ); }
258 
259  virtual QString ogrFeatureStyle( double mmScaleFactor, double mapUnitScaleFactor ) const { Q_UNUSED( mmScaleFactor ) Q_UNUSED( mapUnitScaleFactor ); return QString(); }
260 
266  virtual QgsStringMap properties() const = 0;
267 
268  virtual void drawPreviewIcon( QgsSymbolRenderContext &context, QSize size ) = 0;
269 
273  virtual QgsSymbol *subSymbol() { return nullptr; }
274 
276  virtual bool setSubSymbol( QgsSymbol *symbol SIP_TRANSFER ) { delete symbol; return false; }
277 
278  QgsSymbol::SymbolType type() const { return mType; }
279 
281  virtual bool isCompatibleWithSymbol( QgsSymbol *symbol ) const;
282 
283  void setLocked( bool locked ) { mLocked = locked; }
284  bool isLocked() const { return mLocked; }
285 
292  virtual double estimateMaxBleed( const QgsRenderContext &context ) const { Q_UNUSED( context ) return 0; }
293 
302  virtual void setOutputUnit( QgsUnitTypes::RenderUnit unit ) { Q_UNUSED( unit ) }
303 
313 
314  virtual void setMapUnitScale( const QgsMapUnitScale &scale ) { Q_UNUSED( scale ) }
315  virtual QgsMapUnitScale mapUnitScale() const { return QgsMapUnitScale(); }
316 
323  void setRenderingPass( int renderingPass );
324 
331  int renderingPass() const;
332 
337  virtual QSet<QString> usedAttributes( const QgsRenderContext &context ) const;
338 
346  virtual void setDataDefinedProperty( Property key, const QgsProperty &property );
347 
349  virtual bool writeDxf( QgsDxfExport &e, double mmMapUnitScaleFactor, const QString &layerName, QgsSymbolRenderContext &context, QPointF shift = QPointF( 0.0, 0.0 ) ) const;
350 
352  virtual double dxfWidth( const QgsDxfExport &e, QgsSymbolRenderContext &context ) const;
353 
355  virtual double dxfOffset( const QgsDxfExport &e, QgsSymbolRenderContext &context ) const;
356 
358  virtual QColor dxfColor( QgsSymbolRenderContext &context ) const;
359 
361  virtual double dxfAngle( QgsSymbolRenderContext &context ) const;
362 
364  virtual QVector<qreal> dxfCustomDashPattern( QgsUnitTypes::RenderUnit &unit ) const;
365 
367  virtual Qt::PenStyle dxfPenStyle() const;
368 
370  virtual QColor dxfBrushColor( QgsSymbolRenderContext &context ) const;
371 
373  virtual Qt::BrushStyle dxfBrushStyle() const;
374 
381  QgsPaintEffect *paintEffect() const;
382 
389  void setPaintEffect( QgsPaintEffect *effect SIP_TRANSFER );
390 
397  virtual void prepareExpressions( const QgsSymbolRenderContext &context );
398 
405  QgsPropertyCollection &dataDefinedProperties() { return mDataDefinedProperties; }
406 
412  const QgsPropertyCollection &dataDefinedProperties() const { return mDataDefinedProperties; } SIP_SKIP
413 
420  void setDataDefinedProperties( const QgsPropertyCollection &collection ) { mDataDefinedProperties = collection; }
421 
427  virtual bool hasDataDefinedProperties() const;
428 
429  protected:
430 
431  QgsSymbolLayer( QgsSymbol::SymbolType type, bool locked = false );
432 
434 
436  bool mEnabled = true;
437 
438  bool mLocked = false;
439  QColor mColor;
440  int mRenderingPass = 0;
441 
443 
444  std::unique_ptr< QgsPaintEffect > mPaintEffect;
446 
447  // Configuration of selected symbology implementation
449  static const bool SELECTION_IS_OPAQUE = true;
451  static const bool SELECT_FILL_BORDER = false;
453  static const bool SELECT_FILL_STYLE = false;
454 
459  void restoreOldDataDefinedProperties( const QgsStringMap &stringMap );
460 
465  void copyDataDefinedProperties( QgsSymbolLayer *destLayer ) const;
466 
472  void copyPaintEffect( QgsSymbolLayer *destLayer ) const;
473 
474  private:
475  static void initPropertyDefinitions();
476 
478  static QgsPropertiesDefinition sPropertyDefinitions;
479 
480 #ifdef SIP_RUN
481  QgsSymbolLayer( const QgsSymbolLayer &other );
482 #endif
483 
484 };
485 
487 
493 class CORE_EXPORT QgsMarkerSymbolLayer : public QgsSymbolLayer
494 {
495  public:
496 
499  {
503  };
504 
507  {
508  Top,
511  };
512 
514  QgsMarkerSymbolLayer( const QgsMarkerSymbolLayer &other ) = delete;
515 
517  QgsMarkerSymbolLayer &operator=( const QgsMarkerSymbolLayer &other ) = delete;
518 
519  void startRender( QgsSymbolRenderContext &context ) override;
520 
521  void stopRender( QgsSymbolRenderContext &context ) override;
522 
529  virtual void renderPoint( QPointF point, QgsSymbolRenderContext &context ) = 0;
530 
531  void drawPreviewIcon( QgsSymbolRenderContext &context, QSize size ) override;
532 
539  void setAngle( double angle ) { mAngle = angle; }
540 
545  double angle() const { return mAngle; }
546 
556  void setLineAngle( double lineAngle ) { mLineAngle = lineAngle; }
557 
565  virtual void setSize( double size ) { mSize = size; }
566 
573  double size() const { return mSize; }
574 
582  void setSizeUnit( QgsUnitTypes::RenderUnit unit ) { mSizeUnit = unit; }
583 
590  QgsUnitTypes::RenderUnit sizeUnit() const { return mSizeUnit; }
591 
599  void setSizeMapUnitScale( const QgsMapUnitScale &scale ) { mSizeMapUnitScale = scale; }
600 
607  const QgsMapUnitScale &sizeMapUnitScale() const { return mSizeMapUnitScale; }
608 
614  void setScaleMethod( QgsSymbol::ScaleMethod scaleMethod ) { mScaleMethod = scaleMethod; }
615 
620  QgsSymbol::ScaleMethod scaleMethod() const { return mScaleMethod; }
621 
630  void setOffset( QPointF offset ) { mOffset = offset; }
631 
639  QPointF offset() const { return mOffset; }
640 
648  void setOffsetUnit( QgsUnitTypes::RenderUnit unit ) { mOffsetUnit = unit; }
649 
656  QgsUnitTypes::RenderUnit offsetUnit() const { return mOffsetUnit; }
657 
665  void setOffsetMapUnitScale( const QgsMapUnitScale &scale ) { mOffsetMapUnitScale = scale; }
666 
673  const QgsMapUnitScale &offsetMapUnitScale() const { return mOffsetMapUnitScale; }
674 
682  void setHorizontalAnchorPoint( HorizontalAnchorPoint h ) { mHorizontalAnchorPoint = h; }
683 
690  HorizontalAnchorPoint horizontalAnchorPoint() const { return mHorizontalAnchorPoint; }
691 
699  void setVerticalAnchorPoint( VerticalAnchorPoint v ) { mVerticalAnchorPoint = v; }
700 
707  VerticalAnchorPoint verticalAnchorPoint() const { return mVerticalAnchorPoint; }
708 
709  void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const override;
710 
717  virtual void writeSldMarker( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const
718  { Q_UNUSED( props ) element.appendChild( doc.createComment( QStringLiteral( "QgsMarkerSymbolLayer %1 not implemented yet" ).arg( layerType() ) ) ); }
719 
720  void setOutputUnit( QgsUnitTypes::RenderUnit unit ) override;
721  QgsUnitTypes::RenderUnit outputUnit() const override;
722  void setMapUnitScale( const QgsMapUnitScale &scale ) override;
723  QgsMapUnitScale mapUnitScale() const override;
724 
731  virtual QRectF bounds( QPointF point, QgsSymbolRenderContext &context ) = 0;
732 
733  protected:
734 
739  QgsMarkerSymbolLayer( bool locked = false );
740 
748  void markerOffset( QgsSymbolRenderContext &context, double &offsetX, double &offsetY ) const;
749 
760  void markerOffset( QgsSymbolRenderContext &context, double width, double height, double &offsetX, double &offsetY ) const SIP_PYNAME( markerOffsetWithWidthAndHeight );
761 
763  void markerOffset( QgsSymbolRenderContext &context, double width, double height,
765  double &offsetX, double &offsetY,
766  const QgsMapUnitScale &widthMapUnitScale, const QgsMapUnitScale &heightMapUnitScale ) const SIP_PYNAME( markerOffset2 );
767 
774  static QPointF _rotatedOffset( QPointF offset, double angle );
775 
777  double mAngle = 0;
779  double mLineAngle = 0;
781  double mSize = 2.0;
787  QPointF mOffset;
795  HorizontalAnchorPoint mHorizontalAnchorPoint = HCenter;
797  VerticalAnchorPoint mVerticalAnchorPoint = VCenter;
798 
799  private:
800  static QgsMarkerSymbolLayer::HorizontalAnchorPoint decodeHorizontalAnchorPoint( const QString &str );
801  static QgsMarkerSymbolLayer::VerticalAnchorPoint decodeVerticalAnchorPoint( const QString &str );
802 
803 #ifdef SIP_RUN
805 #endif
806 };
807 
812 class CORE_EXPORT QgsLineSymbolLayer : public QgsSymbolLayer
813 {
814  public:
815 
818  {
822  };
823 
825  QgsLineSymbolLayer( const QgsLineSymbolLayer &other ) = delete;
826 
828  QgsLineSymbolLayer &operator=( const QgsLineSymbolLayer &other ) = delete;
829 
830  void setOutputUnit( QgsUnitTypes::RenderUnit unit ) override;
831  QgsUnitTypes::RenderUnit outputUnit() const override;
832  void setMapUnitScale( const QgsMapUnitScale &scale ) override;
833  QgsMapUnitScale mapUnitScale() const override;
834  void drawPreviewIcon( QgsSymbolRenderContext &context, QSize size ) override;
835  double dxfWidth( const QgsDxfExport &e, QgsSymbolRenderContext &context ) const override;
836 
841  virtual void renderPolyline( const QPolygonF &points, QgsSymbolRenderContext &context ) = 0;
842 
851  virtual void renderPolygonStroke( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context );
852 
866  virtual void setWidth( double width ) { mWidth = width; }
867 
877  virtual double width() const { return mWidth; }
878 
889  virtual double width( const QgsRenderContext &context ) const;
890 
900  double offset() const { return mOffset; }
901 
911  void setOffset( double offset ) { mOffset = offset; }
912 
919  void setOffsetUnit( QgsUnitTypes::RenderUnit unit ) { mOffsetUnit = unit; }
920 
927  QgsUnitTypes::RenderUnit offsetUnit() const { return mOffsetUnit; }
928 
935  void setOffsetMapUnitScale( const QgsMapUnitScale &scale ) { mOffsetMapUnitScale = scale; }
936 
943  const QgsMapUnitScale &offsetMapUnitScale() const { return mOffsetMapUnitScale; }
944 
945  // TODO QGIS 4.0 - setWidthUnit(), widthUnit(), setWidthUnitScale(), widthUnitScale()
946  // only apply to simple line symbol layers and do not belong here.
947 
953  void setWidthUnit( QgsUnitTypes::RenderUnit unit ) { mWidthUnit = unit; }
954 
959  QgsUnitTypes::RenderUnit widthUnit() const { return mWidthUnit; }
960 
961  void setWidthMapUnitScale( const QgsMapUnitScale &scale ) { mWidthMapUnitScale = scale; }
962  const QgsMapUnitScale &widthMapUnitScale() const { return mWidthMapUnitScale; }
963 
974  RenderRingFilter ringFilter() const;
975 
986  void setRingFilter( QgsLineSymbolLayer::RenderRingFilter filter );
987 
988  protected:
989  QgsLineSymbolLayer( bool locked = false );
990 
991  double mWidth = 0;
994  double mOffset = 0;
997 
998  RenderRingFilter mRingFilter = AllRings;
999 
1000  private:
1001 #ifdef SIP_RUN
1002  QgsLineSymbolLayer( const QgsLineSymbolLayer &other );
1003 #endif
1004 };
1005 
1010 class CORE_EXPORT QgsFillSymbolLayer : public QgsSymbolLayer
1011 {
1012  public:
1013 
1015  QgsFillSymbolLayer( const QgsFillSymbolLayer &other ) = delete;
1016 
1018  QgsFillSymbolLayer &operator=( const QgsFillSymbolLayer &other ) = delete;
1019 
1020  virtual void renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context ) = 0;
1021 
1022  void drawPreviewIcon( QgsSymbolRenderContext &context, QSize size ) override;
1023 
1024  void setAngle( double angle ) { mAngle = angle; }
1025  double angle() const { return mAngle; }
1026 
1027  protected:
1028  QgsFillSymbolLayer( bool locked = false );
1030  void _renderPolygon( QPainter *p, const QPolygonF &points, const QList<QPolygonF> *rings, QgsSymbolRenderContext &context );
1031 
1032  double mAngle = 0.0;
1033 
1034  private:
1035 #ifdef SIP_RUN
1036  QgsFillSymbolLayer( const QgsFillSymbolLayer &other );
1037 #endif
1038 };
1039 
1040 class QgsSymbolLayerWidget; // why does SIP fail, when this isn't here
1041 
1042 #endif
1043 
1044 
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:97
Abstract base class for all rendered symbols.
Definition: qgssymbol.h:61
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.
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:86
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:612
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:83
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.
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:94
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:85
virtual QgsMapUnitScale mapUnitScale() const
Stroke style (eg solid, dashed)
Preserve aspect ratio between width and height.
Fill symbol.
Definition: qgssymbol.h:87
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
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:88
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
Horizontal distance between points.
virtual QString layerType() const =0
Returns a string that represents this layer type.
Vertical distance between points.