Class: QgsSimpleMarkerSymbolLayerBase¶
-
class
qgis.core.
QgsSimpleMarkerSymbolLayerBase
(shape: QgsSimpleMarkerSymbolLayerBase.Shape = QgsSimpleMarkerSymbolLayerBase.Circle, size: float = DEFAULT_SIMPLEMARKER_SIZE, angle: float = DEFAULT_SIMPLEMARKER_ANGLE, scaleMethod: QgsSymbol.ScaleMethod = DEFAULT_SCALE_METHOD)¶ Bases:
QgsMarkerSymbolLayer
Constructor for QgsSimpleMarkerSymbolLayerBase.
- Parameters
shape (QgsSimpleMarkerSymbolLayerBase.Shape = QgsSimpleMarkerSymbolLayerBase.Circle) – symbol shape for markers
size (float = DEFAULT_SIMPLEMARKER_SIZE) – symbol size (in mm)
angle (float = DEFAULT_SIMPLEMARKER_ANGLE) – symbol rotation angle
scaleMethod (QgsSymbol.ScaleMethod = DEFAULT_SCALE_METHOD) – scaling method for data defined scaling
QgsSimpleMarkerSymbolLayerBase(
QgsSimpleMarkerSymbolLayerBase
)Abstract base class for simple marker symbol layers. Handles creation of the symbol shapes but leaves the actual drawing of the symbols to subclasses.
Methods
Returns a list of all available shape types.
- param point
Attempts to decode a string representation of a shape name to the corresponding shape.
Encodes a shape to its string representation.
- param point
Sets the rendered marker shape.
Returns the shape for the rendered marker symbol.
Returns true if a symbol shape has a fill.
- param context
- param context
Attributes
-
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.
- Return type
object
-
bounds
(self, point: Union[QPointF, QPoint], context: QgsSymbolRenderContext) → QRectF¶ - Parameters
point (Union[QPointF) –
context (QgsSymbolRenderContext) –
- Return type
QRectF
-
decodeShape
(name: str) → Tuple[QgsSimpleMarkerSymbolLayerBase.Shape, bool]¶ Attempts to decode a string representation of a shape name to the corresponding shape.
- Parameters
name (str) – encoded shape name
ok – if specified, will be set to true if shape was successfully decoded
- Return type
Tuple[QgsSimpleMarkerSymbolLayerBase.Shape, bool]
- Returns
decoded name
See also
-
encodeShape
(shape: QgsSimpleMarkerSymbolLayerBase.Shape) → str¶ Encodes a shape to its string representation.
- Parameters
shape (QgsSimpleMarkerSymbolLayerBase.Shape) – shape to encode
- Return type
str
- Returns
encoded string
See also
-
renderPoint
(self, point: Union[QPointF, QPoint], context: QgsSymbolRenderContext)¶ - Parameters
point (Union[QPointF) –
context (QgsSymbolRenderContext) –
-
setShape
(self, shape: QgsSimpleMarkerSymbolLayerBase.Shape)¶ Sets the rendered marker shape.
- Parameters
shape (QgsSimpleMarkerSymbolLayerBase.Shape) – new marker shape
See also
-
shape
(self) → QgsSimpleMarkerSymbolLayerBase.Shape¶ Returns the shape for the rendered marker symbol.
See also
- Return type
-
shapeIsFilled
(shape: QgsSimpleMarkerSymbolLayerBase.Shape) → bool¶ Returns true if a symbol shape has a fill.
- Parameters
shape (QgsSimpleMarkerSymbolLayerBase.Shape) – shape to test
- Return type
bool
- Returns
true if shape uses a fill, or false if shape uses lines only
-
startRender
(self, context: QgsSymbolRenderContext)¶ - Parameters
context (QgsSymbolRenderContext) –
-
stopRender
(self, context: QgsSymbolRenderContext)¶ - Parameters
context (QgsSymbolRenderContext) –