Subgroup: Simple
Class: QgsSimpleMarkerSymbolLayerBase¶
-
class
qgis.core.
QgsSimpleMarkerSymbolLayerBase
¶ Bases:
qgis._core.QgsMarkerSymbolLayer
Abstract base class for simple marker symbol layers. Handles creation of the symbol shapes but leaves the actual drawing of the symbols to subclasses.
New in version 2.16: Methods
angle
Returns the rotation angle for the marker, in degrees clockwise from north. availableShapes
Returns a list of all available shape types. bounds
clone
Shall be reimplemented by subclasses to create a deep copy of the instance. color
The fill color. copyDataDefinedProperties
copyPaintEffect
dataDefinedProperties
Returns a reference to the symbol layer’s property collection, used for data defined overrides. decodeShape
Attempts to decode a string representation of a shape name to the corresponding shape. drawPreviewIcon
dxfAngle
get angle dxfBrushColor
get brush/fill color dxfBrushStyle
get brush/fill style dxfColor
get color dxfCustomDashPattern
get dash pattern dxfOffset
get offset dxfPenStyle
get pen style dxfWidth
get line width enabled
Returns true if symbol layer is enabled and will be drawn. encodeShape
Encodes a shape to its string representation. estimateMaxBleed
Returns the estimated maximum distance which the layer style will bleed outside the drawn shape when drawn in the specified /a context. fillColor
Get fill color. horizontalAnchorPoint
Returns the horizontal anchor point for positioning the symbol. isCompatibleWithSymbol
Returns if the layer can be used below the specified symbol isLocked
layerType
Returns a string that represents this layer type. mapUnitScale
markerOffset
Calculates the required marker offset, including both the symbol offset and any displacement required to align with the marker’s anchor point. markerOffset2
markerOffsetWithWidthAndHeight
Calculates the required marker offset, including both the symbol offset and any displacement required to align with the marker’s anchor point. offset
Returns the marker’s offset, which is the horizontal and vertical displacement which the rendered marker will have from the original feature’s geometry. offsetMapUnitScale
Returns the map unit scale for the symbol’s offset. offsetUnit
Returns the units for the symbol’s offset. ogrFeatureStyle
outputUnit
paintEffect
Returns the current paint effect for the layer. prepareExpressions
Prepares all data defined property expressions for evaluation. properties
Should be reimplemented by subclasses to return a string map that contains the configuration information for the symbol layer. propertyDefinitions
Returns the symbol layer property definitions. renderPoint
renderingPass
restoreOldDataDefinedProperties
scaleMethod
Returns the method to use for scaling the marker’s size. setAngle
Sets the rotation angle for the marker. setColor
The fill color. setDataDefinedProperties
Sets the symbol layer’s property collection, used for data defined overrides. setDataDefinedProperty
Sets a data defined property for the layer. setEnabled
Sets whether symbol layer is enabled and should be drawn. setFillColor
Set fill color. setHorizontalAnchorPoint
Sets the horizontal anchor point for positioning the symbol. setLineAngle
Sets the line angle modification for the symbol’s angle. setLocked
setMapUnitScale
setOffset
Sets the marker’s offset, which is the horizontal and vertical displacement which the rendered marker should have from the original feature’s geometry. setOffsetMapUnitScale
Sets the map unit scale for the symbol’s offset. setOffsetUnit
Sets the units for the symbol’s offset. setOutputUnit
setPaintEffect
Sets the current paint effect for the layer. setRenderingPass
setScaleMethod
Sets the method to use for scaling the marker’s size. setShape
Sets the rendered marker shape. setSize
Sets the symbol size. setSizeMapUnitScale
Sets the map unit scale for the symbol’s size. setSizeUnit
Sets the units for the symbol’s size. setStrokeColor
Set stroke color. setSubSymbol
set layer’s subsymbol. takes ownership of the passed symbol setVerticalAnchorPoint
Sets the vertical anchor point for positioning the symbol. shape
Returns the shape for the rendered marker symbol. shapeIsFilled
Returns true if a symbol shape has a fill. size
Returns the symbol size. sizeMapUnitScale
Returns the map unit scale for the symbol’s size. sizeUnit
Returns the units for the symbol’s size. startRender
stopRender
strokeColor
Get stroke color. subSymbol
Returns the symbol’s sub symbol, if present. toSld
type
usedAttributes
Returns the set of attributes referenced by the layer. verticalAnchorPoint
Returns the vertical anchor point for positioning the symbol. writeDxf
write as DXF writeSldMarker
Writes the symbol layer definition as a SLD XML element. Attributes
Arrow
ArrowHead
ArrowHeadFilled
Bottom
Circle
Cross
Cross2
CrossFill
DiagonalHalfSquare
Diamond
EquilateralTriangle
HCenter
HalfSquare
Hexagon
Left
LeftHalfTriangle
Line
Pentagon
PropertyAngle
PropertyArrowHeadLength
PropertyArrowHeadThickness
PropertyArrowHeadType
PropertyArrowStartWidth
PropertyArrowType
PropertyArrowWidth
PropertyBlurRadius
PropertyCapStyle
PropertyCharacter
PropertyCoordinateMode
PropertyCustomDash
PropertyDisplacementX
PropertyDisplacementY
PropertyDistanceX
PropertyDistanceY
PropertyFile
PropertyFillColor
PropertyFillStyle
PropertyGradientReference1IsCentroid
PropertyGradientReference1X
PropertyGradientReference1Y
PropertyGradientReference2IsCentroid
PropertyGradientReference2X
PropertyGradientReference2Y
PropertyGradientSpread
PropertyGradientType
PropertyHeight
PropertyHorizontalAnchor
PropertyInterval
PropertyJoinStyle
PropertyLayerEnabled
PropertyLineAngle
PropertyLineDistance
PropertyName
PropertyOffset
PropertyOffsetAlongLine
PropertyOpacity
PropertyPlacement
PropertyPreserveAspectRatio
PropertySecondaryColor
PropertyShapeburstIgnoreRings
PropertyShapeburstMaxDistance
PropertyShapeburstUseWholeShape
PropertySize
PropertyStrokeColor
PropertyStrokeStyle
PropertyStrokeWidth
PropertyVerticalAnchor
PropertyWidth
QuarterCircle
QuarterSquare
Right
RightHalfTriangle
SemiCircle
Square
Star
ThirdCircle
Top
Triangle
VCenter
-
Arrow
= 7¶
-
ArrowHead
= 13¶
-
ArrowHeadFilled
= 14¶
-
Circle
= 8¶
-
Cross
= 9¶
-
Cross2
= 11¶
-
CrossFill
= 10¶
-
DiagonalHalfSquare
= 20¶
-
Diamond
= 1¶
-
EquilateralTriangle
= 5¶
-
HalfSquare
= 19¶
-
Hexagon
= 3¶
-
LeftHalfTriangle
= 22¶
-
Line
= 12¶
-
Pentagon
= 2¶
-
QuarterCircle
= 17¶
-
QuarterSquare
= 18¶
-
RightHalfTriangle
= 21¶
-
SemiCircle
= 15¶
-
class
Shape
¶ Bases:
int
-
Square
= 0¶
-
Star
= 6¶
-
ThirdCircle
= 16¶
-
Triangle
= 4¶
-
availableShapes
() → object¶ Returns a list of all available shape types.
-
bounds
(self, point: Union[QPointF, QPoint], context: QgsSymbolRenderContext) → QRectF¶
-
decodeShape
(name: str) → Tuple[QgsSimpleMarkerSymbolLayerBase.Shape, bool]¶ Attempts to decode a string representation of a shape name to the corresponding shape.
Parameters: - name – encoded shape name
- ok – if specified, will be set to true if shape was successfully decoded
Returns: decoded name
See also
-
encodeShape
(shape: QgsSimpleMarkerSymbolLayerBase.Shape) → str¶ Encodes a shape to its string representation.
Parameters: shape – shape to encode Returns: encoded string See also
-
renderPoint
(self, point: Union[QPointF, QPoint], context: QgsSymbolRenderContext)¶
-
setShape
(self, shape: QgsSimpleMarkerSymbolLayerBase.Shape)¶ Sets the rendered marker shape.
Parameters: shape – new marker shape See also
-
shape
(self) → QgsSimpleMarkerSymbolLayerBase.Shape¶ Returns the shape for the rendered marker symbol.
See also
-
shapeIsFilled
(shape: QgsSimpleMarkerSymbolLayerBase.Shape) → bool¶ Returns true if a symbol shape has a fill.
Parameters: shape – shape to test Returns: true if shape uses a fill, or false if shape uses lines only
-
startRender
(self, context: QgsSymbolRenderContext)¶
-
stopRender
(self, context: QgsSymbolRenderContext)¶
-