QGIS API Documentation  3.4.15-Madeira (e83d02e274)
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 SIP_TRANSFER );
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, 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 
360 
365  QgsShapeburstFillSymbolLayer &operator=( const QgsShapeburstFillSymbolLayer &other ) = delete;
366 
367  // static stuff
368 
369  static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;
370 
371  // implemented from base classes
372 
373  QString layerType() const override;
374 
375  void startRender( QgsSymbolRenderContext &context ) override;
376 
377  void stopRender( QgsSymbolRenderContext &context ) override;
378 
379  void renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context ) override;
380 
381  QgsStringMap properties() const override;
382 
383  QgsShapeburstFillSymbolLayer *clone() const override SIP_FACTORY;
384 
385  double estimateMaxBleed( const QgsRenderContext &context ) const override;
386 
393  void setBlurRadius( int blurRadius ) { mBlurRadius = blurRadius; }
394 
401  int blurRadius() const { return mBlurRadius; }
402 
411  void setUseWholeShape( bool useWholeShape ) { mUseWholeShape = useWholeShape; }
412 
420  bool useWholeShape() const { return mUseWholeShape; }
421 
430  void setMaxDistance( double maxDistance ) { mMaxDistance = maxDistance; }
431 
440  double maxDistance() const { return mMaxDistance; }
441 
449  void setDistanceUnit( QgsUnitTypes::RenderUnit unit ) { mDistanceUnit = unit; }
450 
458  QgsUnitTypes::RenderUnit distanceUnit() const { return mDistanceUnit; }
459 
460  void setDistanceMapUnitScale( const QgsMapUnitScale &scale ) { mDistanceMapUnitScale = scale; }
461  const QgsMapUnitScale &distanceMapUnitScale() const { return mDistanceMapUnitScale; }
462 
473  void setColorType( ShapeburstColorType colorType ) { mColorType = colorType; }
474 
485  ShapeburstColorType colorType() const { return mColorType; }
486 
496  void setColorRamp( QgsColorRamp *ramp SIP_TRANSFER );
497 
505  QgsColorRamp *colorRamp() { return mGradientRamp.get(); }
506 
514  void setColor2( const QColor &color2 ) { mColor2 = color2; }
515 
523  QColor color2() const { return mColor2; }
524 
532  void setIgnoreRings( bool ignoreRings ) { mIgnoreRings = ignoreRings; }
533 
540  bool ignoreRings() const { return mIgnoreRings; }
541 
549  void setOffset( QPointF offset ) { mOffset = offset; }
550 
558  QPointF offset() const { return mOffset; }
559 
567  void setOffsetUnit( QgsUnitTypes::RenderUnit unit ) { mOffsetUnit = unit; }
568 
576  QgsUnitTypes::RenderUnit offsetUnit() const { return mOffsetUnit; }
577 
578  void setOffsetMapUnitScale( const QgsMapUnitScale &scale ) { mOffsetMapUnitScale = scale; }
579  const QgsMapUnitScale &offsetMapUnitScale() const { return mOffsetMapUnitScale; }
580 
581  void setOutputUnit( QgsUnitTypes::RenderUnit unit ) override;
582  QgsUnitTypes::RenderUnit outputUnit() const override;
583 
584  void setMapUnitScale( const QgsMapUnitScale &scale ) override;
585  QgsMapUnitScale mapUnitScale() const override;
586 
587  private:
588  QBrush mBrush;
589  QBrush mSelBrush;
590 
591  int mBlurRadius = 0;
592 
593  bool mUseWholeShape = true;
594  double mMaxDistance = 5.0;
596  QgsMapUnitScale mDistanceMapUnitScale;
597 
598  ShapeburstColorType mColorType = SimpleTwoColor;
599  QColor mColor2;
600 
601  bool mIgnoreRings = false;
602 
603  QPointF mOffset;
605  QgsMapUnitScale mOffsetMapUnitScale;
606 
607  std::unique_ptr< QgsColorRamp > mGradientRamp;
608 
609  //helper functions for data defined symbology
610  void applyDataDefinedSymbology( QgsSymbolRenderContext &context, QColor &color, QColor &color2, int &blurRadius, bool &useWholeShape,
611  double &maxDistance, bool &ignoreRings );
612 
613  /* distance transform of a 1d function using squared distance */
614  void distanceTransform1d( double *f, int n, int *v, double *z, double *d );
615  /* distance transform of 2d function using squared distance */
616  void distanceTransform2d( double *im, int width, int height, QgsRenderContext &context );
617  /* distance transform of a binary QImage */
618  double *distanceTransform( QImage *im, QgsRenderContext &context );
619 
620  /* fills a QImage with values from an array of doubles containing squared distance transform values */
621  void dtArrayToQImage( double *array, QImage *im, QgsColorRamp *ramp, QgsRenderContext &context, double layerAlpha = 1, bool useWholeShape = true, int maxPixelDistance = 0 );
622 
623 #ifdef SIP_RUN
625 #endif
626 };
627 
632 {
633  public:
634 
636  void renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context ) override;
637 
638  QgsSymbol *subSymbol() override { return mStroke.get(); }
639  bool setSubSymbol( QgsSymbol *symbol SIP_TRANSFER ) override;
640 
646  void setStrokeWidthUnit( QgsUnitTypes::RenderUnit unit ) { mStrokeWidthUnit = unit; }
647 
653  QgsUnitTypes::RenderUnit strokeWidthUnit() const { return mStrokeWidthUnit; }
654 
661  void setStrokeWidthMapUnitScale( const QgsMapUnitScale &scale ) { mStrokeWidthMapUnitScale = scale; }
662 
671  const QgsMapUnitScale &strokeWidthMapUnitScale() const { return mStrokeWidthMapUnitScale; }
672 
673  void setOutputUnit( QgsUnitTypes::RenderUnit unit ) override;
674  QgsUnitTypes::RenderUnit outputUnit() const override;
675  void setMapUnitScale( const QgsMapUnitScale &scale ) override;
676  QgsMapUnitScale mapUnitScale() const override;
677  double estimateMaxBleed( const QgsRenderContext &context ) const override;
678  double dxfWidth( const QgsDxfExport &e, QgsSymbolRenderContext &context ) const override;
679  QColor dxfColor( QgsSymbolRenderContext &context ) const override;
680  Qt::PenStyle dxfPenStyle() const override;
681  QSet<QString> usedAttributes( const QgsRenderContext &context ) const override;
682  bool hasDataDefinedProperties() const override;
683 
684  protected:
685  QBrush mBrush;
686  double mNextAngle = 0.0; // mAngle / data defined angle
687 
689  double mStrokeWidth = 0.0;
692 
694  std::unique_ptr< QgsLineSymbol > mStroke;
695 
696  virtual void applyDataDefinedSettings( QgsSymbolRenderContext &context ) { Q_UNUSED( context ); }
697 
698  private:
699 #ifdef SIP_RUN
701 #endif
702 };
703 
711 {
712  public:
713 
716  {
719  };
720 
725  QgsRasterFillSymbolLayer( const QString &imageFilePath = QString() );
726 
731  static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;
732 
738  static void resolvePaths( QgsStringMap &properties, const QgsPathResolver &pathResolver, bool saving );
739 
740  // implemented from base classes
741  QString layerType() const override;
742  void renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context ) override;
743  void startRender( QgsSymbolRenderContext &context ) override;
744  void stopRender( QgsSymbolRenderContext &context ) override;
745  QgsStringMap properties() const override;
746  QgsRasterFillSymbolLayer *clone() const override SIP_FACTORY;
747  double estimateMaxBleed( const QgsRenderContext &context ) const override;
748 
749  //override QgsImageFillSymbolLayer's support for sub symbols
750  QgsSymbol *subSymbol() override { return nullptr; }
751  bool setSubSymbol( QgsSymbol *symbol SIP_TRANSFER ) override;
752 
758  void setImageFilePath( const QString &imagePath );
759 
765  QString imageFilePath() const { return mImageFilePath; }
766 
773  void setCoordinateMode( FillCoordinateMode mode );
774 
781  FillCoordinateMode coordinateMode() const { return mCoordinateMode; }
782 
788  void setOpacity( double opacity );
789 
795  double opacity() const { return mOpacity; }
796 
804  void setOffset( QPointF offset ) { mOffset = offset; }
805 
813  QPointF offset() const { return mOffset; }
814 
822  void setOffsetUnit( const QgsUnitTypes::RenderUnit unit ) { mOffsetUnit = unit; }
823 
831  QgsUnitTypes::RenderUnit offsetUnit() const { return mOffsetUnit; }
832 
840  void setOffsetMapUnitScale( const QgsMapUnitScale &scale ) { mOffsetMapUnitScale = scale; }
841 
849  const QgsMapUnitScale &offsetMapUnitScale() const { return mOffsetMapUnitScale; }
850 
859  void setWidth( const double width ) { mWidth = width; }
860 
869  double width() const { return mWidth; }
870 
878  void setWidthUnit( const QgsUnitTypes::RenderUnit unit ) { mWidthUnit = unit; }
879 
887  QgsUnitTypes::RenderUnit widthUnit() const { return mWidthUnit; }
888 
896  void setWidthMapUnitScale( const QgsMapUnitScale &scale ) { mWidthMapUnitScale = scale; }
897 
905  const QgsMapUnitScale &widthMapUnitScale() const { return mWidthMapUnitScale; }
906 
907  protected:
908 
909  void applyDataDefinedSettings( QgsSymbolRenderContext &context ) override;
910 
911  private:
912 
914  QString mImageFilePath;
916  double mOpacity = 1.0;
917 
918  QPointF mOffset;
920  QgsMapUnitScale mOffsetMapUnitScale;
921 
922  double mWidth = 0.0;
924  QgsMapUnitScale mWidthMapUnitScale;
925 
927  void applyPattern( QBrush &brush, const QString &imageFilePath, double width, double opacity,
928  const QgsSymbolRenderContext &context );
929 };
930 
936 {
937  public:
938 
942  QgsSVGFillSymbolLayer( const QString &svgFilePath, double width = 20, double rotation = 0.0 );
943 
947  QgsSVGFillSymbolLayer( const QByteArray &svgData, double width = 20, double rotation = 0.0 );
948 
953  static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;
954 
959  static QgsSymbolLayer *createFromSld( QDomElement &element ) SIP_FACTORY;
960 
966  static void resolvePaths( QgsStringMap &properties, const QgsPathResolver &pathResolver, bool saving );
967 
968  // implemented from base classes
969 
970  QString layerType() const override;
971  void startRender( QgsSymbolRenderContext &context ) override;
972  void stopRender( QgsSymbolRenderContext &context ) override;
973  QgsStringMap properties() const override;
974  QgsSVGFillSymbolLayer *clone() const override SIP_FACTORY;
975  void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const override;
976 
987  void setSvgFilePath( const QString &svgPath );
988 
994  QString svgFilePath() const { return mSvgFilePath; }
995 
1005  void setPatternWidth( double width ) { mPatternWidth = width;}
1006 
1016  double patternWidth() const { return mPatternWidth; }
1017 
1027  void setSvgFillColor( const QColor &c ) { setColor( c ); }
1028 
1037  QColor svgFillColor() const { return color(); }
1038 
1048  void setSvgStrokeColor( const QColor &c ) { mSvgStrokeColor = c; }
1049 
1058  QColor svgStrokeColor() const { return mSvgStrokeColor; }
1059 
1070  void setSvgStrokeWidth( double w ) { mSvgStrokeWidth = w; }
1071 
1082  double svgStrokeWidth() const { return mSvgStrokeWidth; }
1083 
1091  void setPatternWidthUnit( QgsUnitTypes::RenderUnit unit ) { mPatternWidthUnit = unit; }
1092 
1100  QgsUnitTypes::RenderUnit patternWidthUnit() const { return mPatternWidthUnit; }
1101 
1109  void setPatternWidthMapUnitScale( const QgsMapUnitScale &scale ) { mPatternWidthMapUnitScale = scale; }
1110 
1118  const QgsMapUnitScale &patternWidthMapUnitScale() const { return mPatternWidthMapUnitScale; }
1119 
1127  void setSvgStrokeWidthUnit( QgsUnitTypes::RenderUnit unit ) { mSvgStrokeWidthUnit = unit; }
1128 
1136  QgsUnitTypes::RenderUnit svgStrokeWidthUnit() const { return mSvgStrokeWidthUnit; }
1137 
1145  void setSvgStrokeWidthMapUnitScale( const QgsMapUnitScale &scale ) { mSvgStrokeWidthMapUnitScale = scale; }
1146 
1154  const QgsMapUnitScale &svgStrokeWidthMapUnitScale() const { return mSvgStrokeWidthMapUnitScale; }
1155 
1156  void setOutputUnit( QgsUnitTypes::RenderUnit unit ) override;
1157  QgsUnitTypes::RenderUnit outputUnit() const override;
1158 
1159  void setMapUnitScale( const QgsMapUnitScale &scale ) override;
1160  QgsMapUnitScale mapUnitScale() const override;
1161 
1162  protected:
1163 
1164  void applyDataDefinedSettings( QgsSymbolRenderContext &context ) override;
1165 
1166  private:
1167 
1169  double mPatternWidth = 20;
1171  QgsMapUnitScale mPatternWidthMapUnitScale;
1172 
1174  QByteArray mSvgData;
1176  QString mSvgFilePath;
1178  QRectF mSvgViewBox;
1179 
1180  //param(fill), param(stroke), param(stroke-width) are going
1181  //to be replaced in memory
1182  QColor mSvgStrokeColor = QColor( 35, 35, 35 );
1183  double mSvgStrokeWidth = 0.2;
1185  QgsMapUnitScale mSvgStrokeWidthMapUnitScale;
1186 
1188  void storeViewBox();
1189  void setDefaultSvgParams(); //fills mSvgFillColor, mSvgStrokeColor, mSvgStrokeWidth with default values for mSvgFilePath
1190 
1192  void applyPattern( QBrush &brush, const QString &svgFilePath, double patternWidth, QgsUnitTypes::RenderUnit patternWidthUnit, const QColor &svgFillColor, const QColor &svgStrokeColor,
1193  double svgStrokeWidth, QgsUnitTypes::RenderUnit svgStrokeWidthUnit, const QgsSymbolRenderContext &context, const QgsMapUnitScale &patternWidthMapUnitScale, const QgsMapUnitScale &svgStrokeWidthMapUnitScale );
1194 };
1195 
1202 {
1203  public:
1205  ~QgsLinePatternFillSymbolLayer() override;
1206 
1211  static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;
1212 
1217  static QgsSymbolLayer *createFromSld( QDomElement &element ) SIP_FACTORY;
1218 
1219  QString layerType() const override;
1220  void startRender( QgsSymbolRenderContext &context ) override;
1221  void stopRender( QgsSymbolRenderContext &context ) override;
1222  QgsStringMap properties() const override;
1224  void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const override;
1225  double estimateMaxBleed( const QgsRenderContext &context ) const override;
1226 
1227  QString ogrFeatureStyleWidth( double widthScaleFactor ) const;
1228 
1236  void setLineAngle( double a ) { mLineAngle = a; }
1237 
1245  double lineAngle() const { return mLineAngle; }
1246 
1253  void setDistance( double d ) { mDistance = d; }
1254 
1260  double distance() const { return mDistance; }
1261 
1268  void setLineWidth( double w );
1269 
1276  double lineWidth() const { return mLineWidth; }
1277 
1278  void setColor( const QColor &c ) override;
1279  QColor color() const override;
1280 
1292  void setOffset( double offset ) { mOffset = offset; }
1293 
1305  double offset() const { return mOffset; }
1306 
1313  void setDistanceUnit( QgsUnitTypes::RenderUnit unit ) { mDistanceUnit = unit; }
1314 
1321  QgsUnitTypes::RenderUnit distanceUnit() const { return mDistanceUnit; }
1322 
1330  void setDistanceMapUnitScale( const QgsMapUnitScale &scale ) { mDistanceMapUnitScale = scale; }
1331 
1339  const QgsMapUnitScale &distanceMapUnitScale() const { return mDistanceMapUnitScale; }
1340 
1346  void setLineWidthUnit( QgsUnitTypes::RenderUnit unit ) { mLineWidthUnit = unit; }
1347 
1353  QgsUnitTypes::RenderUnit lineWidthUnit() const { return mLineWidthUnit; }
1354 
1362  void setLineWidthMapUnitScale( const QgsMapUnitScale &scale ) { mLineWidthMapUnitScale = scale; }
1363 
1371  const QgsMapUnitScale &lineWidthMapUnitScale() const { return mLineWidthMapUnitScale; }
1372 
1378  void setOffsetUnit( QgsUnitTypes::RenderUnit unit ) { mOffsetUnit = unit; }
1379 
1385  QgsUnitTypes::RenderUnit offsetUnit() const { return mOffsetUnit; }
1386 
1394  void setOffsetMapUnitScale( const QgsMapUnitScale &scale ) { mOffsetMapUnitScale = scale; }
1395 
1403  const QgsMapUnitScale &offsetMapUnitScale() const { return mOffsetMapUnitScale; }
1404 
1405  void setOutputUnit( QgsUnitTypes::RenderUnit unit ) override;
1406  QgsUnitTypes::RenderUnit outputUnit() const override;
1407  void setMapUnitScale( const QgsMapUnitScale &scale ) override;
1408  QgsMapUnitScale mapUnitScale() const override;
1409  bool setSubSymbol( QgsSymbol *symbol SIP_TRANSFER ) override;
1410  QgsSymbol *subSymbol() override;
1411  QSet<QString> usedAttributes( const QgsRenderContext &context ) const override;
1412  bool hasDataDefinedProperties() const override;
1413 
1414  protected:
1415 
1416  void applyDataDefinedSettings( QgsSymbolRenderContext &context ) override;
1417 
1418  private:
1420  double mDistance = 5.0;
1422  QgsMapUnitScale mDistanceMapUnitScale;
1424  double mLineWidth = 0;
1426  QgsMapUnitScale mLineWidthMapUnitScale;
1428  double mLineAngle = 45.0;
1430  double mOffset = 0.0;
1432  QgsMapUnitScale mOffsetMapUnitScale;
1433 
1434 #ifdef SIP_RUN
1436 #endif
1437 
1439  void applyPattern( const QgsSymbolRenderContext &context, QBrush &brush, double lineAngle, double distance );
1440 
1442  QgsLineSymbol *mFillLineSymbol = nullptr;
1443 };
1444 
1450 {
1451  public:
1453  ~QgsPointPatternFillSymbolLayer() override;
1454 
1455  static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;
1456  static QgsSymbolLayer *createFromSld( QDomElement &element ) SIP_FACTORY;
1457 
1458  QString layerType() const override;
1459 
1460  void startRender( QgsSymbolRenderContext &context ) override;
1461 
1462  void stopRender( QgsSymbolRenderContext &context ) override;
1463 
1464  QgsStringMap properties() const override;
1465 
1467 
1468  void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const override;
1469 
1470  double estimateMaxBleed( const QgsRenderContext &context ) const override;
1471 
1472  //getters and setters
1473  double distanceX() const { return mDistanceX; }
1474  void setDistanceX( double d ) { mDistanceX = d; }
1475 
1476  double distanceY() const { return mDistanceY; }
1477  void setDistanceY( double d ) { mDistanceY = d; }
1478 
1479  double displacementX() const { return mDisplacementX; }
1480  void setDisplacementX( double d ) { mDisplacementX = d; }
1481 
1482  double displacementY() const { return mDisplacementY; }
1483  void setDisplacementY( double d ) { mDisplacementY = d; }
1484 
1485  bool setSubSymbol( QgsSymbol *symbol SIP_TRANSFER ) override;
1486  QgsSymbol *subSymbol() override { return mMarkerSymbol; }
1487 
1494  void setDistanceXUnit( QgsUnitTypes::RenderUnit unit ) { mDistanceXUnit = unit; }
1495 
1501  QgsUnitTypes::RenderUnit distanceXUnit() const { return mDistanceXUnit; }
1502 
1503  void setDistanceXMapUnitScale( const QgsMapUnitScale &scale ) { mDistanceXMapUnitScale = scale; }
1504  const QgsMapUnitScale &distanceXMapUnitScale() const { return mDistanceXMapUnitScale; }
1505 
1512  void setDistanceYUnit( QgsUnitTypes::RenderUnit unit ) { mDistanceYUnit = unit; }
1513 
1519  QgsUnitTypes::RenderUnit distanceYUnit() const { return mDistanceYUnit; }
1520 
1521  void setDistanceYMapUnitScale( const QgsMapUnitScale &scale ) { mDistanceYMapUnitScale = scale; }
1522  const QgsMapUnitScale &distanceYMapUnitScale() const { return mDistanceYMapUnitScale; }
1523 
1530  void setDisplacementXUnit( QgsUnitTypes::RenderUnit unit ) { mDisplacementXUnit = unit; }
1531 
1537  QgsUnitTypes::RenderUnit displacementXUnit() const { return mDisplacementXUnit; }
1538 
1539  void setDisplacementXMapUnitScale( const QgsMapUnitScale &scale ) { mDisplacementXMapUnitScale = scale; }
1540  const QgsMapUnitScale &displacementXMapUnitScale() const { return mDisplacementXMapUnitScale; }
1541 
1548  void setDisplacementYUnit( QgsUnitTypes::RenderUnit unit ) { mDisplacementYUnit = unit; }
1549 
1555  QgsUnitTypes::RenderUnit displacementYUnit() const { return mDisplacementYUnit; }
1556 
1557  void setDisplacementYMapUnitScale( const QgsMapUnitScale &scale ) { mDisplacementYMapUnitScale = scale; }
1558  const QgsMapUnitScale &displacementYMapUnitScale() const { return mDisplacementYMapUnitScale; }
1559 
1560  void setOutputUnit( QgsUnitTypes::RenderUnit unit ) override;
1561  QgsUnitTypes::RenderUnit outputUnit() const override;
1562 
1563  void setMapUnitScale( const QgsMapUnitScale &scale ) override;
1564  QgsMapUnitScale mapUnitScale() const override;
1565 
1566  QSet<QString> usedAttributes( const QgsRenderContext &context ) const override;
1567  bool hasDataDefinedProperties() const override;
1568  void setColor( const QColor &c ) override;
1569  QColor color() const override;
1570 
1571  protected:
1572  QgsMarkerSymbol *mMarkerSymbol = nullptr;
1573  double mDistanceX = 15;
1576  double mDistanceY = 15;
1579  double mDisplacementX = 0;
1582  double mDisplacementY = 0;
1585 
1586  void applyDataDefinedSettings( QgsSymbolRenderContext &context ) override;
1587 
1588  private:
1589 #ifdef SIP_RUN
1591 #endif
1592 
1593  void applyPattern( const QgsSymbolRenderContext &context, QBrush &brush, double distanceX, double distanceY,
1594  double displacementX, double displacementY );
1595 };
1596 
1602 {
1603  public:
1605 
1606  // static stuff
1607 
1608  static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;
1609  static QgsSymbolLayer *createFromSld( QDomElement &element ) SIP_FACTORY;
1610 
1611  // implemented from base classes
1612 
1613  QString layerType() const override;
1614 
1615  void startRender( QgsSymbolRenderContext &context ) override;
1616 
1617  void stopRender( QgsSymbolRenderContext &context ) override;
1618 
1619  void renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context ) override;
1620 
1621  QgsStringMap properties() const override;
1622 
1623  QgsCentroidFillSymbolLayer *clone() const override SIP_FACTORY;
1624 
1625  void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const override;
1626 
1627  void setColor( const QColor &color ) override;
1628  QColor color() const override;
1629 
1630  QgsSymbol *subSymbol() override;
1631  bool setSubSymbol( QgsSymbol *symbol SIP_TRANSFER ) override;
1632 
1633  void setOutputUnit( QgsUnitTypes::RenderUnit unit ) override;
1634  QgsUnitTypes::RenderUnit outputUnit() const override;
1635 
1636  void setMapUnitScale( const QgsMapUnitScale &scale ) override;
1637  QgsMapUnitScale mapUnitScale() const override;
1638 
1639  QSet<QString> usedAttributes( const QgsRenderContext &context ) const override;
1640  bool hasDataDefinedProperties() const override;
1641 
1642  void setPointOnSurface( bool pointOnSurface ) { mPointOnSurface = pointOnSurface; }
1643  bool pointOnSurface() const { return mPointOnSurface; }
1644 
1648  void setPointOnAllParts( bool pointOnAllParts ) { mPointOnAllParts = pointOnAllParts; }
1649 
1653  bool pointOnAllParts() const { return mPointOnAllParts; }
1654 
1655  protected:
1656  std::unique_ptr< QgsMarkerSymbol > mMarker;
1657  bool mPointOnSurface = false;
1658  bool mPointOnAllParts = true;
1659 
1660  QgsFeatureId mCurrentFeatureId = -1;
1661  int mBiggestPartIndex = -1;
1662 
1663  private:
1664 #ifdef SIP_RUN
1666 #endif
1667 };
1668 
1669 #endif
1670 
1671 
void setSvgStrokeWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the pattern&#39;s stroke.
#define DEFAULT_SIMPLEFILL_BORDERCOLOR
const QgsMapUnitScale & patternWidthMapUnitScale() const
Returns the map unit scale for the pattern&#39;s width.
void setDistance(double d)
Sets the distance between lines in the fill pattern.
Qt::PenJoinStyle penJoinStyle() const
virtual QString ogrFeatureStyle(double mmScaleFactor, double mapUnitScaleFactor) const
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
const QgsMapUnitScale & displacementXMapUnitScale() const
QgsUnitTypes::RenderUnit distanceYUnit() const
Returns the units for the vertical distance between points in the pattern.
Qt::PenStyle strokeStyle() const
void setPatternWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the width of the SVG images in the pattern.
QColor strokeColor() const override
Gets stroke color.
#define DEFAULT_SIMPLEFILL_JOINSTYLE
QgsUnitTypes::RenderUnit distanceXUnit() const
Returns the units for the horizontal distance between points in the pattern.
virtual QColor strokeColor() const
Gets stroke color.
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the fill&#39;s offset.
QgsMapUnitScale mStrokeWidthMapUnitScale
virtual Qt::PenStyle dxfPenStyle() const
Gets pen style.
const QgsMapUnitScale & lineWidthMapUnitScale() const
Returns the map unit scale for the pattern&#39;s line width.
void setStrokeWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the stroke width map unit scale.
Qt::BrushStyle brushStyle() const
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the fill&#39;s offset.
void setSvgFillColor(const QColor &c)
Sets the fill color used for rendering the SVG content.
void setOutputUnit(QgsUnitTypes::RenderUnit unit) override
Sets the units to use for sizes and widths within the symbol layer.
void setPatternWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the pattern&#39;s width.
Abstract base class for all rendered symbols.
Definition: qgssymbol.h:61
virtual void applyDataDefinedSettings(QgsSymbolRenderContext &context)
virtual QgsSymbol * subSymbol()
Returns the symbol&#39;s sub symbol, if present.
QString svgFilePath() const
Returns the path to the SVG file used to render the fill.
double maxDistance() const
Returns the maximum distance from the shape&#39;s boundary which is shaded.
void setReferencePoint1IsCentroid(bool isCentroid)
Sets the starting point of the gradient to be the feature centroid.
A symbol fill consisting of repeated parallel lines.
QColor color2() const
Returns the color used for the endpoint of the shapeburst fill.
const QgsMapUnitScale & svgStrokeWidthMapUnitScale() const
Returns the map unit scale for the pattern&#39;s stroke.
Base class for polygon renderers generating texture images.
const QgsMapUnitScale & distanceMapUnitScale() const
void setDisplacementYUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the vertical displacement between rows in the pattern.
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the fill&#39;s offset.
void setOffset(QPointF offset)
Sets the offset for the shapeburst fill.
void setStrokeWidthMapUnitScale(const QgsMapUnitScale &scale)
bool setSubSymbol(QgsSymbol *symbol) override
Sets layer&#39;s subsymbol. takes ownership of the passed symbol.
bool hasDataDefinedProperties() const override
Returns true if the symbol layer (or any of its sub-symbols) contains data defined properties...
Abstract base class for color ramps.
Definition: qgscolorramp.h:31
QgsUnitTypes::RenderUnit distanceUnit() const
Returns the units for the distance between lines in the fill pattern.
std::unique_ptr< QgsMarkerSymbol > mMarker
QgsUnitTypes::RenderUnit displacementXUnit() const
Returns the units for the horizontal displacement between rows in the pattern.
const QgsMapUnitScale & widthMapUnitScale() const
Returns the map unit scale for the image&#39;s width.
const QgsMapUnitScale & offsetMapUnitScale() const
qint64 QgsFeatureId
Definition: qgsfeatureid.h:25
void setUseWholeShape(bool useWholeShape)
Sets whether the shapeburst fill should be drawn using the entire shape.
QgsUnitTypes::RenderUnit strokeWidthUnit() const
Returns the units for the symbol&#39;s stroke width.
void setDistanceUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the maximum distance to shade inside of the shape from the polygon&#39;s boundary...
void setDistanceUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the distance between lines in the fill pattern.
QgsUnitTypes::RenderUnit distanceUnit() const
Returns the unit for the maximum distance to shade inside of the shape from the polygon&#39;s boundary...
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
double offset() const
Returns the offset distance for lines within the fill, which is the distance to offset the parallel l...
const QgsMapUnitScale & strokeWidthMapUnitScale() const
bool ignoreRings() const
Returns whether the shapeburst fill is set to ignore polygon interior rings.
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...
double opacity() const
Returns the opacity for the raster image used in the fill.
GradientColorType mGradientColorType
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:577
Tiling is based on complete map viewport.
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
A marker symbol type, for rendering Point and MultiPoint geometries.
Definition: qgssymbol.h:732
void setStrokeWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the units fo the symbol&#39;s stroke width.
void setStrokeWidth(double strokeWidth)
void setPatternWidth(double width)
Sets the width to render the SVG content as within the fill (i.e.
A line symbol type, for rendering LineString and MultiLineString geometries.
Definition: qgssymbol.h:920
QgsSymbol * subSymbol() override
Returns the symbol&#39;s sub symbol, if present.
virtual QgsUnitTypes::RenderUnit outputUnit() const
Returns the units to use for sizes and widths within the symbol layer.
GradientColorType gradientColorType() const
Gradient color mode, controls how gradient color stops are created.
double svgStrokeWidth() const
Returns the stroke width used for rendering the SVG content.
QgsMapUnitScale mapUnitScale() const override
void setGradientType(GradientType gradientType)
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the line pattern&#39;s offset.
QgsUnitTypes::RenderUnit outputUnit() const override
Returns the units to use for sizes and widths within the symbol layer.
void setMapUnitScale(const QgsMapUnitScale &scale) override
#define DEFAULT_SIMPLEFILL_STYLE
QgsUnitTypes::RenderUnit strokeWidthUnit() const
Returns the units for the width of the fill&#39;s stroke.
bool pointOnAllParts() const
Returns whether a point is drawn for all parts or only on the biggest part of multi-part features...
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the line pattern&#39;s offset.
virtual void setColor(const QColor &color)
The fill color.
void setOffset(QPointF offset)
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into c
QgsUnitTypes::RenderUnit displacementYUnit() const
Returns the units for the vertical displacement between rows in the pattern.
virtual void renderPolygon(const QPolygonF &points, QList< QPolygonF > *rings, QgsSymbolRenderContext &context)=0
void setIgnoreRings(bool ignoreRings)
Sets whether the shapeburst fill should ignore polygon rings when calculating the buffered shading...
QColor color2() const
Color for endpoint of gradient, only used if the gradient color type is set to SimpleTwoColor.
void setLineAngle(double a)
Sets the angle for the parallel lines used to fill the symbol.
virtual QColor dxfBrushColor(QgsSymbolRenderContext &context) const
Gets brush/fill color.
QgsUnitTypes::RenderUnit widthUnit() const
Returns the units for the image&#39;s width.
std::unique_ptr< QgsLineSymbol > mStroke
Custom stroke.
virtual bool setSubSymbol(QgsSymbol *symbol)
Sets layer&#39;s subsymbol. takes ownership of the passed symbol.
A class for filling symbols with a repeated raster image.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
#define DEFAULT_SIMPLEFILL_BORDERWIDTH
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units used for the offset of the shapeburst fill.
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.
const QgsMapUnitScale & offsetMapUnitScale() const
void setWidth(const double width)
Sets the width for scaling the image used in the fill.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the fill&#39;s offset.
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.
virtual QgsMapUnitScale mapUnitScale() const
void setSvgStrokeWidth(double w)
Sets the stroke width used for rendering the SVG content.
virtual bool hasDataDefinedProperties() const
Returns true if the symbol layer (or any of its sub-symbols) contains data defined properties...
double lineAngle() const
Returns the angle for the parallel lines used to fill the symbol.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the pattern&#39;s line offset.
void setWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the image&#39;s width.
const QgsMapUnitScale & distanceXMapUnitScale() const
GradientCoordinateMode coordinateMode() const
Coordinate mode for gradient. Controls how the gradient stops are positioned.
virtual QgsSymbolLayer * clone() const =0
Shall be reimplemented by subclasses to create a deep copy of the instance.
QString imageFilePath() const
The path to the raster image used for the fill.
void setStrokeStyle(Qt::PenStyle strokeStyle)
#define SIP_TRANSFER
Definition: qgis_sip.h:36
double lineWidth() const
Returns the width of the line subsymbol used to render the parallel lines in the fill.
void setDistanceYMapUnitScale(const QgsMapUnitScale &scale)
QColor svgFillColor() const
Returns the fill color used for rendering the SVG content.
double patternWidth() const
Returns the width of the rendered SVG content within the fill (i.e.
ShapeburstColorType colorType() const
Returns the color mode used for the shapeburst fill.
#define SIP_FACTORY
Definition: qgis_sip.h:69
void setPenJoinStyle(Qt::PenJoinStyle style)
int blurRadius() const
Returns the blur radius, which controls the amount of blurring applied to the fill.
QColor fillColor() const override
Gets fill color.
void setLineWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the pattern&#39;s line width.
Tiling is based on feature bounding box.
void setDisplacementXMapUnitScale(const QgsMapUnitScale &scale)
void setOffset(QPointF offset)
Sets the offset for the fill.
virtual void toSld(QDomDocument &doc, QDomElement &element, const QgsStringMap &props) const
QgsUnitTypes::RenderUnit offsetUnit() const
const QgsMapUnitScale & displacementYMapUnitScale() const
void setSvgStrokeWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the stroke width.
void setStrokeColor(const QColor &strokeColor) override
Set stroke color.
void setOffset(QPointF offset)
Offset for gradient fill.
GradientSpread gradientSpread() const
Gradient spread mode. Controls how the gradient behaves outside of the predefined stops...
void setDistanceXUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the horizontal distance between points in the pattern.
GradientCoordinateMode mCoordinateMode
A class for filling symbols with a repeated SVG file.
const QgsMapUnitScale & strokeWidthMapUnitScale() const
Returns the stroke width map unit scale.
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 double dxfAngle(QgsSymbolRenderContext &context) const
Gets angle.
const QgsMapUnitScale & distanceMapUnitScale() const
Returns the map unit scale for the pattern&#39;s line distance.
virtual void setMapUnitScale(const QgsMapUnitScale &scale)
QColor svgStrokeColor() const
Returns the stroke color used for rendering the SVG content.
void setGradientColorType(GradientColorType gradientColorType)
QPointF offset() const
Returns the offset for the fill.
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
FillCoordinateMode coordinateMode() const
Coordinate mode for fill.
const QgsMapUnitScale & distanceYMapUnitScale() const
bool useWholeShape() const
Returns whether the shapeburst fill is set to cover the entire shape.
QgsUnitTypes::RenderUnit svgStrokeWidthUnit() const
Returns the units for the stroke width.
void setStrokeWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the width of the fill&#39;s stroke.
virtual QSet< QString > usedAttributes(const QgsRenderContext &context) const
Returns the set of attributes referenced by the layer.
#define DEFAULT_SIMPLEFILL_BORDERSTYLE
Qt::PenJoinStyle mPenJoinStyle
virtual double dxfWidth(const QgsDxfExport &e, QgsSymbolRenderContext &context) const
Gets line width.
virtual double estimateMaxBleed(const QgsRenderContext &context) const
Returns the estimated maximum distance which the layer style will bleed outside the drawn shape when ...
void setDisplacementXUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the horizontal displacement between rows in the pattern.
void setDisplacementYMapUnitScale(const QgsMapUnitScale &scale)
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 ...
void setColor2(const QColor &color2)
QgsUnitTypes::RenderUnit patternWidthUnit() const
Returns the units for the width of the SVG images in the pattern.
double distance() const
Returns the distance between lines in the fill pattern.
QgsUnitTypes::RenderUnit lineWidthUnit() const
Returns the units for the line&#39;s width.
void setBrushStyle(Qt::BrushStyle style)
QgsColorRamp * colorRamp()
Returns the color ramp used for the gradient fill.
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the units used for the offset for the shapeburst fill.
void setOffset(double offset)
Sets the offset distance for lines within the fill, which is the distance to offset the parallel line...
Resolves relative paths into absolute paths and vice versa.
void setLineWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the line&#39;s width.
double width() const
Returns the width used for scaling the image used in the fill.
void setSvgStrokeColor(const QColor &c)
Sets the stroke color used for rendering the SVG content.
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Units for gradient fill offset.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the pattern&#39;s line offset.
QgsSymbol * subSymbol() override
Returns the symbol&#39;s sub symbol, if present.
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.
virtual QColor color() const
The fill color.
QgsColorRamp * colorRamp()
Returns the color ramp used for the shapeburst fill.
void setGradientSpread(GradientSpread gradientSpread)
FillCoordinateMode
Fill coordinate modes, dictates fill tiling behavior.
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)
Sets the map unit scale for the pattern&#39;s line distance.
virtual Qt::BrushStyle dxfBrushStyle() const
Gets brush/fill style.
QPointF offset() const
Returns the offset for the shapeburst fill.
RenderUnit
Rendering size units.
Definition: qgsunittypes.h:110
const QgsMapUnitScale & offsetMapUnitScale() const
QgsMapUnitScale mStrokeWidthMapUnitScale
void setPointOnSurface(bool pointOnSurface)
QSet< QString > usedAttributes(const QgsRenderContext &context) const override
Returns the set of attributes referenced by the layer.
virtual void startRender(QgsSymbolRenderContext &context)=0
virtual QColor dxfColor(QgsSymbolRenderContext &context) const
Gets color.
virtual QString layerType() const =0
Returns a string that represents this layer type.