mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-10 00:13:55 -04:00
Previously, when marker or hash lines were rendered using interval or center point place placement, the symbol angles were determined by taking the exact line orientation at the position of the symbol. This often leads to undesirable rendering effects, where little jaggies or corners in lines which occur at the position of the symbol cause the marker or hash line to be oriented at a very different angle to what the eye expects to see. With this new option, the angle is instead calculated by averaging the line over a specified distance either side of the symbol. E.g. averaging the line angle over 4mm means we take the points along the line 2mm from either side of the symbol placement, and use these instead to calculate the line angle for that symbol. This has the effect of smoothing (or removing) any tiny local deviations from the overall line direction, resulting in much nicer visual orientation of marker or hash lines. Like all symbol settings, the average angle smoothing distance can be set using mm/pixels/map units/etc, and supports data-defined values. Closed rings also correctly consider wrapping around these average angles from the start/end vertex. (Sponsored by an anonymous corporate backer)
832 lines
24 KiB
Plaintext
832 lines
24 KiB
Plaintext
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/core/symbology/qgslinesymbollayer.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class QgsSimpleLineSymbolLayer : QgsLineSymbolLayer
|
|
{
|
|
%Docstring
|
|
A simple line symbol layer, which renders lines using a line in a variety of styles (e.g. solid, dotted, dashed).
|
|
%End
|
|
|
|
%TypeHeaderCode
|
|
#include "qgslinesymbollayer.h"
|
|
%End
|
|
public:
|
|
|
|
QgsSimpleLineSymbolLayer( const QColor &color = DEFAULT_SIMPLELINE_COLOR,
|
|
double width = DEFAULT_SIMPLELINE_WIDTH,
|
|
Qt::PenStyle penStyle = DEFAULT_SIMPLELINE_PENSTYLE );
|
|
%Docstring
|
|
Constructor for QgsSimpleLineSymbolLayer. Creates a simple line
|
|
symbol in the specified ``color``, ``width`` (in millimeters)
|
|
and ``penStyle``.
|
|
%End
|
|
|
|
|
|
static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) /Factory/;
|
|
%Docstring
|
|
Creates a new QgsSimpleLineSymbolLayer, using the settings
|
|
serialized in the ``properties`` map (corresponding to the output from
|
|
QgsSimpleLineSymbolLayer.properties() ).
|
|
%End
|
|
|
|
static QgsSymbolLayer *createFromSld( QDomElement &element ) /Factory/;
|
|
%Docstring
|
|
Creates a new QgsSimpleLineSymbolLayer from an SLD XML DOM ``element``.
|
|
%End
|
|
|
|
virtual QString layerType() const;
|
|
|
|
virtual void startRender( QgsSymbolRenderContext &context );
|
|
|
|
virtual void stopRender( QgsSymbolRenderContext &context );
|
|
|
|
virtual void renderPolyline( const QPolygonF &points, QgsSymbolRenderContext &context );
|
|
|
|
virtual void renderPolygonStroke( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context );
|
|
|
|
virtual QgsStringMap properties() const;
|
|
|
|
virtual QgsSimpleLineSymbolLayer *clone() const /Factory/;
|
|
|
|
virtual void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const;
|
|
|
|
virtual QString ogrFeatureStyle( double mmScaleFactor, double mapUnitScaleFactor ) const;
|
|
|
|
virtual void setOutputUnit( QgsUnitTypes::RenderUnit unit );
|
|
|
|
virtual QgsUnitTypes::RenderUnit outputUnit() const;
|
|
|
|
virtual void setMapUnitScale( const QgsMapUnitScale &scale );
|
|
|
|
virtual QgsMapUnitScale mapUnitScale() const;
|
|
|
|
virtual double estimateMaxBleed( const QgsRenderContext &context ) const;
|
|
|
|
virtual QVector<qreal> dxfCustomDashPattern( QgsUnitTypes::RenderUnit &unit ) const;
|
|
|
|
virtual Qt::PenStyle dxfPenStyle() const;
|
|
|
|
virtual double dxfWidth( const QgsDxfExport &e, QgsSymbolRenderContext &context ) const;
|
|
|
|
virtual double dxfOffset( const QgsDxfExport &e, QgsSymbolRenderContext &context ) const;
|
|
|
|
virtual QColor dxfColor( QgsSymbolRenderContext &context ) const;
|
|
|
|
|
|
Qt::PenStyle penStyle() const;
|
|
%Docstring
|
|
Returns the pen style used to render the line (e.g. solid, dashed, etc).
|
|
|
|
.. seealso:: :py:func:`setPenStyle`
|
|
%End
|
|
|
|
void setPenStyle( Qt::PenStyle style );
|
|
%Docstring
|
|
Sets the pen ``style`` used to render the line (e.g. solid, dashed, etc).
|
|
|
|
.. seealso:: :py:func:`penStyle`
|
|
%End
|
|
|
|
Qt::PenJoinStyle penJoinStyle() const;
|
|
%Docstring
|
|
Returns the pen join style used to render the line (e.g. miter, bevel, round, etc).
|
|
|
|
.. seealso:: :py:func:`setPenJoinStyle`
|
|
%End
|
|
|
|
void setPenJoinStyle( Qt::PenJoinStyle style );
|
|
%Docstring
|
|
Sets the pen join ``style`` used to render the line (e.g. miter, bevel, round, etc).
|
|
|
|
.. seealso:: :py:func:`penJoinStyle`
|
|
%End
|
|
|
|
Qt::PenCapStyle penCapStyle() const;
|
|
%Docstring
|
|
Returns the pen cap style used to render the line (e.g. flat, square, round, etc).
|
|
|
|
.. seealso:: :py:func:`setPenCapStyle`
|
|
%End
|
|
|
|
void setPenCapStyle( Qt::PenCapStyle style );
|
|
%Docstring
|
|
Sets the pen cap ``style`` used to render the line (e.g. flat, square, round, etc).
|
|
|
|
.. seealso:: :py:func:`penCapStyle`
|
|
%End
|
|
|
|
bool useCustomDashPattern() const;
|
|
%Docstring
|
|
Returns ``True`` if the line uses a custom dash pattern.
|
|
|
|
.. seealso:: :py:func:`setUseCustomDashPattern`
|
|
|
|
.. seealso:: :py:func:`customDashPatternUnit`
|
|
|
|
.. seealso:: :py:func:`customDashVector`
|
|
%End
|
|
|
|
void setUseCustomDashPattern( bool b );
|
|
%Docstring
|
|
Sets whether the line uses a custom dash pattern.
|
|
|
|
.. seealso:: :py:func:`useCustomDashPattern`
|
|
|
|
.. seealso:: :py:func:`setCustomDashPatternUnit`
|
|
|
|
.. seealso:: :py:func:`setCustomDashVector`
|
|
%End
|
|
|
|
void setCustomDashPatternUnit( QgsUnitTypes::RenderUnit unit );
|
|
%Docstring
|
|
Sets the ``unit`` for lengths used in the custom dash pattern.
|
|
|
|
.. seealso:: :py:func:`customDashPatternUnit`
|
|
%End
|
|
|
|
QgsUnitTypes::RenderUnit customDashPatternUnit() const;
|
|
%Docstring
|
|
Returns the units for lengths used in the custom dash pattern.
|
|
|
|
.. seealso:: :py:func:`setCustomDashPatternUnit`
|
|
%End
|
|
|
|
const QgsMapUnitScale &customDashPatternMapUnitScale() const;
|
|
%Docstring
|
|
Returns the map unit scale for lengths used in the custom dash pattern.
|
|
|
|
.. seealso:: :py:func:`setCustomDashPatternMapUnitScale`
|
|
%End
|
|
|
|
void setCustomDashPatternMapUnitScale( const QgsMapUnitScale &scale );
|
|
%Docstring
|
|
Sets the map unit ``scale`` for lengths used in the custom dash pattern.
|
|
|
|
.. seealso:: :py:func:`customDashPatternMapUnitScale`
|
|
%End
|
|
|
|
QVector<qreal> customDashVector() const;
|
|
%Docstring
|
|
Returns the custom dash vector, which is the pattern of alternating drawn/skipped lengths
|
|
used while rendering a custom dash pattern.
|
|
|
|
Units for the vector are specified by customDashPatternUnit()
|
|
|
|
This setting is only used when useCustomDashPattern() returns ``True``.
|
|
|
|
.. seealso:: :py:func:`setCustomDashVector`
|
|
|
|
.. seealso:: :py:func:`customDashPatternUnit`
|
|
|
|
.. seealso:: :py:func:`useCustomDashPattern`
|
|
%End
|
|
|
|
void setCustomDashVector( const QVector<qreal> &vector );
|
|
%Docstring
|
|
Sets the custom dash ``vector``, which is the pattern of alternating drawn/skipped lengths
|
|
used while rendering a custom dash pattern.
|
|
|
|
Units for the vector are specified by customDashPatternUnit()
|
|
|
|
This setting is only used when useCustomDashPattern() returns ``True``.
|
|
|
|
.. seealso:: :py:func:`customDashVector`
|
|
|
|
.. seealso:: :py:func:`setCustomDashPatternUnit`
|
|
|
|
.. seealso:: :py:func:`setUseCustomDashPattern`
|
|
%End
|
|
|
|
bool drawInsidePolygon() const;
|
|
%Docstring
|
|
Returns ``True`` if the line should only be drawn inside polygons, and any portion
|
|
of the line which falls outside the polygon should be clipped away.
|
|
|
|
This setting only has an effect when the line symbol is being
|
|
used to render polygon rings.
|
|
|
|
.. seealso:: :py:func:`setDrawInsidePolygon`
|
|
%End
|
|
|
|
void setDrawInsidePolygon( bool drawInsidePolygon );
|
|
%Docstring
|
|
Sets whether the line should only be drawn inside polygons, and any portion
|
|
of the line which falls outside the polygon should be clipped away.
|
|
|
|
This setting only has an effect when the line symbol is being
|
|
used to render polygon rings.
|
|
|
|
.. seealso:: :py:func:`drawInsidePolygon`
|
|
%End
|
|
|
|
};
|
|
|
|
|
|
|
|
class QgsTemplatedLineSymbolLayerBase : QgsLineSymbolLayer
|
|
{
|
|
%Docstring
|
|
|
|
Base class for templated line symbols, e.g. line symbols which draw markers or hash
|
|
lines at intervals along the line feature.
|
|
|
|
.. versionadded:: 3.8
|
|
%End
|
|
|
|
%TypeHeaderCode
|
|
#include "qgslinesymbollayer.h"
|
|
%End
|
|
public:
|
|
|
|
enum Placement
|
|
{
|
|
Interval,
|
|
Vertex,
|
|
LastVertex,
|
|
FirstVertex,
|
|
CentralPoint,
|
|
CurvePoint,
|
|
};
|
|
|
|
QgsTemplatedLineSymbolLayerBase( bool rotateSymbol = true,
|
|
double interval = 3 );
|
|
%Docstring
|
|
Constructor for QgsTemplatedLineSymbolLayerBase. Creates a template
|
|
line placed at the specified ``interval`` (in millimeters).
|
|
|
|
The ``rotateSymbol`` argument specifies whether individual symbols
|
|
should be rotated to match the line segment alignment.
|
|
%End
|
|
|
|
bool rotateSymbols() const;
|
|
%Docstring
|
|
Returns ``True`` if the repeating symbols be rotated to match their line segment orientation.
|
|
|
|
.. seealso:: :py:func:`setRotateSymbols`
|
|
%End
|
|
|
|
void setRotateSymbols( bool rotate );
|
|
%Docstring
|
|
Sets whether the repeating symbols should be rotated to match their line segment orientation.
|
|
|
|
.. seealso:: :py:func:`rotateSymbols`
|
|
%End
|
|
|
|
double interval() const;
|
|
%Docstring
|
|
Returns the interval between individual symbols. Units are specified through intervalUnits().
|
|
|
|
.. seealso:: :py:func:`setInterval`
|
|
|
|
.. seealso:: :py:func:`intervalUnit`
|
|
%End
|
|
|
|
void setInterval( double interval );
|
|
%Docstring
|
|
Sets the interval between individual symbols.
|
|
|
|
:param interval: interval size. Units are specified through setIntervalUnit()
|
|
|
|
.. seealso:: :py:func:`interval`
|
|
|
|
.. seealso:: :py:func:`setIntervalUnit`
|
|
%End
|
|
|
|
void setIntervalUnit( QgsUnitTypes::RenderUnit unit );
|
|
%Docstring
|
|
Sets the units for the interval between symbols.
|
|
|
|
:param unit: interval units
|
|
|
|
.. seealso:: :py:func:`intervalUnit`
|
|
|
|
.. seealso:: :py:func:`setInterval`
|
|
%End
|
|
|
|
QgsUnitTypes::RenderUnit intervalUnit() const;
|
|
%Docstring
|
|
Returns the units for the interval between symbols.
|
|
|
|
.. seealso:: :py:func:`setIntervalUnit`
|
|
|
|
.. seealso:: :py:func:`interval`
|
|
%End
|
|
|
|
void setIntervalMapUnitScale( const QgsMapUnitScale &scale );
|
|
%Docstring
|
|
Sets the map unit ``scale`` for the interval between symbols.
|
|
|
|
.. seealso:: :py:func:`intervalMapUnitScale`
|
|
|
|
.. seealso:: :py:func:`setIntervalUnit`
|
|
|
|
.. seealso:: :py:func:`setInterval`
|
|
%End
|
|
|
|
const QgsMapUnitScale &intervalMapUnitScale() const;
|
|
%Docstring
|
|
Returns the map unit scale for the interval between symbols.
|
|
|
|
.. seealso:: :py:func:`setIntervalMapUnitScale`
|
|
|
|
.. seealso:: :py:func:`intervalUnit`
|
|
|
|
.. seealso:: :py:func:`interval`
|
|
%End
|
|
|
|
Placement placement() const;
|
|
%Docstring
|
|
Returns the placement of the symbols.
|
|
|
|
.. seealso:: :py:func:`setPlacement`
|
|
%End
|
|
|
|
void setPlacement( Placement placement );
|
|
%Docstring
|
|
Sets the ``placement`` of the symbols.
|
|
|
|
.. seealso:: :py:func:`placement`
|
|
%End
|
|
|
|
double offsetAlongLine() const;
|
|
%Docstring
|
|
Returns the offset along the line for the symbol placement. For Interval placements, this is the distance
|
|
between the start of the line and the first symbol. For FirstVertex and LastVertex placements, this is the
|
|
distance between the symbol and the start of the line or the end of the line respectively.
|
|
This setting has no effect for Vertex or CentralPoint placements.
|
|
|
|
:return: The offset along the line. The unit for the offset is retrievable via offsetAlongLineUnit.
|
|
|
|
.. seealso:: :py:func:`setOffsetAlongLine`
|
|
|
|
.. seealso:: :py:func:`offsetAlongLineUnit`
|
|
|
|
.. seealso:: :py:func:`placement`
|
|
%End
|
|
|
|
void setOffsetAlongLine( double offsetAlongLine );
|
|
%Docstring
|
|
Sets the the offset along the line for the symbol placement. For Interval placements, this is the distance
|
|
between the start of the line and the first symbol. For FirstVertex and LastVertex placements, this is the
|
|
distance between the symbol and the start of the line or the end of the line respectively.
|
|
This setting has no effect for Vertex or CentralPoint placements.
|
|
|
|
:param offsetAlongLine: Distance to offset markers along the line. The offset
|
|
unit is set via setOffsetAlongLineUnit.
|
|
|
|
.. seealso:: :py:func:`offsetAlongLine`
|
|
|
|
.. seealso:: :py:func:`setOffsetAlongLineUnit`
|
|
|
|
.. seealso:: :py:func:`setPlacement`
|
|
%End
|
|
|
|
QgsUnitTypes::RenderUnit offsetAlongLineUnit() const;
|
|
%Docstring
|
|
Returns the unit used for calculating the offset along line for symbols.
|
|
|
|
:return: Offset along line unit type.
|
|
|
|
.. seealso:: :py:func:`setOffsetAlongLineUnit`
|
|
|
|
.. seealso:: :py:func:`offsetAlongLine`
|
|
%End
|
|
|
|
void setOffsetAlongLineUnit( QgsUnitTypes::RenderUnit unit );
|
|
%Docstring
|
|
Sets the unit used for calculating the offset along line for symbols.
|
|
|
|
:param unit: Offset along line unit type.
|
|
|
|
.. seealso:: :py:func:`offsetAlongLineUnit`
|
|
|
|
.. seealso:: :py:func:`setOffsetAlongLine`
|
|
%End
|
|
|
|
const QgsMapUnitScale &offsetAlongLineMapUnitScale() const;
|
|
%Docstring
|
|
Returns the map unit scale used for calculating the offset in map units along line for symbols.
|
|
|
|
.. seealso:: :py:func:`setOffsetAlongLineMapUnitScale`
|
|
%End
|
|
|
|
void setOffsetAlongLineMapUnitScale( const QgsMapUnitScale &scale );
|
|
%Docstring
|
|
Sets the map unit ``scale`` used for calculating the offset in map units along line for symbols.
|
|
|
|
.. seealso:: :py:func:`offsetAlongLineMapUnitScale`
|
|
%End
|
|
|
|
double averageAngleLength() const;
|
|
%Docstring
|
|
Returns the length of line over which the line's direction is averaged when
|
|
calculating individual symbol angles. Longer lengths smooth out angles from jagged lines to a greater extent.
|
|
|
|
Units are retrieved through averageAngleUnit()
|
|
|
|
.. seealso:: :py:func:`setAverageAngleLength`
|
|
|
|
.. seealso:: :py:func:`averageAngleUnit`
|
|
|
|
.. seealso:: :py:func:`averageAngleMapUnitScale`
|
|
%End
|
|
|
|
void setAverageAngleLength( double length );
|
|
%Docstring
|
|
Sets the ``length`` of line over which the line's direction is averaged when
|
|
calculating individual symbol angles. Longer lengths smooth out angles from jagged lines to a greater extent.
|
|
|
|
Units are set through setAverageAngleUnit()
|
|
|
|
.. seealso:: :py:func:`averageAngleLength`
|
|
|
|
.. seealso:: :py:func:`setAverageAngleUnit`
|
|
|
|
.. seealso:: :py:func:`setAverageAngleMapUnitScale`
|
|
%End
|
|
|
|
void setAverageAngleUnit( QgsUnitTypes::RenderUnit unit );
|
|
%Docstring
|
|
Sets the ``unit`` for the length over which the line's direction is averaged when
|
|
calculating individual symbol angles.
|
|
|
|
.. seealso:: :py:func:`averageAngleUnit`
|
|
|
|
.. seealso:: :py:func:`setAverageAngleLength`
|
|
|
|
.. seealso:: :py:func:`setAverageAngleMapUnitScale`
|
|
%End
|
|
|
|
QgsUnitTypes::RenderUnit averageAngleUnit() const;
|
|
%Docstring
|
|
Returns the unit for the length over which the line's direction is averaged when
|
|
calculating individual symbol angles.
|
|
|
|
.. seealso:: :py:func:`setAverageAngleUnit`
|
|
|
|
.. seealso:: :py:func:`averageAngleLength`
|
|
|
|
.. seealso:: :py:func:`averageAngleMapUnitScale`
|
|
%End
|
|
|
|
void setAverageAngleMapUnitScale( const QgsMapUnitScale &scale );
|
|
%Docstring
|
|
Sets the map unit ``scale`` for the length over which the line's direction is averaged when
|
|
calculating individual symbol angles.
|
|
|
|
.. seealso:: :py:func:`averageAngleMapUnitScale`
|
|
|
|
.. seealso:: :py:func:`setAverageAngleLength`
|
|
|
|
.. seealso:: :py:func:`setAverageAngleUnit`
|
|
%End
|
|
|
|
const QgsMapUnitScale &averageAngleMapUnitScale() const;
|
|
%Docstring
|
|
Returns the map unit scale for the length over which the line's direction is averaged when
|
|
calculating individual symbol angles.
|
|
|
|
.. seealso:: :py:func:`setAverageAngleMapUnitScale`
|
|
|
|
.. seealso:: :py:func:`averageAngleLength`
|
|
|
|
.. seealso:: :py:func:`averageAngleUnit`
|
|
%End
|
|
|
|
virtual void renderPolyline( const QPolygonF &points, QgsSymbolRenderContext &context ) ${SIP_FINAL};
|
|
|
|
virtual void renderPolygonStroke( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context ) ${SIP_FINAL};
|
|
|
|
virtual QgsUnitTypes::RenderUnit outputUnit() const ${SIP_FINAL};
|
|
|
|
virtual void setMapUnitScale( const QgsMapUnitScale &scale ) ${SIP_FINAL};
|
|
|
|
virtual QgsMapUnitScale mapUnitScale() const ${SIP_FINAL};
|
|
|
|
virtual QgsStringMap properties() const;
|
|
|
|
|
|
protected:
|
|
|
|
virtual void setSymbolLineAngle( double angle ) = 0;
|
|
%Docstring
|
|
Sets the line ``angle`` modification for the symbol's angle. This angle is added to
|
|
the symbol's rotation and data defined rotation before rendering the symbol, and
|
|
is used for orienting symbols to match the line's angle.
|
|
|
|
:param angle: Angle in degrees, valid values are between 0 and 360
|
|
%End
|
|
|
|
virtual double symbolAngle() const = 0;
|
|
%Docstring
|
|
Returns the symbol's current angle, in degrees clockwise.
|
|
%End
|
|
|
|
virtual void setSymbolAngle( double angle ) = 0;
|
|
%Docstring
|
|
Sets the symbol's ``angle``, in degrees clockwise.
|
|
%End
|
|
|
|
virtual void renderSymbol( const QPointF &point, const QgsFeature *feature, QgsRenderContext &context, int layer = -1, bool selected = false ) = 0;
|
|
%Docstring
|
|
Renders the templated symbol at the specified ``point``, using the given render ``context``.
|
|
|
|
The ``feature`` argument is used to pass the feature currently being rendered (when available).
|
|
|
|
If only a single symbol layer from the symbol should be rendered, it should be specified
|
|
in the ``layer`` argument. A ``layer`` of -1 indicates that all symbol layers should be
|
|
rendered.
|
|
|
|
If ``selected`` is true then the symbol will be drawn using the "selected feature"
|
|
style and colors instead of the symbol's normal style.
|
|
%End
|
|
|
|
void copyTemplateSymbolProperties( QgsTemplatedLineSymbolLayerBase *destLayer ) const;
|
|
%Docstring
|
|
Copies all common properties of this layer to another templated symbol layer.
|
|
%End
|
|
|
|
static void setCommonProperties( QgsTemplatedLineSymbolLayerBase *destLayer, const QgsStringMap &properties );
|
|
%Docstring
|
|
Sets all common symbol properties in the ``destLayer``, using the settings
|
|
serialized in the ``properties`` map.
|
|
%End
|
|
|
|
};
|
|
|
|
class QgsMarkerLineSymbolLayer : QgsTemplatedLineSymbolLayerBase
|
|
{
|
|
%Docstring
|
|
Line symbol layer type which draws repeating marker symbols along a line feature.
|
|
%End
|
|
|
|
%TypeHeaderCode
|
|
#include "qgslinesymbollayer.h"
|
|
%End
|
|
public:
|
|
|
|
QgsMarkerLineSymbolLayer( bool rotateMarker = DEFAULT_MARKERLINE_ROTATE,
|
|
double interval = DEFAULT_MARKERLINE_INTERVAL );
|
|
%Docstring
|
|
Constructor for QgsMarkerLineSymbolLayer. Creates a marker line
|
|
with a default marker symbol, placed at the specified ``interval`` (in millimeters).
|
|
|
|
The ``rotateMarker`` argument specifies whether individual marker symbols
|
|
should be rotated to match the line segment alignment.
|
|
%End
|
|
|
|
|
|
static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) /Factory/;
|
|
%Docstring
|
|
Creates a new QgsMarkerLineSymbolLayer, using the settings
|
|
serialized in the ``properties`` map (corresponding to the output from
|
|
QgsMarkerLineSymbolLayer.properties() ).
|
|
%End
|
|
|
|
static QgsSymbolLayer *createFromSld( QDomElement &element ) /Factory/;
|
|
%Docstring
|
|
Creates a new QgsMarkerLineSymbolLayer from an SLD XML DOM ``element``.
|
|
%End
|
|
|
|
|
|
virtual QString layerType() const;
|
|
|
|
virtual void startRender( QgsSymbolRenderContext &context );
|
|
|
|
virtual void stopRender( QgsSymbolRenderContext &context );
|
|
|
|
virtual QgsMarkerLineSymbolLayer *clone() const /Factory/;
|
|
|
|
virtual void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const;
|
|
|
|
virtual void setColor( const QColor &color );
|
|
|
|
virtual QColor color() const;
|
|
|
|
virtual QgsSymbol *subSymbol();
|
|
|
|
virtual bool setSubSymbol( QgsSymbol *symbol /Transfer/ );
|
|
|
|
virtual void setWidth( double width );
|
|
|
|
virtual double width() const;
|
|
|
|
virtual double width( const QgsRenderContext &context ) const;
|
|
|
|
virtual double estimateMaxBleed( const QgsRenderContext &context ) const;
|
|
|
|
virtual void setOutputUnit( QgsUnitTypes::RenderUnit unit );
|
|
|
|
virtual QSet<QString> usedAttributes( const QgsRenderContext &context ) const;
|
|
|
|
virtual bool hasDataDefinedProperties() const;
|
|
|
|
virtual void setDataDefinedProperty( QgsSymbolLayer::Property key, const QgsProperty &property );
|
|
|
|
|
|
bool rotateMarker() const /Deprecated/;
|
|
%Docstring
|
|
Shall the marker be rotated.
|
|
|
|
:return: ``True`` if the marker should be rotated.
|
|
|
|
.. deprecated:: Use rotateSymbols() instead.
|
|
%End
|
|
|
|
void setRotateMarker( bool rotate ) /Deprecated/;
|
|
%Docstring
|
|
Shall the marker be rotated.
|
|
|
|
.. deprecated:: Use setRotateSymbols() instead.
|
|
%End
|
|
|
|
protected:
|
|
|
|
|
|
virtual void setSymbolLineAngle( double angle );
|
|
|
|
virtual double symbolAngle() const;
|
|
|
|
virtual void setSymbolAngle( double angle );
|
|
|
|
virtual void renderSymbol( const QPointF &point, const QgsFeature *feature, QgsRenderContext &context, int layer = -1, bool selected = false );
|
|
|
|
|
|
private:
|
|
QgsMarkerLineSymbolLayer( const QgsMarkerLineSymbolLayer &other );
|
|
};
|
|
|
|
|
|
class QgsHashedLineSymbolLayer : QgsTemplatedLineSymbolLayerBase
|
|
{
|
|
%Docstring
|
|
|
|
Line symbol layer type which draws repeating line sections along a line feature.
|
|
|
|
.. versionadded:: 3.8
|
|
%End
|
|
|
|
%TypeHeaderCode
|
|
#include "qgslinesymbollayer.h"
|
|
%End
|
|
public:
|
|
|
|
QgsHashedLineSymbolLayer( bool rotateSymbol = true,
|
|
double interval = 3 );
|
|
%Docstring
|
|
Constructor for QgsHashedLineSymbolLayer. Creates a line
|
|
with a default hash symbol, placed at the specified ``interval`` (in millimeters).
|
|
|
|
The ``rotateSymbol`` argument specifies whether individual hash symbols
|
|
should be rotated to match the line segment alignment.
|
|
%End
|
|
|
|
static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) /Factory/;
|
|
%Docstring
|
|
Creates a new QgsHashedLineSymbolLayer, using the settings
|
|
serialized in the ``properties`` map (corresponding to the output from
|
|
QgsHashedLineSymbolLayer.properties() ).
|
|
%End
|
|
|
|
virtual QString layerType() const;
|
|
|
|
virtual void startRender( QgsSymbolRenderContext &context );
|
|
|
|
virtual void stopRender( QgsSymbolRenderContext &context );
|
|
|
|
virtual QgsStringMap properties() const;
|
|
|
|
virtual QgsHashedLineSymbolLayer *clone() const /Factory/;
|
|
|
|
virtual void setColor( const QColor &color );
|
|
|
|
virtual QColor color() const;
|
|
|
|
virtual QgsSymbol *subSymbol();
|
|
|
|
virtual bool setSubSymbol( QgsSymbol *symbol /Transfer/ );
|
|
|
|
virtual void setWidth( double width );
|
|
|
|
virtual double width() const;
|
|
|
|
virtual double width( const QgsRenderContext &context ) const;
|
|
|
|
virtual double estimateMaxBleed( const QgsRenderContext &context ) const;
|
|
|
|
virtual void setOutputUnit( QgsUnitTypes::RenderUnit unit );
|
|
|
|
virtual QSet<QString> usedAttributes( const QgsRenderContext &context ) const;
|
|
|
|
virtual bool hasDataDefinedProperties() const;
|
|
|
|
virtual void setDataDefinedProperty( QgsSymbolLayer::Property key, const QgsProperty &property );
|
|
|
|
|
|
double hashAngle() const;
|
|
%Docstring
|
|
Returns the angle to use when drawing the hashed lines sections, in degrees clockwise.
|
|
|
|
.. seealso:: :py:func:`setHashAngle`
|
|
%End
|
|
|
|
void setHashAngle( double angle );
|
|
%Docstring
|
|
Sets the ``angle`` to use when drawing the hashed lines sections, in degrees clockwise.
|
|
|
|
.. seealso:: :py:func:`hashAngle`
|
|
%End
|
|
|
|
double hashLength() const;
|
|
%Docstring
|
|
Returns the length of hash symbols. Units are specified through hashLengthUnits().
|
|
|
|
.. seealso:: :py:func:`setHashLength`
|
|
|
|
.. seealso:: :py:func:`hashLengthUnit`
|
|
%End
|
|
|
|
void setHashLength( double length );
|
|
%Docstring
|
|
Sets the ``length`` of hash symbols. Units are specified through setHashLengthUnit()
|
|
|
|
.. seealso:: :py:func:`hashLength`
|
|
|
|
.. seealso:: :py:func:`setHashLengthUnit`
|
|
%End
|
|
|
|
void setHashLengthUnit( QgsUnitTypes::RenderUnit unit );
|
|
%Docstring
|
|
Sets the ``unit`` for the length of hash symbols.
|
|
|
|
.. seealso:: :py:func:`hashLengthUnit`
|
|
|
|
.. seealso:: :py:func:`setHashLength`
|
|
%End
|
|
|
|
QgsUnitTypes::RenderUnit hashLengthUnit() const;
|
|
%Docstring
|
|
Returns the units for the length of hash symbols.
|
|
|
|
.. seealso:: :py:func:`setHashLengthUnit`
|
|
|
|
.. seealso:: :py:func:`hashLength`
|
|
%End
|
|
|
|
void setHashLengthMapUnitScale( const QgsMapUnitScale &scale );
|
|
%Docstring
|
|
Sets the map unit ``scale`` for the hash length.
|
|
|
|
.. seealso:: :py:func:`hashLengthMapUnitScale`
|
|
|
|
.. seealso:: :py:func:`setHashLengthUnit`
|
|
|
|
.. seealso:: :py:func:`setHashLength`
|
|
%End
|
|
|
|
const QgsMapUnitScale &hashLengthMapUnitScale() const;
|
|
%Docstring
|
|
Returns the map unit scale for the hash length.
|
|
|
|
.. seealso:: :py:func:`setHashLengthMapUnitScale`
|
|
|
|
.. seealso:: :py:func:`hashLengthUnit`
|
|
|
|
.. seealso:: :py:func:`hashLength`
|
|
%End
|
|
|
|
protected:
|
|
|
|
virtual void setSymbolLineAngle( double angle );
|
|
|
|
virtual double symbolAngle() const;
|
|
|
|
virtual void setSymbolAngle( double angle );
|
|
|
|
virtual void renderSymbol( const QPointF &point, const QgsFeature *feature, QgsRenderContext &context, int layer = -1, bool selected = false );
|
|
|
|
|
|
private:
|
|
QgsHashedLineSymbolLayer( const QgsHashedLineSymbolLayer &other );
|
|
};
|
|
|
|
|
|
|
|
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/core/symbology/qgslinesymbollayer.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|