16#ifndef QGSFILLSYMBOLLAYER_H
17#define QGSFILLSYMBOLLAYER_H
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
69 QString layerType() const override;
70 Qgis::SymbolLayerFlags flags() const override;
73 void renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings,
QgsSymbolRenderContext &context ) override;
74 QVariantMap properties() const override;
76 void toSld( QDomDocument &doc, QDomElement &element, const QVariantMap &props ) const override;
77 QString ogrFeatureStyle(
double mmScaleFactor,
double mapUnitScaleFactor ) const override;
79 Qt::BrushStyle brushStyle()
const {
return mBrushStyle; }
88 void setStrokeStyle( Qt::PenStyle strokeStyle ) { mStrokeStyle = strokeStyle; }
114 QPointF
offset()
const {
return mOffset; }
197 void applyDataDefinedSymbology(
QgsSymbolRenderContext &context, QBrush &brush, QPen &pen, QPen &selPen );
216 const QColor &color2 = Qt::white,
296 QColor
color2()
const {
return mColor2; }
303 void setColor2(
const QColor &color2 ) { mColor2 = color2; }
408 QPointF
offset()
const {
return mOffset; }
457 bool mReferencePoint1IsCentroid =
false;
459 bool mReferencePoint2IsCentroid =
false;
471 void applyGradient(
const QgsSymbolRenderContext &context, QBrush &brush,
const QColor &color,
const QColor &color2,
474 QPointF referencePoint1, QPointF referencePoint2,
double angle );
477 QPointF rotateReferencePoint( QPointF refPoint,
double angle );
493 int blurRadius = 0,
bool useWholeShape =
true,
double maxDistance = 5 );
520 QString layerType() const override;
521 Qgis::SymbolLayerFlags flags() const override;
524 void renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings,
QgsSymbolRenderContext &context ) override;
525 QVariantMap properties() const override;
528 bool canCauseArtifactsBetweenAdjacentTiles() const override;
535 void setBlurRadius(
int blurRadius ) { mBlurRadius = blurRadius; }
644 void setColor2(
const QColor &color2 ) { mColor2 = color2; }
652 QColor
color2()
const {
return mColor2; }
683 QPointF
offset()
const {
return mOffset; }
717 bool mUseWholeShape =
true;
718 double mMaxDistance = 5.0;
725 bool mIgnoreRings =
false;
731 std::unique_ptr< QgsColorRamp > mGradientRamp;
734 void applyDataDefinedSymbology(
QgsSymbolRenderContext &context, QColor &color, QColor &color2,
int &blurRadius,
bool &useWholeShape,
735 double &maxDistance,
bool &ignoreRings );
738 void distanceTransform1d(
double *f,
int n,
int *v,
double *z,
double *d );
740 void distanceTransform2d(
double *im,
int width,
int height,
QgsRenderContext &context );
745 void dtArrayToQImage(
double *array, QImage *im,
QgsColorRamp *ramp,
QgsRenderContext &context,
bool useWholeShape =
true,
int maxPixelDistance = 0 );
825 double mNextAngle = 0.0;
828 double mStrokeWidth = 0.0;
884 static
void resolvePaths( QVariantMap &properties, const
QgsPathResolver &pathResolver,
bool saving );
887 QString layerType() const override;
888 Qgis::SymbolLayerFlags flags() const override;
889 void renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings,
QgsSymbolRenderContext &context ) override;
892 QVariantMap properties() const override;
895 bool usesMapUnits() const override;
896 QColor color() const override;
897 void setOutputUnit(
Qgis::RenderUnit unit ) override;
908 void setImageFilePath(
const QString &imagePath );
938 void setOpacity(
double opacity );
963 QPointF
offset()
const {
return mOffset; }
1149 QString mImageFilePath;
1151 double mOpacity = 1.0;
1157 double mWidth = 0.0;
1161 double mHeight = 0.0;
1164 void applyPattern( QBrush &brush,
const QString &imageFilePath,
double width,
double height,
double opacity,
1204 static
void resolvePaths( QVariantMap &properties, const
QgsPathResolver &pathResolver,
bool saving );
1208 QString layerType() const override;
1211 void renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings,
QgsSymbolRenderContext &context ) override;
1212 QVariantMap properties() const override;
1214 void toSld( QDomDocument &doc, QDomElement &element, const QVariantMap &props ) const override;
1215 bool usesMapUnits() const override;
1220 QSet<QString> usedAttributes( const
QgsRenderContext &context ) const override;
1221 bool hasDataDefinedProperties() const override;
1234 void setSvgFilePath( const QString &svgPath );
1241 QString svgFilePath()
const {
return mSvgFilePath; }
1413 QMap<QString, QgsProperty>
parameters()
const {
return mParameters; }
1419 void setParameters(
const QMap<QString, QgsProperty> ¶meters );
1428 double mPatternWidth = 20;
1431 QMap<QString, QgsProperty> mParameters;
1434 QByteArray mSvgData;
1436 QString mSvgFilePath;
1442 QColor mSvgStrokeColor = QColor( 35, 35, 35 );
1443 double mSvgStrokeWidth = 0.2;
1448 std::unique_ptr< QgsLineSymbol > mStroke;
1451 void storeViewBox();
1452 void setDefaultSvgParams();
1455 void applyPattern( QBrush &brush,
const QString &svgFilePath,
double patternWidth,
Qgis::RenderUnit patternWidthUnit,
const QColor &svgFillColor,
const QColor &svgStrokeColor,
1483 QString layerType() const override;
1486 void renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings,
QgsSymbolRenderContext &context ) override;
1487 QVariantMap properties() const override;
1489 void toSld( QDomDocument &doc, QDomElement &element, const QVariantMap &props ) const override;
1490 QImage toTiledPatternImage( ) const override;
1493 QString ogrFeatureStyleWidth(
double widthScaleFactor ) const;
1502 void setLineAngle(
double a ) { mLineAngle = a; }
1534 void setLineWidth(
double w );
1544 void setColor(
const QColor &
c )
override;
1545 QColor
color()
const override;
1705 double mDistance = 5.0;
1709 double mLineWidth = 0;
1713 double mLineAngle = 45.0;
1715 double mOffset = 0.0;
1719 bool mRenderUsingLines =
false;
1726 bool applyPattern(
const QgsSymbolRenderContext &context, QBrush &brush,
double lineAngle,
double distance );
1729 std::unique_ptr< QgsLineSymbol > mFillLineSymbol;
1730 bool mFillLineSymbolRenderStarted =
false;
1754 QString layerType() const override;
1759 void renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings,
QgsSymbolRenderContext &context ) override;
1760 QVariantMap properties() const override;
1762 void toSld( QDomDocument &doc, QDomElement &element, const QVariantMap &props ) const override;
1763 QImage toTiledPatternImage( ) const override;
1767 void setOutputUnit(
Qgis::RenderUnit unit ) override;
1768 Qgis::RenderUnit outputUnit() const override;
1769 bool usesMapUnits() const override;
1772 QSet<QString> usedAttributes( const
QgsRenderContext &context ) const override;
1773 bool hasDataDefinedProperties() const override;
1774 void setColor( const QColor &
c ) override;
1775 QColor color() const override;
1786 double distanceX()
const {
return mDistanceX; }
2230 unsigned long seed()
const {
return mSeed; }
2240 void setSeed(
unsigned long seed ) { mSeed = seed; }
2244 bool mMarkerSymbolRenderStarted =
false;
2245 double mDistanceX = 15;
2248 double mDistanceY = 15;
2251 double mDisplacementX = 0;
2254 double mDisplacementY = 0;
2257 double mOffsetX = 0;
2260 double mOffsetY = 0;
2264 double mRandomDeviationX = 0;
2267 double mRandomDeviationY = 0;
2270 unsigned long mSeed = 0;
2279 bool applyPattern(
const QgsSymbolRenderContext &context, QBrush &brush,
double distanceX,
double distanceY,
2280 double displacementX,
double displacementY,
double offsetX,
double offsetY );
2284 bool mRenderUsingMarkers =
false;
2316 QString layerType() const override;
2319 void renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings,
QgsSymbolRenderContext &context ) override;
2320 QVariantMap properties() const override;
2322 bool canCauseArtifactsBetweenAdjacentTiles() const override;
2324 void setColor( const QColor &color ) override;
2325 QColor color() const override;
2330 void setOutputUnit(
Qgis::RenderUnit unit ) override;
2331 Qgis::RenderUnit outputUnit() const override;
2332 bool usesMapUnits() const override;
2337 QSet<QString> usedAttributes( const
QgsRenderContext &context ) const override;
2338 bool hasDataDefinedProperties() const override;
2345 int pointCount() const;
2352 void setPointCount(
int count );
2359 unsigned long seed() const;
2368 void setSeed(
unsigned long seed );
2375 bool clipPoints() const;
2382 void setClipPoints(
bool clipped );
2389 Qgis::PointCountMethod countMethod() const;
2396 void setCountMethod(
Qgis::PointCountMethod method );
2407 double densityArea() const;
2414 void setDensityArea(
double area );
2421 void setDensityAreaUnit(
Qgis::RenderUnit unit ) { mDensityAreaUnit = unit; }
2457 QVector<QPolygonF> rings;
2460 QVector< Part > mCurrentParts;
2464 std::unique_ptr< QgsMarkerSymbol > mMarker;
2466 int mPointCount = 10;
2467 double mDensityArea = 250.0;
2470 unsigned long mSeed = 0;
2471 bool mClipPoints =
false;
2473 bool mRenderingFeature =
false;
2474 double mFeatureSymbolOpacity = 1;
2502 QString layerType() const override;
2505 void renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings,
QgsSymbolRenderContext &context ) override;
2506 QVariantMap properties() const override;
2508 void toSld( QDomDocument &doc, QDomElement &element, const QVariantMap &props ) const override;
2509 void setColor( const QColor &color ) override;
2510 QColor color() const override;
2513 void setOutputUnit(
Qgis::RenderUnit unit ) override;
2514 Qgis::RenderUnit outputUnit() const override;
2515 bool usesMapUnits() const override;
2518 QSet<QString> usedAttributes( const
QgsRenderContext &context ) const override;
2519 bool hasDataDefinedProperties() const override;
2520 bool canCauseArtifactsBetweenAdjacentTiles() const override;
2522 void setPointOnSurface(
bool pointOnSurface ) { mPointOnSurface = pointOnSurface; }
2575 bool mPointOnSurface =
false;
2576 bool mPointOnAllParts =
true;
2577 bool mClipPoints =
false;
2578 bool mClipOnCurrentPartOnly =
false;
2580 bool mRenderingFeature =
false;
2581 double mFeatureSymbolOpacity = 1;
2582 bool mUseSelectedColor =
false;
2591 QVector<QPolygonF> rings;
2595 QVector<Part> mCurrentParts;
The Qgis class provides global constants for use throughout the application.
MarkerClipMode
Marker clipping modes.
@ Shape
Clip to polygon shape.
LineClipMode
Line clipping modes.
@ ClipPainterOnly
Applying clipping on the painter only (i.e. line endpoints will coincide with polygon bounding box,...
GradientColorSource
Gradient color sources.
@ SimpleTwoColor
Simple two color gradient.
GradientSpread
Gradient spread options, which control how gradients are rendered outside of their start and end poin...
@ Pad
Pad out gradient using colors at endpoint of gradient.
PointCountMethod
Methods which define the number of points randomly filling a polygon.
@ Absolute
The point count is used as an absolute count of markers.
QFlags< SymbolLayerFlag > SymbolLayerFlags
Symbol layer flags.
RenderUnit
Rendering size units.
@ Millimeters
Millimeters.
GradientType
Gradient types.
SymbolCoordinateReference
Symbol coordinate reference modes.
@ Feature
Relative to feature/shape being rendered.
A fill symbol layer which renders a marker symbol at the centroid of a polygon geometry.
void setPointOnAllParts(bool pointOnAllParts)
Sets whether a point is drawn for all parts or only on the biggest part of multi-part features.
bool pointOnSurface() const
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
bool pointOnAllParts() const
Returns whether a point is drawn for all parts or only on the biggest part of multi-part features.
bool clipPoints() const
Returns true if point markers should be clipped to the polygon boundary.
~QgsCentroidFillSymbolLayer() override
bool clipOnCurrentPartOnly() const
Returns true if point markers should be clipped to the current part boundary only.
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...
Abstract base class for fill symbol layers.
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,...
A fill symbol layer which draws a smooth color gradient over a polygon.
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].
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
Qgis::GradientSpread mGradientSpread
void setReferencePoint2IsCentroid(bool isCentroid)
Sets whether the end point for the gradient is taken from the feature centroid.
Qgis::GradientType mGradientType
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].
QgsMapUnitScale mOffsetMapUnitScale
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].
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 polygon renderers generating texture images.
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...
void setCoordinateReference(Qgis::SymbolCoordinateReference coordinateReference)
Sets the coordinate reference mode for fill which controls how the top left corner of the image fill ...
Qgis::RenderUnit strokeWidthUnit() const
Returns the units for the symbol's stroke width.
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.
Qgis::RenderUnit distanceUnit() const
Returns the units for the distance between lines in the fill pattern.
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.
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.
const QgsMapUnitScale & distanceMapUnitScale() const
Returns the map unit scale for the pattern's line distance.
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.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the pattern's line offset.
~QgsLinePatternFillSymbolLayer() override
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.
A fill symbol layer which fills polygon shapes with repeating marker symbols.
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.
QgsMapUnitScale mDisplacementYMapUnitScale
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.
QgsMapUnitScale mDisplacementXMapUnitScale
const QgsMapUnitScale & randomDeviationXMapUnitScale() const
Returns the unit scale for the horizontal random deviation of points in the pattern.
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.
Qgis::RenderUnit randomDeviationYUnit() const
Returns the units for the vertical random deviation of points in the pattern.
QgsMapUnitScale mDistanceYMapUnitScale
double displacementY() const
Returns the vertical displacement for odd numbered columns in the pattern.
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 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.
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.
void setMaximumRandomDeviationX(double deviation)
Sets the maximum horizontal random deviation of points in the pattern.
QgsMapUnitScale mDistanceXMapUnitScale
void setDisplacementYMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the vertical displacement between odd numbered columns in the pattern.
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.
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.
QgsMapUnitScale mOffsetXMapUnitScale
Qgis::RenderUnit distanceYUnit() const
Returns the units for the vertical distance between points in the pattern.
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.
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.
QgsMapUnitScale mRandomDeviationXMapUnitScale
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.
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.
double maximumRandomDeviationX() const
Returns the maximum horizontal random deviation of points in the pattern.
std::unique_ptr< QgsMarkerSymbol > mMarkerSymbol
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.
void setDistanceYMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the vertical distance between points in the pattern.
QgsMapUnitScale mRandomDeviationYMapUnitScale
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.
~QgsPointPatternFillSymbolLayer() override
QgsMapUnitScale mOffsetYMapUnitScale
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.
A fill symbol layer which places markers at random locations within polygons.
~QgsRandomMarkerFillSymbolLayer() override
void setDensityAreaUnitScale(const QgsMapUnitScale &scale)
Sets the map scale for the density area.
Qgis::RenderUnit densityAreaUnit() const
Returns the units for the density area.
const QgsMapUnitScale & densityAreaUnitScale() const
Returns the map scale for the density area.
A class for filling symbols with a repeated raster image.
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.
void setOffsetUnit(const Qgis::RenderUnit unit)
Sets the units for the fill's offset.
void setHeight(double height)
Sets the height for scaling the image.
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.
Qgis::RenderUnit offsetUnit() const
Returns the units for the fill's offset.
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.
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.
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.
void setOffset(QPointF offset)
Sets the offset for the fill.
Contains information about the context of a rendering operation.
A class for filling symbols with a repeated SVG file.
void setSvgStrokeWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the pattern's stroke.
QColor svgStrokeColor() const
Returns the stroke color used for rendering the SVG content.
void setSvgStrokeWidthUnit(Qgis::RenderUnit unit)
Sets the unit for the stroke width.
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.
QMap< QString, QgsProperty > parameters() const
Returns the dynamic SVG parameters.
void setSvgStrokeWidth(double w)
Sets the stroke width used for rendering the SVG content.
void setPatternWidthUnit(Qgis::RenderUnit unit)
Sets the unit for the width of the SVG images in the pattern.
QColor svgFillColor() const
Returns the fill color used for rendering the SVG content.
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.
~QgsSVGFillSymbolLayer() override
void setPatternWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the pattern's width.
~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.
void setOffset(QPointF offset)
Sets the offset for the shapeburst fill.
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.
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.
const QgsMapUnitScale & offsetMapUnitScale() const
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.
QgsShapeburstFillSymbolLayer(const QgsShapeburstFillSymbolLayer &other)=delete
QgsShapeburstFillSymbolLayer cannot be copied.
const QgsMapUnitScale & distanceMapUnitScale() const
Renders polygons using a single fill and stroke color.
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
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
void setPenJoinStyle(Qt::PenJoinStyle style)
QColor fillColor() const override
Returns the fill color for the symbol layer.
Qt::PenStyle strokeStyle() const
QgsMapUnitScale mOffsetMapUnitScale
double strokeWidth() const
void setStrokeWidth(double strokeWidth)
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 setFillColor(const QColor &color) override
Sets the fill color for the symbol layer.
Qt::PenStyle mStrokeStyle
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.
Qt::PenJoinStyle mPenJoinStyle
Qt::BrushStyle mBrushStyle
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the fill's offset.
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 QColor strokeColor() const
Returns the stroke color for the symbol layer.
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.
Abstract base class for all rendered symbols.
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
#define DEFAULT_SIMPLEFILL_JOINSTYLE
#define DEFAULT_SIMPLEFILL_COLOR
#define DEFAULT_SIMPLEFILL_STYLE
#define DEFAULT_SIMPLEFILL_BORDERSTYLE
#define DEFAULT_SIMPLEFILL_BORDERCOLOR
#define DEFAULT_SIMPLEFILL_BORDERWIDTH