2017-06-07 16:07:17 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
2017-08-06 13:39:03 +02:00
|
|
|
* src/core/symbology/qgssymbollayer.h *
|
2017-06-07 16:07:17 +02:00
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-05-08 19:17:42 +10:00
|
|
|
|
2016-08-05 08:08:39 +02:00
|
|
|
class QgsSymbolLayer
|
2012-09-24 02:28:15 +02:00
|
|
|
{
|
2017-06-07 16:07:17 +02:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
%TypeHeaderCode
|
2017-06-07 16:07:17 +02:00
|
|
|
#include "qgssymbollayer.h"
|
2016-08-07 17:33:22 +02:00
|
|
|
#include <qgslinesymbollayer.h>
|
2012-09-24 02:28:15 +02:00
|
|
|
%End
|
|
|
|
%ConvertToSubClassCode
|
2017-06-07 16:07:17 +02:00
|
|
|
switch ( sipCpp->type() )
|
|
|
|
{
|
|
|
|
case QgsSymbol::Marker:
|
|
|
|
if ( sipCpp->layerType() == "EllipseMarker" )
|
|
|
|
sipType = sipType_QgsEllipseSymbolLayer;
|
|
|
|
else if ( sipCpp->layerType() == "FontMarker" )
|
|
|
|
sipType = sipType_QgsFontMarkerSymbolLayer;
|
|
|
|
else if ( sipCpp->layerType() == "SimpleMarker" )
|
|
|
|
sipType = sipType_QgsSimpleMarkerSymbolLayer;
|
|
|
|
else if ( sipCpp->layerType() == "FilledMarker" )
|
|
|
|
sipType = sipType_QgsFilledMarkerSymbolLayer;
|
|
|
|
else if ( sipCpp->layerType() == "SvgMarker" )
|
|
|
|
sipType = sipType_QgsSvgMarkerSymbolLayer;
|
2018-12-01 16:03:10 +07:00
|
|
|
else if ( sipCpp->layerType() == "RasterMarker" )
|
|
|
|
sipType = sipType_QgsRasterMarkerSymbolLayer;
|
2017-06-07 16:07:17 +02:00
|
|
|
else if ( sipCpp->layerType() == "VectorField" )
|
|
|
|
sipType = sipType_QgsVectorFieldSymbolLayer;
|
2019-11-07 08:17:25 +01:00
|
|
|
else if ( sipCpp->layerType() == "MaskMarker" )
|
|
|
|
sipType = sipType_QgsMaskMarkerSymbolLayer;
|
2017-06-07 16:07:17 +02:00
|
|
|
else
|
|
|
|
sipType = sipType_QgsMarkerSymbolLayer;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case QgsSymbol::Line:
|
|
|
|
if ( sipCpp->layerType() == "MarkerLine" )
|
|
|
|
sipType = sipType_QgsMarkerLineSymbolLayer;
|
|
|
|
else if ( sipCpp->layerType() == "SimpleLine" )
|
|
|
|
sipType = sipType_QgsSimpleLineSymbolLayer;
|
|
|
|
else if ( sipCpp->layerType() == "ArrowLine" )
|
|
|
|
sipType = sipType_QgsArrowSymbolLayer;
|
|
|
|
else
|
|
|
|
sipType = sipType_QgsLineSymbolLayer;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case QgsSymbol::Fill:
|
|
|
|
if ( sipCpp->layerType() == "SimpleFill" )
|
|
|
|
sipType = sipType_QgsSimpleFillSymbolLayer;
|
|
|
|
else if ( sipCpp->layerType() == "LinePatternFill" )
|
|
|
|
sipType = sipType_QgsLinePatternFillSymbolLayer;
|
|
|
|
else if ( sipCpp->layerType() == "PointPatternFill" )
|
|
|
|
sipType = sipType_QgsPointPatternFillSymbolLayer;
|
|
|
|
else if ( sipCpp->layerType() == "SVGFill" )
|
|
|
|
sipType = sipType_QgsSVGFillSymbolLayer;
|
|
|
|
else if ( sipCpp->layerType() == "RasterFill" )
|
|
|
|
sipType = sipType_QgsRasterFillSymbolLayer;
|
|
|
|
else if ( sipCpp->layerType() == "CentroidFill" )
|
|
|
|
sipType = sipType_QgsCentroidFillSymbolLayer;
|
|
|
|
else if ( sipCpp->layerType() == "GradientFill" )
|
|
|
|
sipType = sipType_QgsGradientFillSymbolLayer;
|
|
|
|
else if ( sipCpp->layerType() == "ShapeburstFill" )
|
|
|
|
sipType = sipType_QgsShapeburstFillSymbolLayer;
|
2019-10-28 10:14:38 +10:00
|
|
|
else if ( sipCpp->layerType() == "RandomMarkerFill" )
|
|
|
|
sipType = sipType_QgsRandomMarkerFillSymbolLayer;
|
2017-06-07 16:07:17 +02:00
|
|
|
else
|
|
|
|
sipType = sipType_QgsFillSymbolLayer;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case QgsSymbol::Hybrid:
|
|
|
|
sipType = sipType_QgsGeometryGeneratorSymbolLayer;
|
|
|
|
break;
|
|
|
|
}
|
2012-09-24 02:28:15 +02:00
|
|
|
%End
|
|
|
|
public:
|
|
|
|
|
2017-01-11 10:36:51 +10:00
|
|
|
enum Property
|
|
|
|
{
|
2017-06-07 16:07:17 +02:00
|
|
|
PropertySize,
|
|
|
|
PropertyAngle,
|
|
|
|
PropertyName,
|
|
|
|
PropertyFillColor,
|
|
|
|
PropertyStrokeColor,
|
|
|
|
PropertyStrokeWidth,
|
|
|
|
PropertyStrokeStyle,
|
|
|
|
PropertyOffset,
|
|
|
|
PropertyCharacter,
|
|
|
|
PropertyWidth,
|
|
|
|
PropertyHeight,
|
2017-07-20 12:51:35 +02:00
|
|
|
PropertyPreserveAspectRatio,
|
2017-06-07 16:07:17 +02:00
|
|
|
PropertyFillStyle,
|
|
|
|
PropertyJoinStyle,
|
|
|
|
PropertySecondaryColor,
|
|
|
|
PropertyLineAngle,
|
|
|
|
PropertyLineDistance,
|
|
|
|
PropertyGradientType,
|
|
|
|
PropertyCoordinateMode,
|
|
|
|
PropertyGradientSpread,
|
|
|
|
PropertyGradientReference1X,
|
|
|
|
PropertyGradientReference1Y,
|
|
|
|
PropertyGradientReference2X,
|
|
|
|
PropertyGradientReference2Y,
|
|
|
|
PropertyGradientReference1IsCentroid,
|
|
|
|
PropertyGradientReference2IsCentroid,
|
|
|
|
PropertyBlurRadius,
|
|
|
|
PropertyShapeburstUseWholeShape,
|
|
|
|
PropertyShapeburstMaxDistance,
|
|
|
|
PropertyShapeburstIgnoreRings,
|
|
|
|
PropertyFile,
|
|
|
|
PropertyDistanceX,
|
|
|
|
PropertyDistanceY,
|
|
|
|
PropertyDisplacementX,
|
|
|
|
PropertyDisplacementY,
|
|
|
|
PropertyOpacity,
|
|
|
|
PropertyCustomDash,
|
|
|
|
PropertyCapStyle,
|
|
|
|
PropertyPlacement,
|
|
|
|
PropertyInterval,
|
|
|
|
PropertyOffsetAlongLine,
|
2019-03-25 17:58:47 +10:00
|
|
|
PropertyAverageAngleLength,
|
2017-06-07 16:07:17 +02:00
|
|
|
PropertyHorizontalAnchor,
|
|
|
|
PropertyVerticalAnchor,
|
|
|
|
PropertyLayerEnabled,
|
|
|
|
PropertyArrowWidth,
|
|
|
|
PropertyArrowStartWidth,
|
|
|
|
PropertyArrowHeadLength,
|
|
|
|
PropertyArrowHeadThickness,
|
|
|
|
PropertyArrowHeadType,
|
|
|
|
PropertyArrowType,
|
2019-04-24 11:16:28 +07:00
|
|
|
PropertyOffsetX,
|
|
|
|
PropertyOffsetY,
|
2019-10-05 19:37:32 +10:00
|
|
|
PropertyPointCount,
|
|
|
|
PropertyRandomSeed,
|
|
|
|
PropertyClipPoints,
|
2019-10-28 15:34:04 +07:00
|
|
|
PropertyDensityArea,
|
2017-01-11 10:36:51 +10:00
|
|
|
};
|
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
static const QgsPropertiesDefinition &propertyDefinitions();
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the symbol layer property definitions.
|
|
|
|
|
2017-06-07 16:07:17 +02:00
|
|
|
.. versionadded:: 3.0
|
|
|
|
%End
|
2017-01-23 12:22:40 +10:00
|
|
|
|
2016-08-05 08:08:39 +02:00
|
|
|
virtual ~QgsSymbolLayer();
|
2015-04-07 14:27:39 +02:00
|
|
|
|
2019-07-24 08:27:09 +10:00
|
|
|
|
|
|
|
|
2016-10-13 07:39:49 +10:00
|
|
|
bool enabled() const;
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2019-02-26 19:54:09 +10:00
|
|
|
Returns ``True`` if symbol layer is enabled and will be drawn.
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setEnabled`
|
2018-05-28 11:31:08 -04:00
|
|
|
|
|
|
|
.. versionadded:: 3.0
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
2016-10-13 07:39:49 +10:00
|
|
|
|
|
|
|
void setEnabled( bool enabled );
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets whether symbol layer is enabled and should be drawn. Disabled
|
|
|
|
layers are not drawn, but remain part of the symbol and can be re-enabled
|
|
|
|
when desired.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`enabled`
|
2018-05-28 11:31:08 -04:00
|
|
|
|
|
|
|
.. versionadded:: 3.0
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
2016-10-13 07:39:49 +10:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
virtual QColor color() const;
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
The fill color.
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual void setColor( const QColor &color );
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
The fill color.
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
2016-02-14 03:50:23 +01:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual void setStrokeColor( const QColor &color );
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Set stroke color. Supported by marker and fill layers.
|
|
|
|
|
2017-06-07 16:07:17 +02:00
|
|
|
.. versionadded:: 2.1
|
|
|
|
%End
|
2016-02-14 03:50:23 +01:00
|
|
|
|
2017-02-22 17:13:57 +10:00
|
|
|
virtual QColor strokeColor() const;
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2018-05-26 18:44:30 +10:00
|
|
|
Gets stroke color. Supported by marker and fill layers.
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-06-07 16:07:17 +02:00
|
|
|
.. versionadded:: 2.1
|
|
|
|
%End
|
2016-02-14 03:50:23 +01:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual void setFillColor( const QColor &color );
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Set fill color. Supported by marker and fill layers.
|
|
|
|
|
2017-06-07 16:07:17 +02:00
|
|
|
.. versionadded:: 2.1
|
|
|
|
%End
|
2016-02-14 03:50:23 +01:00
|
|
|
|
2014-01-12 18:17:20 +01:00
|
|
|
virtual QColor fillColor() const;
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2018-05-26 18:44:30 +10:00
|
|
|
Gets fill color. Supported by marker and fill layers.
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-06-07 16:07:17 +02:00
|
|
|
.. versionadded:: 2.1
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
|
|
|
virtual QString layerType() const = 0;
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
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.
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual void startRender( QgsSymbolRenderContext &context ) = 0;
|
2019-10-15 11:04:45 +10:00
|
|
|
%Docstring
|
|
|
|
Called before a set of rendering operations commences on the supplied render ``context``.
|
|
|
|
|
|
|
|
This is always followed by a call to stopRender() after all rendering operations
|
|
|
|
have been completed.
|
|
|
|
|
|
|
|
Subclasses can use this method to prepare for a set of rendering operations, e.g. by
|
|
|
|
pre-evaluating paths or images to render, and performing other one-time optimisations.
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`startFeatureRender`
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`stopRender`
|
|
|
|
%End
|
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual void stopRender( QgsSymbolRenderContext &context ) = 0;
|
2019-10-15 11:04:45 +10:00
|
|
|
%Docstring
|
|
|
|
Called after a set of rendering operations has finished on the supplied render ``context``.
|
|
|
|
|
|
|
|
This is always preceded by a call to startRender() before all rendering operations
|
|
|
|
are commenced.
|
|
|
|
|
|
|
|
Subclasses can use this method to cleanup after a set of rendering operations.
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`startRender`
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`stopFeatureRender`
|
|
|
|
%End
|
|
|
|
|
|
|
|
virtual void startFeatureRender( const QgsFeature &feature, QgsRenderContext &context );
|
|
|
|
%Docstring
|
|
|
|
Called before the layer will be rendered for a particular ``feature``.
|
|
|
|
|
|
|
|
This is always followed by a call to stopFeatureRender() after the feature
|
|
|
|
has been completely rendered (i.e. all parts have been rendered).
|
|
|
|
|
|
|
|
The default implementation does nothing.
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
In some circumstances, startFeatureRender() and stopFeatureRender() may not be called
|
|
|
|
before a symbol layer is rendered. E.g., when a symbol layer is being rendered in isolation
|
|
|
|
and not as a result of rendering a feature (for instance, when rendering a legend patch or other
|
|
|
|
non-feature based shape).
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`stopFeatureRender`
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`startRender`
|
|
|
|
|
|
|
|
|
|
|
|
.. versionadded:: 3.12
|
|
|
|
%End
|
|
|
|
|
|
|
|
virtual void stopFeatureRender( const QgsFeature &feature, QgsRenderContext &context );
|
|
|
|
%Docstring
|
|
|
|
Called after the layer has been rendered for a particular ``feature``.
|
|
|
|
|
2019-10-28 11:58:04 +10:00
|
|
|
This is always preceded by a call to startFeatureRender() just before the feature
|
2019-10-15 11:04:45 +10:00
|
|
|
will be rendered.
|
|
|
|
|
|
|
|
The default implementation does nothing.
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
In some circumstances, startFeatureRender() and stopFeatureRender() may not be called
|
|
|
|
before a symbol layer is rendered. E.g., when a symbol layer is being rendered in isolation
|
|
|
|
and not as a result of rendering a feature (for instance, when rendering a legend patch or other
|
|
|
|
non-feature based shape).
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`startFeatureRender`
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`stopRender`
|
|
|
|
|
|
|
|
|
|
|
|
.. versionadded:: 3.12
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual QgsSymbolLayer *clone() const = 0 /Factory/;
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Shall be reimplemented by subclasses to create a deep copy of the instance.
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const;
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2013-06-23 16:00:16 +02:00
|
|
|
virtual QString ogrFeatureStyle( double mmScaleFactor, double mapUnitScaleFactor ) const;
|
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
virtual QgsStringMap properties() const = 0;
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
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.
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual void drawPreviewIcon( QgsSymbolRenderContext &context, QSize size ) = 0;
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual QgsSymbol *subSymbol();
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the symbol's sub symbol, if present.
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
2017-07-24 14:52:22 +10:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual bool setSubSymbol( QgsSymbol *symbol /Transfer/ );
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2018-05-25 13:54:27 +10:00
|
|
|
Sets layer's subsymbol. takes ownership of the passed symbol
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2016-08-05 08:09:43 +02:00
|
|
|
QgsSymbol::SymbolType type() const;
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual bool isCompatibleWithSymbol( QgsSymbol *symbol ) const;
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
|
|
|
Returns if the layer can be used below the specified symbol
|
|
|
|
%End
|
2016-01-04 22:51:18 +11:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
void setLocked( bool locked );
|
|
|
|
bool isLocked() const;
|
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual double estimateMaxBleed( const QgsRenderContext &context ) const;
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the estimated maximum distance which the layer style will bleed outside
|
2017-06-07 16:07:17 +02:00
|
|
|
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.*
|
|
|
|
%End
|
2014-01-26 18:35:21 +01:00
|
|
|
|
2016-07-17 22:11:17 +10:00
|
|
|
virtual void setOutputUnit( QgsUnitTypes::RenderUnit unit );
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets the units to use for sizes and widths within the symbol layer. 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.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param unit: output units
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`outputUnit`
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
2016-07-18 09:42:45 +10:00
|
|
|
|
2016-07-17 22:11:17 +10:00
|
|
|
virtual QgsUnitTypes::RenderUnit outputUnit() const;
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the units to use for sizes and widths within the symbol layer. 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.
|
|
|
|
|
|
|
|
:return: output unit, or QgsUnitTypes.RenderUnknownUnit if the symbol layer contains mixed units
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setOutputUnit`
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
2014-05-07 19:02:11 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual void setMapUnitScale( const QgsMapUnitScale &scale );
|
2014-04-06 21:14:02 +02:00
|
|
|
virtual QgsMapUnitScale mapUnitScale() const;
|
2013-04-19 15:20:44 +02:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
void setRenderingPass( int renderingPass );
|
2019-04-30 15:04:15 +02:00
|
|
|
%Docstring
|
|
|
|
Specifies the rendering pass in which this symbol layer should be rendered.
|
|
|
|
The lower the number, the lower the symbol will be rendered.
|
|
|
|
0: first pass, 1: second pass, ...
|
|
|
|
Defaults to 0
|
|
|
|
%End
|
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
int renderingPass() const;
|
2019-04-30 15:04:15 +02:00
|
|
|
%Docstring
|
|
|
|
Specifies the rendering pass in which this symbol layer should be rendered.
|
|
|
|
The lower the number, the lower the symbol will be rendered.
|
|
|
|
0: first pass, 1: second pass, ...
|
|
|
|
Defaults to 0
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual QSet<QString> usedAttributes( const QgsRenderContext &context ) const;
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the set of attributes referenced by the layer. This includes attributes
|
|
|
|
required by any data defined properties associated with the layer.
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
2015-05-06 18:23:07 +10:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual void setDataDefinedProperty( Property key, const QgsProperty &property );
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets a data defined property for the layer. Any existing property with the same key
|
|
|
|
will be overwritten.
|
|
|
|
|
2018-05-25 09:00:58 +10:00
|
|
|
.. seealso:: :py:func:`dataDefinedProperties`
|
2018-05-28 11:31:08 -04:00
|
|
|
|
2019-01-21 11:22:06 +10:00
|
|
|
.. seealso:: Property
|
|
|
|
|
2018-05-28 11:31:08 -04:00
|
|
|
.. versionadded:: 3.0
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
2014-01-26 18:35:21 +01:00
|
|
|
|
2016-08-05 08:09:43 +02:00
|
|
|
virtual bool writeDxf( QgsDxfExport &e, double mmMapUnitScaleFactor, const QString &layerName, QgsSymbolRenderContext &context, QPointF shift = QPointF( 0.0, 0.0 ) ) const;
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
|
|
|
write as DXF
|
|
|
|
%End
|
2014-01-26 18:35:21 +01:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual double dxfWidth( const QgsDxfExport &e, QgsSymbolRenderContext &context ) const;
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2018-05-26 18:44:30 +10:00
|
|
|
Gets line width
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual double dxfOffset( const QgsDxfExport &e, QgsSymbolRenderContext &context ) const;
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2018-05-26 18:44:30 +10:00
|
|
|
Gets offset
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
2014-01-26 18:35:21 +01:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual QColor dxfColor( QgsSymbolRenderContext &context ) const;
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2018-05-26 18:44:30 +10:00
|
|
|
Gets color
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual double dxfAngle( QgsSymbolRenderContext &context ) const;
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2018-05-26 18:44:30 +10:00
|
|
|
Gets angle
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
2014-01-26 18:35:21 +01:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual QVector<qreal> dxfCustomDashPattern( QgsUnitTypes::RenderUnit &unit ) const;
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2018-05-26 18:44:30 +10:00
|
|
|
Gets dash pattern
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
|
|
|
|
2014-01-26 18:35:21 +01:00
|
|
|
virtual Qt::PenStyle dxfPenStyle() const;
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2018-05-26 18:44:30 +10:00
|
|
|
Gets pen style
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual QColor dxfBrushColor( QgsSymbolRenderContext &context ) const;
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2018-05-26 18:44:30 +10:00
|
|
|
Gets brush/fill color
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
|
|
|
|
2014-11-21 01:17:21 +01:00
|
|
|
virtual Qt::BrushStyle dxfBrushStyle() const;
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2018-05-26 18:44:30 +10:00
|
|
|
Gets brush/fill style
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
2013-04-19 15:20:44 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
QgsPaintEffect *paintEffect() const;
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the current paint effect for the layer.
|
|
|
|
|
|
|
|
:return: paint effect
|
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`setPaintEffect`
|
2018-05-28 11:31:08 -04:00
|
|
|
|
|
|
|
.. versionadded:: 2.9
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
2015-03-28 20:03:37 +11:00
|
|
|
|
2017-06-07 16:07:17 +02:00
|
|
|
void setPaintEffect( QgsPaintEffect *effect /Transfer/ );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets the current paint effect for the layer.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param effect: paint effect. Ownership is transferred to the layer.
|
|
|
|
|
2017-12-05 20:04:14 -04:00
|
|
|
.. seealso:: :py:func:`paintEffect`
|
2018-05-28 11:31:08 -04:00
|
|
|
|
|
|
|
.. versionadded:: 2.9
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
2015-05-06 18:23:07 +10:00
|
|
|
|
2017-06-07 16:07:17 +02:00
|
|
|
virtual void prepareExpressions( const QgsSymbolRenderContext &context );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Prepares all data defined property expressions for evaluation. This should
|
|
|
|
be called prior to evaluating data defined properties.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param context: symbol render context
|
|
|
|
|
2017-06-07 16:07:17 +02:00
|
|
|
.. versionadded:: 2.12
|
|
|
|
%End
|
2016-10-17 15:44:19 +10:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
QgsPropertyCollection &dataDefinedProperties();
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns a reference to the symbol layer's property collection, used for data defined overrides.
|
|
|
|
|
2018-05-25 09:00:58 +10:00
|
|
|
.. seealso:: :py:func:`setDataDefinedProperties`
|
2018-05-28 11:31:08 -04:00
|
|
|
|
2019-01-21 11:22:06 +10:00
|
|
|
.. seealso:: Property
|
|
|
|
|
2018-05-28 11:31:08 -04:00
|
|
|
.. versionadded:: 3.0
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
|
|
|
|
2017-01-11 10:36:51 +10:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
void setDataDefinedProperties( const QgsPropertyCollection &collection );
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets the symbol layer's property collection, used for data defined overrides.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param collection: property collection. Existing properties will be replaced.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`properties`
|
2018-05-28 11:31:08 -04:00
|
|
|
|
|
|
|
.. versionadded:: 3.0
|
2019-01-22 13:29:00 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
virtual bool hasDataDefinedProperties() const;
|
|
|
|
%Docstring
|
2019-02-26 19:54:09 +10:00
|
|
|
Returns ``True`` if the symbol layer (or any of its sub-symbols) contains data defined properties.
|
2019-01-22 13:29:00 +10:00
|
|
|
|
|
|
|
.. versionadded:: 3.4.5
|
2019-11-07 08:17:25 +01:00
|
|
|
%End
|
|
|
|
|
|
|
|
virtual QgsSymbolLayerReferenceList masks() const;
|
|
|
|
%Docstring
|
|
|
|
Returns masks defined by this symbol layer.
|
|
|
|
This is a list of symbol layers of other layers that should be occluded.
|
|
|
|
|
|
|
|
.. versionadded:: 3.12
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
2017-01-11 10:36:51 +10:00
|
|
|
|
|
|
|
protected:
|
2017-06-07 16:07:17 +02:00
|
|
|
|
2017-01-11 10:36:51 +10:00
|
|
|
QgsSymbolLayer( QgsSymbol::SymbolType type, bool locked = false );
|
2015-05-06 18:23:07 +10:00
|
|
|
|
2017-06-07 16:07:17 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
void restoreOldDataDefinedProperties( const QgsStringMap &stringMap );
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Restores older data defined properties from string map.
|
|
|
|
|
2017-06-07 16:07:17 +02:00
|
|
|
.. versionadded:: 3.0
|
|
|
|
%End
|
2015-05-06 18:23:07 +10:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
void copyDataDefinedProperties( QgsSymbolLayer *destLayer ) const;
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Copies all data defined properties of this layer to another symbol layer.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param destLayer: destination layer
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
2015-05-06 18:23:07 +10:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
void copyPaintEffect( QgsSymbolLayer *destLayer ) const;
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Copies paint effect of this layer to another symbol layer
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param destLayer: destination layer
|
|
|
|
|
2017-06-07 16:07:17 +02:00
|
|
|
.. versionadded:: 2.9
|
|
|
|
%End
|
2015-03-28 20:03:37 +11:00
|
|
|
|
2019-07-24 08:27:09 +10:00
|
|
|
private:
|
|
|
|
QgsSymbolLayer( const QgsSymbolLayer &other );
|
2012-09-24 02:28:15 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2016-08-06 11:01:42 +02:00
|
|
|
class QgsMarkerSymbolLayer : QgsSymbolLayer
|
2012-09-24 02:28:15 +02:00
|
|
|
{
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2018-05-26 14:10:30 +10:00
|
|
|
Abstract base class for marker symbol layers.
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
%TypeHeaderCode
|
2017-06-07 16:07:17 +02:00
|
|
|
#include "qgssymbollayer.h"
|
2012-09-24 02:28:15 +02:00
|
|
|
%End
|
|
|
|
public:
|
2014-01-27 09:22:24 +01:00
|
|
|
|
2014-01-26 18:35:21 +01:00
|
|
|
enum HorizontalAnchorPoint
|
|
|
|
{
|
2017-06-07 16:07:17 +02:00
|
|
|
Left,
|
|
|
|
HCenter,
|
|
|
|
Right,
|
2014-01-26 18:35:21 +01:00
|
|
|
};
|
2014-01-27 09:22:24 +01:00
|
|
|
|
2014-01-26 18:35:21 +01:00
|
|
|
enum VerticalAnchorPoint
|
|
|
|
{
|
2017-06-07 16:07:17 +02:00
|
|
|
Top,
|
|
|
|
VCenter,
|
|
|
|
Bottom,
|
2014-01-26 18:35:21 +01:00
|
|
|
};
|
|
|
|
|
2019-07-24 08:27:09 +10:00
|
|
|
|
|
|
|
|
2017-06-07 16:07:17 +02:00
|
|
|
virtual void startRender( QgsSymbolRenderContext &context );
|
|
|
|
|
2019-07-24 08:27:09 +10:00
|
|
|
%Docstring
|
|
|
|
QgsMarkerSymbolLayer cannot be copied
|
|
|
|
%End
|
2014-01-26 18:35:21 +01:00
|
|
|
|
2018-12-01 16:03:10 +07:00
|
|
|
virtual void stopRender( QgsSymbolRenderContext &context );
|
|
|
|
|
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual void renderPoint( QPointF point, QgsSymbolRenderContext &context ) = 0;
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Renders a marker at the specified point. Derived classes must implement this to
|
|
|
|
handle drawing the point.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param point: position at which to render point, in painter units
|
|
|
|
:param context: symbol render context
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
virtual void drawPreviewIcon( QgsSymbolRenderContext &context, QSize size );
|
2012-09-24 02:28:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
void setAngle( double angle );
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets the rotation angle for the marker.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param angle: angle in degrees clockwise from north.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`angle`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setLineAngle`
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
2016-05-05 16:58:44 +10:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
double angle() const;
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the rotation angle for the marker, in degrees clockwise from north.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setAngle`
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
2015-05-24 18:48:22 +02:00
|
|
|
|
2015-05-15 15:53:05 +07:00
|
|
|
void setLineAngle( double lineAngle );
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets the line angle modification for the symbol's angle. This angle is added to
|
|
|
|
the marker's rotation and data defined rotation before rendering the symbol, and
|
|
|
|
is usually used for orienting symbols to match a line's angle.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param lineAngle: Angle in degrees clockwise from north, valid values are between 0 and 360
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setAngle`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`angle`
|
2018-05-28 11:31:08 -04:00
|
|
|
|
|
|
|
.. versionadded:: 2.9
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2019-05-08 10:40:38 +07:00
|
|
|
virtual void setSize( double size );
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets the symbol size.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param size: symbol size. Units are specified by sizeUnit().
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`size`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setSizeUnit`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setSizeMapUnitScale`
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
2016-05-05 16:58:44 +10:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
double size() const;
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the symbol size. Units are specified by sizeUnit().
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setSize`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`sizeUnit`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-05-25 09:00:58 +10:00
|
|
|
.. seealso:: :py:func:`sizeMapUnitScale`
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2016-07-17 22:11:17 +10:00
|
|
|
void setSizeUnit( QgsUnitTypes::RenderUnit unit );
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets the units for the symbol's size.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param unit: size units
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`sizeUnit`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setSize`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setSizeMapUnitScale`
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
2016-05-05 16:58:44 +10:00
|
|
|
|
2016-07-17 22:11:17 +10:00
|
|
|
QgsUnitTypes::RenderUnit sizeUnit() const;
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the units for the symbol's size.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setSizeUnit`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`size`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`sizeMapUnitScale`
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
void setSizeMapUnitScale( const QgsMapUnitScale &scale );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets the map unit scale for the symbol's size.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param scale: size map unit scale
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`sizeMapUnitScale`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setSize`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setSizeUnit`
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
2016-05-05 16:58:44 +10:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
const QgsMapUnitScale &sizeMapUnitScale() const;
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the map unit scale for the symbol's size.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setSizeMapUnitScale`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`size`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`sizeUnit`
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
2016-05-05 16:58:44 +10:00
|
|
|
|
2016-08-05 08:09:43 +02:00
|
|
|
void setScaleMethod( QgsSymbol::ScaleMethod scaleMethod );
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets the method to use for scaling the marker's size.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param scaleMethod: scale method
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`scaleMethod`
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
2016-05-05 16:58:44 +10:00
|
|
|
|
2016-08-05 08:09:43 +02:00
|
|
|
QgsSymbol::ScaleMethod scaleMethod() const;
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the method to use for scaling the marker's size.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setScaleMethod`
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
|
|
|
void setOffset( QPointF offset );
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets the marker's offset, which is the horizontal and vertical displacement which the rendered marker
|
|
|
|
should have from the original feature's geometry.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param offset: marker offset. Units are specified by offsetUnit()
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`offset`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setOffsetUnit`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setOffsetMapUnitScale`
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
QPointF offset() const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the marker's offset, which is the horizontal and vertical displacement which the rendered marker
|
|
|
|
will have from the original feature's geometry. Units are specified by offsetUnit().
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setOffset`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`offsetUnit`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`offsetMapUnitScale`
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2016-07-17 22:11:17 +10:00
|
|
|
void setOffsetUnit( QgsUnitTypes::RenderUnit unit );
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets the units for the symbol's offset.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param unit: offset units
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`offsetUnit`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setOffset`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setOffsetMapUnitScale`
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
2016-05-05 16:58:44 +10:00
|
|
|
|
2016-07-17 22:11:17 +10:00
|
|
|
QgsUnitTypes::RenderUnit offsetUnit() const;
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the units for the symbol's offset.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setOffsetUnit`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`offset`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`offsetMapUnitScale`
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
void setOffsetMapUnitScale( const QgsMapUnitScale &scale );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets the map unit scale for the symbol's offset.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param scale: offset map unit scale
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`offsetMapUnitScale`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setOffset`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setOffsetUnit`
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
2014-05-07 19:02:11 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
const QgsMapUnitScale &offsetMapUnitScale() const;
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the map unit scale for the symbol's offset.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setOffsetMapUnitScale`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`offset`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`offsetUnit`
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
2013-04-19 15:20:44 +02:00
|
|
|
|
2016-05-05 16:58:44 +10:00
|
|
|
void setHorizontalAnchorPoint( HorizontalAnchorPoint h );
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets the horizontal anchor point for positioning the symbol.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param h: anchor point. Symbol will be drawn so that the horizontal anchor point is aligned with
|
2018-05-24 21:21:14 +10:00
|
|
|
the marker's desired location.
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`horizontalAnchorPoint`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setVerticalAnchorPoint`
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
2014-05-07 19:02:11 +02:00
|
|
|
|
2016-05-05 16:58:44 +10:00
|
|
|
HorizontalAnchorPoint horizontalAnchorPoint() const;
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the horizontal anchor point for positioning the symbol. The symbol will be drawn so that
|
|
|
|
the horizontal anchor point is aligned with the marker's desired location.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setHorizontalAnchorPoint`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`verticalAnchorPoint`
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
2016-05-05 16:58:44 +10:00
|
|
|
|
|
|
|
void setVerticalAnchorPoint( VerticalAnchorPoint v );
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets the vertical anchor point for positioning the symbol.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param v: anchor point. Symbol will be drawn so that the vertical anchor point is aligned with
|
2018-05-24 21:21:14 +10:00
|
|
|
the marker's desired location.
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`verticalAnchorPoint`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setHorizontalAnchorPoint`
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
2016-05-05 16:58:44 +10:00
|
|
|
|
|
|
|
VerticalAnchorPoint verticalAnchorPoint() const;
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the vertical anchor point for positioning the symbol. The symbol will be drawn so that
|
|
|
|
the vertical anchor point is aligned with the marker's desired location.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setVerticalAnchorPoint`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`horizontalAnchorPoint`
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
2016-05-05 16:58:44 +10:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const;
|
2016-05-05 16:58:44 +10:00
|
|
|
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual void writeSldMarker( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const;
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Writes the symbol layer definition as a SLD XML element.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param doc: XML document
|
|
|
|
:param element: parent XML element
|
|
|
|
:param props: symbol layer definition (see properties())
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
virtual void setOutputUnit( QgsUnitTypes::RenderUnit unit );
|
2013-04-19 15:20:44 +02:00
|
|
|
|
2017-06-07 16:07:17 +02:00
|
|
|
virtual QgsUnitTypes::RenderUnit outputUnit() const;
|
|
|
|
|
|
|
|
virtual void setMapUnitScale( const QgsMapUnitScale &scale );
|
|
|
|
|
|
|
|
virtual QgsMapUnitScale mapUnitScale() const;
|
2014-05-07 19:02:11 +02:00
|
|
|
|
2013-04-19 15:20:44 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual QRectF bounds( QPointF point, QgsSymbolRenderContext &context ) = 0;
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the approximate bounding box of the marker symbol layer, taking into account
|
|
|
|
any data defined overrides and offsets which are set for the marker layer.
|
|
|
|
|
|
|
|
:return: approximate symbol bounds, in painter units
|
|
|
|
|
2017-06-07 16:07:17 +02:00
|
|
|
.. versionadded:: 2.14
|
|
|
|
%End
|
2015-11-20 19:16:15 +11:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
protected:
|
2016-05-05 16:58:44 +10:00
|
|
|
|
2016-08-06 11:01:42 +02:00
|
|
|
QgsMarkerSymbolLayer( bool locked = false );
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Constructor for QgsMarkerSymbolLayer.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2019-02-26 19:54:09 +10:00
|
|
|
:param locked: set to ``True`` to lock symbol color
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
2014-01-26 18:35:21 +01:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
void markerOffset( QgsSymbolRenderContext &context, double &offsetX, double &offsetY ) const;
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Calculates the required marker offset, including both the symbol offset
|
|
|
|
and any displacement required to align with the marker's anchor point.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param context: symbol render context
|
|
|
|
:param offsetX: will be set to required horizontal offset (in painter units)
|
|
|
|
:param offsetY: will be set to required vertical offset (in painter units)
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
2014-01-27 09:22:24 +01:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
void markerOffset( QgsSymbolRenderContext &context, double width, double height, double &offsetX, double &offsetY ) const /PyName=markerOffsetWithWidthAndHeight/;
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Calculates the required marker offset, including both the symbol offset
|
|
|
|
and any displacement required to align with the marker's anchor point.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param context: symbol render context
|
|
|
|
:param width: marker width
|
|
|
|
:param height: marker height
|
|
|
|
:param offsetX: will be set to required horizontal offset (in painter units)
|
|
|
|
:param offsetY: will be set to required vertical offset (in painter units)
|
|
|
|
|
2017-06-07 16:07:17 +02:00
|
|
|
.. note::
|
|
|
|
|
|
|
|
available in Python as markerOffsetWithWidthAndHeight
|
|
|
|
%End
|
2014-11-21 01:17:21 +01:00
|
|
|
|
2017-06-07 16:07:17 +02:00
|
|
|
void markerOffset( QgsSymbolRenderContext &context, double width, double height,
|
2016-07-17 22:11:17 +10:00
|
|
|
QgsUnitTypes::RenderUnit widthUnit, QgsUnitTypes::RenderUnit heightUnit,
|
2017-06-07 16:07:17 +02:00
|
|
|
double &offsetX, double &offsetY,
|
2014-05-07 19:02:11 +02:00
|
|
|
const QgsMapUnitScale &widthMapUnitScale, const QgsMapUnitScale &heightMapUnitScale ) const /PyName=markerOffset2/;
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-06-07 16:07:17 +02:00
|
|
|
.. note::
|
|
|
|
|
|
|
|
available in Python bindings as markerOffset2
|
|
|
|
%End
|
2014-01-27 09:22:24 +01:00
|
|
|
|
2016-02-02 19:46:18 +11:00
|
|
|
static QPointF _rotatedOffset( QPointF offset, double angle );
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Adjusts a marker offset to account for rotation.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param offset: offset prior to rotation
|
|
|
|
:param angle: rotation angle in degrees clockwise from north
|
|
|
|
|
|
|
|
:return: adjusted offset
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
|
2019-07-24 08:27:09 +10:00
|
|
|
private:
|
|
|
|
QgsMarkerSymbolLayer( const QgsMarkerSymbolLayer &other );
|
2012-09-24 02:28:15 +02:00
|
|
|
};
|
|
|
|
|
2016-08-06 11:01:42 +02:00
|
|
|
class QgsLineSymbolLayer : QgsSymbolLayer
|
2012-09-24 02:28:15 +02:00
|
|
|
{
|
2017-06-07 16:07:17 +02:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
%TypeHeaderCode
|
2017-06-07 16:07:17 +02:00
|
|
|
#include "qgssymbollayer.h"
|
2012-09-24 02:28:15 +02:00
|
|
|
%End
|
|
|
|
public:
|
2018-11-06 15:04:06 +10:00
|
|
|
|
|
|
|
enum RenderRingFilter
|
|
|
|
{
|
|
|
|
AllRings,
|
|
|
|
ExteriorRingOnly,
|
|
|
|
InteriorRingsOnly,
|
|
|
|
};
|
|
|
|
|
2019-07-24 08:27:09 +10:00
|
|
|
|
|
|
|
|
[FEATURE] New line symbol type: Hash line
This line symbol type is designed to replicate the ArcGIS Hash Line
symbol layer type. It allows for a repeating line segment to be
drawn over the length of a feature, with a line-sub symbol used
to render each individual segment.
To reduce code duplication, this is heavily based off the current
line marker symbol layer, since the functionality is almost
identical (draw some sub symbol at some interval along a line).
Accordingly, I've split off QgsMarkerLineSymbolLayer to move
as much of the common functionality as possible to a new abstract
base class, so that only the actual marker/line segment rendering
occurs in the marker line/hash line subclasses.
This also gives the hash line all the existing placement options
permissible for marker lines -- e.g. first/last vertex, mid points,
regular intervals, etc.
The hash line length and angle can have data defined overrides,
which are evaluated per-line segment, allowing for the hash line
to change size and angle over the length of a single rendered
feature.
2019-03-19 17:08:15 +10:00
|
|
|
virtual void setOutputUnit( QgsUnitTypes::RenderUnit unit );
|
|
|
|
|
2019-07-24 08:27:09 +10:00
|
|
|
%Docstring
|
|
|
|
QgsLineSymbolLayer cannot be copied
|
|
|
|
%End
|
[FEATURE] New line symbol type: Hash line
This line symbol type is designed to replicate the ArcGIS Hash Line
symbol layer type. It allows for a repeating line segment to be
drawn over the length of a feature, with a line-sub symbol used
to render each individual segment.
To reduce code duplication, this is heavily based off the current
line marker symbol layer, since the functionality is almost
identical (draw some sub symbol at some interval along a line).
Accordingly, I've split off QgsMarkerLineSymbolLayer to move
as much of the common functionality as possible to a new abstract
base class, so that only the actual marker/line segment rendering
occurs in the marker line/hash line subclasses.
This also gives the hash line all the existing placement options
permissible for marker lines -- e.g. first/last vertex, mid points,
regular intervals, etc.
The hash line length and angle can have data defined overrides,
which are evaluated per-line segment, allowing for the hash line
to change size and angle over the length of a single rendered
feature.
2019-03-19 17:08:15 +10:00
|
|
|
virtual QgsUnitTypes::RenderUnit outputUnit() const;
|
|
|
|
|
|
|
|
virtual void setMapUnitScale( const QgsMapUnitScale &scale );
|
|
|
|
|
|
|
|
virtual QgsMapUnitScale mapUnitScale() const;
|
|
|
|
|
|
|
|
virtual void drawPreviewIcon( QgsSymbolRenderContext &context, QSize size );
|
|
|
|
|
|
|
|
virtual double dxfWidth( const QgsDxfExport &e, QgsSymbolRenderContext &context ) const;
|
|
|
|
|
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual void renderPolyline( const QPolygonF &points, QgsSymbolRenderContext &context ) = 0;
|
[FEATURE] New line symbol type: Hash line
This line symbol type is designed to replicate the ArcGIS Hash Line
symbol layer type. It allows for a repeating line segment to be
drawn over the length of a feature, with a line-sub symbol used
to render each individual segment.
To reduce code duplication, this is heavily based off the current
line marker symbol layer, since the functionality is almost
identical (draw some sub symbol at some interval along a line).
Accordingly, I've split off QgsMarkerLineSymbolLayer to move
as much of the common functionality as possible to a new abstract
base class, so that only the actual marker/line segment rendering
occurs in the marker line/hash line subclasses.
This also gives the hash line all the existing placement options
permissible for marker lines -- e.g. first/last vertex, mid points,
regular intervals, etc.
The hash line length and angle can have data defined overrides,
which are evaluated per-line segment, allowing for the hash line
to change size and angle over the length of a single rendered
feature.
2019-03-19 17:08:15 +10:00
|
|
|
%Docstring
|
|
|
|
Renders the line symbol layer along the line joining ``points``, using the given render ``context``.
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`renderPolygonStroke`
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual void renderPolygonStroke( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context );
|
[FEATURE] New line symbol type: Hash line
This line symbol type is designed to replicate the ArcGIS Hash Line
symbol layer type. It allows for a repeating line segment to be
drawn over the length of a feature, with a line-sub symbol used
to render each individual segment.
To reduce code duplication, this is heavily based off the current
line marker symbol layer, since the functionality is almost
identical (draw some sub symbol at some interval along a line).
Accordingly, I've split off QgsMarkerLineSymbolLayer to move
as much of the common functionality as possible to a new abstract
base class, so that only the actual marker/line segment rendering
occurs in the marker line/hash line subclasses.
This also gives the hash line all the existing placement options
permissible for marker lines -- e.g. first/last vertex, mid points,
regular intervals, etc.
The hash line length and angle can have data defined overrides,
which are evaluated per-line segment, allowing for the hash line
to change size and angle over the length of a single rendered
feature.
2019-03-19 17:08:15 +10:00
|
|
|
%Docstring
|
|
|
|
Renders the line symbol layer along the outline of polygon, using the given render ``context``.
|
|
|
|
|
|
|
|
The exterior ring of the polygon is specified in ``points``. Optionally, interior
|
2019-03-28 16:12:03 +10:00
|
|
|
rings are set via the ``rings`` argument.
|
[FEATURE] New line symbol type: Hash line
This line symbol type is designed to replicate the ArcGIS Hash Line
symbol layer type. It allows for a repeating line segment to be
drawn over the length of a feature, with a line-sub symbol used
to render each individual segment.
To reduce code duplication, this is heavily based off the current
line marker symbol layer, since the functionality is almost
identical (draw some sub symbol at some interval along a line).
Accordingly, I've split off QgsMarkerLineSymbolLayer to move
as much of the common functionality as possible to a new abstract
base class, so that only the actual marker/line segment rendering
occurs in the marker line/hash line subclasses.
This also gives the hash line all the existing placement options
permissible for marker lines -- e.g. first/last vertex, mid points,
regular intervals, etc.
The hash line length and angle can have data defined overrides,
which are evaluated per-line segment, allowing for the hash line
to change size and angle over the length of a single rendered
feature.
2019-03-19 17:08:15 +10:00
|
|
|
|
|
|
|
.. seealso:: :py:func:`renderPolyline`
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
|
|
|
virtual void setWidth( double width );
|
[FEATURE] New line symbol type: Hash line
This line symbol type is designed to replicate the ArcGIS Hash Line
symbol layer type. It allows for a repeating line segment to be
drawn over the length of a feature, with a line-sub symbol used
to render each individual segment.
To reduce code duplication, this is heavily based off the current
line marker symbol layer, since the functionality is almost
identical (draw some sub symbol at some interval along a line).
Accordingly, I've split off QgsMarkerLineSymbolLayer to move
as much of the common functionality as possible to a new abstract
base class, so that only the actual marker/line segment rendering
occurs in the marker line/hash line subclasses.
This also gives the hash line all the existing placement options
permissible for marker lines -- e.g. first/last vertex, mid points,
regular intervals, etc.
The hash line length and angle can have data defined overrides,
which are evaluated per-line segment, allowing for the hash line
to change size and angle over the length of a single rendered
feature.
2019-03-19 17:08:15 +10:00
|
|
|
%Docstring
|
|
|
|
Sets the ``width`` of the line symbol layer.
|
|
|
|
|
|
|
|
Calling this method updates the width of the line symbol layer, without
|
|
|
|
changing the existing width units. It has different effects depending
|
|
|
|
on the line symbol layer subclass, e.g. for a simple line layer it
|
|
|
|
changes the stroke width of the line, for a marker line layer it
|
|
|
|
changes the size of the markers used to draw the line.
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`width`
|
|
|
|
|
|
|
|
.. warning::
|
|
|
|
|
|
|
|
Since the width units vary, this method is useful for changing the
|
|
|
|
relative width of a line symbol layer only.
|
|
|
|
%End
|
2019-02-04 10:48:41 +10:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
virtual double width() const;
|
2019-02-04 10:48:41 +10:00
|
|
|
%Docstring
|
|
|
|
Returns the estimated width for the line symbol layer.
|
|
|
|
|
|
|
|
.. warning::
|
|
|
|
|
|
|
|
This returned value is inaccurate if the symbol layer has sub-symbols with
|
|
|
|
different width units. Use the overload accepting a :py:class:`QgsRenderContext`
|
|
|
|
argument instead for accurate sizes in this case.
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`setWidth`
|
|
|
|
%End
|
|
|
|
|
|
|
|
virtual double width( const QgsRenderContext &context ) const;
|
|
|
|
%Docstring
|
|
|
|
Returns the line symbol layer width, in painter units.
|
|
|
|
|
|
|
|
This method returns an accurate width by calculating the actual rendered
|
|
|
|
width of the symbol layer using the provided render ``context``.
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`setWidth`
|
|
|
|
|
|
|
|
.. versionadded:: 3.4.5
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2015-01-23 09:08:51 +01:00
|
|
|
double offset() const;
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
[FEATURE] New line symbol type: Hash line
This line symbol type is designed to replicate the ArcGIS Hash Line
symbol layer type. It allows for a repeating line segment to be
drawn over the length of a feature, with a line-sub symbol used
to render each individual segment.
To reduce code duplication, this is heavily based off the current
line marker symbol layer, since the functionality is almost
identical (draw some sub symbol at some interval along a line).
Accordingly, I've split off QgsMarkerLineSymbolLayer to move
as much of the common functionality as possible to a new abstract
base class, so that only the actual marker/line segment rendering
occurs in the marker line/hash line subclasses.
This also gives the hash line all the existing placement options
permissible for marker lines -- e.g. first/last vertex, mid points,
regular intervals, etc.
The hash line length and angle can have data defined overrides,
which are evaluated per-line segment, allowing for the hash line
to change size and angle over the length of a single rendered
feature.
2019-03-19 17:08:15 +10:00
|
|
|
Returns the line's offset.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
[FEATURE] New line symbol type: Hash line
This line symbol type is designed to replicate the ArcGIS Hash Line
symbol layer type. It allows for a repeating line segment to be
drawn over the length of a feature, with a line-sub symbol used
to render each individual segment.
To reduce code duplication, this is heavily based off the current
line marker symbol layer, since the functionality is almost
identical (draw some sub symbol at some interval along a line).
Accordingly, I've split off QgsMarkerLineSymbolLayer to move
as much of the common functionality as possible to a new abstract
base class, so that only the actual marker/line segment rendering
occurs in the marker line/hash line subclasses.
This also gives the hash line all the existing placement options
permissible for marker lines -- e.g. first/last vertex, mid points,
regular intervals, etc.
The hash line length and angle can have data defined overrides,
which are evaluated per-line segment, allowing for the hash line
to change size and angle over the length of a single rendered
feature.
2019-03-19 17:08:15 +10:00
|
|
|
Offset units can be retrieved by calling offsetUnit().
|
2017-12-15 10:36:55 -04:00
|
|
|
|
[FEATURE] New line symbol type: Hash line
This line symbol type is designed to replicate the ArcGIS Hash Line
symbol layer type. It allows for a repeating line segment to be
drawn over the length of a feature, with a line-sub symbol used
to render each individual segment.
To reduce code duplication, this is heavily based off the current
line marker symbol layer, since the functionality is almost
identical (draw some sub symbol at some interval along a line).
Accordingly, I've split off QgsMarkerLineSymbolLayer to move
as much of the common functionality as possible to a new abstract
base class, so that only the actual marker/line segment rendering
occurs in the marker line/hash line subclasses.
This also gives the hash line all the existing placement options
permissible for marker lines -- e.g. first/last vertex, mid points,
regular intervals, etc.
The hash line length and angle can have data defined overrides,
which are evaluated per-line segment, allowing for the hash line
to change size and angle over the length of a single rendered
feature.
2019-03-19 17:08:15 +10:00
|
|
|
.. seealso:: :py:func:`setOffset`
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`offsetUnit`
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`offsetMapUnitScale`
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
2016-07-18 09:42:45 +10:00
|
|
|
|
[FEATURE] New line symbol type: Hash line
This line symbol type is designed to replicate the ArcGIS Hash Line
symbol layer type. It allows for a repeating line segment to be
drawn over the length of a feature, with a line-sub symbol used
to render each individual segment.
To reduce code duplication, this is heavily based off the current
line marker symbol layer, since the functionality is almost
identical (draw some sub symbol at some interval along a line).
Accordingly, I've split off QgsMarkerLineSymbolLayer to move
as much of the common functionality as possible to a new abstract
base class, so that only the actual marker/line segment rendering
occurs in the marker line/hash line subclasses.
This also gives the hash line all the existing placement options
permissible for marker lines -- e.g. first/last vertex, mid points,
regular intervals, etc.
The hash line length and angle can have data defined overrides,
which are evaluated per-line segment, allowing for the hash line
to change size and angle over the length of a single rendered
feature.
2019-03-19 17:08:15 +10:00
|
|
|
void setOffset( double offset );
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
[FEATURE] New line symbol type: Hash line
This line symbol type is designed to replicate the ArcGIS Hash Line
symbol layer type. It allows for a repeating line segment to be
drawn over the length of a feature, with a line-sub symbol used
to render each individual segment.
To reduce code duplication, this is heavily based off the current
line marker symbol layer, since the functionality is almost
identical (draw some sub symbol at some interval along a line).
Accordingly, I've split off QgsMarkerLineSymbolLayer to move
as much of the common functionality as possible to a new abstract
base class, so that only the actual marker/line segment rendering
occurs in the marker line/hash line subclasses.
This also gives the hash line all the existing placement options
permissible for marker lines -- e.g. first/last vertex, mid points,
regular intervals, etc.
The hash line length and angle can have data defined overrides,
which are evaluated per-line segment, allowing for the hash line
to change size and angle over the length of a single rendered
feature.
2019-03-19 17:08:15 +10:00
|
|
|
Sets the line's ``offset``.
|
2017-12-15 10:36:55 -04:00
|
|
|
|
[FEATURE] New line symbol type: Hash line
This line symbol type is designed to replicate the ArcGIS Hash Line
symbol layer type. It allows for a repeating line segment to be
drawn over the length of a feature, with a line-sub symbol used
to render each individual segment.
To reduce code duplication, this is heavily based off the current
line marker symbol layer, since the functionality is almost
identical (draw some sub symbol at some interval along a line).
Accordingly, I've split off QgsMarkerLineSymbolLayer to move
as much of the common functionality as possible to a new abstract
base class, so that only the actual marker/line segment rendering
occurs in the marker line/hash line subclasses.
This also gives the hash line all the existing placement options
permissible for marker lines -- e.g. first/last vertex, mid points,
regular intervals, etc.
The hash line length and angle can have data defined overrides,
which are evaluated per-line segment, allowing for the hash line
to change size and angle over the length of a single rendered
feature.
2019-03-19 17:08:15 +10:00
|
|
|
Offset units are set via setOffsetUnit().
|
2014-05-07 19:02:11 +02:00
|
|
|
|
[FEATURE] New line symbol type: Hash line
This line symbol type is designed to replicate the ArcGIS Hash Line
symbol layer type. It allows for a repeating line segment to be
drawn over the length of a feature, with a line-sub symbol used
to render each individual segment.
To reduce code duplication, this is heavily based off the current
line marker symbol layer, since the functionality is almost
identical (draw some sub symbol at some interval along a line).
Accordingly, I've split off QgsMarkerLineSymbolLayer to move
as much of the common functionality as possible to a new abstract
base class, so that only the actual marker/line segment rendering
occurs in the marker line/hash line subclasses.
This also gives the hash line all the existing placement options
permissible for marker lines -- e.g. first/last vertex, mid points,
regular intervals, etc.
The hash line length and angle can have data defined overrides,
which are evaluated per-line segment, allowing for the hash line
to change size and angle over the length of a single rendered
feature.
2019-03-19 17:08:15 +10:00
|
|
|
.. seealso:: :py:func:`offset`
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`setOffsetUnit`
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`setOffsetMapUnitScale`
|
|
|
|
%End
|
2013-04-19 15:20:44 +02:00
|
|
|
|
2016-07-17 22:11:17 +10:00
|
|
|
void setOffsetUnit( QgsUnitTypes::RenderUnit unit );
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
[FEATURE] New line symbol type: Hash line
This line symbol type is designed to replicate the ArcGIS Hash Line
symbol layer type. It allows for a repeating line segment to be
drawn over the length of a feature, with a line-sub symbol used
to render each individual segment.
To reduce code duplication, this is heavily based off the current
line marker symbol layer, since the functionality is almost
identical (draw some sub symbol at some interval along a line).
Accordingly, I've split off QgsMarkerLineSymbolLayer to move
as much of the common functionality as possible to a new abstract
base class, so that only the actual marker/line segment rendering
occurs in the marker line/hash line subclasses.
This also gives the hash line all the existing placement options
permissible for marker lines -- e.g. first/last vertex, mid points,
regular intervals, etc.
The hash line length and angle can have data defined overrides,
which are evaluated per-line segment, allowing for the hash line
to change size and angle over the length of a single rendered
feature.
2019-03-19 17:08:15 +10:00
|
|
|
Sets the ``unit`` for the line's offset.
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`offsetUnit`
|
[FEATURE] New line symbol type: Hash line
This line symbol type is designed to replicate the ArcGIS Hash Line
symbol layer type. It allows for a repeating line segment to be
drawn over the length of a feature, with a line-sub symbol used
to render each individual segment.
To reduce code duplication, this is heavily based off the current
line marker symbol layer, since the functionality is almost
identical (draw some sub symbol at some interval along a line).
Accordingly, I've split off QgsMarkerLineSymbolLayer to move
as much of the common functionality as possible to a new abstract
base class, so that only the actual marker/line segment rendering
occurs in the marker line/hash line subclasses.
This also gives the hash line all the existing placement options
permissible for marker lines -- e.g. first/last vertex, mid points,
regular intervals, etc.
The hash line length and angle can have data defined overrides,
which are evaluated per-line segment, allowing for the hash line
to change size and angle over the length of a single rendered
feature.
2019-03-19 17:08:15 +10:00
|
|
|
|
|
|
|
.. seealso:: :py:func:`setOffset`
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`setOffsetMapUnitScale`
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
2016-07-18 09:42:45 +10:00
|
|
|
|
2016-07-17 22:11:17 +10:00
|
|
|
QgsUnitTypes::RenderUnit offsetUnit() const;
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the units for the line's offset.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setOffsetUnit`
|
[FEATURE] New line symbol type: Hash line
This line symbol type is designed to replicate the ArcGIS Hash Line
symbol layer type. It allows for a repeating line segment to be
drawn over the length of a feature, with a line-sub symbol used
to render each individual segment.
To reduce code duplication, this is heavily based off the current
line marker symbol layer, since the functionality is almost
identical (draw some sub symbol at some interval along a line).
Accordingly, I've split off QgsMarkerLineSymbolLayer to move
as much of the common functionality as possible to a new abstract
base class, so that only the actual marker/line segment rendering
occurs in the marker line/hash line subclasses.
This also gives the hash line all the existing placement options
permissible for marker lines -- e.g. first/last vertex, mid points,
regular intervals, etc.
The hash line length and angle can have data defined overrides,
which are evaluated per-line segment, allowing for the hash line
to change size and angle over the length of a single rendered
feature.
2019-03-19 17:08:15 +10:00
|
|
|
|
|
|
|
.. seealso:: :py:func:`offset`
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`offsetMapUnitScale`
|
2017-06-07 16:07:17 +02:00
|
|
|
%End
|
2015-01-23 09:08:51 +01:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
void setOffsetMapUnitScale( const QgsMapUnitScale &scale );
|
[FEATURE] New line symbol type: Hash line
This line symbol type is designed to replicate the ArcGIS Hash Line
symbol layer type. It allows for a repeating line segment to be
drawn over the length of a feature, with a line-sub symbol used
to render each individual segment.
To reduce code duplication, this is heavily based off the current
line marker symbol layer, since the functionality is almost
identical (draw some sub symbol at some interval along a line).
Accordingly, I've split off QgsMarkerLineSymbolLayer to move
as much of the common functionality as possible to a new abstract
base class, so that only the actual marker/line segment rendering
occurs in the marker line/hash line subclasses.
This also gives the hash line all the existing placement options
permissible for marker lines -- e.g. first/last vertex, mid points,
regular intervals, etc.
The hash line length and angle can have data defined overrides,
which are evaluated per-line segment, allowing for the hash line
to change size and angle over the length of a single rendered
feature.
2019-03-19 17:08:15 +10:00
|
|
|
%Docstring
|
|
|
|
Sets the map unit ``scale`` for the line's offset.
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`offsetMapUnitScale`
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`setOffset`
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`setOffsetUnit`
|
|
|
|
%End
|
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
const QgsMapUnitScale &offsetMapUnitScale() const;
|
[FEATURE] New line symbol type: Hash line
This line symbol type is designed to replicate the ArcGIS Hash Line
symbol layer type. It allows for a repeating line segment to be
drawn over the length of a feature, with a line-sub symbol used
to render each individual segment.
To reduce code duplication, this is heavily based off the current
line marker symbol layer, since the functionality is almost
identical (draw some sub symbol at some interval along a line).
Accordingly, I've split off QgsMarkerLineSymbolLayer to move
as much of the common functionality as possible to a new abstract
base class, so that only the actual marker/line segment rendering
occurs in the marker line/hash line subclasses.
This also gives the hash line all the existing placement options
permissible for marker lines -- e.g. first/last vertex, mid points,
regular intervals, etc.
The hash line length and angle can have data defined overrides,
which are evaluated per-line segment, allowing for the hash line
to change size and angle over the length of a single rendered
feature.
2019-03-19 17:08:15 +10:00
|
|
|
%Docstring
|
|
|
|
Returns the map unit scale for the line's offset.
|
2017-06-07 16:07:17 +02:00
|
|
|
|
[FEATURE] New line symbol type: Hash line
This line symbol type is designed to replicate the ArcGIS Hash Line
symbol layer type. It allows for a repeating line segment to be
drawn over the length of a feature, with a line-sub symbol used
to render each individual segment.
To reduce code duplication, this is heavily based off the current
line marker symbol layer, since the functionality is almost
identical (draw some sub symbol at some interval along a line).
Accordingly, I've split off QgsMarkerLineSymbolLayer to move
as much of the common functionality as possible to a new abstract
base class, so that only the actual marker/line segment rendering
occurs in the marker line/hash line subclasses.
This also gives the hash line all the existing placement options
permissible for marker lines -- e.g. first/last vertex, mid points,
regular intervals, etc.
The hash line length and angle can have data defined overrides,
which are evaluated per-line segment, allowing for the hash line
to change size and angle over the length of a single rendered
feature.
2019-03-19 17:08:15 +10:00
|
|
|
.. seealso:: :py:func:`setOffsetMapUnitScale`
|
2017-06-07 16:07:17 +02:00
|
|
|
|
[FEATURE] New line symbol type: Hash line
This line symbol type is designed to replicate the ArcGIS Hash Line
symbol layer type. It allows for a repeating line segment to be
drawn over the length of a feature, with a line-sub symbol used
to render each individual segment.
To reduce code duplication, this is heavily based off the current
line marker symbol layer, since the functionality is almost
identical (draw some sub symbol at some interval along a line).
Accordingly, I've split off QgsMarkerLineSymbolLayer to move
as much of the common functionality as possible to a new abstract
base class, so that only the actual marker/line segment rendering
occurs in the marker line/hash line subclasses.
This also gives the hash line all the existing placement options
permissible for marker lines -- e.g. first/last vertex, mid points,
regular intervals, etc.
The hash line length and angle can have data defined overrides,
which are evaluated per-line segment, allowing for the hash line
to change size and angle over the length of a single rendered
feature.
2019-03-19 17:08:15 +10:00
|
|
|
.. seealso:: :py:func:`offset`
|
2017-06-07 16:07:17 +02:00
|
|
|
|
[FEATURE] New line symbol type: Hash line
This line symbol type is designed to replicate the ArcGIS Hash Line
symbol layer type. It allows for a repeating line segment to be
drawn over the length of a feature, with a line-sub symbol used
to render each individual segment.
To reduce code duplication, this is heavily based off the current
line marker symbol layer, since the functionality is almost
identical (draw some sub symbol at some interval along a line).
Accordingly, I've split off QgsMarkerLineSymbolLayer to move
as much of the common functionality as possible to a new abstract
base class, so that only the actual marker/line segment rendering
occurs in the marker line/hash line subclasses.
This also gives the hash line all the existing placement options
permissible for marker lines -- e.g. first/last vertex, mid points,
regular intervals, etc.
The hash line length and angle can have data defined overrides,
which are evaluated per-line segment, allowing for the hash line
to change size and angle over the length of a single rendered
feature.
2019-03-19 17:08:15 +10:00
|
|
|
.. seealso:: :py:func:`offsetUnit`
|
|
|
|
%End
|
2015-01-23 09:08:51 +01:00
|
|
|
|
2017-06-07 16:07:17 +02:00
|
|
|
|
[FEATURE] New line symbol type: Hash line
This line symbol type is designed to replicate the ArcGIS Hash Line
symbol layer type. It allows for a repeating line segment to be
drawn over the length of a feature, with a line-sub symbol used
to render each individual segment.
To reduce code duplication, this is heavily based off the current
line marker symbol layer, since the functionality is almost
identical (draw some sub symbol at some interval along a line).
Accordingly, I've split off QgsMarkerLineSymbolLayer to move
as much of the common functionality as possible to a new abstract
base class, so that only the actual marker/line segment rendering
occurs in the marker line/hash line subclasses.
This also gives the hash line all the existing placement options
permissible for marker lines -- e.g. first/last vertex, mid points,
regular intervals, etc.
The hash line length and angle can have data defined overrides,
which are evaluated per-line segment, allowing for the hash line
to change size and angle over the length of a single rendered
feature.
2019-03-19 17:08:15 +10:00
|
|
|
void setWidthUnit( QgsUnitTypes::RenderUnit unit );
|
|
|
|
%Docstring
|
|
|
|
Sets the units for the line's width.
|
2014-05-07 19:02:11 +02:00
|
|
|
|
[FEATURE] New line symbol type: Hash line
This line symbol type is designed to replicate the ArcGIS Hash Line
symbol layer type. It allows for a repeating line segment to be
drawn over the length of a feature, with a line-sub symbol used
to render each individual segment.
To reduce code duplication, this is heavily based off the current
line marker symbol layer, since the functionality is almost
identical (draw some sub symbol at some interval along a line).
Accordingly, I've split off QgsMarkerLineSymbolLayer to move
as much of the common functionality as possible to a new abstract
base class, so that only the actual marker/line segment rendering
occurs in the marker line/hash line subclasses.
This also gives the hash line all the existing placement options
permissible for marker lines -- e.g. first/last vertex, mid points,
regular intervals, etc.
The hash line length and angle can have data defined overrides,
which are evaluated per-line segment, allowing for the hash line
to change size and angle over the length of a single rendered
feature.
2019-03-19 17:08:15 +10:00
|
|
|
:param unit: width units
|
2014-05-07 19:02:11 +02:00
|
|
|
|
[FEATURE] New line symbol type: Hash line
This line symbol type is designed to replicate the ArcGIS Hash Line
symbol layer type. It allows for a repeating line segment to be
drawn over the length of a feature, with a line-sub symbol used
to render each individual segment.
To reduce code duplication, this is heavily based off the current
line marker symbol layer, since the functionality is almost
identical (draw some sub symbol at some interval along a line).
Accordingly, I've split off QgsMarkerLineSymbolLayer to move
as much of the common functionality as possible to a new abstract
base class, so that only the actual marker/line segment rendering
occurs in the marker line/hash line subclasses.
This also gives the hash line all the existing placement options
permissible for marker lines -- e.g. first/last vertex, mid points,
regular intervals, etc.
The hash line length and angle can have data defined overrides,
which are evaluated per-line segment, allowing for the hash line
to change size and angle over the length of a single rendered
feature.
2019-03-19 17:08:15 +10:00
|
|
|
.. seealso:: :py:func:`widthUnit`
|
|
|
|
%End
|
2017-06-07 16:07:17 +02:00
|
|
|
|
[FEATURE] New line symbol type: Hash line
This line symbol type is designed to replicate the ArcGIS Hash Line
symbol layer type. It allows for a repeating line segment to be
drawn over the length of a feature, with a line-sub symbol used
to render each individual segment.
To reduce code duplication, this is heavily based off the current
line marker symbol layer, since the functionality is almost
identical (draw some sub symbol at some interval along a line).
Accordingly, I've split off QgsMarkerLineSymbolLayer to move
as much of the common functionality as possible to a new abstract
base class, so that only the actual marker/line segment rendering
occurs in the marker line/hash line subclasses.
This also gives the hash line all the existing placement options
permissible for marker lines -- e.g. first/last vertex, mid points,
regular intervals, etc.
The hash line length and angle can have data defined overrides,
which are evaluated per-line segment, allowing for the hash line
to change size and angle over the length of a single rendered
feature.
2019-03-19 17:08:15 +10:00
|
|
|
QgsUnitTypes::RenderUnit widthUnit() const;
|
|
|
|
%Docstring
|
|
|
|
Returns the units for the line's width.
|
2012-09-24 02:28:15 +02:00
|
|
|
|
[FEATURE] New line symbol type: Hash line
This line symbol type is designed to replicate the ArcGIS Hash Line
symbol layer type. It allows for a repeating line segment to be
drawn over the length of a feature, with a line-sub symbol used
to render each individual segment.
To reduce code duplication, this is heavily based off the current
line marker symbol layer, since the functionality is almost
identical (draw some sub symbol at some interval along a line).
Accordingly, I've split off QgsMarkerLineSymbolLayer to move
as much of the common functionality as possible to a new abstract
base class, so that only the actual marker/line segment rendering
occurs in the marker line/hash line subclasses.
This also gives the hash line all the existing placement options
permissible for marker lines -- e.g. first/last vertex, mid points,
regular intervals, etc.
The hash line length and angle can have data defined overrides,
which are evaluated per-line segment, allowing for the hash line
to change size and angle over the length of a single rendered
feature.
2019-03-19 17:08:15 +10:00
|
|
|
.. seealso:: :py:func:`setWidthUnit`
|
|
|
|
%End
|
2014-01-27 09:22:24 +01:00
|
|
|
|
[FEATURE] New line symbol type: Hash line
This line symbol type is designed to replicate the ArcGIS Hash Line
symbol layer type. It allows for a repeating line segment to be
drawn over the length of a feature, with a line-sub symbol used
to render each individual segment.
To reduce code duplication, this is heavily based off the current
line marker symbol layer, since the functionality is almost
identical (draw some sub symbol at some interval along a line).
Accordingly, I've split off QgsMarkerLineSymbolLayer to move
as much of the common functionality as possible to a new abstract
base class, so that only the actual marker/line segment rendering
occurs in the marker line/hash line subclasses.
This also gives the hash line all the existing placement options
permissible for marker lines -- e.g. first/last vertex, mid points,
regular intervals, etc.
The hash line length and angle can have data defined overrides,
which are evaluated per-line segment, allowing for the hash line
to change size and angle over the length of a single rendered
feature.
2019-03-19 17:08:15 +10:00
|
|
|
void setWidthMapUnitScale( const QgsMapUnitScale &scale );
|
|
|
|
const QgsMapUnitScale &widthMapUnitScale() const;
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2018-11-06 15:04:06 +10:00
|
|
|
RenderRingFilter ringFilter() const;
|
|
|
|
%Docstring
|
|
|
|
Returns the line symbol layer's ring filter, which controls which rings are
|
|
|
|
rendered when the line symbol is being used to draw a polygon's rings.
|
|
|
|
|
|
|
|
This setting has no effect when the line symbol is not being rendered
|
|
|
|
for a polygon.
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`setRingFilter`
|
|
|
|
|
|
|
|
.. versionadded:: 3.6
|
|
|
|
%End
|
|
|
|
|
|
|
|
void setRingFilter( QgsLineSymbolLayer::RenderRingFilter filter );
|
|
|
|
%Docstring
|
|
|
|
Sets the line symbol layer's ring ``filter``, which controls which rings are
|
|
|
|
rendered when the line symbol is being used to draw a polygon's rings.
|
|
|
|
|
|
|
|
This setting has no effect when the line symbol is not being rendered
|
|
|
|
for a polygon.
|
|
|
|
|
|
|
|
.. seealso:: :py:func:`ringFilter`
|
|
|
|
|
|
|
|
.. versionadded:: 3.6
|
|
|
|
%End
|
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
protected:
|
2016-08-06 11:01:42 +02:00
|
|
|
QgsLineSymbolLayer( bool locked = false );
|
2017-06-07 16:07:17 +02:00
|
|
|
|
2018-11-06 15:04:06 +10:00
|
|
|
|
2019-07-24 08:27:09 +10:00
|
|
|
|
|
|
|
private:
|
|
|
|
QgsLineSymbolLayer( const QgsLineSymbolLayer &other );
|
2012-09-24 02:28:15 +02:00
|
|
|
};
|
|
|
|
|
2016-08-06 11:01:42 +02:00
|
|
|
class QgsFillSymbolLayer : QgsSymbolLayer
|
2012-09-24 02:28:15 +02:00
|
|
|
{
|
2017-06-07 16:07:17 +02:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
%TypeHeaderCode
|
2017-06-07 16:07:17 +02:00
|
|
|
#include "qgssymbollayer.h"
|
2012-09-24 02:28:15 +02:00
|
|
|
%End
|
|
|
|
public:
|
2019-07-24 08:27:09 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
virtual void renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context ) = 0;
|
2019-07-24 08:27:09 +10:00
|
|
|
%Docstring
|
|
|
|
QgsFillSymbolLayer cannot be copied
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-06-07 16:07:17 +02:00
|
|
|
virtual void drawPreviewIcon( QgsSymbolRenderContext &context, QSize size );
|
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
|
|
|
|
void setAngle( double angle );
|
|
|
|
double angle() const;
|
|
|
|
|
|
|
|
protected:
|
2016-08-06 11:01:42 +02:00
|
|
|
QgsFillSymbolLayer( bool locked = false );
|
2017-05-01 18:13:15 +02:00
|
|
|
void _renderPolygon( QPainter *p, const QPolygonF &points, const QList<QPolygonF> *rings, QgsSymbolRenderContext &context );
|
2017-06-07 16:07:17 +02:00
|
|
|
%Docstring
|
|
|
|
Default method to render polygon
|
|
|
|
%End
|
|
|
|
|
2019-07-24 08:27:09 +10:00
|
|
|
|
|
|
|
private:
|
|
|
|
QgsFillSymbolLayer( const QgsFillSymbolLayer &other );
|
2012-09-24 02:28:15 +02:00
|
|
|
};
|
2017-06-07 16:07:17 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
2017-08-06 13:39:03 +02:00
|
|
|
* src/core/symbology/qgssymbollayer.h *
|
2017-06-07 16:07:17 +02:00
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|