QGIS API Documentation  3.0.2-Girona (307d082)
qgsfillsymbollayer.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsfillsymbollayer.h
3  ---------------------
4  begin : November 2009
5  copyright : (C) 2009 by Martin Dobias
6  email : wonder dot sk at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #ifndef QGSFILLSYMBOLLAYERV2_H
17 #define QGSFILLSYMBOLLAYERV2_H
18 
19 #include "qgis_core.h"
20 #include "qgis.h"
21 #include "qgssymbollayer.h"
22 
23 #define DEFAULT_SIMPLEFILL_COLOR QColor(0,0,255)
24 #define DEFAULT_SIMPLEFILL_STYLE Qt::SolidPattern
25 #define DEFAULT_SIMPLEFILL_BORDERCOLOR QColor( 35, 35, 35 )
26 #define DEFAULT_SIMPLEFILL_BORDERSTYLE Qt::SolidLine
27 #define DEFAULT_SIMPLEFILL_BORDERWIDTH DEFAULT_LINE_WIDTH
28 #define DEFAULT_SIMPLEFILL_JOINSTYLE Qt::BevelJoin
29 
30 #define INF 1E20
31 
32 #include <QPen>
33 #include <QBrush>
34 
39 class CORE_EXPORT QgsSimpleFillSymbolLayer : public QgsFillSymbolLayer
40 {
41  public:
43  Qt::BrushStyle style = DEFAULT_SIMPLEFILL_STYLE,
44  const QColor &strokeColor = DEFAULT_SIMPLEFILL_BORDERCOLOR,
45  Qt::PenStyle strokeStyle = DEFAULT_SIMPLEFILL_BORDERSTYLE,
46  double strokeWidth = DEFAULT_SIMPLEFILL_BORDERWIDTH,
47  Qt::PenJoinStyle penJoinStyle = DEFAULT_SIMPLEFILL_JOINSTYLE
48  );
49 
50  // static stuff
51 
52  static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;
53  static QgsSymbolLayer *createFromSld( QDomElement &element ) SIP_FACTORY;
54 
55  // implemented from base classes
56 
57  QString layerType() const override;
58 
59  void startRender( QgsSymbolRenderContext &context ) override;
60 
61  void stopRender( QgsSymbolRenderContext &context ) override;
62 
63  void renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context ) override;
64 
65  QgsStringMap properties() const override;
66 
67  QgsSimpleFillSymbolLayer *clone() const override SIP_FACTORY;
68 
69  void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const override;
70 
71  QString ogrFeatureStyle( double mmScaleFactor, double mapUnitScaleFactor ) const override;
72 
73  Qt::BrushStyle brushStyle() const { return mBrushStyle; }
74  void setBrushStyle( Qt::BrushStyle style ) { mBrushStyle = style; }
75 
76  QColor strokeColor() const override { return mStrokeColor; }
77  void setStrokeColor( const QColor &strokeColor ) override { mStrokeColor = strokeColor; }
78 
79  QColor fillColor() const override { return color(); }
80  void setFillColor( const QColor &color ) override { setColor( color ); }
81 
82  Qt::PenStyle strokeStyle() const { return mStrokeStyle; }
83  void setStrokeStyle( Qt::PenStyle strokeStyle ) { mStrokeStyle = strokeStyle; }
84 
85  double strokeWidth() const { return mStrokeWidth; }
86  void setStrokeWidth( double strokeWidth ) { mStrokeWidth = strokeWidth; }
87 
88  Qt::PenJoinStyle penJoinStyle() const { return mPenJoinStyle; }
89  void setPenJoinStyle( Qt::PenJoinStyle style ) { mPenJoinStyle = style; }
90 
91  void setOffset( QPointF offset ) { mOffset = offset; }
92  QPointF offset() { return mOffset; }
93 
99  void setStrokeWidthUnit( QgsUnitTypes::RenderUnit unit ) { mStrokeWidthUnit = unit; }
100 
105  QgsUnitTypes::RenderUnit strokeWidthUnit() const { return mStrokeWidthUnit; }
106 
107  void setStrokeWidthMapUnitScale( const QgsMapUnitScale &scale ) { mStrokeWidthMapUnitScale = scale; }
108  const QgsMapUnitScale &strokeWidthMapUnitScale() const { return mStrokeWidthMapUnitScale; }
109 
115  void setOffsetUnit( QgsUnitTypes::RenderUnit unit ) { mOffsetUnit = unit; }
116 
121  QgsUnitTypes::RenderUnit offsetUnit() const { return mOffsetUnit; }
122 
123  void setOffsetMapUnitScale( const QgsMapUnitScale &scale ) { mOffsetMapUnitScale = scale; }
124  const QgsMapUnitScale &offsetMapUnitScale() const { return mOffsetMapUnitScale; }
125 
126  void setOutputUnit( QgsUnitTypes::RenderUnit unit ) override;
127  QgsUnitTypes::RenderUnit outputUnit() const override;
128 
129  void setMapUnitScale( const QgsMapUnitScale &scale ) override;
130  QgsMapUnitScale mapUnitScale() const override;
131 
132  double estimateMaxBleed( const QgsRenderContext &context ) const override;
133 
134  double dxfWidth( const QgsDxfExport &e, QgsSymbolRenderContext &context ) const override;
135  QColor dxfColor( QgsSymbolRenderContext &context ) const override;
136  double dxfAngle( QgsSymbolRenderContext &context ) const override;
137 
138  Qt::PenStyle dxfPenStyle() const override;
139  QColor dxfBrushColor( QgsSymbolRenderContext &context ) const override;
140  Qt::BrushStyle dxfBrushStyle() const override;
141 
142  protected:
143  QBrush mBrush;
144  QBrush mSelBrush;
145  Qt::BrushStyle mBrushStyle;
146  QColor mStrokeColor;
147  Qt::PenStyle mStrokeStyle;
148  double mStrokeWidth;
151  Qt::PenJoinStyle mPenJoinStyle;
152  QPen mPen;
153  QPen mSelPen;
154 
155  QPointF mOffset;
158 
159  private:
160  //helper functions for data defined symbology
161  void applyDataDefinedSymbology( QgsSymbolRenderContext &context, QBrush &brush, QPen &pen, QPen &selPen );
162 };
163 
164 class QgsColorRamp;
165 
171 {
172  public:
173 
175  {
177  ColorRamp
178  };
179 
181  {
184  Conical
185  };
186 
188  {
190  Viewport
191  };
192 
194  {
197  Repeat
198  };
199 
201  const QColor &color2 = Qt::white,
202  GradientColorType gradientColorType = SimpleTwoColor,
203  GradientType gradientType = Linear,
204  GradientCoordinateMode coordinateMode = Feature,
205  GradientSpread gradientSpread = Pad
206  );
207 
208  ~QgsGradientFillSymbolLayer() override;
209 
210  // static stuff
211 
212  static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;
213 
214  // implemented from base classes
215 
216  QString layerType() const override;
217 
218  void startRender( QgsSymbolRenderContext &context ) override;
219 
220  void stopRender( QgsSymbolRenderContext &context ) override;
221 
222  void renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context ) override;
223 
224  QgsStringMap properties() const override;
225 
226  QgsGradientFillSymbolLayer *clone() const override SIP_FACTORY;
227 
228  double estimateMaxBleed( const QgsRenderContext &context ) const override;
229 
231  GradientType gradientType() const { return mGradientType; }
232  void setGradientType( GradientType gradientType ) { mGradientType = gradientType; }
233 
235  GradientColorType gradientColorType() const { return mGradientColorType; }
236  void setGradientColorType( GradientColorType gradientColorType ) { mGradientColorType = gradientColorType; }
237 
244  QgsColorRamp *colorRamp() { return mGradientRamp; }
245 
253  void setColorRamp( QgsColorRamp *ramp );
254 
256  QColor color2() const { return mColor2; }
257  void setColor2( const QColor &color2 ) { mColor2 = color2; }
258 
260  GradientCoordinateMode coordinateMode() const { return mCoordinateMode; }
261  void setCoordinateMode( GradientCoordinateMode coordinateMode ) { mCoordinateMode = coordinateMode; }
262 
264  GradientSpread gradientSpread() const { return mGradientSpread; }
265  void setGradientSpread( GradientSpread gradientSpread ) { mGradientSpread = gradientSpread; }
266 
268  void setReferencePoint1( QPointF referencePoint ) { mReferencePoint1 = referencePoint; }
269  QPointF referencePoint1() const { return mReferencePoint1; }
270 
272  void setReferencePoint1IsCentroid( bool isCentroid ) { mReferencePoint1IsCentroid = isCentroid; }
273  bool referencePoint1IsCentroid() const { return mReferencePoint1IsCentroid; }
274 
276  void setReferencePoint2( QPointF referencePoint ) { mReferencePoint2 = referencePoint; }
277  QPointF referencePoint2() const { return mReferencePoint2; }
278 
280  void setReferencePoint2IsCentroid( bool isCentroid ) { mReferencePoint2IsCentroid = isCentroid; }
281  bool referencePoint2IsCentroid() const { return mReferencePoint2IsCentroid; }
282 
284  void setOffset( QPointF offset ) { mOffset = offset; }
285  QPointF offset() const { return mOffset; }
286 
288  void setOffsetUnit( QgsUnitTypes::RenderUnit unit ) { mOffsetUnit = unit; }
289  QgsUnitTypes::RenderUnit offsetUnit() const { return mOffsetUnit; }
290 
291  void setOffsetMapUnitScale( const QgsMapUnitScale &scale ) { mOffsetMapUnitScale = scale; }
292  const QgsMapUnitScale &offsetMapUnitScale() const { return mOffsetMapUnitScale; }
293 
294  void setOutputUnit( QgsUnitTypes::RenderUnit unit ) override;
295  QgsUnitTypes::RenderUnit outputUnit() const override;
296 
297  void setMapUnitScale( const QgsMapUnitScale &scale ) override;
298  QgsMapUnitScale mapUnitScale() const override;
299 
300  protected:
301  QBrush mBrush;
302  QBrush mSelBrush;
303 
305  QColor mColor2;
306  QgsColorRamp *mGradientRamp = nullptr;
310 
312  bool mReferencePoint1IsCentroid = false;
314  bool mReferencePoint2IsCentroid = false;
315 
316  QPointF mOffset;
319 
320  private:
321 
322  //helper functions for data defined symbology
323  void applyDataDefinedSymbology( QgsSymbolRenderContext &context, const QPolygonF &points );
324 
326  void applyGradient( const QgsSymbolRenderContext &context, QBrush &brush, const QColor &color, const QColor &color2,
327  GradientColorType gradientColorType, QgsColorRamp *gradientRamp, GradientType gradientType,
328  GradientCoordinateMode coordinateMode, GradientSpread gradientSpread,
329  QPointF referencePoint1, QPointF referencePoint2, const double angle );
330 
332  QPointF rotateReferencePoint( QPointF refPoint, double angle );
333 };
334 
340 {
341  public:
342 
344  {
346  ColorRamp
347  };
348 
349  QgsShapeburstFillSymbolLayer( const QColor &color = DEFAULT_SIMPLEFILL_COLOR, const QColor &color2 = Qt::white,
350  ShapeburstColorType colorType = SimpleTwoColor,
351  int blurRadius = 0, bool useWholeShape = true, double maxDistance = 5 );
352 
353  ~QgsShapeburstFillSymbolLayer() override;
354 
355  // static stuff
356 
357  static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;
358 
359  // implemented from base classes
360 
361  QString layerType() const override;
362 
363  void startRender( QgsSymbolRenderContext &context ) override;
364 
365  void stopRender( QgsSymbolRenderContext &context ) override;
366 
367  void renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context ) override;
368 
369  QgsStringMap properties() const override;
370 
371  QgsShapeburstFillSymbolLayer *clone() const override SIP_FACTORY;
372 
373  double estimateMaxBleed( const QgsRenderContext &context ) const override;
374 
381  void setBlurRadius( int blurRadius ) { mBlurRadius = blurRadius; }
382 
389  int blurRadius() const { return mBlurRadius; }
390 
399  void setUseWholeShape( bool useWholeShape ) { mUseWholeShape = useWholeShape; }
400 
408  bool useWholeShape() const { return mUseWholeShape; }
409 
418  void setMaxDistance( double maxDistance ) { mMaxDistance = maxDistance; }
419 
428  double maxDistance() const { return mMaxDistance; }
429 
437  void setDistanceUnit( QgsUnitTypes::RenderUnit unit ) { mDistanceUnit = unit; }
438 
446  QgsUnitTypes::RenderUnit distanceUnit() const { return mDistanceUnit; }
447 
448  void setDistanceMapUnitScale( const QgsMapUnitScale &scale ) { mDistanceMapUnitScale = scale; }
449  const QgsMapUnitScale &distanceMapUnitScale() const { return mDistanceMapUnitScale; }
450 
461  void setColorType( ShapeburstColorType colorType ) { mColorType = colorType; }
462 
473  ShapeburstColorType colorType() const { return mColorType; }
474 
482  void setColorRamp( QgsColorRamp *ramp );
483 
491  QgsColorRamp *colorRamp() { return mGradientRamp; }
492 
500  void setColor2( const QColor &color2 ) { mColor2 = color2; }
501 
509  QColor color2() const { return mColor2; }
510 
518  void setIgnoreRings( bool ignoreRings ) { mIgnoreRings = ignoreRings; }
519 
526  bool ignoreRings() const { return mIgnoreRings; }
527 
535  void setOffset( QPointF offset ) { mOffset = offset; }
536 
544  QPointF offset() const { return mOffset; }
545 
553  void setOffsetUnit( QgsUnitTypes::RenderUnit unit ) { mOffsetUnit = unit; }
554 
562  QgsUnitTypes::RenderUnit offsetUnit() const { return mOffsetUnit; }
563 
564  void setOffsetMapUnitScale( const QgsMapUnitScale &scale ) { mOffsetMapUnitScale = scale; }
565  const QgsMapUnitScale &offsetMapUnitScale() const { return mOffsetMapUnitScale; }
566 
567  void setOutputUnit( QgsUnitTypes::RenderUnit unit ) override;
568  QgsUnitTypes::RenderUnit outputUnit() const override;
569 
570  void setMapUnitScale( const QgsMapUnitScale &scale ) override;
571  QgsMapUnitScale mapUnitScale() const override;
572 
573  protected:
574  QBrush mBrush;
575  QBrush mSelBrush;
576 
578 
580  double mMaxDistance;
583 
585  QColor mColor2;
586  QgsColorRamp *mGradientRamp = nullptr;
587  QgsColorRamp *mTwoColorGradientRamp = nullptr;
588 
589  bool mIgnoreRings = false;
590 
591  QPointF mOffset;
594 
595  private:
596 
597  //helper functions for data defined symbology
598  void applyDataDefinedSymbology( QgsSymbolRenderContext &context, QColor &color, QColor &color2, int &blurRadius, bool &useWholeShape,
599  double &maxDistance, bool &ignoreRings );
600 
601  /* distance transform of a 1d function using squared distance */
602  void distanceTransform1d( double *f, int n, int *v, double *z, double *d );
603  /* distance transform of 2d function using squared distance */
604  void distanceTransform2d( double *im, int width, int height );
605  /* distance transform of a binary QImage */
606  double *distanceTransform( QImage *im );
607 
608  /* fills a QImage with values from an array of doubles containing squared distance transform values */
609  void dtArrayToQImage( double *array, QImage *im, QgsColorRamp *ramp, double layerAlpha = 1, bool useWholeShape = true, int maxPixelDistance = 0 );
610 };
611 
616 {
617  public:
618 
620  void renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context ) override;
621 
622  QgsSymbol *subSymbol() override { return mStroke.get(); }
623  bool setSubSymbol( QgsSymbol *symbol SIP_TRANSFER ) override;
624 
630  void setStrokeWidthUnit( QgsUnitTypes::RenderUnit unit ) { mStrokeWidthUnit = unit; }
631 
636  QgsUnitTypes::RenderUnit strokeWidthUnit() const { return mStrokeWidthUnit; }
637 
638  void setStrokeWidthMapUnitScale( const QgsMapUnitScale &scale ) { mStrokeWidthMapUnitScale = scale; }
639  const QgsMapUnitScale &strokeWidthMapUnitScale() const { return mStrokeWidthMapUnitScale; }
640 
641  void setOutputUnit( QgsUnitTypes::RenderUnit unit ) override;
642  QgsUnitTypes::RenderUnit outputUnit() const override;
643 
644  void setMapUnitScale( const QgsMapUnitScale &scale ) override;
645  QgsMapUnitScale mapUnitScale() const override;
646 
647  double estimateMaxBleed( const QgsRenderContext &context ) const override;
648 
649  double dxfWidth( const QgsDxfExport &e, QgsSymbolRenderContext &context ) const override;
650  QColor dxfColor( QgsSymbolRenderContext &context ) const override;
651 
652  Qt::PenStyle dxfPenStyle() const override;
653 
654  QSet<QString> usedAttributes( const QgsRenderContext &context ) const override;
655 
656  protected:
657  QBrush mBrush;
658  double mNextAngle = 0.0; // mAngle / data defined angle
659 
661  double mStrokeWidth = 0.0;
664 
666  std::unique_ptr< QgsLineSymbol > mStroke;
667 
668  virtual void applyDataDefinedSettings( QgsSymbolRenderContext &context ) { Q_UNUSED( context ); }
669 
670  private:
671 #ifdef SIP_RUN
673 #endif
674 };
675 
683 {
684  public:
685 
687  {
689  Viewport
690  };
691 
692  QgsRasterFillSymbolLayer( const QString &imageFilePath = QString() );
693 
694  static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;
695 
701  static void resolvePaths( QgsStringMap &properties, const QgsPathResolver &pathResolver, bool saving );
702 
703  // implemented from base classes
704  QString layerType() const override;
705  void renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context ) override;
706  void startRender( QgsSymbolRenderContext &context ) override;
707  void stopRender( QgsSymbolRenderContext &context ) override;
708  QgsStringMap properties() const override;
709  QgsRasterFillSymbolLayer *clone() const override SIP_FACTORY;
710  double estimateMaxBleed( const QgsRenderContext &context ) const override;
711 
712  //override QgsImageFillSymbolLayer's support for sub symbols
713  QgsSymbol *subSymbol() override { return nullptr; }
714  bool setSubSymbol( QgsSymbol *symbol SIP_TRANSFER ) override;
715 
721  void setImageFilePath( const QString &imagePath );
722 
728  QString imageFilePath() const { return mImageFilePath; }
729 
736  void setCoordinateMode( const FillCoordinateMode mode );
737 
744  FillCoordinateMode coordinateMode() const { return mCoordinateMode; }
745 
751  void setOpacity( const double opacity );
752 
758  double opacity() const { return mOpacity; }
759 
767  void setOffset( QPointF offset ) { mOffset = offset; }
768 
776  QPointF offset() const { return mOffset; }
777 
785  void setOffsetUnit( const QgsUnitTypes::RenderUnit unit ) { mOffsetUnit = unit; }
786 
794  QgsUnitTypes::RenderUnit offsetUnit() const { return mOffsetUnit; }
795 
803  void setOffsetMapUnitScale( const QgsMapUnitScale &scale ) { mOffsetMapUnitScale = scale; }
804 
812  const QgsMapUnitScale &offsetMapUnitScale() const { return mOffsetMapUnitScale; }
813 
822  void setWidth( const double width ) { mWidth = width; }
823 
832  double width() const { return mWidth; }
833 
841  void setWidthUnit( const QgsUnitTypes::RenderUnit unit ) { mWidthUnit = unit; }
842 
850  QgsUnitTypes::RenderUnit widthUnit() const { return mWidthUnit; }
851 
859  void setWidthMapUnitScale( const QgsMapUnitScale &scale ) { mWidthMapUnitScale = scale; }
860 
868  const QgsMapUnitScale &widthMapUnitScale() const { return mWidthMapUnitScale; }
869 
870  protected:
871 
873  QString mImageFilePath;
875  double mOpacity = 1.0;
876 
877  QPointF mOffset;
880 
881  double mWidth = 0.0;
884 
885  void applyDataDefinedSettings( QgsSymbolRenderContext &context ) override;
886 
887  private:
888 
890  void applyPattern( QBrush &brush, const QString &imageFilePath, const double width, const double opacity,
891  const QgsSymbolRenderContext &context );
892 };
893 
899 {
900  public:
902  QgsSVGFillSymbolLayer( const QString &svgFilePath, double width = 20, double rotation = 0.0 );
903  QgsSVGFillSymbolLayer( const QByteArray &svgData, double width = 20, double rotation = 0.0 );
904  ~QgsSVGFillSymbolLayer() override;
905 
906  static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;
907  static QgsSymbolLayer *createFromSld( QDomElement &element ) SIP_FACTORY;
908 
914  static void resolvePaths( QgsStringMap &properties, const QgsPathResolver &pathResolver, bool saving );
915 
916  // implemented from base classes
917 
918  QString layerType() const override;
919 
920  void startRender( QgsSymbolRenderContext &context ) override;
921  void stopRender( QgsSymbolRenderContext &context ) override;
922 
923  QgsStringMap properties() const override;
924 
925  QgsSVGFillSymbolLayer *clone() const override SIP_FACTORY;
926 
927  void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const override;
928 
929  //getters and setters
930  void setSvgFilePath( const QString &svgPath );
931  QString svgFilePath() const { return mSvgFilePath; }
932  void setPatternWidth( double width ) { mPatternWidth = width;}
933  double patternWidth() const { return mPatternWidth; }
934 
935  void setSvgFillColor( const QColor &c ) { setColor( c ); }
936  QColor svgFillColor() const { return color(); }
937 
938  void setSvgStrokeColor( const QColor &c ) { mSvgStrokeColor = c; }
939  QColor svgStrokeColor() const { return mSvgStrokeColor; }
940  void setSvgStrokeWidth( double w ) { mSvgStrokeWidth = w; }
941  double svgStrokeWidth() const { return mSvgStrokeWidth; }
942 
948  void setPatternWidthUnit( QgsUnitTypes::RenderUnit unit ) { mPatternWidthUnit = unit; }
949 
954  QgsUnitTypes::RenderUnit patternWidthUnit() const { return mPatternWidthUnit; }
955 
956  void setPatternWidthMapUnitScale( const QgsMapUnitScale &scale ) { mPatternWidthMapUnitScale = scale; }
957  const QgsMapUnitScale &patternWidthMapUnitScale() const { return mPatternWidthMapUnitScale; }
958 
964  void setSvgStrokeWidthUnit( QgsUnitTypes::RenderUnit unit ) { mSvgStrokeWidthUnit = unit; }
965 
970  QgsUnitTypes::RenderUnit svgStrokeWidthUnit() const { return mSvgStrokeWidthUnit; }
971 
972  void setSvgStrokeWidthMapUnitScale( const QgsMapUnitScale &scale ) { mSvgStrokeWidthMapUnitScale = scale; }
973  const QgsMapUnitScale &svgStrokeWidthMapUnitScale() const { return mSvgStrokeWidthMapUnitScale; }
974 
975  void setOutputUnit( QgsUnitTypes::RenderUnit unit ) override;
976  QgsUnitTypes::RenderUnit outputUnit() const override;
977 
978  void setMapUnitScale( const QgsMapUnitScale &scale ) override;
979  QgsMapUnitScale mapUnitScale() const override;
980 
981  protected:
986 
988  QByteArray mSvgData;
990  QString mSvgFilePath;
992  QRectF mSvgViewBox;
994  QImage *mSvgPattern = nullptr;
995 
996  //param(fill), param(stroke), param(stroke-width) are going
997  //to be replaced in memory
1002 
1003  void applyDataDefinedSettings( QgsSymbolRenderContext &context ) override;
1004 
1005  private:
1007  void storeViewBox();
1008  void setDefaultSvgParams(); //fills mSvgFillColor, mSvgStrokeColor, mSvgStrokeWidth with default values for mSvgFilePath
1009 
1011  void applyPattern( QBrush &brush, const QString &svgFilePath, double patternWidth, QgsUnitTypes::RenderUnit patternWidthUnit, const QColor &svgFillColor, const QColor &svgStrokeColor,
1012  double svgStrokeWidth, QgsUnitTypes::RenderUnit svgStrokeWidthUnit, const QgsSymbolRenderContext &context, const QgsMapUnitScale &patternWidthMapUnitScale, const QgsMapUnitScale &svgStrokeWidthMapUnitScale );
1013 };
1014 
1020 {
1021  public:
1023  ~QgsLinePatternFillSymbolLayer() override;
1024 
1025  static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;
1026  static QgsSymbolLayer *createFromSld( QDomElement &element ) SIP_FACTORY;
1027 
1028  QString layerType() const override;
1029 
1030  void startRender( QgsSymbolRenderContext &context ) override;
1031 
1032  void stopRender( QgsSymbolRenderContext &context ) override;
1033 
1034  QgsStringMap properties() const override;
1035 
1037 
1038  void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const override;
1039 
1040  double estimateMaxBleed( const QgsRenderContext &context ) const override;
1041 
1042  QString ogrFeatureStyleWidth( double widthScaleFactor ) const;
1043 
1044  //getters and setters
1045  void setLineAngle( double a ) { mLineAngle = a; }
1046  double lineAngle() const { return mLineAngle; }
1047 
1054  void setDistance( double d ) { mDistance = d; }
1055 
1061  double distance() const { return mDistance; }
1062 
1063  void setLineWidth( double w );
1064  double lineWidth() const { return mLineWidth; }
1065  void setColor( const QColor &c ) override;
1066  QColor color() const override;
1067  void setOffset( double offset ) { mOffset = offset; }
1068  double offset() const { return mOffset; }
1069 
1076  void setDistanceUnit( QgsUnitTypes::RenderUnit unit ) { mDistanceUnit = unit; }
1077 
1083  QgsUnitTypes::RenderUnit distanceUnit() const { return mDistanceUnit; }
1084 
1085  void setDistanceMapUnitScale( const QgsMapUnitScale &scale ) { mDistanceMapUnitScale = scale; }
1086  const QgsMapUnitScale &distanceMapUnitScale() const { return mDistanceMapUnitScale; }
1087 
1093  void setLineWidthUnit( QgsUnitTypes::RenderUnit unit ) { mLineWidthUnit = unit; }
1094 
1099  QgsUnitTypes::RenderUnit lineWidthUnit() const { return mLineWidthUnit; }
1100 
1101  void setLineWidthMapUnitScale( const QgsMapUnitScale &scale ) { mLineWidthMapUnitScale = scale; }
1102  const QgsMapUnitScale &lineWidthMapUnitScale() const { return mLineWidthMapUnitScale; }
1103 
1109  void setOffsetUnit( QgsUnitTypes::RenderUnit unit ) { mOffsetUnit = unit; }
1110 
1115  QgsUnitTypes::RenderUnit offsetUnit() const { return mOffsetUnit; }
1116 
1117  void setOffsetMapUnitScale( const QgsMapUnitScale &scale ) { mOffsetMapUnitScale = scale; }
1118  const QgsMapUnitScale &offsetMapUnitScale() const { return mOffsetMapUnitScale; }
1119 
1120  void setOutputUnit( QgsUnitTypes::RenderUnit unit ) override;
1121  QgsUnitTypes::RenderUnit outputUnit() const override;
1122 
1123  void setMapUnitScale( const QgsMapUnitScale &scale ) override;
1124  QgsMapUnitScale mapUnitScale() const override;
1125 
1126  bool setSubSymbol( QgsSymbol *symbol SIP_TRANSFER ) override;
1127  QgsSymbol *subSymbol() override;
1128 
1129  QSet<QString> usedAttributes( const QgsRenderContext &context ) const override;
1130 
1131  protected:
1133  double mDistance = 5.0;
1137  double mLineWidth = 0;
1140  QColor mColor;
1142  double mLineAngle = 45.0;
1144  double mOffset = 0.0;
1147 
1148  void applyDataDefinedSettings( QgsSymbolRenderContext &context ) override;
1149 
1150  private:
1151 #ifdef SIP_RUN
1153 #endif
1154 
1156  void applyPattern( const QgsSymbolRenderContext &context, QBrush &brush, double lineAngle, double distance );
1157 
1159  QgsLineSymbol *mFillLineSymbol = nullptr;
1160 };
1161 
1167 {
1168  public:
1170  ~QgsPointPatternFillSymbolLayer() override;
1171 
1172  static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;
1173  static QgsSymbolLayer *createFromSld( QDomElement &element ) SIP_FACTORY;
1174 
1175  QString layerType() const override;
1176 
1177  void startRender( QgsSymbolRenderContext &context ) override;
1178 
1179  void stopRender( QgsSymbolRenderContext &context ) override;
1180 
1181  QgsStringMap properties() const override;
1182 
1184 
1185  void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const override;
1186 
1187  double estimateMaxBleed( const QgsRenderContext &context ) const override;
1188 
1189  //getters and setters
1190  double distanceX() const { return mDistanceX; }
1191  void setDistanceX( double d ) { mDistanceX = d; }
1192 
1193  double distanceY() const { return mDistanceY; }
1194  void setDistanceY( double d ) { mDistanceY = d; }
1195 
1196  double displacementX() const { return mDisplacementX; }
1197  void setDisplacementX( double d ) { mDisplacementX = d; }
1198 
1199  double displacementY() const { return mDisplacementY; }
1200  void setDisplacementY( double d ) { mDisplacementY = d; }
1201 
1202  bool setSubSymbol( QgsSymbol *symbol SIP_TRANSFER ) override;
1203  QgsSymbol *subSymbol() override { return mMarkerSymbol; }
1204 
1211  void setDistanceXUnit( QgsUnitTypes::RenderUnit unit ) { mDistanceXUnit = unit; }
1212 
1218  QgsUnitTypes::RenderUnit distanceXUnit() const { return mDistanceXUnit; }
1219 
1220  void setDistanceXMapUnitScale( const QgsMapUnitScale &scale ) { mDistanceXMapUnitScale = scale; }
1221  const QgsMapUnitScale &distanceXMapUnitScale() const { return mDistanceXMapUnitScale; }
1222 
1229  void setDistanceYUnit( QgsUnitTypes::RenderUnit unit ) { mDistanceYUnit = unit; }
1230 
1236  QgsUnitTypes::RenderUnit distanceYUnit() const { return mDistanceYUnit; }
1237 
1238  void setDistanceYMapUnitScale( const QgsMapUnitScale &scale ) { mDistanceYMapUnitScale = scale; }
1239  const QgsMapUnitScale &distanceYMapUnitScale() const { return mDistanceYMapUnitScale; }
1240 
1247  void setDisplacementXUnit( QgsUnitTypes::RenderUnit unit ) { mDisplacementXUnit = unit; }
1248 
1254  QgsUnitTypes::RenderUnit displacementXUnit() const { return mDisplacementXUnit; }
1255 
1256  void setDisplacementXMapUnitScale( const QgsMapUnitScale &scale ) { mDisplacementXMapUnitScale = scale; }
1257  const QgsMapUnitScale &displacementXMapUnitScale() const { return mDisplacementXMapUnitScale; }
1258 
1265  void setDisplacementYUnit( QgsUnitTypes::RenderUnit unit ) { mDisplacementYUnit = unit; }
1266 
1272  QgsUnitTypes::RenderUnit displacementYUnit() const { return mDisplacementYUnit; }
1273 
1274  void setDisplacementYMapUnitScale( const QgsMapUnitScale &scale ) { mDisplacementYMapUnitScale = scale; }
1275  const QgsMapUnitScale &displacementYMapUnitScale() const { return mDisplacementYMapUnitScale; }
1276 
1277  void setOutputUnit( QgsUnitTypes::RenderUnit unit ) override;
1278  QgsUnitTypes::RenderUnit outputUnit() const override;
1279 
1280  void setMapUnitScale( const QgsMapUnitScale &scale ) override;
1281  QgsMapUnitScale mapUnitScale() const override;
1282 
1283  QSet<QString> usedAttributes( const QgsRenderContext &context ) const override;
1284  void setColor( const QColor &c ) override;
1285  QColor color() const override;
1286 
1287  protected:
1288  QgsMarkerSymbol *mMarkerSymbol = nullptr;
1289  double mDistanceX = 15;
1292  double mDistanceY = 15;
1295  double mDisplacementX = 0;
1298  double mDisplacementY = 0;
1301 
1302  void applyDataDefinedSettings( QgsSymbolRenderContext &context ) override;
1303 
1304  private:
1305 #ifdef SIP_RUN
1307 #endif
1308 
1309  void applyPattern( const QgsSymbolRenderContext &context, QBrush &brush, double distanceX, double distanceY,
1310  double displacementX, double displacementY );
1311 };
1312 
1318 {
1319  public:
1321 
1322  // static stuff
1323 
1324  static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;
1325  static QgsSymbolLayer *createFromSld( QDomElement &element ) SIP_FACTORY;
1326 
1327  // implemented from base classes
1328 
1329  QString layerType() const override;
1330 
1331  void startRender( QgsSymbolRenderContext &context ) override;
1332 
1333  void stopRender( QgsSymbolRenderContext &context ) override;
1334 
1335  void renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context ) override;
1336 
1337  QgsStringMap properties() const override;
1338 
1339  QgsCentroidFillSymbolLayer *clone() const override SIP_FACTORY;
1340 
1341  void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const override;
1342 
1343  void setColor( const QColor &color ) override;
1344  QColor color() const override;
1345 
1346  QgsSymbol *subSymbol() override;
1347  bool setSubSymbol( QgsSymbol *symbol SIP_TRANSFER ) override;
1348 
1349  void setOutputUnit( QgsUnitTypes::RenderUnit unit ) override;
1350  QgsUnitTypes::RenderUnit outputUnit() const override;
1351 
1352  void setMapUnitScale( const QgsMapUnitScale &scale ) override;
1353  QgsMapUnitScale mapUnitScale() const override;
1354 
1355  QSet<QString> usedAttributes( const QgsRenderContext &context ) const override;
1356 
1357  void setPointOnSurface( bool pointOnSurface ) { mPointOnSurface = pointOnSurface; }
1358  bool pointOnSurface() const { return mPointOnSurface; }
1359 
1363  void setPointOnAllParts( bool pointOnAllParts ) { mPointOnAllParts = pointOnAllParts; }
1364 
1368  bool pointOnAllParts() const { return mPointOnAllParts; }
1369 
1370  protected:
1371  std::unique_ptr< QgsMarkerSymbol > mMarker;
1372  bool mPointOnSurface = false;
1373  bool mPointOnAllParts = true;
1374 
1375  QgsFeatureId mCurrentFeatureId = -1;
1376  int mBiggestPartIndex = -1;
1377 
1378  private:
1379 #ifdef SIP_RUN
1381 #endif
1382 };
1383 
1384 #endif
1385 
1386 
QColor color2() const
Returns the color used for the endpoint of the shapeburst fill.
void setSvgStrokeWidthMapUnitScale(const QgsMapUnitScale &scale)
#define DEFAULT_SIMPLEFILL_BORDERCOLOR
void setDistance(double d)
Sets the distance between lines in the fill pattern.
const QgsMapUnitScale & displacementYMapUnitScale() const
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
QString svgFilePath() const
void setPatternWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the width of the SVG images in the pattern.
QColor strokeColor() const override
Get stroke color.
virtual QString ogrFeatureStyle(double mmScaleFactor, double mapUnitScaleFactor) const
#define DEFAULT_SIMPLEFILL_JOINSTYLE
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the fill&#39;s offset.
QgsMapUnitScale mStrokeWidthMapUnitScale
QgsUnitTypes::RenderUnit distanceUnit() const
Returns the units for the distance between lines in the fill pattern.
void setStrokeWidthMapUnitScale(const QgsMapUnitScale &scale)
const QgsMapUnitScale & lineWidthMapUnitScale() const
void setSvgFillColor(const QColor &c)
void setOutputUnit(QgsUnitTypes::RenderUnit unit) override
Sets the units to use for sizes and widths within the symbol layer.
void setPatternWidthMapUnitScale(const QgsMapUnitScale &scale)
virtual void applyDataDefinedSettings(QgsSymbolRenderContext &context)
const QgsMapUnitScale & displacementXMapUnitScale() const
virtual QgsSymbol * subSymbol()
Returns the symbol&#39;s sub symbol, if present.
QString imageFilePath() const
The path to the raster image used for the fill.
QPointF offset() const
Returns the offset for the shapeburst fill.
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units used for the offset of the shapeburst fill.
GradientCoordinateMode coordinateMode() const
Coordinate mode for gradient. Controls how the gradient stops are positioned.
void setReferencePoint1IsCentroid(bool isCentroid)
Sets the starting point of the gradient to be the feature centroid.
Qt::PenJoinStyle penJoinStyle() const
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the line pattern&#39;s offset.
GradientSpread gradientSpread() const
Gradient spread mode. Controls how the gradient behaves outside of the predefined stops...
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the fill&#39;s offset.
Base class for polygon renderers generating texture images.
QgsMapUnitScale mPatternWidthMapUnitScale
QgsUnitTypes::RenderUnit widthUnit() const
Returns the units for the image&#39;s width.
void setDisplacementYUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the vertical displacement between rows in the pattern.
void setOffset(QPointF offset)
Sets the offset for the shapeburst fill.
void setStrokeWidthMapUnitScale(const QgsMapUnitScale &scale)
bool setSubSymbol(QgsSymbol *symbol) override
set layer&#39;s subsymbol. takes ownership of the passed symbol
QgsUnitTypes::RenderUnit patternWidthUnit() const
Returns the units for the width of the SVG images in the pattern.
Abstract base class for color ramps.
Definition: qgscolorramp.h:31
virtual QColor strokeColor() const
Get stroke color.
std::unique_ptr< QgsMarkerSymbol > mMarker
QgsUnitTypes::RenderUnit mSvgStrokeWidthUnit
void setUseWholeShape(bool useWholeShape)
Sets whether the shapeburst fill should be drawn using the entire shape.
void setDistanceUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the maximum distance to shade inside of the shape from the polygon&#39;s boundary...
const QgsMapUnitScale & strokeWidthMapUnitScale() const
ShapeburstColorType colorType() const
Returns the color mode used for the shapeburst fill.
const QgsMapUnitScale & strokeWidthMapUnitScale() const
void setDistanceUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the distance between lines in the fill pattern.
bool useWholeShape() const
Returns whether the shapeburst fill is set to cover the entire shape.
void setOffsetUnit(const QgsUnitTypes::RenderUnit unit)
Sets the units for the fill&#39;s offset.
void setDistanceXMapUnitScale(const QgsMapUnitScale &scale)
void setDistanceMapUnitScale(const QgsMapUnitScale &scale)
#define DEFAULT_SIMPLEFILL_COLOR
virtual double dxfWidth(const QgsDxfExport &e, QgsSymbolRenderContext &context) const
get line width
QColor color2() const
Color for endpoint of gradient, only used if the gradient color type is set to SimpleTwoColor.
void setReferencePoint2IsCentroid(bool isCentroid)
Sets the end point of the gradient to be the feature centroid.
virtual QgsStringMap properties() const =0
Should be reimplemented by subclasses to return a string map that contains the configuration informat...
GradientColorType mGradientColorType
const QgsMapUnitScale & svgStrokeWidthMapUnitScale() const
void setPointOnAllParts(bool pointOnAllParts)
Sets whether a point is drawn for all parts or only on the biggest part of multi-part features...
QMap< QString, QString > QgsStringMap
Definition: qgis.h:479
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
void setStrokeWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the symbol&#39;s stroke width.
void setStrokeWidth(double strokeWidth)
void setPatternWidth(double width)
QgsSymbol * subSymbol() override
Returns the symbol&#39;s sub symbol, if present.
QgsMapUnitScale mapUnitScale() const override
void setGradientType(GradientType gradientType)
QgsUnitTypes::RenderUnit outputUnit() const override
Returns the units to use for sizes and widths within the symbol layer.
const QgsMapUnitScale & offsetMapUnitScale() const
void setMapUnitScale(const QgsMapUnitScale &scale) override
#define DEFAULT_SIMPLEFILL_STYLE
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the line pattern&#39;s offset.
virtual void setColor(const QColor &color)
The fill color.
void setOffset(QPointF offset)
virtual void renderPolygon(const QPolygonF &points, QList< QPolygonF > *rings, QgsSymbolRenderContext &context)=0
QString mImageFilePath
Path to the image file.
void setIgnoreRings(bool ignoreRings)
Sets whether the shapeburst fill should ignore polygon rings when calculating the buffered shading...
virtual QgsUnitTypes::RenderUnit outputUnit() const
Returns the units to use for sizes and widths within the symbol layer.
const QgsMapUnitScale & distanceMapUnitScale() const
std::unique_ptr< QgsLineSymbol > mStroke
Custom stroke.
virtual bool setSubSymbol(QgsSymbol *symbol)
set layer&#39;s subsymbol. takes ownership of the passed symbol
A class for filling symbols with a repeated raster image.
QByteArray mSvgData
SVG data.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
#define DEFAULT_SIMPLEFILL_BORDERWIDTH
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
void setColor2(const QColor &color2)
Sets the color for the endpoint of the shapeburst fill.
virtual void setOutputUnit(QgsUnitTypes::RenderUnit unit)
Sets the units to use for sizes and widths within the symbol layer.
void setWidth(const double width)
Sets the width for scaling the image used in the fill.
QgsUnitTypes::RenderUnit displacementYUnit() const
Returns the units for the vertical displacement between rows in the pattern.
void setReferencePoint1(QPointF referencePoint)
Starting point of gradient fill, in the range [0,0] - [1,1].
void setFillColor(const QColor &color) override
Set fill color.
void setSvgStrokeWidth(double w)
void setWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the image&#39;s width.
virtual Qt::BrushStyle dxfBrushStyle() const
get brush/fill style
const QgsMapUnitScale & offsetMapUnitScale() const
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the fill&#39;s offset.
virtual QgsSymbolLayer * clone() const =0
Shall be reimplemented by subclasses to create a deep copy of the instance.
void setStrokeStyle(Qt::PenStyle strokeStyle)
#define SIP_TRANSFER
Definition: qgis_sip.h:36
virtual QColor color() const
The fill color.
void setDistanceYMapUnitScale(const QgsMapUnitScale &scale)
bool ignoreRings() const
Returns whether the shapeburst fill is set to ignore polygon interior rings.
QgsUnitTypes::RenderUnit offsetUnit() const
#define SIP_FACTORY
Definition: qgis_sip.h:69
void setPenJoinStyle(Qt::PenJoinStyle style)
QColor fillColor() const override
Get fill color.
QgsUnitTypes::RenderUnit svgStrokeWidthUnit() const
Returns the units for the stroke width.
QColor svgStrokeColor() const
void setLineWidthMapUnitScale(const QgsMapUnitScale &scale)
void setDisplacementXMapUnitScale(const QgsMapUnitScale &scale)
QgsMapUnitScale mOffsetMapUnitScale
void setOffset(QPointF offset)
Sets the offset for the fill.
QString mSvgFilePath
Path to the svg file (or empty if constructed directly from data)
virtual double estimateMaxBleed(const QgsRenderContext &context) const
Returns the estimated maximum distance which the layer style will bleed outside the drawn shape when ...
void setSvgStrokeWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the stroke width.
virtual QColor dxfBrushColor(QgsSymbolRenderContext &context) const
get brush/fill color
void setStrokeColor(const QColor &strokeColor) override
Set stroke color.
void setOffset(QPointF offset)
Offset for gradient fill.
void setDistanceXUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the horizontal distance between points in the pattern.
virtual Qt::PenStyle dxfPenStyle() const
get pen style
Qt::BrushStyle brushStyle() const
GradientCoordinateMode mCoordinateMode
const QgsMapUnitScale & distanceMapUnitScale() const
virtual void toSld(QDomDocument &doc, QDomElement &element, const QgsStringMap &props) const
QgsMapUnitScale mWidthMapUnitScale
A class for svg fill patterns.
virtual QgsMapUnitScale mapUnitScale() const
virtual QSet< QString > usedAttributes(const QgsRenderContext &context) const
Returns the set of attributes referenced by the layer.
Contains information about the context of a rendering operation.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the fill&#39;s offset.
virtual void setMapUnitScale(const QgsMapUnitScale &scale)
void setGradientColorType(GradientColorType gradientColorType)
void setWidthUnit(const QgsUnitTypes::RenderUnit unit)
Sets the units for the image&#39;s width.
Struct for storing maximum and minimum scales for measurements in map units.
virtual void stopRender(QgsSymbolRenderContext &context)=0
virtual double dxfAngle(QgsSymbolRenderContext &context) const
get angle
QgsUnitTypes::RenderUnit distanceXUnit() const
Returns the units for the horizontal distance between points in the pattern.
QgsUnitTypes::RenderUnit displacementXUnit() const
Returns the units for the horizontal displacement between rows in the pattern.
const QgsMapUnitScale & distanceXMapUnitScale() const
const QgsMapUnitScale & patternWidthMapUnitScale() const
virtual QColor dxfColor(QgsSymbolRenderContext &context) const
get color
Qt::PenStyle strokeStyle() const
const QgsMapUnitScale & offsetMapUnitScale() const
void setStrokeWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the width of the fill&#39;s stroke.
#define DEFAULT_SIMPLEFILL_BORDERSTYLE
GradientColorType gradientColorType() const
Gradient color mode, controls how gradient color stops are created.
Qt::PenJoinStyle mPenJoinStyle
const QgsMapUnitScale & distanceYMapUnitScale() const
FillCoordinateMode coordinateMode() const
Coordinate mode for fill.
const QgsMapUnitScale & widthMapUnitScale() const
Returns the map unit scale for the image&#39;s width.
void setDisplacementXUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the horizontal displacement between rows in the pattern.
double maxDistance() const
Returns the maximum distance from the shape&#39;s boundary which is shaded.
void setDisplacementYMapUnitScale(const QgsMapUnitScale &scale)
bool pointOnAllParts() const
Returns whether a point is drawn for all parts or only on the biggest part of multi-part features...
void setMaxDistance(double maxDistance)
Sets the maximum distance to shape inside of the shape from the polygon&#39;s boundary.
double estimateMaxBleed(const QgsRenderContext &context) const override
Returns the estimated maximum distance which the layer style will bleed outside the drawn shape when ...
qint64 QgsFeatureId
Definition: qgsfeature.h:37
double opacity() const
Returns the opacity for the raster image used in the fill.
QgsUnitTypes::RenderUnit lineWidthUnit() const
Returns the units for the line&#39;s width.
void setColor2(const QColor &color2)
void setBrushStyle(Qt::BrushStyle style)
QgsColorRamp * colorRamp()
Returns the color ramp used for the gradient fill.
double svgStrokeWidth() const
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the fill&#39;s offset.
int blurRadius() const
Returns the blur radius, which controls the amount of blurring applied to the fill.
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the units used for the offset for the shapeburst fill.
QgsUnitTypes::RenderUnit strokeWidthUnit() const
Returns the units for the width of the fill&#39;s stroke.
Resolves relative paths into absolute paths and vice versa.
void setLineWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the line&#39;s width.
void setSvgStrokeColor(const QColor &c)
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Units for gradient fill offset.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
double distance() const
Returns the distance between lines in the fill pattern.
QgsSymbol * subSymbol() override
Returns the symbol&#39;s sub symbol, if present.
QgsUnitTypes::RenderUnit strokeWidthUnit() const
Returns the units for the symbol&#39;s stroke width.
void setColorType(ShapeburstColorType colorType)
Sets the color mode to use for the shapeburst fill.
void setDistanceYUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the vertical distance between points in the pattern.
double width() const
Returns the width used for scaling the image used in the fill.
QgsColorRamp * colorRamp()
Returns the color ramp used for the shapeburst fill.
const QgsMapUnitScale & offsetMapUnitScale() const
void setGradientSpread(GradientSpread gradientSpread)
QgsUnitTypes::RenderUnit mPatternWidthUnit
QgsMapUnitScale mOffsetMapUnitScale
void setCoordinateMode(GradientCoordinateMode coordinateMode)
void setReferencePoint2(QPointF referencePoint)
End point of gradient fill, in the range [0,0] - [1,1].
void setDistanceMapUnitScale(const QgsMapUnitScale &scale)
QgsUnitTypes::RenderUnit distanceYUnit() const
Returns the units for the vertical distance between points in the pattern.
QgsMapUnitScale mSvgStrokeWidthMapUnitScale
RenderUnit
Rendering size units.
Definition: qgsunittypes.h:100
QgsMapUnitScale mStrokeWidthMapUnitScale
void setPointOnSurface(bool pointOnSurface)
QSet< QString > usedAttributes(const QgsRenderContext &context) const override
Returns the set of attributes referenced by the layer.
QRectF mSvgViewBox
SVG view box (to keep the aspect ratio.
virtual void startRender(QgsSymbolRenderContext &context)=0
QPointF offset() const
Returns the offset for the fill.
virtual QString layerType() const =0
Returns a string that represents this layer type.
double mPatternWidth
Width of the pattern (in output units)
QgsUnitTypes::RenderUnit distanceUnit() const
Returns the unit for the maximum distance to shade inside of the shape from the polygon&#39;s boundary...