Class: QgsShapeburstFillSymbolLayer¶
- class qgis.core.QgsShapeburstFillSymbolLayer(color: QColor | Qt.GlobalColor | QGradient = DEFAULT_SIMPLEFILL_COLOR, color2: QColor | Qt.GlobalColor | QGradient = Qt.white, colorType: Qgis.GradientColorSource = Qgis.GradientColorSource.SimpleTwoColor, blurRadius: int = 0, useWholeShape: bool = True, maxDistance: float = 5)¶
Bases:
QgsFillSymbolLayer
Constructor for QgsShapeburstFillSymbolLayer.
Enums
alias of
GradientColorSource
Methods
Returns the blur radius, which controls the amount of blurring applied to the fill.
- rtype:
bool
- rtype:
QgsShapeburstFillSymbolLayer
Returns the color used for the endpoint of the shapeburst fill.
Returns the color ramp used for the shapeburst fill.
Returns the color mode used for the shapeburst fill.
Copies all data defined properties of this layer to another symbol layer.
Copies paint effect of this layer to another symbol layer
Creates a new
QgsShapeburstFillSymbolLayer
using the specifiedproperties
map containing symbol properties (seeproperties()
).- rtype:
QgsMapUnitScale
Returns the unit for the maximum distance to shade inside of the shape from the polygon's boundary.
- param context:
Returns whether the shapeburst fill is set to ignore polygon interior rings.
When rendering, install masks on
context
painter ifrecursive
isTrue
masks are installed recursively for all children symbol layers- rtype:
str
- rtype:
QgsMapUnitScale
Returns the maximum distance from the shape's boundary which is shaded.
Returns the offset for the shapeburst fill.
- rtype:
QgsMapUnitScale
Returns the units used for the offset of the shapeburst fill.
- rtype:
Qgis.RenderUnit
- rtype:
Dict[str, Any]
When rendering, remove previously installed masks from
context
painter ifrecursive
isTrue
masks are removed recursively for all children symbol layers- param points:
Restores older data defined properties from string map.
Sets the blur radius, which controls the amount of blurring applied to the fill.
Sets the color for the endpoint of the shapeburst fill.
Sets the color
ramp
used to draw the shapeburst fill.Sets the color mode to use for the shapeburst fill.
- param scale:
Sets the unit for the maximum distance to shade inside of the shape from the polygon's boundary.
Sets whether the shapeburst fill should ignore polygon rings when calculating the buffered shading.
- param scale:
Sets the maximum distance to shape inside of the shape from the polygon's boundary.
Sets the offset for the shapeburst fill.
- param scale:
Sets the units used for the offset for the shapeburst fill.
- param unit:
Sets whether the shapeburst fill should be drawn using the entire shape.
Returns
True
if the symbol layer should be rendered using the selection color from the render context.- param context:
- param context:
Returns whether the shapeburst fill is set to cover the entire shape.
- rtype:
bool
- ShapeburstColorType¶
alias of
GradientColorSource
- blurRadius(self) int ¶
Returns the blur radius, which controls the amount of blurring applied to the fill.
- Return type:
int
- Returns:
Integer representing the radius for fill blur. Higher values indicate a stronger blur. A 0 value indicates that blurring is disabled.
See also
New in version 2.3.
- canCauseArtifactsBetweenAdjacentTiles(self) bool ¶
- Return type:
bool
- clone(self) QgsShapeburstFillSymbolLayer ¶
- Return type:
- color2(self) QColor ¶
Returns the color used for the endpoint of the shapeburst fill. This color is only used if the colorType is set to ShapeburstColorType.SimpleTwoColor
- Return type:
QColor
- Returns:
a QColor indicating the color of the endpoint of the gradient
See also
See also
New in version 2.3.
- colorRamp(self) QgsColorRamp ¶
Returns the color ramp used for the shapeburst fill. The color ramp is only used if the colorType is set to ShapeburstColorType.ColorRamp
- Return type:
- Returns:
a
QgsColorRamp
color ramp
See also
See also
New in version 2.3.
- colorType(self) Qgis.GradientColorSource ¶
Returns the color mode used for the shapeburst fill. Shapeburst can either be drawn using a
QgsColorRamp
color ramp or by simply specificing a start and end color.- Return type:
- Returns:
current color mode used for the shapeburst fill
See also
See also
color()
See also
See also
New in version 2.3.
- copyDataDefinedProperties(self, destLayer: QgsSymbolLayer)¶
Copies all data defined properties of this layer to another symbol layer.
- Parameters:
destLayer – destination layer
- copyPaintEffect(self, destLayer: QgsSymbolLayer)¶
Copies paint effect of this layer to another symbol layer
- Parameters:
destLayer – destination layer
New in version 2.9.
- create(properties: Dict[str, Any] = {}) QgsSymbolLayer ¶
Creates a new
QgsShapeburstFillSymbolLayer
using the specifiedproperties
map containing symbol properties (seeproperties()
).Caller takes ownership of the returned symbol layer.
- Parameters:
properties (Dict[str) –
- Return type:
- distanceMapUnitScale(self) QgsMapUnitScale ¶
- Return type:
- distanceUnit(self) Qgis.RenderUnit ¶
Returns the unit for the maximum distance to shade inside of the shape from the polygon’s boundary.
- Return type:
- Returns:
distance unit for the maximum distance
See also
See also
New in version 2.3.
- estimateMaxBleed(self, context: QgsRenderContext) float ¶
- Parameters:
context (QgsRenderContext) –
- Return type:
float
- ignoreRings(self) bool ¶
Returns whether the shapeburst fill is set to ignore polygon interior rings.
- Return type:
bool
- Returns:
True
if the shapeburst fill will ignore interior rings when calculating buffered shading.
See also
New in version 2.3.
- installMasks(self, context: QgsRenderContext, recursive: bool)¶
When rendering, install masks on
context
painter ifrecursive
isTrue
masks are installed recursively for all children symbol layersSee also
prepareMasks()
See also
New in version 3.30.
- layerType(self) str ¶
- Return type:
str
- mapUnitScale(self) QgsMapUnitScale ¶
- Return type:
- maxDistance(self) float ¶
Returns the maximum distance from the shape’s boundary which is shaded. This parameter is only effective if useWholeShape is
False
.- Return type:
float
- Returns:
the maximum distance from the polygon’s boundary which is shaded. Distance units are indicated by distanceUnit.
See also
See also
See also
New in version 2.3.
- offset(self) QPointF ¶
Returns the offset for the shapeburst fill.
- Return type:
QPointF
- Returns:
a QPointF indicating the horizontal/vertical offset amount
See also
See also
New in version 2.3.
- offsetMapUnitScale(self) QgsMapUnitScale ¶
- Return type:
- offsetUnit(self) Qgis.RenderUnit ¶
Returns the units used for the offset of the shapeburst fill.
- Return type:
- Returns:
units used for the fill offset
See also
See also
New in version 2.3.
- outputUnit(self) Qgis.RenderUnit ¶
- Return type:
- properties(self) Dict[str, Any] ¶
- Return type:
Dict[str, Any]
- removeMasks(self, context: QgsRenderContext, recursive: bool)¶
When rendering, remove previously installed masks from
context
painter ifrecursive
isTrue
masks are removed recursively for all children symbol layersSee also
prepareMasks()
See also
New in version 3.30.
- renderPolygon(self, points: QPolygonF, rings: Iterable[QPolygonF], context: QgsSymbolRenderContext)¶
- Parameters:
points (QPolygonF) –
rings (Iterable[QPolygonF]) –
context (QgsSymbolRenderContext) –
- restoreOldDataDefinedProperties(self, stringMap: Dict[str, Any])¶
Restores older data defined properties from string map.
New in version 3.0.
- setBlurRadius(self, blurRadius: int)¶
Sets the blur radius, which controls the amount of blurring applied to the fill.
- Parameters:
blurRadius (int) – Radius for fill blur. Values between 0 - 17 are valid, where higher values results in a stronger blur. Set to 0 to disable blur.
See also
New in version 2.3.
- setColor2(self, color2: QColor | Qt.GlobalColor | QGradient)¶
Sets the color for the endpoint of the shapeburst fill. This color is only used if setColorType is set ShapeburstColorType.SimpleTwoColor.
- Parameters:
color2 (Union[QColor) – QColor to use for endpoint of gradient
See also
See also
New in version 2.3.
- setColorRamp(self, ramp: QgsColorRamp)¶
Sets the color
ramp
used to draw the shapeburst fill. Color ramps are only used if setColorType is set ShapeburstColorType.ColorRamp.Ownership of
ramp
is transferred to the fill.See also
See also
New in version 2.3.
- Parameters:
ramp (QgsColorRamp) –
- setColorType(self, colorType: Qgis.GradientColorSource)¶
Sets the color mode to use for the shapeburst fill. Shapeburst can either be drawn using a
QgsColorRamp
color ramp or by simply specificing a start and end color. setColorType is used to specify which mode to use for the fill.- Parameters:
colorType (Qgis.GradientColorSource) – color type to use for shapeburst fill
See also
See also
setColor()
See also
See also
New in version 2.3.
- setDistanceMapUnitScale(self, scale: QgsMapUnitScale)¶
- Parameters:
scale (QgsMapUnitScale) –
- setDistanceUnit(self, unit: Qgis.RenderUnit)¶
Sets the unit for the maximum distance to shade inside of the shape from the polygon’s boundary.
- Parameters:
unit (Qgis.RenderUnit) – distance unit for the maximum distance
See also
See also
New in version 2.3.
- setIgnoreRings(self, ignoreRings: bool)¶
Sets whether the shapeburst fill should ignore polygon rings when calculating the buffered shading.
- Parameters:
ignoreRings (bool) – Set to
True
if buffers should ignore interior rings for polygons.
See also
New in version 2.3.
- setMapUnitScale(self, scale: QgsMapUnitScale)¶
- Parameters:
scale (QgsMapUnitScale) –
- setMaxDistance(self, maxDistance: float)¶
Sets the maximum distance to shape inside of the shape from the polygon’s boundary.
- Parameters:
maxDistance (float) – distance from boundary to shade. setUseWholeShape must be set to
False
for this parameter to take effect. Distance unit is controlled by setDistanceUnit.
See also
See also
See also
New in version 2.3.
- setOffset(self, offset: QPointF | QPoint)¶
Sets the offset for the shapeburst fill.
- Parameters:
offset (Union[QPointF) – QPointF indicating the horizontal/vertical offset amount
See also
See also
New in version 2.3.
- setOffsetMapUnitScale(self, scale: QgsMapUnitScale)¶
- Parameters:
scale (QgsMapUnitScale) –
- setOffsetUnit(self, unit: Qgis.RenderUnit)¶
Sets the units used for the offset for the shapeburst fill.
- Parameters:
unit (Qgis.RenderUnit) – units for fill offset
See also
See also
New in version 2.3.
- setOutputUnit(self, unit: Qgis.RenderUnit)¶
- Parameters:
unit (Qgis.RenderUnit) –
- setUseWholeShape(self, useWholeShape: bool)¶
Sets whether the shapeburst fill should be drawn using the entire shape.
- Parameters:
useWholeShape (bool) – Set to
True
if shapeburst should cover entire shape. IfFalse
, setMaxDistance is used to calculate how far from the boundary of the shape should be shaded
See also
See also
New in version 2.3.
- shouldRenderUsingSelectionColor(self, context: QgsSymbolRenderContext) bool ¶
Returns
True
if the symbol layer should be rendered using the selection color from the render context.New in version 3.34.
- startRender(self, context: QgsSymbolRenderContext)¶
- Parameters:
context (QgsSymbolRenderContext) –
- stopRender(self, context: QgsSymbolRenderContext)¶
- Parameters:
context (QgsSymbolRenderContext) –
- useWholeShape(self) bool ¶
Returns whether the shapeburst fill is set to cover the entire shape.
- Return type:
bool
- Returns:
True
if shapeburst fill will cover the entire shape. IfFalse
, shapeburst is drawn to a distance of maxDistance from the polygon’s boundary.
See also
See also
New in version 2.3.
- usesMapUnits(self) bool ¶
- Return type:
bool