Beispiel #1
0
def append_LineFillSymbolLayer(symbol, layer: LineFillSymbolLayer):
    """
    Appends a LineFillSymbolLayer to a symbol
    """
    line = Symbol_to_QgsSymbol(layer.line)

    out = QgsLinePatternFillSymbolLayer()
    out.setSubSymbol(line)
    out.setLineAngle(convert_angle(layer.angle))
    out.setDistance(layer.separation)
    out.setDistanceUnit(QgsUnitTypes.RenderPoints)
    out.setOffset(layer.offset)
    out.setOffsetUnit(QgsUnitTypes.RenderPoints)

    symbol.appendSymbolLayer(out)
    if layer.outline_layer:
        append_SymbolLayer_to_QgsSymbolLayer(symbol, layer.outline_layer)
    elif layer.outline_symbol:
        # get all layers from outline
        append_SymbolLayer_to_QgsSymbolLayer(symbol, layer.outline_symbol)
Beispiel #2
0
def append_LineFillSymbolLayer(symbol, layer: LineFillSymbolLayer,
                               context: Context):
    """
    Appends a LineFillSymbolLayer to a symbol
    """
    line = Symbol_to_QgsSymbol(layer.line, context)

    out = QgsLinePatternFillSymbolLayer()
    out.setSubSymbol(line)
    out.setLineAngle(layer.angle)
    out.setDistance(context.convert_size(layer.separation))
    out.setDistanceUnit(context.units)
    out.setOffset(context.convert_size(layer.offset))
    out.setOffsetUnit(context.units)

    symbol.appendSymbolLayer(out)
    if layer.outline_layer:
        append_SymbolLayer_to_QgsSymbolLayer(symbol, layer.outline_layer,
                                             context)
    elif layer.outline_symbol:
        # get all layers from outline
        append_SymbolLayer_to_QgsSymbolLayer(symbol, layer.outline_symbol,
                                             context)