QGIS API Documentation 4.0.0-Norrköping (1ddcee3d0e4)
Loading...
Searching...
No Matches
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 QGSFILLSYMBOLLAYER_H
17#define QGSFILLSYMBOLLAYER_H
18
19#include "qgis.h"
20#include "qgis_core.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 Qgis::DEFAULT_LINE_WIDTH
28#define DEFAULT_SIMPLEFILL_JOINSTYLE Qt::BevelJoin
29
30#define INF 1E20
31
32#include <QPen>
33#include <QBrush>
34
35class QgsMarkerSymbol;
36class QgsLineSymbol;
37class QgsPathResolver;
38
45{
46 public:
48 const QColor &color = DEFAULT_SIMPLEFILL_COLOR,
49 Qt::BrushStyle style = DEFAULT_SIMPLEFILL_STYLE,
54 );
55
57
58 // static stuff
59
65 static QgsSymbolLayer *create( const QVariantMap &properties = QVariantMap() ) SIP_FACTORY;
66 static QgsSymbolLayer *createFromSld( QDomElement &element ) SIP_FACTORY;
67
68 // implemented from base classes
69
70 QString layerType() const override;
71 Qgis::SymbolLayerFlags flags() const override;
72 void startRender( QgsSymbolRenderContext &context ) override;
73 void stopRender( QgsSymbolRenderContext &context ) override;
74 void renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context ) override;
75 QVariantMap properties() const override;
77 Q_DECL_DEPRECATED void toSld( QDomDocument &doc, QDomElement &element, const QVariantMap &props ) const override SIP_DEPRECATED;
78 bool toSld( QDomDocument &doc, QDomElement &element, QgsSldExportContext &context ) const override;
79 QString ogrFeatureStyle( double mmScaleFactor, double mapUnitScaleFactor ) const override;
80
81 Qt::BrushStyle brushStyle() const { return mBrushStyle; }
82 void setBrushStyle( Qt::BrushStyle style ) { mBrushStyle = style; }
83
84 QColor strokeColor() const override { return mStrokeColor; }
85 void setStrokeColor( const QColor &strokeColor ) override { mStrokeColor = strokeColor; }
86 QColor fillColor() const override { return color(); }
87 void setFillColor( const QColor &color ) override { setColor( color ); }
88
89 Qt::PenStyle strokeStyle() const { return mStrokeStyle; }
91
92 double strokeWidth() const { return mStrokeWidth; }
94
95 Qt::PenJoinStyle penJoinStyle() const { return mPenJoinStyle; }
96 void setPenJoinStyle( Qt::PenJoinStyle style ) { mPenJoinStyle = style; }
97
106 void setOffset( QPointF offset ) { mOffset = offset; }
107
116 QPointF offset() const { return mOffset; }
117
124
130
133
140
147
154
161
162 void setOutputUnit( Qgis::RenderUnit unit ) override;
163 Qgis::RenderUnit outputUnit() const override;
164 bool usesMapUnits() const override;
165
166 void setMapUnitScale( const QgsMapUnitScale &scale ) override;
167 QgsMapUnitScale mapUnitScale() const override;
168
169 double estimateMaxBleed( const QgsRenderContext &context ) const override;
170
171 double dxfWidth( const QgsDxfExport &e, QgsSymbolRenderContext &context ) const override;
172 QColor dxfColor( QgsSymbolRenderContext &context ) const override;
173 double dxfAngle( QgsSymbolRenderContext &context ) const override;
174
175 Qt::PenStyle dxfPenStyle() const override;
176 QColor dxfBrushColor( QgsSymbolRenderContext &context ) const override;
177 Qt::BrushStyle dxfBrushStyle() const override;
178 QImage toTiledPatternImage() const override;
179
180 protected:
181 QBrush mBrush;
182 QBrush mSelBrush;
183 Qt::BrushStyle mBrushStyle;
185 Qt::PenStyle mStrokeStyle;
189 Qt::PenJoinStyle mPenJoinStyle;
190 QPen mPen;
192
193 QPointF mOffset;
196
197 private:
198 //helper functions for data defined symbology
199 void applyDataDefinedSymbology( QgsSymbolRenderContext &context, QBrush &brush, QPen &pen, QPen &selPen );
200};
201
202class QgsColorRamp;
203
210{
211 public:
216 const QColor &color = DEFAULT_SIMPLEFILL_COLOR,
217 const QColor &color2 = Qt::white,
222 );
223
225
226 // static stuff
227
233 static QgsSymbolLayer *create( const QVariantMap &properties = QVariantMap() ) SIP_FACTORY;
234
235 // implemented from base classes
236
237 Qgis::SymbolLayerFlags flags() const override;
238 QString layerType() const override;
239 void startRender( QgsSymbolRenderContext &context ) override;
240 void stopRender( QgsSymbolRenderContext &context ) override;
241 void renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context ) override;
242 QVariantMap properties() const override;
244 double estimateMaxBleed( const QgsRenderContext &context ) const override;
245 bool canCauseArtifactsBetweenAdjacentTiles() const override;
246
253
260
267
274
282
290 void setColorRamp( QgsColorRamp *ramp SIP_TRANSFER );
291
297 QColor color2() const { return mColor2; }
298
304 void setColor2( const QColor &color2 ) { mColor2 = color2; }
305
312
319
326
333
339 void setReferencePoint1( QPointF referencePoint ) { mReferencePoint1 = referencePoint; }
340
346 QPointF referencePoint1() const { return mReferencePoint1; }
347
353 void setReferencePoint1IsCentroid( bool isCentroid ) { mReferencePoint1IsCentroid = isCentroid; }
354
361
367 void setReferencePoint2( QPointF referencePoint ) { mReferencePoint2 = referencePoint; }
368
374 QPointF referencePoint2() const { return mReferencePoint2; }
375
381 void setReferencePoint2IsCentroid( bool isCentroid ) { mReferencePoint2IsCentroid = isCentroid; }
382
383
390
399 void setOffset( QPointF offset ) { mOffset = offset; }
400
409 QPointF offset() const { return mOffset; }
410
417
424
431
438
439 void setOutputUnit( Qgis::RenderUnit unit ) override;
440 Qgis::RenderUnit outputUnit() const override;
441 bool usesMapUnits() const override;
442
443 void setMapUnitScale( const QgsMapUnitScale &scale ) override;
444 QgsMapUnitScale mapUnitScale() const override;
445
446 protected:
447 QBrush mBrush;
448 QBrush mSelBrush;
449
451 QColor mColor2;
452 std::unique_ptr<QgsColorRamp> mGradientRamp;
456
461
462 QPointF mOffset;
465
466 private:
467 //helper functions for data defined symbology
468 void applyDataDefinedSymbology( QgsSymbolRenderContext &context, const QPolygonF &points );
469
471 void applyGradient(
472 const QgsSymbolRenderContext &context,
473 QBrush &brush,
474 const QColor &color,
475 const QColor &color2,
477 QgsColorRamp *gradientRamp,
481 QPointF referencePoint1,
482 QPointF referencePoint2,
483 double angle
484 );
485
487 QPointF rotateReferencePoint( QPointF refPoint, double angle );
488};
489
496{
497 public:
502 const QColor &color = DEFAULT_SIMPLEFILL_COLOR,
503 const QColor &color2 = Qt::white,
505 int blurRadius = 0,
506 bool useWholeShape = true,
507 double maxDistance = 5
508 );
509
511
517
523
524 // static stuff
525
531 static QgsSymbolLayer *create( const QVariantMap &properties = QVariantMap() ) SIP_FACTORY;
532
533 // implemented from base classes
534
535 QString layerType() const override;
536 Qgis::SymbolLayerFlags flags() const override;
537 void startRender( QgsSymbolRenderContext &context ) override;
538 void stopRender( QgsSymbolRenderContext &context ) override;
539 void renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context ) override;
540 QVariantMap properties() const override;
542 double estimateMaxBleed( const QgsRenderContext &context ) const override;
543 bool canCauseArtifactsBetweenAdjacentTiles() const override;
544
550 void setBlurRadius( int blurRadius ) { mBlurRadius = blurRadius; }
551
557 int blurRadius() const { return mBlurRadius; }
558
566 void setUseWholeShape( bool useWholeShape ) { mUseWholeShape = useWholeShape; }
567
574 bool useWholeShape() const { return mUseWholeShape; }
575
583 void setMaxDistance( double maxDistance ) { mMaxDistance = maxDistance; }
584
592 double maxDistance() const { return mMaxDistance; }
593
600 void setDistanceUnit( Qgis::RenderUnit unit ) { mDistanceUnit = unit; }
601
608 Qgis::RenderUnit distanceUnit() const { return mDistanceUnit; }
609
610 void setDistanceMapUnitScale( const QgsMapUnitScale &scale ) { mDistanceMapUnitScale = scale; }
611 const QgsMapUnitScale &distanceMapUnitScale() const { return mDistanceMapUnitScale; }
612
623
633 Qgis::GradientColorSource colorType() const { return mColorType; }
634
643 void setColorRamp( QgsColorRamp *ramp SIP_TRANSFER );
644
651 QgsColorRamp *colorRamp() { return mGradientRamp.get(); }
652
659 void setColor2( const QColor &color2 ) { mColor2 = color2; }
660
667 QColor color2() const { return mColor2; }
668
675 void setIgnoreRings( bool ignoreRings ) { mIgnoreRings = ignoreRings; }
676
682 bool ignoreRings() const { return mIgnoreRings; }
683
690 void setOffset( QPointF offset ) { mOffset = offset; }
691
698 QPointF offset() const { return mOffset; }
699
706 void setOffsetUnit( Qgis::RenderUnit unit ) { mOffsetUnit = unit; }
707
714 Qgis::RenderUnit offsetUnit() const { return mOffsetUnit; }
715
716 void setOffsetMapUnitScale( const QgsMapUnitScale &scale ) { mOffsetMapUnitScale = scale; }
717 const QgsMapUnitScale &offsetMapUnitScale() const { return mOffsetMapUnitScale; }
718
719 void setOutputUnit( Qgis::RenderUnit unit ) override;
720 Qgis::RenderUnit outputUnit() const override;
721 bool usesMapUnits() const override;
722
723 void setMapUnitScale( const QgsMapUnitScale &scale ) override;
724 QgsMapUnitScale mapUnitScale() const override;
725
726 private:
727 QBrush mBrush;
728 QBrush mSelBrush;
729
730 int mBlurRadius = 0;
731
732 bool mUseWholeShape = true;
733 double mMaxDistance = 5.0;
735 QgsMapUnitScale mDistanceMapUnitScale;
736
738 QColor mColor2;
739
740 bool mIgnoreRings = false;
741
742 QPointF mOffset;
744 QgsMapUnitScale mOffsetMapUnitScale;
745
746 std::unique_ptr< QgsColorRamp > mGradientRamp;
747
748 //helper functions for data defined symbology
749 void applyDataDefinedSymbology( QgsSymbolRenderContext &context, QColor &color, QColor &color2, int &blurRadius, bool &useWholeShape, double &maxDistance, bool &ignoreRings );
750
751 /* distance transform of a 1d function using squared distance */
752 void distanceTransform1d( double *f, int n, int *v, double *z, double *d );
753 /* distance transform of 2d function using squared distance */
754 void distanceTransform2d( double *im, int width, int height, QgsRenderContext &context );
755 /* distance transform of a binary QImage */
756 double *distanceTransform( QImage *im, QgsRenderContext &context );
757
758 /* fills a QImage with values from an array of doubles containing squared distance transform values */
759 void dtArrayToQImage( double *array, QImage *im, QgsColorRamp *ramp, QgsRenderContext &context, bool useWholeShape = true, int maxPixelDistance = 0 );
760
761#ifdef SIP_RUN
763#endif
764};
765
771{
772 public:
775
776 void renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context ) override;
777
784
791
799
808
817
826
827 void setOutputUnit( Qgis::RenderUnit unit ) override;
828 Qgis::RenderUnit outputUnit() const override;
829 void setMapUnitScale( const QgsMapUnitScale &scale ) override;
830 QgsMapUnitScale mapUnitScale() const override;
831 double dxfWidth( const QgsDxfExport &e, QgsSymbolRenderContext &context ) const override;
832 Qt::PenStyle dxfPenStyle() const override;
833 QVariantMap properties() const override;
834
835 protected:
836 QBrush mBrush;
838 double mNextAngle = 0.0; // mAngle / data defined angle
839
841 double mStrokeWidth = 0.0;
844
848 virtual void applyDataDefinedSettings( QgsSymbolRenderContext &context ) { Q_UNUSED( context ) }
849
855 virtual bool applyBrushTransformFromContext( QgsSymbolRenderContext *context = nullptr ) const;
856
857 private:
858#ifdef SIP_RUN
860#endif
861};
862
869{
870 public:
875 QgsRasterFillSymbolLayer( const QString &imageFilePath = QString() );
876
878
883 static QgsSymbolLayer *create( const QVariantMap &properties = QVariantMap() ) SIP_FACTORY;
884
890 static QgsSymbolLayer *createFromSld( QDomElement &element ) SIP_FACTORY;
891
896 static void resolvePaths( QVariantMap &properties, const QgsPathResolver &pathResolver, bool saving );
897
898 // implemented from base classes
899 QString layerType() const override;
900 Qgis::SymbolLayerFlags flags() const override;
901 void renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context ) override;
902 void startRender( QgsSymbolRenderContext &context ) override;
903 void stopRender( QgsSymbolRenderContext &context ) override;
904 QVariantMap properties() const override;
906 double estimateMaxBleed( const QgsRenderContext &context ) const override;
907 bool usesMapUnits() const override;
908 QColor color() const override;
909 void setOutputUnit( Qgis::RenderUnit unit ) override;
910
911 //override QgsImageFillSymbolLayer's support for sub symbols
912 QgsSymbol *subSymbol() override { return nullptr; }
913 bool setSubSymbol( QgsSymbol *symbol SIP_TRANSFER ) override;
914
920 void setImageFilePath( const QString &imagePath );
921
927 QString imageFilePath() const { return mImageFilePath; }
928
935 void setCoordinateMode( Qgis::SymbolCoordinateReference mode );
936
943 Qgis::SymbolCoordinateReference coordinateMode() const { return mCoordinateMode; }
944
950 void setOpacity( double opacity );
951
957 double opacity() const { return mOpacity; }
958
966 void setOffset( QPointF offset ) { mOffset = offset; }
967
975 QPointF offset() const { return mOffset; }
976
984 void setOffsetUnit( const Qgis::RenderUnit unit ) { mOffsetUnit = unit; }
985
993 Qgis::RenderUnit offsetUnit() const { return mOffsetUnit; }
994
1002 void setOffsetMapUnitScale( const QgsMapUnitScale &scale ) { mOffsetMapUnitScale = scale; }
1003
1011 const QgsMapUnitScale &offsetMapUnitScale() const { return mOffsetMapUnitScale; }
1012
1024 void setWidth( double width ) { mWidth = width; }
1025
1036 double width() const { return mWidth; }
1037
1049 void setHeight( double height ) { mHeight = height; }
1050
1061 double height() const { return mHeight; }
1062
1072 Q_DECL_DEPRECATED void setWidthUnit( Qgis::RenderUnit unit ) SIP_DEPRECATED { mSizeUnit = unit; }
1073
1083 void setSizeUnit( Qgis::RenderUnit unit ) { mSizeUnit = unit; }
1084
1094 Q_DECL_DEPRECATED Qgis::RenderUnit widthUnit() const SIP_DEPRECATED { return mSizeUnit; }
1095
1106 Qgis::RenderUnit sizeUnit() const { return mSizeUnit; }
1107
1117 Q_DECL_DEPRECATED void setWidthMapUnitScale( const QgsMapUnitScale &scale ) SIP_DEPRECATED { mSizeMapUnitScale = scale; }
1118
1129 void setSizeMapUnitScale( const QgsMapUnitScale &scale ) { mSizeMapUnitScale = scale; }
1130
1140 Q_DECL_DEPRECATED const QgsMapUnitScale &widthMapUnitScale() const SIP_DEPRECATED { return mSizeMapUnitScale; }
1141
1152 const QgsMapUnitScale &sizeMapUnitScale() const { return mSizeMapUnitScale; }
1153
1154 protected:
1155 void applyDataDefinedSettings( QgsSymbolRenderContext &context ) override;
1156 bool applyBrushTransformFromContext( QgsSymbolRenderContext *context = nullptr ) const override;
1157
1158 private:
1160 QString mImageFilePath;
1162 double mOpacity = 1.0;
1163
1164 QPointF mOffset;
1166 QgsMapUnitScale mOffsetMapUnitScale;
1167
1168 double mWidth = 0.0;
1170 QgsMapUnitScale mSizeMapUnitScale;
1171
1172 double mHeight = 0.0;
1173
1175 void applyPattern( QBrush &brush, const QString &imageFilePath, double width, double height, double opacity, const QgsSymbolRenderContext &context );
1176};
1177
1183{
1184 public:
1188 QgsSVGFillSymbolLayer( const QString &svgFilePath, double width = 20, double rotation = 0.0 );
1189
1193 QgsSVGFillSymbolLayer( const QByteArray &svgData, double width = 20, double rotation = 0.0 );
1194
1196
1201 static QgsSymbolLayer *create( const QVariantMap &properties = QVariantMap() ) SIP_FACTORY;
1202
1207 static QgsSymbolLayer *createFromSld( QDomElement &element ) SIP_FACTORY;
1208
1213 static void resolvePaths( QVariantMap &properties, const QgsPathResolver &pathResolver, bool saving );
1214
1215 // implemented from base classes
1216
1217 QString layerType() const override;
1218 void startRender( QgsSymbolRenderContext &context ) override;
1219 void stopRender( QgsSymbolRenderContext &context ) override;
1220 void renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context ) override;
1221 QVariantMap properties() const override;
1222 QgsSVGFillSymbolLayer *clone() const override SIP_FACTORY;
1223 Q_DECL_DEPRECATED void toSld( QDomDocument &doc, QDomElement &element, const QVariantMap &props ) const override SIP_DEPRECATED;
1224 bool toSld( QDomDocument &doc, QDomElement &element, QgsSldExportContext &context ) const override;
1225 bool usesMapUnits() const override;
1226 QgsSymbol *subSymbol() override;
1227 bool setSubSymbol( QgsSymbol *symbol SIP_TRANSFER ) override;
1228 double estimateMaxBleed( const QgsRenderContext &context ) const override;
1229 QColor dxfColor( QgsSymbolRenderContext &context ) const override;
1230 QSet<QString> usedAttributes( const QgsRenderContext &context ) const override;
1231 bool hasDataDefinedProperties() const override;
1232
1244 void setSvgFilePath( const QString &svgPath );
1245
1251 QString svgFilePath() const { return mSvgFilePath; }
1252
1262 void setPatternWidth( double width ) { mPatternWidth = width; }
1263
1273 double patternWidth() const { return mPatternWidth; }
1274
1284 void setSvgFillColor( const QColor &c ) { setColor( c ); }
1285
1294 QColor svgFillColor() const { return color(); }
1295
1305 void setSvgStrokeColor( const QColor &c ) { mSvgStrokeColor = c; }
1306
1315 QColor svgStrokeColor() const { return mSvgStrokeColor; }
1316
1327 void setSvgStrokeWidth( double w ) { mSvgStrokeWidth = w; }
1328
1339 double svgStrokeWidth() const { return mSvgStrokeWidth; }
1340
1348 void setPatternWidthUnit( Qgis::RenderUnit unit ) { mPatternWidthUnit = unit; }
1349
1357 Qgis::RenderUnit patternWidthUnit() const { return mPatternWidthUnit; }
1358
1366 void setPatternWidthMapUnitScale( const QgsMapUnitScale &scale ) { mPatternWidthMapUnitScale = scale; }
1367
1375 const QgsMapUnitScale &patternWidthMapUnitScale() const { return mPatternWidthMapUnitScale; }
1376
1384 void setSvgStrokeWidthUnit( Qgis::RenderUnit unit ) { mSvgStrokeWidthUnit = unit; }
1385
1393 Qgis::RenderUnit svgStrokeWidthUnit() const { return mSvgStrokeWidthUnit; }
1394
1402 void setSvgStrokeWidthMapUnitScale( const QgsMapUnitScale &scale ) { mSvgStrokeWidthMapUnitScale = scale; }
1403
1411 const QgsMapUnitScale &svgStrokeWidthMapUnitScale() const { return mSvgStrokeWidthMapUnitScale; }
1412
1413 void setOutputUnit( Qgis::RenderUnit unit ) override;
1414 Qgis::RenderUnit outputUnit() const override;
1415
1416 void setMapUnitScale( const QgsMapUnitScale &scale ) override;
1417 QgsMapUnitScale mapUnitScale() const override;
1418
1423 QMap<QString, QgsProperty> parameters() const { return mParameters; }
1424
1429 void setParameters( const QMap<QString, QgsProperty> &parameters );
1430
1431 protected:
1432 void applyDataDefinedSettings( QgsSymbolRenderContext &context ) override;
1433
1434 private:
1436 double mPatternWidth = 20;
1438 QgsMapUnitScale mPatternWidthMapUnitScale;
1439 QMap<QString, QgsProperty> mParameters;
1440
1442 QByteArray mSvgData;
1444 QString mSvgFilePath;
1446 QRectF mSvgViewBox;
1447
1448 //param(fill), param(stroke), param(stroke-width) are going
1449 //to be replaced in memory
1450 QColor mSvgStrokeColor = QColor( 35, 35, 35 );
1451 double mSvgStrokeWidth = 0.2;
1452 Qgis::RenderUnit mSvgStrokeWidthUnit = Qgis::RenderUnit::Millimeters;
1453 QgsMapUnitScale mSvgStrokeWidthMapUnitScale;
1454
1456 std::unique_ptr< QgsLineSymbol > mStroke;
1457
1459 void storeViewBox();
1460 void setDefaultSvgParams(); //fills mSvgFillColor, mSvgStrokeColor, mSvgStrokeWidth with default values for mSvgFilePath
1461
1463 void applyPattern(
1464 QBrush &brush,
1465 const QString &svgFilePath,
1466 double patternWidth,
1467 Qgis::RenderUnit patternWidthUnit,
1468 const QColor &svgFillColor,
1469 const QColor &svgStrokeColor,
1470 double svgStrokeWidth,
1471 Qgis::RenderUnit svgStrokeWidthUnit,
1472 const QgsSymbolRenderContext &context,
1473 const QgsMapUnitScale &patternWidthMapUnitScale,
1474 const QgsMapUnitScale &svgStrokeWidthMapUnitScale,
1475 const QgsStringMap svgParameters
1476 );
1477};
1478
1485{
1486 public:
1489
1494 static QgsSymbolLayer *create( const QVariantMap &properties = QVariantMap() ) SIP_FACTORY;
1495
1500 static QgsSymbolLayer *createFromSld( QDomElement &element ) SIP_FACTORY;
1501
1502 QString layerType() const override;
1503 void startRender( QgsSymbolRenderContext &context ) override;
1504 void stopRender( QgsSymbolRenderContext &context ) override;
1505 void renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context ) override;
1506 QVariantMap properties() const override;
1508 Q_DECL_DEPRECATED void toSld( QDomDocument &doc, QDomElement &element, const QVariantMap &props ) const override SIP_DEPRECATED;
1509 bool toSld( QDomDocument &doc, QDomElement &element, QgsSldExportContext &context ) const override;
1510 QImage toTiledPatternImage() const override;
1511 double estimateMaxBleed( const QgsRenderContext &context ) const override;
1512
1513 QString ogrFeatureStyleWidth( double widthScaleFactor ) const;
1514
1522 void setLineAngle( double a ) { mLineAngle = a; }
1523
1531 double lineAngle() const { return mLineAngle; }
1532
1539 void setDistance( double d ) { mDistance = d; }
1540
1546 double distance() const { return mDistance; }
1547
1554 void setLineWidth( double w );
1555
1562 double lineWidth() const { return mLineWidth; }
1563
1564 void setColor( const QColor &c ) override;
1565 QColor color() const override;
1566
1578 void setOffset( double offset ) { mOffset = offset; }
1579
1591 double offset() const { return mOffset; }
1592
1599 void setDistanceUnit( Qgis::RenderUnit unit ) { mDistanceUnit = unit; }
1600
1607 Qgis::RenderUnit distanceUnit() const { return mDistanceUnit; }
1608
1616 void setDistanceMapUnitScale( const QgsMapUnitScale &scale ) { mDistanceMapUnitScale = scale; }
1617
1625 const QgsMapUnitScale &distanceMapUnitScale() const { return mDistanceMapUnitScale; }
1626
1632 void setLineWidthUnit( Qgis::RenderUnit unit ) { mLineWidthUnit = unit; }
1633
1639 Qgis::RenderUnit lineWidthUnit() const { return mLineWidthUnit; }
1640
1648 void setLineWidthMapUnitScale( const QgsMapUnitScale &scale ) { mLineWidthMapUnitScale = scale; }
1649
1657 const QgsMapUnitScale &lineWidthMapUnitScale() const { return mLineWidthMapUnitScale; }
1658
1664 void setOffsetUnit( Qgis::RenderUnit unit ) { mOffsetUnit = unit; }
1665
1671 Qgis::RenderUnit offsetUnit() const { return mOffsetUnit; }
1672
1680 void setOffsetMapUnitScale( const QgsMapUnitScale &scale ) { mOffsetMapUnitScale = scale; }
1681
1689 const QgsMapUnitScale &offsetMapUnitScale() const { return mOffsetMapUnitScale; }
1690
1697 Qgis::LineClipMode clipMode() const { return mClipMode; }
1698
1705 void setClipMode( Qgis::LineClipMode mode ) { mClipMode = mode; }
1706
1707 void setOutputUnit( Qgis::RenderUnit unit ) override;
1708 Qgis::RenderUnit outputUnit() const override;
1709 bool usesMapUnits() const override;
1710 void setMapUnitScale( const QgsMapUnitScale &scale ) override;
1711 QgsMapUnitScale mapUnitScale() const override;
1712 bool setSubSymbol( QgsSymbol *symbol SIP_TRANSFER ) override;
1713 QgsSymbol *subSymbol() override;
1714 QSet<QString> usedAttributes( const QgsRenderContext &context ) const override;
1715 bool hasDataDefinedProperties() const override;
1716 void startFeatureRender( const QgsFeature &feature, QgsRenderContext &context ) override;
1717 void stopFeatureRender( const QgsFeature &feature, QgsRenderContext &context ) override;
1718
1719 protected:
1720 void applyDataDefinedSettings( QgsSymbolRenderContext &context ) override;
1721
1722 private:
1724 double mDistance = 5.0;
1726 QgsMapUnitScale mDistanceMapUnitScale;
1728 double mLineWidth = 0;
1730 QgsMapUnitScale mLineWidthMapUnitScale;
1732 double mLineAngle = 45.0;
1734 double mOffset = 0.0;
1736 QgsMapUnitScale mOffsetMapUnitScale;
1737
1738 bool mRenderUsingLines = false;
1739
1740#ifdef SIP_RUN
1742#endif
1743
1745 bool applyPattern( const QgsSymbolRenderContext &context, QBrush &brush, double lineAngle, double distance );
1746
1748 std::unique_ptr< QgsLineSymbol > mFillLineSymbol;
1749 bool mFillLineSymbolRenderStarted = false;
1750
1752};
1753
1760{
1761 public:
1764
1770 static QgsSymbolLayer *create( const QVariantMap &properties = QVariantMap() ) SIP_FACTORY;
1771 static QgsSymbolLayer *createFromSld( QDomElement &element ) SIP_FACTORY;
1772
1773 QString layerType() const override;
1774 void startRender( QgsSymbolRenderContext &context ) override;
1775 void stopRender( QgsSymbolRenderContext &context ) override;
1776 void startFeatureRender( const QgsFeature &feature, QgsRenderContext &context ) override;
1777 void stopFeatureRender( const QgsFeature &feature, QgsRenderContext &context ) override;
1778 void renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context ) override;
1779 QVariantMap properties() const override;
1781 Q_DECL_DEPRECATED void toSld( QDomDocument &doc, QDomElement &element, const QVariantMap &props ) const override SIP_DEPRECATED;
1782 bool toSld( QDomDocument &doc, QDomElement &element, QgsSldExportContext &context ) const override;
1783 QImage toTiledPatternImage() const override;
1784 double estimateMaxBleed( const QgsRenderContext &context ) const override;
1785 bool setSubSymbol( QgsSymbol *symbol SIP_TRANSFER ) override;
1786 QgsSymbol *subSymbol() override;
1787 void setOutputUnit( Qgis::RenderUnit unit ) override;
1788 Qgis::RenderUnit outputUnit() const override;
1789 bool usesMapUnits() const override;
1790 void setMapUnitScale( const QgsMapUnitScale &scale ) override;
1791 QgsMapUnitScale mapUnitScale() const override;
1792 QSet<QString> usedAttributes( const QgsRenderContext &context ) const override;
1793 bool hasDataDefinedProperties() const override;
1794 void setColor( const QColor &c ) override;
1795 QColor color() const override;
1796
1806 double distanceX() const { return mDistanceX; }
1807
1817 void setDistanceX( double d ) { mDistanceX = d; }
1818
1826
1833
1841
1849
1859 double distanceY() const { return mDistanceY; }
1860
1870 void setDistanceY( double d ) { mDistanceY = d; }
1871
1879
1886
1894
1902
1912 double displacementX() const { return mDisplacementX; }
1913
1923 void setDisplacementX( double d ) { mDisplacementX = d; }
1924
1932
1939
1947
1955
1965 double displacementY() const { return mDisplacementY; }
1966
1976 void setDisplacementY( double d ) { mDisplacementY = d; }
1977
1985
1992
2000
2008
2016 void setOffsetX( double offset ) { mOffsetX = offset; }
2017
2024 double offsetX() const { return mOffsetX; }
2025
2033 void setOffsetY( double offset ) { mOffsetY = offset; }
2034
2041 double offsetY() const { return mOffsetY; }
2042
2051
2059
2068
2076
2085
2093
2102
2110
2117 Qgis::MarkerClipMode clipMode() const { return mClipMode; }
2118
2125 void setClipMode( Qgis::MarkerClipMode mode ) { mClipMode = mode; }
2126
2136 void setMaximumRandomDeviationX( double deviation ) { mRandomDeviationX = deviation; }
2137
2148
2158 void setMaximumRandomDeviationY( double deviation ) { mRandomDeviationY = deviation; }
2159
2170
2179
2188
2197
2207
2216
2225
2234
2243
2250 unsigned long seed() const { return mSeed; }
2251
2260 void setSeed( unsigned long seed ) { mSeed = seed; }
2261
2262 protected:
2263 std::unique_ptr< QgsMarkerSymbol > mMarkerSymbol;
2265 double mDistanceX = 15;
2268 double mDistanceY = 15;
2271 double mDisplacementX = 0;
2274 double mDisplacementY = 0;
2277 double mOffsetX = 0;
2280 double mOffsetY = 0;
2283
2290 unsigned long mSeed = 0;
2291
2292 void applyDataDefinedSettings( QgsSymbolRenderContext &context ) override;
2293
2294 private:
2295#ifdef SIP_RUN
2297#endif
2298
2299 bool applyPattern( const QgsSymbolRenderContext &context, QBrush &brush, double distanceX, double distanceY, double displacementX, double displacementY, double offsetX, double offsetY );
2300
2302
2303 bool mRenderUsingMarkers = false;
2304};
2305
2315{
2316 public:
2324
2326
2332 static QgsSymbolLayer *create( const QVariantMap &properties = QVariantMap() ) SIP_FACTORY;
2333
2334 QString layerType() const override;
2335 void startRender( QgsSymbolRenderContext &context ) override;
2336 void stopRender( QgsSymbolRenderContext &context ) override;
2337 void renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context ) override;
2338 QVariantMap properties() const override;
2340 bool canCauseArtifactsBetweenAdjacentTiles() const override;
2341 bool rendersIdenticallyTo( const QgsSymbolLayer *other ) const override;
2342
2343 void setColor( const QColor &color ) override;
2344 QColor color() const override;
2345
2346 QgsSymbol *subSymbol() override;
2347 bool setSubSymbol( QgsSymbol *symbol SIP_TRANSFER ) final;
2348
2349 void setOutputUnit( Qgis::RenderUnit unit ) override;
2350 Qgis::RenderUnit outputUnit() const override;
2351 bool usesMapUnits() const override;
2352
2353 void setMapUnitScale( const QgsMapUnitScale &scale ) override;
2354 QgsMapUnitScale mapUnitScale() const override;
2355
2356 QSet<QString> usedAttributes( const QgsRenderContext &context ) const override;
2357 bool hasDataDefinedProperties() const override;
2358
2364 int pointCount() const;
2365
2371 void setPointCount( int count );
2372
2378 unsigned long seed() const;
2379
2387 void setSeed( unsigned long seed );
2388
2394 bool clipPoints() const;
2395
2401 void setClipPoints( bool clipped );
2402
2408 Qgis::PointCountMethod countMethod() const;
2409
2415 void setCountMethod( Qgis::PointCountMethod method );
2416
2426 double densityArea() const;
2427
2433 void setDensityArea( double area );
2434
2440 void setDensityAreaUnit( Qgis::RenderUnit unit ) { mDensityAreaUnit = unit; }
2441
2446 Qgis::RenderUnit densityAreaUnit() const { return mDensityAreaUnit; }
2447
2455 void setDensityAreaUnitScale( const QgsMapUnitScale &scale ) { mDensityAreaUnitScale = scale; }
2456
2463 const QgsMapUnitScale &densityAreaUnitScale() const { return mDensityAreaUnitScale; }
2464
2465 void startFeatureRender( const QgsFeature &feature, QgsRenderContext &context ) override;
2466 void stopFeatureRender( const QgsFeature &feature, QgsRenderContext &context ) override;
2467
2468 private:
2469#ifdef SIP_RUN
2471#endif
2472
2473 struct Part
2474 {
2475 QPolygonF exterior;
2476 QVector<QPolygonF> rings;
2477 };
2478
2479 QVector< Part > mCurrentParts;
2480
2481 void render( QgsRenderContext &context, const QVector< Part > &parts, const QgsFeature &feature, bool selected );
2482
2483 std::unique_ptr< QgsMarkerSymbol > mMarker;
2485 int mPointCount = 10;
2486 double mDensityArea = 250.0;
2488 QgsMapUnitScale mDensityAreaUnitScale;
2489 unsigned long mSeed = 0;
2490 bool mClipPoints = false;
2491
2492 bool mRenderingFeature = false;
2493 double mFeatureSymbolOpacity = 1;
2494};
2495
2496
2504{
2505 public:
2508
2509 // static stuff
2510
2516 static QgsSymbolLayer *create( const QVariantMap &properties = QVariantMap() ) SIP_FACTORY;
2517 static QgsSymbolLayer *createFromSld( QDomElement &element ) SIP_FACTORY;
2518
2519 // implemented from base classes
2520
2521 QString layerType() const override;
2522 void startRender( QgsSymbolRenderContext &context ) override;
2523 void stopRender( QgsSymbolRenderContext &context ) override;
2524 void renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context ) override;
2525 QVariantMap properties() const override;
2527 Q_DECL_DEPRECATED void toSld( QDomDocument &doc, QDomElement &element, const QVariantMap &props ) const override SIP_DEPRECATED;
2528 bool toSld( QDomDocument &doc, QDomElement &element, QgsSldExportContext &context ) const override;
2529 void setColor( const QColor &color ) override;
2530 QColor color() const override;
2531 QgsSymbol *subSymbol() override;
2532 bool setSubSymbol( QgsSymbol *symbol SIP_TRANSFER ) final;
2533 void setOutputUnit( Qgis::RenderUnit unit ) override;
2534 Qgis::RenderUnit outputUnit() const override;
2535 bool usesMapUnits() const override;
2536 void setMapUnitScale( const QgsMapUnitScale &scale ) override;
2537 QgsMapUnitScale mapUnitScale() const override;
2538 QSet<QString> usedAttributes( const QgsRenderContext &context ) const override;
2539 bool hasDataDefinedProperties() const override;
2540 bool canCauseArtifactsBetweenAdjacentTiles() const override;
2541
2543 bool pointOnSurface() const { return mPointOnSurface; }
2544
2550
2555 bool pointOnAllParts() const { return mPointOnAllParts; }
2556
2563 bool clipPoints() const { return mClipPoints; }
2564
2572
2580
2588
2589 void startFeatureRender( const QgsFeature &feature, QgsRenderContext &context ) override;
2590 void stopFeatureRender( const QgsFeature &feature, QgsRenderContext &context ) override;
2591
2592 protected:
2593 std::unique_ptr< QgsMarkerSymbol > mMarker;
2594 bool mPointOnSurface = false;
2595 bool mPointOnAllParts = true;
2596 bool mClipPoints = false;
2598
2599 bool mRenderingFeature = false;
2601 bool mUseSelectedColor = false;
2602
2603 private:
2604#ifdef SIP_RUN
2606#endif
2607 struct Part
2608 {
2609 QPolygonF exterior;
2610 QVector<QPolygonF> rings;
2611 };
2612
2613 void render( QgsRenderContext &context, const QVector<Part> &parts, const QgsFeature &feature, bool selected );
2614 QVector<Part> mCurrentParts;
2615};
2616
2617#endif
Provides global constants and enumerations for use throughout the application.
Definition qgis.h:62
MarkerClipMode
Marker clipping modes.
Definition qgis.h:3363
@ Shape
Clip to polygon shape.
Definition qgis.h:3365
LineClipMode
Line clipping modes.
Definition qgis.h:3377
@ ClipPainterOnly
Applying clipping on the painter only (i.e. line endpoints will coincide with polygon bounding box,...
Definition qgis.h:3378
GradientColorSource
Gradient color sources.
Definition qgis.h:3292
@ SimpleTwoColor
Simple two color gradient.
Definition qgis.h:3293
GradientSpread
Gradient spread options, which control how gradients are rendered outside of their start and end poin...
Definition qgis.h:3336
@ Pad
Pad out gradient using colors at endpoint of gradient.
Definition qgis.h:3337
PointCountMethod
Methods which define the number of points randomly filling a polygon.
Definition qgis.h:3351
@ Absolute
The point count is used as an absolute count of markers.
Definition qgis.h:3352
QFlags< SymbolLayerFlag > SymbolLayerFlags
Symbol layer flags.
Definition qgis.h:913
RenderUnit
Rendering size units.
Definition qgis.h:5340
@ Millimeters
Millimeters.
Definition qgis.h:5341
@ Pixels
Pixels.
Definition qgis.h:5343
GradientType
Gradient types.
Definition qgis.h:3306
@ Linear
Linear gradient.
Definition qgis.h:3307
SymbolCoordinateReference
Symbol coordinate reference modes.
Definition qgis.h:3321
@ Feature
Relative to feature/shape being rendered.
Definition qgis.h:3322
static QgsSymbolLayer * createFromSld(QDomElement &element)
QSet< QString > usedAttributes(const QgsRenderContext &context) const override
Returns the set of attributes referenced by the layer.
QVariantMap properties() const override
Should be reimplemented by subclasses to return a string map that contains the configuration informat...
QgsSymbol * subSymbol() override
Returns the symbol's sub symbol, if present.
Qgis::RenderUnit outputUnit() const override
Returns the units to use for sizes and widths within the symbol layer.
void setPointOnAllParts(bool pointOnAllParts)
Sets whether a point is drawn for all parts or only on the biggest part of multi-part features.
void setMapUnitScale(const QgsMapUnitScale &scale) override
bool canCauseArtifactsBetweenAdjacentTiles() const override
Returns true if the symbol layer rendering can cause visible artifacts across a single feature when t...
bool setSubSymbol(QgsSymbol *symbol) final
Sets layer's subsymbol. takes ownership of the passed symbol.
QgsMapUnitScale mapUnitScale() const override
void setClipOnCurrentPartOnly(bool clipOnCurrentPartOnly)
Sets whether point markers should be clipped to the current part boundary only.
void setClipPoints(bool clipPoints)
Sets whether point markers should be clipped to the polygon boundary.
std::unique_ptr< QgsMarkerSymbol > mMarker
QString layerType() const override
Returns a string that represents this layer type.
void setColor(const QColor &color) override
Sets the "representative" color for the symbol layer.
bool pointOnAllParts() const
Returns whether a point is drawn for all parts or only on the biggest part of multi-part features.
void renderPolygon(const QPolygonF &points, const QVector< QPolygonF > *rings, QgsSymbolRenderContext &context) override
Renders the fill symbol layer for the polygon whose outer ring is defined by points,...
void startRender(QgsSymbolRenderContext &context) override
Called before a set of rendering operations commences on the supplied render context.
bool hasDataDefinedProperties() const override
Returns true if the symbol layer (or any of its sub-symbols) contains data defined properties.
void setOutputUnit(Qgis::RenderUnit unit) override
Sets the units to use for sizes and widths within the symbol layer.
bool usesMapUnits() const override
Returns true if the symbol layer has any components which use map unit based sizes.
bool clipPoints() const
Returns true if point markers should be clipped to the polygon boundary.
QgsCentroidFillSymbolLayer * clone() const override
Shall be reimplemented by subclasses to create a deep copy of the instance.
Q_DECL_DEPRECATED void toSld(QDomDocument &doc, QDomElement &element, const QVariantMap &props) const override
Saves the symbol layer as SLD.
static QgsSymbolLayer * create(const QVariantMap &properties=QVariantMap())
Creates a new QgsCentroidFillSymbolLayer using the specified properties map containing symbol propert...
~QgsCentroidFillSymbolLayer() override
void stopRender(QgsSymbolRenderContext &context) override
Called after a set of rendering operations has finished on the supplied render context.
QColor color() const override
Returns the "representative" color of the symbol layer.
bool clipOnCurrentPartOnly() const
Returns true if point markers should be clipped to the current part boundary only.
void setPointOnSurface(bool pointOnSurface)
Abstract base class for color ramps.
Exports QGIS layers to the DXF format.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Definition qgsfeature.h:60
virtual void renderPolygon(const QPolygonF &points, const QVector< QPolygonF > *rings, QgsSymbolRenderContext &context)=0
Renders the fill symbol layer for the polygon whose outer ring is defined by points,...
virtual QImage toTiledPatternImage() const
Renders the symbol layer as an image that can be used as a seamless pattern fill for polygons,...
double angle() const
Returns the rotation angle of the fill symbol, in degrees clockwise.
QgsFillSymbolLayer(const QgsFillSymbolLayer &other)=delete
QColor color2() const
Returns the color for endpoint of gradient, only used if the gradient color type is set to SimpleTwoC...
void setGradientSpread(Qgis::GradientSpread gradientSpread)
Sets the gradient spread mode, which controls how the gradient behaves outside of the predefined stop...
Qgis::RenderUnit offsetUnit() const
Returns the units for the fill's offset.
Qgis::SymbolCoordinateReference coordinateMode() const
Returns the coordinate mode for gradient, which controls how the gradient stops are positioned.
bool referencePoint2IsCentroid() const
Returns whether the end point for the gradient is taken from the feature centroid.
void setGradientType(Qgis::GradientType gradientType)
Sets the type of gradient, e.g., linear or radial.
void setReferencePoint2(QPointF referencePoint)
Sets the end point of gradient fill, in the range [0,0] - [1,1].
QVariantMap properties() const override
Should be reimplemented by subclasses to return a string map that contains the configuration informat...
void setOffsetUnit(Qgis::RenderUnit unit)
Sets the unit for the fill's offset.
void setCoordinateMode(Qgis::SymbolCoordinateReference coordinateMode)
Sets the coordinate mode for gradient, which controls how the gradient stops are positioned.
Qgis::SymbolCoordinateReference mCoordinateMode
QgsGradientFillSymbolLayer(const QColor &color=DEFAULT_SIMPLEFILL_COLOR, const QColor &color2=Qt::white, Qgis::GradientColorSource gradientColorType=Qgis::GradientColorSource::SimpleTwoColor, Qgis::GradientType gradientType=Qgis::GradientType::Linear, Qgis::SymbolCoordinateReference coordinateMode=Qgis::SymbolCoordinateReference::Feature, Qgis::GradientSpread gradientSpread=Qgis::GradientSpread::Pad)
Constructor for QgsGradientFillSymbolLayer.
static QgsSymbolLayer * create(const QVariantMap &properties=QVariantMap())
Creates a new QgsGradientFillSymbolLayer using the specified properties map containing symbol propert...
Qgis::GradientSpread mGradientSpread
void setReferencePoint2IsCentroid(bool isCentroid)
Sets whether the end point for the gradient is taken from the feature centroid.
void setReferencePoint1IsCentroid(bool isCentroid)
Sets whether the starting point for the gradient is taken from the feature centroid.
void setOffset(QPointF offset)
Sets an offset by which polygons will be translated during rendering.
void setGradientColorType(Qgis::GradientColorSource gradientColorType)
Sets the gradient color mode, which controls how gradient color stops are created.
QPointF referencePoint1() const
Returns the starting point of gradient fill, in the range [0,0] - [1,1].
Qgis::GradientSpread gradientSpread() const
Returns the gradient spread mode, which controls how the gradient behaves outside of the predefined s...
QgsColorRamp * colorRamp()
Returns the color ramp used for the gradient fill.
void setReferencePoint1(QPointF referencePoint)
Sets the starting point of gradient fill, in the range [0,0] - [1,1].
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the fill's offset.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the fill's offset.
Qgis::GradientColorSource gradientColorType() const
Returns the gradient color mode, which controls how gradient color stops are created.
QPointF offset() const
Returns the offset by which polygons will be translated during rendering.
Qgis::GradientColorSource mGradientColorType
Qgis::GradientType gradientType() const
Returns the type of gradient, e.g., linear or radial.
bool referencePoint1IsCentroid() const
Returns whether the starting point for the gradient is taken from the feature centroid.
QPointF referencePoint2() const
Returns the end point of gradient fill, in the range [0,0] - [1,1].
std::unique_ptr< QgsColorRamp > mGradientRamp
void setColor2(const QColor &color2)
Sets the color for endpoint of gradient, only used if the gradient color type is set to SimpleTwoColo...
Base class for fill symbol layers which fill polygons with a repeated image.
QgsMapUnitScale mStrokeWidthMapUnitScale
void setStrokeWidthUnit(Qgis::RenderUnit unit)
Sets the units for the symbol's stroke width.
void setStrokeWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the stroke width map unit scale.
Qgis::SymbolCoordinateReference coordinateReference() const
Returns the coordinate reference mode for fill which controls how the top left corner of the image fi...
double mStrokeWidth
Stroke width.
void setCoordinateReference(Qgis::SymbolCoordinateReference coordinateReference)
Sets the coordinate reference mode for fill which controls how the top left corner of the image fill ...
Qgis::SymbolCoordinateReference mCoordinateReference
Qgis::RenderUnit strokeWidthUnit() const
Returns the units for the symbol's stroke width.
Qgis::RenderUnit mStrokeWidthUnit
virtual void applyDataDefinedSettings(QgsSymbolRenderContext &context)
Applies data defined settings prior to generating the fill symbol brush.
const QgsMapUnitScale & strokeWidthMapUnitScale() const
Returns the stroke width map unit scale.
~QgsImageFillSymbolLayer() override
A symbol fill consisting of repeated parallel lines.
void startRender(QgsSymbolRenderContext &context) override
Called before a set of rendering operations commences on the supplied render context.
QString layerType() const override
Returns a string that represents this layer type.
QgsLinePatternFillSymbolLayer * clone() const override
Shall be reimplemented by subclasses to create a deep copy of the instance.
Qgis::RenderUnit distanceUnit() const
Returns the units for the distance between lines in the fill pattern.
Q_DECL_DEPRECATED void toSld(QDomDocument &doc, QDomElement &element, const QVariantMap &props) const override
Saves the symbol layer as SLD.
void setLineWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the pattern's line width.
double lineWidth() const
Returns the width of the line subsymbol used to render the parallel lines in the fill.
void setDistanceMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the pattern's line distance.
Qgis::LineClipMode clipMode() const
Returns the line clipping mode, which defines how lines are clipped at the edges of shapes.
double lineAngle() const
Returns the angle for the parallel lines used to fill the symbol.
void renderPolygon(const QPolygonF &points, const QVector< QPolygonF > *rings, QgsSymbolRenderContext &context) override
Renders the fill symbol layer for the polygon whose outer ring is defined by points,...
Qgis::RenderUnit lineWidthUnit() const
Returns the units for the line's width.
void setLineWidthUnit(Qgis::RenderUnit unit)
Sets the unit for the line's width.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the pattern's line offset.
void setDistance(double d)
Sets the distance between lines in the fill pattern.
const QgsMapUnitScale & lineWidthMapUnitScale() const
Returns the map unit scale for the pattern's line width.
void setClipMode(Qgis::LineClipMode mode)
Sets the line clipping mode, which defines how lines are clipped at the edges of shapes.
void setOffsetUnit(Qgis::RenderUnit unit)
Sets the unit for the line pattern's offset.
QVariantMap properties() const override
Should be reimplemented by subclasses to return a string map that contains the configuration informat...
const QgsMapUnitScale & distanceMapUnitScale() const
Returns the map unit scale for the pattern's line distance.
QImage toTiledPatternImage() const override
Renders the symbol layer as an image that can be used as a seamless pattern fill for polygons,...
void setLineAngle(double a)
Sets the angle for the parallel lines used to fill the symbol.
double offset() const
Returns the offset distance for lines within the fill, which is the distance to offset the parallel l...
void setDistanceUnit(Qgis::RenderUnit unit)
Sets the unit for the distance between lines in the fill pattern.
double distance() const
Returns the distance between lines in the fill pattern.
void setOffset(double offset)
Sets the offset distance for lines within the fill, which is the distance to offset the parallel line...
Qgis::RenderUnit offsetUnit() const
Returns the units for the line pattern's offset.
QString ogrFeatureStyleWidth(double widthScaleFactor) const
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the pattern's line offset.
void stopRender(QgsSymbolRenderContext &context) override
Called after a set of rendering operations has finished on the supplied render context.
~QgsLinePatternFillSymbolLayer() override
double estimateMaxBleed(const QgsRenderContext &context) const override
Returns the estimated maximum distance which the layer style will bleed outside the drawn shape when ...
static QgsSymbolLayer * createFromSld(QDomElement &element)
Creates a new QgsLinePatternFillSymbolLayer from a SLD element.
static QgsSymbolLayer * create(const QVariantMap &properties=QVariantMap())
Creates a new QgsLinePatternFillSymbolLayer from a properties map.
A line symbol type, for rendering LineString and MultiLineString geometries.
Struct for storing maximum and minimum scales for measurements in map units.
A marker symbol type, for rendering Point and MultiPoint geometries.
Resolves relative paths into absolute paths and vice versa.
QgsMapUnitScale mapUnitScale() const override
const QgsMapUnitScale & distanceYMapUnitScale() const
Returns the map unit scale for the vertical distance between points in the pattern.
void setDisplacementX(double d)
Sets the horizontal displacement for odd numbered rows in the pattern.
void stopRender(QgsSymbolRenderContext &context) override
Called after a set of rendering operations has finished on the supplied render context.
void setOffsetXUnit(Qgis::RenderUnit unit)
Sets the units for the horizontal offset between rows in the pattern.
Qgis::RenderUnit offsetYUnit() const
Returns the units for the vertical offset for rows in the pattern.
const QgsMapUnitScale & randomDeviationXMapUnitScale() const
Returns the unit scale for the horizontal random deviation of points in the pattern.
void renderPolygon(const QPolygonF &points, const QVector< QPolygonF > *rings, QgsSymbolRenderContext &context) override
Renders the fill symbol layer for the polygon whose outer ring is defined by points,...
void setOffsetX(double offset)
Sets the horizontal offset values for points in the pattern.
double maximumRandomDeviationY() const
Returns the maximum vertical random deviation of points in the pattern.
void setDistanceYUnit(Qgis::RenderUnit unit)
Sets the unit for the vertical distance between points in the pattern.
double distanceX() const
Returns the horizontal distance between rendered markers in the fill.
Qgis::RenderUnit randomDeviationYUnit() const
Returns the units for the vertical random deviation of points in the pattern.
QImage toTiledPatternImage() const override
Renders the symbol layer as an image that can be used as a seamless pattern fill for polygons,...
double displacementY() const
Returns the vertical displacement for odd numbered columns in the pattern.
void setColor(const QColor &c) override
Sets the "representative" color for the symbol layer.
void setDisplacementYUnit(Qgis::RenderUnit unit)
Sets the units for the vertical displacement between rows in the pattern.
void setRandomDeviationYUnit(Qgis::RenderUnit unit)
Sets the unit for the vertical random deviation of points in the pattern.
const QgsMapUnitScale & distanceXMapUnitScale() const
Returns the map unit scale for the horizontal distance between points in the pattern.
void startFeatureRender(const QgsFeature &feature, QgsRenderContext &context) override
Called before the layer will be rendered for a particular feature.
static QgsSymbolLayer * create(const QVariantMap &properties=QVariantMap())
Creates a new QgsPointPatternFillSymbolLayer using the specified properties map containing symbol pro...
void setRandomDeviationYMapUnitScale(const QgsMapUnitScale &scale)
Sets the unit scale for the vertical random deviation of points in the pattern.
unsigned long seed() const
Returns the random number seed to use when randomly shifting points, or 0 if a truly random sequence ...
Qgis::MarkerClipMode clipMode() const
Returns the marker clipping mode, which defines how markers are clipped at the edges of shapes.
void setRandomDeviationXMapUnitScale(const QgsMapUnitScale &scale)
Sets the unit scale for the horizontal random deviation of points in the pattern.
Qgis::RenderUnit distanceXUnit() const
Returns the units for the horizontal distance between points in the pattern.
bool hasDataDefinedProperties() const override
Returns true if the symbol layer (or any of its sub-symbols) contains data defined properties.
double offsetY() const
Returns the vertical offset values for points in the pattern.
void setDisplacementY(double d)
Sets the vertical displacement for odd numbered columns in the pattern.
QgsSymbol * subSymbol() override
Returns the symbol's sub symbol, if present.
void setMaximumRandomDeviationX(double deviation)
Sets the maximum horizontal random deviation of points in the pattern.
void setDisplacementYMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the vertical displacement between odd numbered columns in the pattern.
void setMapUnitScale(const QgsMapUnitScale &scale) override
double estimateMaxBleed(const QgsRenderContext &context) const override
Returns the estimated maximum distance which the layer style will bleed outside the drawn shape when ...
void startRender(QgsSymbolRenderContext &context) override
Called before a set of rendering operations commences on the supplied render context.
QString layerType() const override
Returns a string that represents this layer type.
void applyDataDefinedSettings(QgsSymbolRenderContext &context) override
Applies data defined settings prior to generating the fill symbol brush.
void setSeed(unsigned long seed)
Sets the random number seed to use when randomly shifting points, or 0 if a truly random sequence wil...
void setOffsetY(double offset)
Sets the vertical offset values for points in the pattern.
const QgsMapUnitScale & offsetXMapUnitScale() const
Returns the unit scale for the horizontal offset for rows in the pattern.
const QgsMapUnitScale & displacementXMapUnitScale() const
Returns the map unit scale for the horizontal displacement between odd numbered rows in the pattern.
QVariantMap properties() const override
Should be reimplemented by subclasses to return a string map that contains the configuration informat...
const QgsMapUnitScale & offsetYMapUnitScale() const
Returns the unit scale for the vertical offset between rows in the pattern.
void setDistanceXMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the horizontal distance between points in the pattern.
Qgis::RenderUnit distanceYUnit() const
Returns the units for the vertical distance between points in the pattern.
void stopFeatureRender(const QgsFeature &feature, QgsRenderContext &context) override
Called after the layer has been rendered for a particular feature.
const QgsMapUnitScale & displacementYMapUnitScale() const
Returns the map unit scale for the vertical displacement between odd numbered columns in the pattern.
void setDistanceXUnit(Qgis::RenderUnit unit)
Sets the unit for the horizontal distance between points in the pattern.
QColor color() const override
Returns the "representative" color of the symbol layer.
void setOffsetYUnit(Qgis::RenderUnit unit)
Sets the units for the vertical offset for rows in the pattern.
const QgsMapUnitScale & randomDeviationYMapUnitScale() const
Returns the unit scale for the vertical random deviation of points in the pattern.
Qgis::RenderUnit offsetXUnit() const
Returns the units for the horizontal offset for rows in the pattern.
void setOffsetYMapUnitScale(const QgsMapUnitScale &scale)
Sets the unit scale for the vertical offset for rows in the pattern.
void setDistanceY(double d)
Sets the vertical distance between rendered markers in the fill.
Qgis::RenderUnit displacementXUnit() const
Returns the units for the horizontal displacement between rows in the pattern.
Qgis::RenderUnit randomDeviationXUnit() const
Returns the units for the horizontal random deviation of points in the pattern.
void setDisplacementXUnit(Qgis::RenderUnit unit)
Sets the units for the horizontal displacement between rows in the pattern.
void setDistanceX(double d)
Sets the horizontal distance between rendered markers in the fill.
Q_DECL_DEPRECATED void toSld(QDomDocument &doc, QDomElement &element, const QVariantMap &props) const override
Saves the symbol layer as SLD.
double offsetX() const
Returns the horizontal offset values for points in the pattern.
void setRandomDeviationXUnit(Qgis::RenderUnit unit)
Sets the unit for the horizontal random deviation of points in the pattern.
Qgis::RenderUnit outputUnit() const override
Returns the units to use for sizes and widths within the symbol layer.
double maximumRandomDeviationX() const
Returns the maximum horizontal random deviation of points in the pattern.
std::unique_ptr< QgsMarkerSymbol > mMarkerSymbol
bool usesMapUnits() const override
Returns true if the symbol layer has any components which use map unit based sizes.
void setDisplacementXMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the horizontal displacement between odd numbered rows in the pattern.
void setMaximumRandomDeviationY(double deviation)
Sets the maximum vertical random deviation of points in the pattern.
QgsPointPatternFillSymbolLayer * clone() const override
Shall be reimplemented by subclasses to create a deep copy of the instance.
void setDistanceYMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the vertical distance between points in the pattern.
Qgis::RenderUnit displacementYUnit() const
Returns the units for the vertical displacement between rows in the pattern.
double displacementX() const
Returns the horizontal displacement for odd numbered rows in the pattern.
void setOffsetXMapUnitScale(const QgsMapUnitScale &scale)
Sets the unit scale for the horizontal offset for rows in the pattern.
void setOutputUnit(Qgis::RenderUnit unit) override
Sets the units to use for sizes and widths within the symbol layer.
QSet< QString > usedAttributes(const QgsRenderContext &context) const override
Returns the set of attributes referenced by the layer.
~QgsPointPatternFillSymbolLayer() override
bool setSubSymbol(QgsSymbol *symbol) override
Sets layer's subsymbol. takes ownership of the passed symbol.
double distanceY() const
Returns the vertical distance between rendered markers in the fill.
void setClipMode(Qgis::MarkerClipMode mode)
Sets the marker clipping mode, which defines how markers are clipped at the edges of shapes.
static QgsSymbolLayer * createFromSld(QDomElement &element)
A fill symbol layer which places markers at random locations within polygons.
~QgsRandomMarkerFillSymbolLayer() override
bool setSubSymbol(QgsSymbol *symbol) final
Sets layer's subsymbol. takes ownership of the passed symbol.
int pointCount() const
Returns the count of random points to render in the fill.
bool usesMapUnits() const override
Returns true if the symbol layer has any components which use map unit based sizes.
QgsRandomMarkerFillSymbolLayer(int pointCount=10, Qgis::PointCountMethod method=Qgis::PointCountMethod::Absolute, double densityArea=250.0, unsigned long seed=0)
Constructor for QgsRandomMarkerFillSymbolLayer, with the specified pointCount.
unsigned long seed() const
Returns the random number seed to use when generating points, or 0 if a truly random sequence will be...
static QgsSymbolLayer * create(const QVariantMap &properties=QVariantMap())
Creates a new QgsRandomMarkerFillSymbolLayer using the specified properties map containing symbol pro...
void renderPolygon(const QPolygonF &points, const QVector< QPolygonF > *rings, QgsSymbolRenderContext &context) override
Renders the fill symbol layer for the polygon whose outer ring is defined by points,...
QString layerType() const override
Returns a string that represents this layer type.
QVariantMap properties() const override
Should be reimplemented by subclasses to return a string map that contains the configuration informat...
void setDensityAreaUnitScale(const QgsMapUnitScale &scale)
Sets the map scale for the density area.
QgsRandomMarkerFillSymbolLayer * clone() const override
Shall be reimplemented by subclasses to create a deep copy of the instance.
Qgis::RenderUnit outputUnit() const override
Returns the units to use for sizes and widths within the symbol layer.
void setMapUnitScale(const QgsMapUnitScale &scale) override
bool hasDataDefinedProperties() const override
Returns true if the symbol layer (or any of its sub-symbols) contains data defined properties.
void startRender(QgsSymbolRenderContext &context) override
Called before a set of rendering operations commences on the supplied render context.
void setCountMethod(Qgis::PointCountMethod method)
Sets the count method used to randomly fill the polygon.
bool clipPoints() const
Returns true if point markers should be clipped to the polygon boundary.
bool canCauseArtifactsBetweenAdjacentTiles() const override
Returns true if the symbol layer rendering can cause visible artifacts across a single feature when t...
void setClipPoints(bool clipped)
Sets whether point markers should be clipped to the polygon boundary.
QgsSymbol * subSymbol() override
Returns the symbol's sub symbol, if present.
void stopRender(QgsSymbolRenderContext &context) override
Called after a set of rendering operations has finished on the supplied render context.
QColor color() const override
Returns the "representative" color of the symbol layer.
void setSeed(unsigned long seed)
Sets the random number seed to use when generating points, or 0 if a truly random sequence will be us...
QSet< QString > usedAttributes(const QgsRenderContext &context) const override
Returns the set of attributes referenced by the layer.
void setPointCount(int count)
Sets the count of random points to render in the fill.
Qgis::RenderUnit densityAreaUnit() const
Returns the units for the density area.
Qgis::PointCountMethod countMethod() const
Returns the count method used to randomly fill the polygon.
void setDensityAreaUnit(Qgis::RenderUnit unit)
Sets the units for the density area.
const QgsMapUnitScale & densityAreaUnitScale() const
Returns the map scale for the density area.
double densityArea() const
Returns the density area used to count the number of points to randomly fill the polygon.
bool rendersIdenticallyTo(const QgsSymbolLayer *other) const override
Returns true if this symbol layer will always render identically to an other symbol layer.
void setColor(const QColor &color) override
Sets the "representative" color for the symbol layer.
void setDensityArea(double area)
Sets the density area used to count the number of points to randomly fill the polygon.
void setOutputUnit(Qgis::RenderUnit unit) override
Sets the units to use for sizes and widths within the symbol layer.
QgsMapUnitScale mapUnitScale() const override
void stopRender(QgsSymbolRenderContext &context) override
Called after a set of rendering operations has finished on the supplied render context.
const QgsMapUnitScale & sizeMapUnitScale() const
Returns the map unit scale for the image's width and height.
double width() const
Returns the width used for scaling the image used in the fill.
Q_DECL_DEPRECATED void setWidthUnit(Qgis::RenderUnit unit)
Sets the unit for the image's width.
double estimateMaxBleed(const QgsRenderContext &context) const override
Returns the estimated maximum distance which the layer style will bleed outside the drawn shape when ...
Qgis::SymbolLayerFlags flags() const override
Returns flags which control the symbol layer's behavior.
void setOffsetUnit(const Qgis::RenderUnit unit)
Sets the units for the fill's offset.
void renderPolygon(const QPolygonF &points, const QVector< QPolygonF > *rings, QgsSymbolRenderContext &context) override
Renders the fill symbol layer for the polygon whose outer ring is defined by points,...
static QgsSymbolLayer * createFromSld(QDomElement &element)
Creates a new QgsRasterFillSymbolLayer from a SLD element.
void setHeight(double height)
Sets the height for scaling the image.
static QgsSymbolLayer * create(const QVariantMap &properties=QVariantMap())
Creates a new QgsRasterFillSymbolLayer from a properties map.
Q_DECL_DEPRECATED const QgsMapUnitScale & widthMapUnitScale() const
Returns the map unit scale for the image's width.
Qgis::SymbolCoordinateReference coordinateMode() const
Coordinate mode for fill.
QString layerType() const override
Returns a string that represents this layer type.
void setOutputUnit(Qgis::RenderUnit unit) override
Sets the units to use for sizes and widths within the symbol layer.
Qgis::RenderUnit offsetUnit() const
Returns the units for the fill's offset.
QgsRasterFillSymbolLayer(const QString &imageFilePath=QString())
Constructor for QgsRasterFillSymbolLayer, using a raster fill from the specified imageFilePath.
double opacity() const
Returns the opacity for the raster image used in the fill.
void setSizeUnit(Qgis::RenderUnit unit)
Sets the unit for the image's width and height.
~QgsRasterFillSymbolLayer() override
Q_DECL_DEPRECATED Qgis::RenderUnit widthUnit() const
Returns the units for the image's width.
QColor color() const override
Returns the "representative" color of the symbol layer.
QgsSymbol * subSymbol() override
Returns the symbol's sub symbol, if present.
QVariantMap properties() const override
Should be reimplemented by subclasses to return a string map that contains the configuration informat...
void startRender(QgsSymbolRenderContext &context) override
Called before a set of rendering operations commences on the supplied render context.
Qgis::RenderUnit sizeUnit() const
Returns the units for the image's width and height.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the fill's offset.
QString imageFilePath() const
The path to the raster image used for the fill.
Q_DECL_DEPRECATED void setWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the image's width.
double height() const
Returns the height used for scaling the image used in the fill.
void setWidth(double width)
Sets the width for scaling the image used in the fill.
static void resolvePaths(QVariantMap &properties, const QgsPathResolver &pathResolver, bool saving)
Turns relative paths in properties map to absolute when reading and vice versa when writing.
void setSizeMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the image's width and height.
QPointF offset() const
Returns the offset for the fill.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the fill's offset.
bool usesMapUnits() const override
Returns true if the symbol layer has any components which use map unit based sizes.
void setOffset(QPointF offset)
Sets the offset for the fill.
QgsRasterFillSymbolLayer * clone() const override
Shall be reimplemented by subclasses to create a deep copy of the instance.
Contains information about the context of a rendering operation.
void renderPolygon(const QPolygonF &points, const QVector< QPolygonF > *rings, QgsSymbolRenderContext &context) override
Renders the fill symbol layer for the polygon whose outer ring is defined by points,...
QString svgFilePath() const
Returns the path to the SVG file used to render the fill.
void startRender(QgsSymbolRenderContext &context) override
Called before a set of rendering operations commences on the supplied render context.
void setSvgStrokeWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the pattern's stroke.
QColor dxfColor(QgsSymbolRenderContext &context) const override
Gets color.
static QgsSymbolLayer * createFromSld(QDomElement &element)
Creates a new QgsSVGFillSymbolLayer from a SLD element.
bool setSubSymbol(QgsSymbol *symbol) override
Sets layer's subsymbol. takes ownership of the passed symbol.
QColor svgStrokeColor() const
Returns the stroke color used for rendering the SVG content.
bool usesMapUnits() const override
Returns true if the symbol layer has any components which use map unit based sizes.
void setSvgStrokeWidthUnit(Qgis::RenderUnit unit)
Sets the unit for the stroke width.
void stopRender(QgsSymbolRenderContext &context) override
Called after a set of rendering operations has finished on the supplied render context.
Qgis::RenderUnit patternWidthUnit() const
Returns the units for the width of the SVG images in the pattern.
void setSvgFillColor(const QColor &c)
Sets the fill color used for rendering the SVG content.
const QgsMapUnitScale & svgStrokeWidthMapUnitScale() const
Returns the map unit scale for the pattern's stroke.
double svgStrokeWidth() const
Returns the stroke width used for rendering the SVG content.
QString layerType() const override
Returns a string that represents this layer type.
QMap< QString, QgsProperty > parameters() const
Returns the dynamic SVG parameters.
void setSvgStrokeWidth(double w)
Sets the stroke width used for rendering the SVG content.
QgsSVGFillSymbolLayer * clone() const override
Shall be reimplemented by subclasses to create a deep copy of the instance.
double estimateMaxBleed(const QgsRenderContext &context) const override
Returns the estimated maximum distance which the layer style will bleed outside the drawn shape when ...
QSet< QString > usedAttributes(const QgsRenderContext &context) const override
Returns the set of attributes referenced by the layer.
QgsSVGFillSymbolLayer(const QString &svgFilePath, double width=20, double rotation=0.0)
Constructor for QgsSVGFillSymbolLayer, using the SVG picture at the specified absolute file path.
void setPatternWidthUnit(Qgis::RenderUnit unit)
Sets the unit for the width of the SVG images in the pattern.
void setSvgFilePath(const QString &svgPath)
Sets the path to the SVG file to render in the fill.
static QgsSymbolLayer * create(const QVariantMap &properties=QVariantMap())
Creates a new QgsSVGFillSymbolLayer from a properties map.
QColor svgFillColor() const
Returns the fill color used for rendering the SVG content.
static void resolvePaths(QVariantMap &properties, const QgsPathResolver &pathResolver, bool saving)
Turns relative paths in properties map to absolute when reading and vice versa when writing.
QVariantMap properties() const override
Should be reimplemented by subclasses to return a string map that contains the configuration informat...
void setSvgStrokeColor(const QColor &c)
Sets the stroke color used for rendering the SVG content.
const QgsMapUnitScale & patternWidthMapUnitScale() const
Returns the map unit scale for the pattern's width.
Qgis::RenderUnit svgStrokeWidthUnit() const
Returns the units for the stroke width.
void setPatternWidth(double width)
Sets the width to render the SVG content as within the fill (i.e.
double patternWidth() const
Returns the width of the rendered SVG content within the fill (i.e.
bool hasDataDefinedProperties() const override
Returns true if the symbol layer (or any of its sub-symbols) contains data defined properties.
~QgsSVGFillSymbolLayer() override
Q_DECL_DEPRECATED void toSld(QDomDocument &doc, QDomElement &element, const QVariantMap &props) const override
Saves the symbol layer as SLD.
void setPatternWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the pattern's width.
QgsSymbol * subSymbol() override
Returns the symbol's sub symbol, if present.
A fill symbol layer which applies a gradient from the outer edges of a symbol to the inside.
void startRender(QgsSymbolRenderContext &context) override
Called before a set of rendering operations commences on the supplied render context.
QgsShapeburstFillSymbolLayer(const QColor &color=DEFAULT_SIMPLEFILL_COLOR, const QColor &color2=Qt::white, Qgis::GradientColorSource colorType=Qgis::GradientColorSource::SimpleTwoColor, int blurRadius=0, bool useWholeShape=true, double maxDistance=5)
Constructor for QgsShapeburstFillSymbolLayer.
QgsShapeburstFillSymbolLayer * clone() const override
Shall be reimplemented by subclasses to create a deep copy of the instance.
~QgsShapeburstFillSymbolLayer() override
Qgis::RenderUnit offsetUnit() const
Returns the units used for the offset of the shapeburst fill.
QgsColorRamp * colorRamp()
Returns the color ramp used for the shapeburst fill.
int blurRadius() const
Returns the blur radius, which controls the amount of blurring applied to the fill.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
void setOffsetUnit(Qgis::RenderUnit unit)
Sets the units used for the offset for the shapeburst fill.
QVariantMap properties() const override
Should be reimplemented by subclasses to return a string map that contains the configuration informat...
void setOffset(QPointF offset)
Sets the offset for the shapeburst fill.
void setBlurRadius(int blurRadius)
Sets the blur radius, which controls the amount of blurring applied to the fill.
void stopRender(QgsSymbolRenderContext &context) override
Called after a set of rendering operations has finished on the supplied render context.
void setUseWholeShape(bool useWholeShape)
Sets whether the shapeburst fill should be drawn using the entire shape.
QColor color2() const
Returns the color used for the endpoint of the shapeburst fill.
void setIgnoreRings(bool ignoreRings)
Sets whether the shapeburst fill should ignore polygon rings when calculating the buffered shading.
void setMaxDistance(double maxDistance)
Sets the maximum distance to shape inside of the shape from the polygon's boundary.
void setColor2(const QColor &color2)
Sets the color for the endpoint of the shapeburst fill.
QgsShapeburstFillSymbolLayer & operator=(const QgsShapeburstFillSymbolLayer &other)=delete
QgsShapeburstFillSymbolLayer cannot be copied.
Qgis::RenderUnit distanceUnit() const
Returns the unit for the maximum distance to shade inside of the shape from the polygon's boundary.
void renderPolygon(const QPolygonF &points, const QVector< QPolygonF > *rings, QgsSymbolRenderContext &context) override
Renders the fill symbol layer for the polygon whose outer ring is defined by points,...
bool canCauseArtifactsBetweenAdjacentTiles() const override
Returns true if the symbol layer rendering can cause visible artifacts across a single feature when t...
static QgsSymbolLayer * create(const QVariantMap &properties=QVariantMap())
Creates a new QgsShapeburstFillSymbolLayer using the specified properties map containing symbol prope...
QPointF offset() const
Returns the offset for the shapeburst fill.
bool useWholeShape() const
Returns whether the shapeburst fill is set to cover the entire shape.
bool ignoreRings() const
Returns whether the shapeburst fill is set to ignore polygon interior rings.
double maxDistance() const
Returns the maximum distance from the shape's boundary which is shaded.
Qgis::SymbolLayerFlags flags() const override
Returns flags which control the symbol layer's behavior.
const QgsMapUnitScale & offsetMapUnitScale() const
QString layerType() const override
Returns a string that represents this layer type.
void setDistanceUnit(Qgis::RenderUnit unit)
Sets the unit for the maximum distance to shade inside of the shape from the polygon's boundary.
void setDistanceMapUnitScale(const QgsMapUnitScale &scale)
void setColorType(Qgis::GradientColorSource colorType)
Sets the color mode to use for the shapeburst fill.
Qgis::GradientColorSource colorType() const
Returns the color mode used for the shapeburst fill.
double estimateMaxBleed(const QgsRenderContext &context) const override
Returns the estimated maximum distance which the layer style will bleed outside the drawn shape when ...
QgsShapeburstFillSymbolLayer(const QgsShapeburstFillSymbolLayer &other)=delete
QgsShapeburstFillSymbolLayer cannot be copied.
const QgsMapUnitScale & distanceMapUnitScale() const
QgsSimpleFillSymbolLayer(const QColor &color=DEFAULT_SIMPLEFILL_COLOR, Qt::BrushStyle style=DEFAULT_SIMPLEFILL_STYLE, const QColor &strokeColor=DEFAULT_SIMPLEFILL_BORDERCOLOR, Qt::PenStyle strokeStyle=DEFAULT_SIMPLEFILL_BORDERSTYLE, double strokeWidth=DEFAULT_SIMPLEFILL_BORDERWIDTH, Qt::PenJoinStyle penJoinStyle=DEFAULT_SIMPLEFILL_JOINSTYLE)
Qgis::RenderUnit strokeWidthUnit() const
Returns the units for the width of the fill's stroke.
Qt::PenJoinStyle penJoinStyle() const
QColor strokeColor() const override
Returns the stroke color for the symbol layer.
void setBrushStyle(Qt::BrushStyle style)
void setStrokeWidthMapUnitScale(const QgsMapUnitScale &scale)
const QgsMapUnitScale & strokeWidthMapUnitScale() const
QString ogrFeatureStyle(double mmScaleFactor, double mapUnitScaleFactor) const override
void startRender(QgsSymbolRenderContext &context) override
Called before a set of rendering operations commences on the supplied render context.
Qgis::SymbolLayerFlags flags() const override
Returns flags which control the symbol layer's behavior.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the fill's offset.
void setStrokeWidthUnit(Qgis::RenderUnit unit)
Sets the units for the width of the fill's stroke.
~QgsSimpleFillSymbolLayer() override
Q_DECL_DEPRECATED void toSld(QDomDocument &doc, QDomElement &element, const QVariantMap &props) const override
Saves the symbol layer as SLD.
void setPenJoinStyle(Qt::PenJoinStyle style)
QColor fillColor() const override
Returns the fill color for the symbol layer.
Qt::PenStyle strokeStyle() const
QString layerType() const override
Returns a string that represents this layer type.
QgsMapUnitScale mOffsetMapUnitScale
Qgis::RenderUnit mStrokeWidthUnit
void setStrokeWidth(double strokeWidth)
void stopRender(QgsSymbolRenderContext &context) override
Called after a set of rendering operations has finished on the supplied render context.
QPointF offset() const
Returns the offset by which polygons will be translated during rendering.
Qgis::RenderUnit offsetUnit() const
Returns the units for the fill's offset.
void setStrokeStyle(Qt::PenStyle strokeStyle)
QgsMapUnitScale mStrokeWidthMapUnitScale
void setOffsetUnit(Qgis::RenderUnit unit)
Sets the unit for the fill's offset.
void renderPolygon(const QPolygonF &points, const QVector< QPolygonF > *rings, QgsSymbolRenderContext &context) override
Renders the fill symbol layer for the polygon whose outer ring is defined by points,...
void setFillColor(const QColor &color) override
Sets the fill color for the symbol layer.
QgsSimpleFillSymbolLayer * clone() const override
Shall be reimplemented by subclasses to create a deep copy of the instance.
void setOffset(QPointF offset)
Sets an offset by which polygons will be translated during rendering.
void setStrokeColor(const QColor &strokeColor) override
Sets the stroke color for the symbol layer.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the fill's offset.
Qt::BrushStyle brushStyle() const
QVariantMap properties() const override
Should be reimplemented by subclasses to return a string map that contains the configuration informat...
static QgsSymbolLayer * create(const QVariantMap &properties=QVariantMap())
Creates a new QgsSimpleFillSymbolLayer using the specified properties map containing symbol propertie...
static QgsSymbolLayer * createFromSld(QDomElement &element)
Holds SLD export options and other information related to SLD export of a QGIS layer style.
virtual QgsSymbolLayer * clone() const =0
Shall be reimplemented by subclasses to create a deep copy of the instance.
virtual bool setSubSymbol(QgsSymbol *symbol)
Sets layer's subsymbol. takes ownership of the passed symbol.
virtual void startFeatureRender(const QgsFeature &feature, QgsRenderContext &context)
Called before the layer will be rendered for a particular feature.
virtual QgsMapUnitScale mapUnitScale() const
virtual QColor dxfBrushColor(QgsSymbolRenderContext &context) const
Gets brush/fill color.
virtual QSet< QString > usedAttributes(const QgsRenderContext &context) const
Returns the set of attributes referenced by the layer.
virtual double estimateMaxBleed(const QgsRenderContext &context) const
Returns the estimated maximum distance which the layer style will bleed outside the drawn shape when ...
virtual void startRender(QgsSymbolRenderContext &context)=0
Called before a set of rendering operations commences on the supplied render context.
virtual QVariantMap properties() const =0
Should be reimplemented by subclasses to return a string map that contains the configuration informat...
virtual Qt::PenStyle dxfPenStyle() const
Gets pen style.
virtual QColor dxfColor(QgsSymbolRenderContext &context) const
Gets color.
virtual QString layerType() const =0
Returns a string that represents this layer type.
virtual void stopRender(QgsSymbolRenderContext &context)=0
Called after a set of rendering operations has finished on the supplied render context.
virtual Qgis::RenderUnit outputUnit() const
Returns the units to use for sizes and widths within the symbol layer.
virtual void setColor(const QColor &color)
Sets the "representative" color for the symbol layer.
virtual QgsSymbol * subSymbol()
Returns the symbol's sub symbol, if present.
virtual QColor color() const
Returns the "representative" color of the symbol layer.
virtual void stopFeatureRender(const QgsFeature &feature, QgsRenderContext &context)
Called after the layer has been rendered for a particular feature.
virtual double dxfWidth(const QgsDxfExport &e, QgsSymbolRenderContext &context) const
Gets line width.
virtual double dxfAngle(QgsSymbolRenderContext &context) const
Gets angle.
virtual bool canCauseArtifactsBetweenAdjacentTiles() const
Returns true if the symbol layer rendering can cause visible artifacts across a single feature when t...
virtual void setMapUnitScale(const QgsMapUnitScale &scale)
virtual bool usesMapUnits() const
Returns true if the symbol layer has any components which use map unit based sizes.
virtual void setOutputUnit(Qgis::RenderUnit unit)
Sets the units to use for sizes and widths within the symbol layer.
virtual Qgis::SymbolLayerFlags flags() const
Returns flags which control the symbol layer's behavior.
virtual Qt::BrushStyle dxfBrushStyle() const
Gets brush/fill style.
virtual bool hasDataDefinedProperties() const
Returns true if the symbol layer (or any of its sub-symbols) contains data defined properties.
QgsSymbolLayer(const QgsSymbolLayer &other)
Encapsulates the context in which a symbol is being rendered.
Abstract base class for all rendered symbols.
Definition qgssymbol.h:227
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
QMap< QString, QString > QgsStringMap
Definition qgis.h:7475
#define SIP_DEPRECATED
Definition qgis_sip.h:113
#define SIP_TRANSFER
Definition qgis_sip.h:35
#define SIP_ABSTRACT
Definition qgis_sip.h:220
#define SIP_FACTORY
Definition qgis_sip.h:83
#define DEFAULT_SIMPLEFILL_JOINSTYLE
#define DEFAULT_SIMPLEFILL_COLOR
#define DEFAULT_SIMPLEFILL_STYLE
#define DEFAULT_SIMPLEFILL_BORDERSTYLE
#define DEFAULT_SIMPLEFILL_BORDERCOLOR
#define DEFAULT_SIMPLEFILL_BORDERWIDTH