QgsLinePatternFillSymbolLayer class
A symbol fill consisting of repeated parallel lines.
Contents
Base classes
- class QgsImageFillSymbolLayer
- Base class for polygon renderers generating texture images.
Public static functions
- static auto create(const QgsStringMap& properties = QgsStringMap()) -> QgsSymbolLayer*
- Creates a new QgsLinePatternFillSymbolLayer from a properties map.
- static auto createFromSld(QDomElement& element) -> QgsSymbolLayer*
- Creates a new QgsLinePatternFillSymbolLayer from a SLD element.
Public functions
- auto clone() const -> QgsLinePatternFillSymbolLayer* override
- Shall be reimplemented by subclasses to create a deep copy of the instance.
- auto color() const -> QColor override
- The fill color.
- auto distance() const -> double
- Returns the distance between lines in the fill pattern.
- auto distanceMapUnitScale() const -> const QgsMapUnitScale&
- Returns the map unit scale for the pattern's line distance.
-
auto distanceUnit() const -> QgsUnitTypes::
RenderUnit - Returns the units for the distance between lines in the fill pattern.
- auto estimateMaxBleed(const QgsRenderContext& context) const -> double override
- Returns the estimated maximum distance which the layer style will bleed outside the drawn shape when drawn in the specified /a context.
- auto layerType() const -> QString override
- Returns a string that represents this layer type.
- auto lineAngle() const -> double
- Returns the angle for the parallel lines used to fill the symbol.
- auto lineWidth() const -> double
- Returns the width of the line subsymbol used to render the parallel lines in the fill.
- auto lineWidthMapUnitScale() const -> const QgsMapUnitScale&
- Returns the map unit scale for the pattern's line width.
-
auto lineWidthUnit() const -> QgsUnitTypes::
RenderUnit - Returns the units for the line's width.
- auto offset() const -> double
- Returns the offset distance for lines within the fill, which is the distance to offset the parallel lines from their normal position.
- auto offsetMapUnitScale() const -> const QgsMapUnitScale&
- Returns the map unit scale for the pattern's line offset.
-
auto offsetUnit() const -> QgsUnitTypes::
RenderUnit - Returns the units for the line pattern's offset.
-
auto outputUnit() const -> QgsUnitTypes::
RenderUnit override - Returns the units to use for sizes and widths within the symbol layer.
- auto properties() const -> QgsStringMap override
- Should be reimplemented by subclasses to return a string map that contains the configuration information for the symbol layer.
- void setColor(const QColor& color) override
- The fill color.
- void setDistance(double d)
- Sets the distance between lines in the fill pattern.
- void setDistanceMapUnitScale(const QgsMapUnitScale& scale)
- Sets the map unit scale for the pattern's line distance.
-
void setDistanceUnit(QgsUnitTypes::
RenderUnit unit) - Sets the unit for the distance between lines in the fill pattern.
- void setLineAngle(double a)
- Sets the angle for the parallel lines used to fill the symbol.
- void setLineWidth(double w)
- Sets the width of the line subsymbol used to render the parallel lines in the fill.
- void setLineWidthMapUnitScale(const QgsMapUnitScale& scale)
- Sets the map unit scale for the pattern's line width.
-
void setLineWidthUnit(QgsUnitTypes::
RenderUnit unit) - Sets the unit for the line's width.
- void setOffset(double offset)
- Sets the offset distance for lines within the fill, which is the distance to offset the parallel lines from their normal position.
- void setOffsetMapUnitScale(const QgsMapUnitScale& scale)
- Sets the map unit scale for the pattern's line offset.
-
void setOffsetUnit(QgsUnitTypes::
RenderUnit unit) - Sets the unit for the line pattern's offset.
-
void setOutputUnit(QgsUnitTypes::
RenderUnit unit) override - Sets the units to use for sizes and widths within the symbol layer.
- auto setSubSymbol(QgsSymbol* symbol) -> bool override
- Sets layer's subsymbol. takes ownership of the passed symbol.
- auto subSymbol() -> QgsSymbol* override
- Returns the symbol's sub symbol, if present.
- auto usedAttributes(const QgsRenderContext& context) const -> QSet<QString> override
- Returns the set of attributes referenced by the layer.
Function documentation
static QgsSymbolLayer* QgsLinePatternFillSymbolLayer:: create(const QgsStringMap& properties = QgsStringMap())
Creates a new QgsLinePatternFillSymbolLayer from a properties map.
The caller takes ownership of the returned object.
static QgsSymbolLayer* QgsLinePatternFillSymbolLayer:: createFromSld(QDomElement& element)
Creates a new QgsLinePatternFillSymbolLayer from a SLD element.
The caller takes ownership of the returned object.
double QgsLinePatternFillSymbolLayer:: distance() const
Returns the distance between lines in the fill pattern.
Units are retrieved by distanceUnit().
const QgsMapUnitScale& QgsLinePatternFillSymbolLayer:: distanceMapUnitScale() const
Returns the map unit scale for the pattern's line distance.
QgsUnitTypes:: RenderUnit QgsLinePatternFillSymbolLayer:: distanceUnit() const
Returns the units for the distance between lines in the fill pattern.
double QgsLinePatternFillSymbolLayer:: estimateMaxBleed(const QgsRenderContext& context) const override
Returns the estimated maximum distance which the layer style will bleed outside the drawn shape when drawn in the specified /a context.
For example, polygons drawn with an stroke will draw half the width of the stroke outside of the polygon. This amount is estimated, since it may be affected by data defined symbology rules.
QString QgsLinePatternFillSymbolLayer:: layerType() const override
Returns a string that represents this layer type.
Used for serialization. Should match with the string used to register this symbol layer in the registry.
double QgsLinePatternFillSymbolLayer:: lineAngle() const
Returns the angle for the parallel lines used to fill the symbol.
Angles are in degrees, clockwise from North.
double QgsLinePatternFillSymbolLayer:: lineWidth() const
Returns the width of the line subsymbol used to render the parallel lines in the fill.
const QgsMapUnitScale& QgsLinePatternFillSymbolLayer:: lineWidthMapUnitScale() const
Returns the map unit scale for the pattern's line width.
QgsUnitTypes:: RenderUnit QgsLinePatternFillSymbolLayer:: lineWidthUnit() const
Returns the units for the line's width.
double QgsLinePatternFillSymbolLayer:: offset() const
Returns the offset distance for lines within the fill, which is the distance to offset the parallel lines from their normal position.
Units are retrieved via offsetUnit().
const QgsMapUnitScale& QgsLinePatternFillSymbolLayer:: offsetMapUnitScale() const
Returns the map unit scale for the pattern's line offset.
QgsUnitTypes:: RenderUnit QgsLinePatternFillSymbolLayer:: offsetUnit() const
Returns the units for the line pattern's offset.
QgsUnitTypes:: RenderUnit QgsLinePatternFillSymbolLayer:: outputUnit() const override
Returns the units to use for sizes and widths within the symbol layer.
| Returns | output unit, or QgsUnitTypes:: |
|---|
Individual symbol layer subclasses will interpret this in different ways, e.g., a marker symbol layer may use it to specify the units for the marker size, while a line symbol layer may use it to specify the units for the line width.
QgsStringMap QgsLinePatternFillSymbolLayer:: properties() const override
Should be reimplemented by subclasses to return a string map that contains the configuration information for the symbol layer.
This is used to serialize a symbol layer perstistently.
void QgsLinePatternFillSymbolLayer:: setDistance(double d)
Sets the distance between lines in the fill pattern.
| Parameters | |
|---|---|
| d | distance. Units are specified by setDistanceUnit() |
void QgsLinePatternFillSymbolLayer:: setDistanceMapUnitScale(const QgsMapUnitScale& scale)
Sets the map unit scale for the pattern's line distance.
void QgsLinePatternFillSymbolLayer:: setDistanceUnit(QgsUnitTypes:: RenderUnit unit)
Sets the unit for the distance between lines in the fill pattern.
void QgsLinePatternFillSymbolLayer:: setLineAngle(double a)
Sets the angle for the parallel lines used to fill the symbol.
Angles are in degrees, clockwise from North.
void QgsLinePatternFillSymbolLayer:: setLineWidth(double w)
Sets the width of the line subsymbol used to render the parallel lines in the fill.
void QgsLinePatternFillSymbolLayer:: setLineWidthMapUnitScale(const QgsMapUnitScale& scale)
Sets the map unit scale for the pattern's line width.
void QgsLinePatternFillSymbolLayer:: setLineWidthUnit(QgsUnitTypes:: RenderUnit unit)
Sets the unit for the line's width.
void QgsLinePatternFillSymbolLayer:: setOffset(double offset)
Sets the offset distance for lines within the fill, which is the distance to offset the parallel lines from their normal position.
Units are specified via setOffsetUnit().
void QgsLinePatternFillSymbolLayer:: setOffsetMapUnitScale(const QgsMapUnitScale& scale)
Sets the map unit scale for the pattern's line offset.
void QgsLinePatternFillSymbolLayer:: setOffsetUnit(QgsUnitTypes:: RenderUnit unit)
Sets the unit for the line pattern's offset.
void QgsLinePatternFillSymbolLayer:: setOutputUnit(QgsUnitTypes:: RenderUnit unit) override
Sets the units to use for sizes and widths within the symbol layer.
| Parameters | |
|---|---|
| unit | output units |
Individual symbol layer subclasses will interpret this in different ways, e.g., a marker symbol layer may use it to specify the units for the marker size, while a line symbol layer may use it to specify the units for the line width.
QSet<QString> QgsLinePatternFillSymbolLayer:: usedAttributes(const QgsRenderContext& context) const override
Returns the set of attributes referenced by the layer.
This includes attributes required by any data defined properties associated with the layer.