2017-06-06 11:03:05 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
2017-08-06 13:39:03 +02:00
* src/core/symbology/qgsfillsymbollayer.h *
2017-06-06 11:03:05 +02:00
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
2016-08-06 11:01:42 +02:00
class QgsSimpleFillSymbolLayer : QgsFillSymbolLayer
2012-09-24 02:28:15 +02:00
{
2017-06-06 11:03:05 +02:00
2012-09-24 02:28:15 +02:00
%TypeHeaderCode
2017-06-06 11:03:05 +02:00
#include "qgsfillsymbollayer.h"
2012-09-24 02:28:15 +02:00
%End
public:
2017-06-06 11:03:05 +02:00
QgsSimpleFillSymbolLayer( const QColor &color = DEFAULT_SIMPLEFILL_COLOR,
Qt::BrushStyle style = DEFAULT_SIMPLEFILL_STYLE,
const QColor &strokeColor = DEFAULT_SIMPLEFILL_BORDERCOLOR,
Qt::PenStyle strokeStyle = DEFAULT_SIMPLEFILL_BORDERSTYLE,
double strokeWidth = DEFAULT_SIMPLEFILL_BORDERWIDTH,
Qt::PenJoinStyle penJoinStyle = DEFAULT_SIMPLEFILL_JOINSTYLE
);
2014-05-07 19:02:11 +02:00
2012-09-24 02:28:15 +02:00
2017-05-01 18:13:15 +02:00
static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) /Factory/;
static QgsSymbolLayer *createFromSld( QDomElement &element ) /Factory/;
2017-06-06 11:03:05 +02:00
2012-09-24 02:28:15 +02:00
2017-06-06 11:03:05 +02:00
virtual QString layerType() const;
2012-09-24 02:28:15 +02:00
2017-06-06 11:03:05 +02:00
virtual void startRender( QgsSymbolRenderContext &context );
2012-09-24 02:28:15 +02:00
2017-06-06 11:03:05 +02:00
virtual void stopRender( QgsSymbolRenderContext &context );
virtual void renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context );
virtual QgsStringMap properties() const;
2012-09-24 02:28:15 +02:00
2017-05-01 18:13:15 +02:00
virtual QgsSimpleFillSymbolLayer *clone() const /Factory/;
2012-09-24 02:28:15 +02:00
2017-06-06 11:03:05 +02:00
virtual void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const;
virtual QString ogrFeatureStyle( double mmScaleFactor, double mapUnitScaleFactor ) const;
2013-06-23 16:00:16 +02:00
2012-09-24 02:28:15 +02:00
Qt::BrushStyle brushStyle() const;
void setBrushStyle( Qt::BrushStyle style );
2017-06-06 11:03:05 +02:00
virtual QColor strokeColor() const;
virtual void setStrokeColor( const QColor &strokeColor );
2014-01-26 18:35:21 +01:00
2017-06-06 11:03:05 +02:00
virtual QColor fillColor() const;
virtual void setFillColor( const QColor &color );
2014-01-12 18:17:20 +01:00
2017-02-22 17:13:57 +10:00
Qt::PenStyle strokeStyle() const;
void setStrokeStyle( Qt::PenStyle strokeStyle );
2012-09-24 02:28:15 +02:00
2017-02-22 17:13:57 +10:00
double strokeWidth() const;
void setStrokeWidth( double strokeWidth );
2014-05-07 19:02:11 +02:00
2014-03-17 18:42:41 +11:00
Qt::PenJoinStyle penJoinStyle() const;
void setPenJoinStyle( Qt::PenJoinStyle style );
2012-09-24 02:28:15 +02:00
void setOffset( QPointF offset );
QPointF offset();
2013-04-19 15:20:44 +02:00
2017-02-22 17:13:57 +10:00
void setStrokeWidthUnit( QgsUnitTypes::RenderUnit unit );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the units for the width of the fill's stroke.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param unit: width units
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`strokeWidthUnit`
2017-06-06 11:03:05 +02:00
%End
2016-07-18 09:42:45 +10:00
2017-02-22 17:13:57 +10:00
QgsUnitTypes::RenderUnit strokeWidthUnit() const;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the units for the width of the fill's stroke.
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`setStrokeWidthUnit`
2017-06-06 11:03:05 +02:00
%End
2014-05-07 19:02:11 +02:00
2017-06-06 11:03:05 +02:00
void setStrokeWidthMapUnitScale( const QgsMapUnitScale &scale );
2017-05-01 18:13:15 +02:00
const QgsMapUnitScale &strokeWidthMapUnitScale() const;
2013-04-19 15:20:44 +02:00
2016-07-17 22:11:17 +10:00
void setOffsetUnit( QgsUnitTypes::RenderUnit unit );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the units for the fill'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-06-06 11:03:05 +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-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the units for the fill's offset.
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`setOffsetUnit`
2017-06-06 11:03:05 +02:00
%End
2014-05-07 19:02:11 +02:00
2017-06-06 11:03:05 +02:00
void setOffsetMapUnitScale( const QgsMapUnitScale &scale );
2017-05-01 18:13:15 +02:00
const QgsMapUnitScale &offsetMapUnitScale() const;
2017-06-06 11:03:05 +02:00
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 double dxfWidth( const QgsDxfExport &e, QgsSymbolRenderContext &context ) const;
virtual QColor dxfColor( QgsSymbolRenderContext &context ) const;
virtual double dxfAngle( QgsSymbolRenderContext &context ) const;
virtual Qt::PenStyle dxfPenStyle() const;
virtual QColor dxfBrushColor( QgsSymbolRenderContext &context ) const;
virtual Qt::BrushStyle dxfBrushStyle() const;
2013-04-19 15:20:44 +02:00
2014-05-07 19:02:11 +02:00
2017-06-06 11:03:05 +02:00
protected:
2014-01-26 18:35:21 +01:00
2012-09-24 02:28:15 +02:00
};
2017-06-06 11:03:05 +02:00
2016-08-06 11:01:42 +02:00
class QgsGradientFillSymbolLayer : QgsFillSymbolLayer
2013-09-08 22:03:04 +10:00
{
2017-06-06 11:03:05 +02:00
2013-09-08 22:03:04 +10:00
%TypeHeaderCode
2017-06-06 11:03:05 +02:00
#include "qgsfillsymbollayer.h"
2013-09-08 22:03:04 +10:00
%End
public:
2014-05-27 23:22:50 +02:00
2013-09-08 22:03:04 +10:00
enum GradientColorType
{
SimpleTwoColor,
ColorRamp
};
enum GradientType
{
Linear,
Radial,
Conical
};
enum GradientCoordinateMode
{
Feature,
Viewport
};
enum GradientSpread
{
Pad,
Reflect,
Repeat
};
2014-01-03 23:06:49 +01:00
2017-06-06 11:03:05 +02:00
QgsGradientFillSymbolLayer( const QColor &color = DEFAULT_SIMPLEFILL_COLOR,
const QColor &color2 = Qt::white,
GradientColorType gradientColorType = SimpleTwoColor,
GradientType gradientType = Linear,
GradientCoordinateMode coordinateMode = Feature,
GradientSpread gradientSpread = Pad
);
2014-01-27 09:22:24 +01:00
2017-12-15 08:57:22 +10:00
~QgsGradientFillSymbolLayer();
2014-01-27 09:22:24 +01:00
2013-09-08 22:03:04 +10:00
2017-05-01 18:13:15 +02:00
static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) /Factory/;
2017-06-06 11:03:05 +02:00
virtual QString layerType() const;
virtual void startRender( QgsSymbolRenderContext &context );
2013-09-08 22:03:04 +10:00
2017-06-06 11:03:05 +02:00
virtual void stopRender( QgsSymbolRenderContext &context );
2013-09-08 22:03:04 +10:00
2017-06-06 11:03:05 +02:00
virtual void renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context );
2013-09-08 22:03:04 +10:00
2017-06-06 11:03:05 +02:00
virtual QgsStringMap properties() const;
2013-09-08 22:03:04 +10:00
2017-05-01 18:13:15 +02:00
virtual QgsGradientFillSymbolLayer *clone() const /Factory/;
2013-09-08 22:03:04 +10:00
2014-01-27 09:22:24 +01:00
2017-06-06 11:03:05 +02:00
virtual double estimateMaxBleed( const QgsRenderContext &context ) const;
2013-09-08 22:03:04 +10:00
GradientType gradientType() const;
2017-06-06 11:03:05 +02:00
%Docstring
Type of gradient, e.g., linear or radial
%End
2013-09-08 22:03:04 +10:00
void setGradientType( GradientType gradientType );
GradientColorType gradientColorType() const;
2017-06-06 11:03:05 +02:00
%Docstring
Gradient color mode, controls how gradient color stops are created
%End
2013-09-08 22:03:04 +10:00
void setGradientColorType( GradientColorType gradientColorType );
2017-05-01 18:13:15 +02:00
QgsColorRamp *colorRamp();
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the color ramp used for the gradient fill. This is only
used if the gradient color type is set to ColorRamp.
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`setColorRamp`
2017-12-15 10:36:55 -04:00
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`gradientColorType`
2017-06-06 11:03:05 +02:00
%End
2019-04-26 12:08:58 +10:00
void setColorRamp( QgsColorRamp *ramp /Transfer/ );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the color ramp used for the gradient fill. This is only
used if the gradient color type is set to ColorRamp.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param ramp: color ramp. Ownership is transferred.
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`colorRamp`
2017-12-15 10:36:55 -04:00
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`setGradientColorType`
2017-06-06 11:03:05 +02:00
%End
2013-09-08 22:03:04 +10:00
QColor color2() const;
2017-06-06 11:03:05 +02:00
%Docstring
Color for endpoint of gradient, only used if the gradient color type is set to SimpleTwoColor
%End
2017-05-01 18:13:15 +02:00
void setColor2( const QColor &color2 );
2013-09-08 22:03:04 +10:00
GradientCoordinateMode coordinateMode() const;
2017-06-06 11:03:05 +02:00
%Docstring
Coordinate mode for gradient. Controls how the gradient stops are positioned.
%End
2013-09-08 22:03:04 +10:00
void setCoordinateMode( GradientCoordinateMode coordinateMode );
GradientSpread gradientSpread() const;
2017-06-06 11:03:05 +02:00
%Docstring
Gradient spread mode. Controls how the gradient behaves outside of the predefined stops
%End
2013-09-08 22:03:04 +10:00
void setGradientSpread( GradientSpread gradientSpread );
void setReferencePoint1( QPointF referencePoint );
2017-06-06 11:03:05 +02:00
%Docstring
Starting point of gradient fill, in the range [0,0] - [1,1]
%End
2013-09-08 22:03:04 +10:00
QPointF referencePoint1() const;
2014-01-03 23:06:49 +01:00
2013-11-03 20:31:52 +11:00
void setReferencePoint1IsCentroid( bool isCentroid );
2017-06-06 11:03:05 +02:00
%Docstring
Sets the starting point of the gradient to be the feature centroid
%End
2013-11-03 20:31:52 +11:00
bool referencePoint1IsCentroid() const;
2013-09-08 22:03:04 +10:00
void setReferencePoint2( QPointF referencePoint );
2017-06-06 11:03:05 +02:00
%Docstring
End point of gradient fill, in the range [0,0] - [1,1]
%End
2013-09-08 22:03:04 +10:00
QPointF referencePoint2() const;
2014-01-03 23:06:49 +01:00
2013-11-03 20:31:52 +11:00
void setReferencePoint2IsCentroid( bool isCentroid );
2017-06-06 11:03:05 +02:00
%Docstring
Sets the end point of the gradient to be the feature centroid
%End
2014-01-03 23:06:49 +01:00
bool referencePoint2IsCentroid() const;
2013-09-08 22:03:04 +10:00
void setOffset( QPointF offset );
2017-06-06 11:03:05 +02:00
%Docstring
Offset for gradient fill
%End
2013-09-08 22:03:04 +10:00
QPointF offset() const;
2016-07-17 22:11:17 +10:00
void setOffsetUnit( QgsUnitTypes::RenderUnit unit );
2017-06-06 11:03:05 +02:00
%Docstring
Units for gradient fill offset
%End
2016-07-17 22:11:17 +10:00
QgsUnitTypes::RenderUnit offsetUnit() const;
2014-05-07 19:02:11 +02:00
2017-06-06 11:03:05 +02:00
void setOffsetMapUnitScale( const QgsMapUnitScale &scale );
2017-05-01 18:13:15 +02:00
const QgsMapUnitScale &offsetMapUnitScale() const;
2017-06-06 11:03:05 +02:00
virtual void setOutputUnit( QgsUnitTypes::RenderUnit unit );
virtual QgsUnitTypes::RenderUnit outputUnit() const;
virtual void setMapUnitScale( const QgsMapUnitScale &scale );
virtual QgsMapUnitScale mapUnitScale() const;
protected:
2014-05-07 19:02:11 +02:00
2014-04-06 21:14:02 +02:00
2014-01-03 23:06:49 +01:00
2013-09-08 22:03:04 +10:00
};
2016-08-06 11:01:42 +02:00
class QgsShapeburstFillSymbolLayer : QgsFillSymbolLayer
2014-03-21 12:50:50 +11:00
{
2017-06-06 11:03:05 +02:00
2014-03-21 12:50:50 +11:00
%TypeHeaderCode
2017-06-06 11:03:05 +02:00
#include "qgsfillsymbollayer.h"
2014-03-21 12:50:50 +11:00
%End
public:
2014-05-27 23:22:50 +02:00
2014-03-21 12:50:50 +11:00
enum ShapeburstColorType
{
SimpleTwoColor,
ColorRamp
};
2017-06-06 11:03:05 +02:00
QgsShapeburstFillSymbolLayer( const QColor &color = DEFAULT_SIMPLEFILL_COLOR, const QColor &color2 = Qt::white,
ShapeburstColorType colorType = SimpleTwoColor,
int blurRadius = 0, bool useWholeShape = true, double maxDistance = 5 );
2014-03-21 12:50:50 +11:00
2017-12-15 08:57:22 +10:00
~QgsShapeburstFillSymbolLayer();
2014-03-21 12:50:50 +11:00
2018-05-29 16:12:39 +10:00
2017-05-01 18:13:15 +02:00
static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) /Factory/;
2017-06-06 11:03:05 +02:00
virtual QString layerType() const;
virtual void startRender( QgsSymbolRenderContext &context );
2014-03-21 12:50:50 +11:00
2017-06-06 11:03:05 +02:00
virtual void stopRender( QgsSymbolRenderContext &context );
2014-03-21 12:50:50 +11:00
2017-06-06 11:03:05 +02:00
virtual void renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context );
2014-03-21 12:50:50 +11:00
2017-06-06 11:03:05 +02:00
virtual QgsStringMap properties() const;
2014-03-21 12:50:50 +11:00
2017-05-01 18:13:15 +02:00
virtual QgsShapeburstFillSymbolLayer *clone() const /Factory/;
2014-03-21 12:50:50 +11:00
2017-06-06 11:03:05 +02:00
virtual double estimateMaxBleed( const QgsRenderContext &context ) const;
2014-03-21 12:50:50 +11:00
void setBlurRadius( int blurRadius );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the blur radius, which controls the amount of blurring applied to the fill.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param blurRadius: Radius for fill blur. Values between 0 - 17 are valid, where higher values results in a stronger blur. Set to 0 to disable blur.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`blurRadius`
2018-05-28 11:31:08 -04:00
.. versionadded:: 2.3
2017-06-06 11:03:05 +02:00
%End
2014-03-21 12:50:50 +11:00
int blurRadius() const;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the blur radius, which controls the amount of blurring applied to the fill.
:return: Integer representing the radius for fill blur. Higher values indicate a stronger blur. A 0 value indicates that blurring is disabled.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setBlurRadius`
2018-05-28 11:31:08 -04:00
.. versionadded:: 2.3
2017-06-06 11:03:05 +02:00
%End
2014-03-21 12:50:50 +11:00
2014-11-19 19:40:51 +11:00
void setUseWholeShape( bool useWholeShape );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets whether the shapeburst fill should be drawn using the entire shape.
2017-12-15 21:36:08 -04:00
2019-02-26 19:54:09 +10:00
:param useWholeShape: Set to ``True`` if shapeburst should cover entire shape. If ``False``, setMaxDistance is used to calculate how far from the boundary of the shape should
2018-05-24 21:21:14 +10:00
be shaded
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`useWholeShape`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setMaxDistance`
2018-05-28 11:31:08 -04:00
.. versionadded:: 2.3
2017-06-06 11:03:05 +02:00
%End
2014-11-19 19:40:51 +11:00
bool useWholeShape() const;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns whether the shapeburst fill is set to cover the entire shape.
2019-02-26 19:54:09 +10:00
:return: ``True`` if shapeburst fill will cover the entire shape. If ``False``, shapeburst is drawn to a distance of maxDistance from the polygon's boundary.
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setUseWholeShape`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`maxDistance`
2018-05-28 11:31:08 -04:00
.. versionadded:: 2.3
2017-06-06 11:03:05 +02:00
%End
2014-03-21 12:50:50 +11:00
void setMaxDistance( double maxDistance );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the maximum distance to shape inside of the shape from the polygon's boundary.
2017-12-15 21:36:08 -04:00
2019-02-26 19:54:09 +10:00
:param maxDistance: distance from boundary to shade. setUseWholeShape must be set to ``False`` for this parameter to take effect. Distance unit is controlled by setDistanceUnit.
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`maxDistance`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setUseWholeShape`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setDistanceUnit`
2018-05-28 11:31:08 -04:00
.. versionadded:: 2.3
2017-06-06 11:03:05 +02:00
%End
2014-03-21 12:50:50 +11:00
double maxDistance() const;
2017-06-06 11:03:05 +02:00
%Docstring
2019-02-26 19:54:09 +10:00
Returns the maximum distance from the shape's boundary which is shaded. This parameter is only effective if useWholeShape is ``False``.
2017-12-15 10:36:55 -04:00
:return: the maximum distance from the polygon's boundary which is shaded. Distance units are indicated by distanceUnit.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`useWholeShape`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setMaxDistance`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`distanceUnit`
2018-05-28 11:31:08 -04:00
.. versionadded:: 2.3
2017-06-06 11:03:05 +02:00
%End
2014-03-21 12:50:50 +11:00
2016-07-17 22:11:17 +10:00
void setDistanceUnit( QgsUnitTypes::RenderUnit unit );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the unit for the maximum distance to shade inside of the shape from the polygon's boundary.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param unit: distance unit for the maximum distance
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setMaxDistance`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`distanceUnit`
2018-05-28 11:31:08 -04:00
.. versionadded:: 2.3
2017-06-06 11:03:05 +02:00
%End
2016-07-17 22:11:17 +10:00
QgsUnitTypes::RenderUnit distanceUnit() const;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the unit for the maximum distance to shade inside of the shape from the polygon's boundary.
:return: distance unit for the maximum distance
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`maxDistance`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setDistanceUnit`
2018-05-28 11:31:08 -04:00
.. versionadded:: 2.3
2017-06-06 11:03:05 +02:00
%End
2014-03-21 12:50:50 +11:00
2017-05-01 18:13:15 +02:00
void setDistanceMapUnitScale( const QgsMapUnitScale &scale );
const QgsMapUnitScale &distanceMapUnitScale() const;
2014-05-07 19:02:11 +02:00
2014-03-21 12:50:50 +11:00
void setColorType( ShapeburstColorType colorType );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the color mode to use for the shapeburst fill. Shapeburst can either be drawn using a QgsColorRamp color ramp
or by simply specificing a start and end color. setColorType is used to specify which mode to use for the fill.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param colorType: color type to use for shapeburst fill
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`colorType`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setColor`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setColor2`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setColorRamp`
2018-05-28 11:31:08 -04:00
.. versionadded:: 2.3
2017-06-06 11:03:05 +02:00
%End
2014-03-21 12:50:50 +11:00
ShapeburstColorType colorType() const;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the color mode used for the shapeburst fill. Shapeburst can either be drawn using a QgsColorRamp color ramp
or by simply specificing a start and end color.
:return: current color mode used for the shapeburst fill
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setColorType`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`color`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`color2`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`colorRamp`
2018-05-28 11:31:08 -04:00
.. versionadded:: 2.3
2017-06-06 11:03:05 +02:00
%End
2014-03-21 12:50:50 +11:00
2019-08-30 04:12:23 +10:00
void setColorRamp( QgsColorRamp *ramp /Transfer/ );
2017-06-06 11:03:05 +02:00
%Docstring
2019-08-30 04:12:23 +10:00
Sets the color ``ramp`` used to draw the shapeburst fill. Color ramps are only used if setColorType is set ShapeburstColorType.ColorRamp.
2017-12-15 21:36:08 -04:00
2019-08-30 04:12:23 +10:00
Ownership of ``ramp`` is transferred to the fill.
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setColorType`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`colorRamp`
2018-05-28 11:31:08 -04:00
.. versionadded:: 2.3
2017-06-06 11:03:05 +02:00
%End
2017-05-01 18:13:15 +02:00
QgsColorRamp *colorRamp();
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the color ramp used for the shapeburst fill. The color ramp is only used if the colorType is set to ShapeburstColorType.ColorRamp
:return: a QgsColorRamp color ramp
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setColorRamp`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`colorType`
2018-05-28 11:31:08 -04:00
.. versionadded:: 2.3
2017-06-06 11:03:05 +02:00
%End
2014-03-21 12:50:50 +11:00
2017-05-01 18:13:15 +02:00
void setColor2( const QColor &color2 );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the color for the endpoint of the shapeburst fill. This color is only used if setColorType is set ShapeburstColorType.SimpleTwoColor.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param color2: QColor to use for endpoint of gradient
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setColorType`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`color2`
2018-05-28 11:31:08 -04:00
.. versionadded:: 2.3
2017-06-06 11:03:05 +02:00
%End
2014-03-21 12:50:50 +11:00
QColor color2() const;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the color used for the endpoint of the shapeburst fill. This color is only used if the colorType is set to ShapeburstColorType.SimpleTwoColor
:return: a QColor indicating the color of the endpoint of the gradient
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setColor2`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`colorType`
2018-05-28 11:31:08 -04:00
.. versionadded:: 2.3
2017-06-06 11:03:05 +02:00
%End
2014-05-07 19:02:11 +02:00
2014-11-19 19:40:51 +11:00
void setIgnoreRings( bool ignoreRings );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets whether the shapeburst fill should ignore polygon rings when calculating
the buffered shading.
2017-12-15 21:36:08 -04:00
2019-02-26 19:54:09 +10:00
:param ignoreRings: Set to ``True`` if buffers should ignore interior rings for polygons.
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`ignoreRings`
2018-05-28 11:31:08 -04:00
.. versionadded:: 2.3
2017-06-06 11:03:05 +02:00
%End
2014-11-19 19:40:51 +11:00
bool ignoreRings() const;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns whether the shapeburst fill is set to ignore polygon interior rings.
2019-02-26 19:54:09 +10:00
:return: ``True`` if the shapeburst fill will ignore interior rings when calculating buffered shading.
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setIgnoreRings`
2018-05-28 11:31:08 -04:00
.. versionadded:: 2.3
2017-06-06 11:03:05 +02:00
%End
2014-03-21 12:50:50 +11:00
void setOffset( QPointF offset );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the offset for the shapeburst fill.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param offset: QPointF indicating the horizontal/vertical offset amount
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`offset`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setOffsetUnit`
2018-05-28 11:31:08 -04:00
.. versionadded:: 2.3
2017-06-06 11:03:05 +02:00
%End
2014-03-21 12:50:50 +11:00
QPointF offset() const;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the offset for the shapeburst fill.
:return: a QPointF indicating the horizontal/vertical offset amount
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setOffset`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`offsetUnit`
2018-05-28 11:31:08 -04:00
.. versionadded:: 2.3
2017-06-06 11:03:05 +02:00
%End
2014-03-21 12:50:50 +11:00
2016-07-17 22:11:17 +10:00
void setOffsetUnit( QgsUnitTypes::RenderUnit unit );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the units used for the offset for the shapeburst fill.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param unit: units for fill offset
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setOffset`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`offsetUnit`
2018-05-28 11:31:08 -04:00
.. versionadded:: 2.3
2017-06-06 11:03:05 +02:00
%End
2016-07-17 22:11:17 +10:00
QgsUnitTypes::RenderUnit offsetUnit() const;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the units used for the offset of the shapeburst fill.
:return: units used for the fill offset
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`offset`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setOffsetUnit`
2018-05-28 11:31:08 -04:00
.. versionadded:: 2.3
2017-06-06 11:03:05 +02:00
%End
2014-05-07 19:02:11 +02:00
2017-06-06 11:03:05 +02:00
void setOffsetMapUnitScale( const QgsMapUnitScale &scale );
2017-05-01 18:13:15 +02:00
const QgsMapUnitScale &offsetMapUnitScale() const;
2017-06-06 11:03:05 +02:00
virtual void setOutputUnit( QgsUnitTypes::RenderUnit unit );
virtual QgsUnitTypes::RenderUnit outputUnit() const;
virtual void setMapUnitScale( const QgsMapUnitScale &scale );
virtual QgsMapUnitScale mapUnitScale() const;
2018-05-29 16:08:49 +10:00
private:
QgsShapeburstFillSymbolLayer( const QgsShapeburstFillSymbolLayer &other );
2014-03-21 12:50:50 +11:00
};
2016-08-06 11:01:42 +02:00
class QgsImageFillSymbolLayer: QgsFillSymbolLayer
2012-09-24 02:28:15 +02:00
{
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Base class for polygon renderers generating texture images*
2012-09-24 02:28:15 +02:00
%End
2017-06-06 11:03:05 +02:00
%TypeHeaderCode
#include "qgsfillsymbollayer.h"
%End
2012-09-24 02:28:15 +02:00
public:
2017-06-06 11:03:05 +02:00
2012-09-24 02:28:15 +02:00
QgsImageFillSymbolLayer();
2017-06-06 11:03:05 +02:00
virtual void renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context );
2012-09-24 02:28:15 +02:00
2017-05-01 18:13:15 +02:00
virtual QgsSymbol *subSymbol();
virtual bool setSubSymbol( QgsSymbol *symbol /Transfer/ );
2013-04-19 15:20:44 +02:00
2017-12-15 08:57:22 +10:00
2017-02-22 17:13:57 +10:00
void setStrokeWidthUnit( QgsUnitTypes::RenderUnit unit );
2017-06-06 11:03:05 +02:00
%Docstring
2018-10-15 09:38:58 +10:00
Sets the ``units`` fo the symbol's stroke width.
2017-12-15 10:36:55 -04:00
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`strokeWidthUnit`
2018-10-15 09:38:58 +10:00
.. seealso:: :py:func:`setStrokeWidthMapUnitScale`
2017-06-06 11:03:05 +02:00
%End
2016-07-18 09:42:45 +10:00
2017-02-22 17:13:57 +10:00
QgsUnitTypes::RenderUnit strokeWidthUnit() const;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the units for the symbol's stroke width.
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`setStrokeWidthUnit`
2018-10-15 09:38:58 +10:00
.. seealso:: :py:func:`strokeWidthMapUnitScale`
2017-06-06 11:03:05 +02:00
%End
2014-05-07 19:02:11 +02:00
2017-06-06 11:03:05 +02:00
void setStrokeWidthMapUnitScale( const QgsMapUnitScale &scale );
2018-10-15 09:38:58 +10:00
%Docstring
Sets the stroke width map unit ``scale``.
.. seealso:: :py:func:`strokeWidthMapUnitScale`
.. seealso:: :py:func:`setStrokeWidthUnit`
%End
2017-05-01 18:13:15 +02:00
const QgsMapUnitScale &strokeWidthMapUnitScale() const;
2018-10-15 09:38:58 +10:00
%Docstring
Returns the stroke width map unit scale.
.. seealso:: :py:func:`setStrokeWidthMapUnitScale`
.. seealso:: :py:func:`strokeWidthUnit`
.. versionadded:: 2.16
%End
2017-06-06 11:03:05 +02:00
virtual void setOutputUnit( QgsUnitTypes::RenderUnit unit );
virtual QgsUnitTypes::RenderUnit outputUnit() const;
2014-05-07 19:02:11 +02:00
2017-06-06 11:03:05 +02:00
virtual void setMapUnitScale( const QgsMapUnitScale &scale );
virtual QgsMapUnitScale mapUnitScale() const;
2017-05-01 18:13:15 +02:00
virtual double estimateMaxBleed( const QgsRenderContext &context ) const;
2014-01-27 09:22:24 +01:00
2017-05-01 18:13:15 +02:00
virtual double dxfWidth( const QgsDxfExport &e, QgsSymbolRenderContext &context ) const;
2017-06-06 11:03:05 +02:00
2017-05-01 18:13:15 +02:00
virtual QColor dxfColor( QgsSymbolRenderContext &context ) const;
2017-06-06 11:03:05 +02:00
2014-01-27 09:22:24 +01:00
virtual Qt::PenStyle dxfPenStyle() const;
2015-11-04 16:03:46 +11:00
2017-06-06 11:03:05 +02:00
virtual QSet<QString> usedAttributes( const QgsRenderContext &context ) const;
2019-01-22 13:29:00 +10:00
virtual bool hasDataDefinedProperties() const;
2016-01-04 22:51:18 +11:00
protected:
2017-06-06 11:03:05 +02:00
2017-05-01 18:13:15 +02:00
virtual void applyDataDefinedSettings( QgsSymbolRenderContext &context );
2017-06-06 11:03:05 +02:00
%Docstring
Custom stroke
%End
2017-02-20 10:37:06 +10:00
private:
2017-05-01 18:13:15 +02:00
QgsImageFillSymbolLayer( const QgsImageFillSymbolLayer &other );
2012-09-24 02:28:15 +02:00
};
2014-11-17 23:30:00 +11:00
class QgsRasterFillSymbolLayer: QgsImageFillSymbolLayer
{
2017-06-06 11:03:05 +02:00
%Docstring
2018-05-26 14:10:30 +10:00
A class for filling symbols with a repeated raster image.
2017-12-15 10:36:55 -04:00
2017-06-06 11:03:05 +02:00
.. versionadded:: 2.7
%End
2014-11-17 23:30:00 +11:00
%TypeHeaderCode
2017-06-06 11:03:05 +02:00
#include "qgsfillsymbollayer.h"
2014-11-17 23:30:00 +11:00
%End
public:
enum FillCoordinateMode
{
Feature,
2018-10-15 09:38:58 +10:00
Viewport,
2014-11-17 23:30:00 +11:00
};
2017-05-01 18:13:15 +02:00
QgsRasterFillSymbolLayer( const QString &imageFilePath = QString() );
2018-10-15 09:38:58 +10:00
%Docstring
Constructor for QgsRasterFillSymbolLayer, using a raster fill from the
specified ``imageFilePath``.
%End
2014-11-17 23:30:00 +11:00
2017-06-06 11:03:05 +02:00
static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) /Factory/;
2018-10-15 09:38:58 +10:00
%Docstring
Creates a new QgsRasterFillSymbolLayer from a ``properties`` map. The caller takes
ownership of the returned object.
%End
2017-06-06 11:03:05 +02:00
2018-01-29 15:31:00 +10:00
static void resolvePaths( QgsStringMap &properties, const QgsPathResolver &pathResolver, bool saving );
%Docstring
Turns relative paths in properties map to absolute when reading and vice versa when writing.
Used internally when reading/writing symbols.
.. versionadded:: 3.0
%End
2017-06-06 11:03:05 +02:00
virtual QString layerType() const;
virtual void renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context );
virtual void startRender( QgsSymbolRenderContext &context );
virtual void stopRender( QgsSymbolRenderContext &context );
virtual QgsStringMap properties() const;
virtual QgsRasterFillSymbolLayer *clone() const /Factory/;
2014-11-17 23:30:00 +11:00
2017-05-01 18:13:15 +02:00
virtual double estimateMaxBleed( const QgsRenderContext &context ) const;
2014-11-17 23:30:00 +11:00
2017-12-15 08:57:22 +10:00
2017-05-01 18:13:15 +02:00
virtual QgsSymbol *subSymbol();
virtual bool setSubSymbol( QgsSymbol *symbol /Transfer/ );
2014-11-17 23:30:00 +11:00
2017-12-15 08:57:22 +10:00
2017-05-01 18:13:15 +02:00
void setImageFilePath( const QString &imagePath );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the path to the raster image used for the fill.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param imagePath: path to image file
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`imageFilePath`
2017-06-06 11:03:05 +02:00
%End
2014-11-17 23:30:00 +11:00
QString imageFilePath() const;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
The path to the raster image used for the fill.
:return: path to image file
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setImageFilePath`
2017-06-06 11:03:05 +02:00
%End
2014-11-17 23:30:00 +11:00
2018-06-04 21:56:07 +10:00
void setCoordinateMode( FillCoordinateMode mode );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Set the coordinate mode for fill. Controls how the top left corner of the image
fill is positioned relative to the feature.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param mode: coordinate mode
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`coordinateMode`
2017-06-06 11:03:05 +02:00
%End
2014-11-17 23:30:00 +11:00
FillCoordinateMode coordinateMode() const;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Coordinate mode for fill. Controls how the top left corner of the image
fill is positioned relative to the feature.
:return: coordinate mode
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setCoordinateMode`
2017-06-06 11:03:05 +02:00
%End
2014-11-17 23:30:00 +11:00
2018-06-04 21:56:07 +10:00
void setOpacity( double opacity );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the ``opacity`` for the raster image used in the fill.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param opacity: opacity value between 0 (fully transparent) and 1 (fully opaque)
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`opacity`
2017-06-06 11:03:05 +02:00
%End
2017-05-30 11:07:22 +10:00
double opacity() const;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the opacity for the raster image used in the fill.
:return: opacity value between 0 (fully transparent) and 1 (fully opaque)
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`setOpacity`
2017-06-06 11:03:05 +02:00
%End
2014-11-17 23:30:00 +11:00
2016-02-02 19:46:18 +11:00
void setOffset( QPointF offset );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the offset for the fill.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param offset: offset for fill
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`offset`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setOffsetUnit`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setOffsetMapUnitScale`
2017-06-06 11:03:05 +02:00
%End
2014-11-17 23:30:00 +11:00
QPointF offset() const;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the offset for the fill.
:return: offset for fill
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setOffset`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`offsetUnit`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`offsetMapUnitScale`
2017-06-06 11:03:05 +02:00
%End
2014-11-17 23:30:00 +11:00
2016-07-17 22:11:17 +10:00
void setOffsetUnit( const QgsUnitTypes::RenderUnit unit );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the units for the fill's offset.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param unit: units for offset
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`offsetUnit`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setOffset`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setOffsetMapUnitScale`
2017-06-06 11:03:05 +02:00
%End
2016-07-17 22:11:17 +10:00
QgsUnitTypes::RenderUnit offsetUnit() const;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the units for the fill's offset.
:return: units for offset
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setOffsetUnit`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`offset`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`offsetMapUnitScale`
2017-06-06 11:03:05 +02:00
%End
2014-11-17 23:30:00 +11:00
2017-05-01 18:13:15 +02:00
void setOffsetMapUnitScale( const QgsMapUnitScale &scale );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the map unit scale for the fill's offset.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param scale: map unit scale for offset
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`offsetMapUnitScale`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setOffset`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setOffsetUnit`
2017-06-06 11:03:05 +02:00
%End
2017-05-01 18:13:15 +02:00
const QgsMapUnitScale &offsetMapUnitScale() const;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the map unit scale for the fill's offset.
:return: map unit scale for offset
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setOffsetMapUnitScale`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`offset`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`offsetUnit`
2017-06-06 11:03:05 +02:00
%End
2014-11-17 23:30:00 +11:00
void setWidth( const double width );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the width for scaling the image used in the fill. The image's height will also be
scaled to maintain the image's aspect ratio.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param width: width for scaling the image
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`width`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setWidthUnit`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setWidthMapUnitScale`
2017-06-06 11:03:05 +02:00
%End
2014-11-17 23:30:00 +11:00
double width() const;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the width used for scaling the image used in the fill. The image's height is
scaled to maintain the image's aspect ratio.
:return: width used for scaling the image
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setWidth`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`widthUnit`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`widthMapUnitScale`
2017-06-06 11:03:05 +02:00
%End
2014-11-17 23:30:00 +11:00
2016-07-17 22:11:17 +10:00
void setWidthUnit( const QgsUnitTypes::RenderUnit unit );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the units for the image's width.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param unit: units for width
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`widthUnit`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setWidth`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setWidthMapUnitScale`
2017-06-06 11:03:05 +02:00
%End
2016-07-17 22:11:17 +10:00
QgsUnitTypes::RenderUnit widthUnit() const;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the units for the image's width.
:return: units for width
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setWidthUnit`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`width`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`widthMapUnitScale`
2017-06-06 11:03:05 +02:00
%End
2014-11-17 23:30:00 +11:00
2017-05-01 18:13:15 +02:00
void setWidthMapUnitScale( const QgsMapUnitScale &scale );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the map unit scale for the image's width.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param scale: map unit scale for width
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`widthMapUnitScale`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setWidth`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setWidthUnit`
2017-06-06 11:03:05 +02:00
%End
2017-05-01 18:13:15 +02:00
const QgsMapUnitScale &widthMapUnitScale() const;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the map unit scale for the image's width.
:return: map unit scale for width
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setWidthMapUnitScale`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`width`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`widthUnit`
2017-06-06 11:03:05 +02:00
%End
2014-11-17 23:30:00 +11:00
protected:
2017-06-06 11:03:05 +02:00
virtual void applyDataDefinedSettings( QgsSymbolRenderContext &context );
2014-11-17 23:30:00 +11:00
};
2012-09-24 02:28:15 +02:00
class QgsSVGFillSymbolLayer: QgsImageFillSymbolLayer
{
2017-06-06 11:03:05 +02:00
%Docstring
2018-10-15 09:38:58 +10:00
A class for filling symbols with a repeated SVG file.
2012-09-24 02:28:15 +02:00
%End
2017-06-06 11:03:05 +02:00
%TypeHeaderCode
#include "qgsfillsymbollayer.h"
%End
2012-09-24 02:28:15 +02:00
public:
2018-10-15 09:38:58 +10:00
2017-06-06 11:03:05 +02:00
QgsSVGFillSymbolLayer( const QString &svgFilePath, double width = 20, double rotation = 0.0 );
%Docstring
2018-10-15 09:38:58 +10:00
Constructor for QgsSVGFillSymbolLayer, using the SVG picture at the specified absolute file path.
2017-06-06 11:03:05 +02:00
%End
2018-10-15 09:38:58 +10:00
2017-06-06 11:03:05 +02:00
QgsSVGFillSymbolLayer( const QByteArray &svgData, double width = 20, double rotation = 0.0 );
2018-10-15 09:38:58 +10:00
%Docstring
Constructor for QgsSVGFillSymbolLayer, using the specified SVG picture data.
%End
2012-09-24 02:28:15 +02:00
2017-06-06 11:03:05 +02:00
static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) /Factory/;
2018-10-15 09:38:58 +10:00
%Docstring
Creates a new QgsSVGFillSymbolLayer from a ``properties`` map. The caller takes
ownership of the returned object.
%End
2017-06-06 11:03:05 +02:00
static QgsSymbolLayer *createFromSld( QDomElement &element ) /Factory/;
2018-10-15 09:38:58 +10:00
%Docstring
Creates a new QgsSVGFillSymbolLayer from a SLD ``element``. The caller takes
ownership of the returned object.
%End
2012-09-24 02:28:15 +02:00
2017-06-06 11:03:05 +02:00
static void resolvePaths( QgsStringMap &properties, const QgsPathResolver &pathResolver, bool saving );
%Docstring
2017-12-15 10:36:55 -04:00
Turns relative paths in properties map to absolute when reading and vice versa when writing.
Used internally when reading/writing symbols.
2017-06-06 11:03:05 +02:00
.. versionadded:: 3.0
%End
2012-09-24 02:28:15 +02:00
2017-06-06 11:03:05 +02:00
virtual QString layerType() const;
virtual void startRender( QgsSymbolRenderContext &context );
virtual void stopRender( QgsSymbolRenderContext &context );
virtual QgsStringMap properties() const;
2012-09-24 02:28:15 +02:00
2017-05-01 18:13:15 +02:00
virtual QgsSVGFillSymbolLayer *clone() const /Factory/;
2012-09-24 02:28:15 +02:00
2017-06-06 11:03:05 +02:00
virtual void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const;
2017-05-01 18:13:15 +02:00
void setSvgFilePath( const QString &svgPath );
2018-10-15 09:38:58 +10:00
%Docstring
Sets the path to the SVG file to render in the fill.
This is usually an absolute file path. Other supported options include
- relative paths to folders from the user's SVG search paths
- base64 encoded content, prefixed with a 'base64:' string
- http(s) paths
.. seealso:: :py:func:`svgFilePath`
%End
2012-09-24 02:28:15 +02:00
QString svgFilePath() const;
2018-10-15 09:38:58 +10:00
%Docstring
Returns the path to the SVG file used to render the fill.
.. seealso:: :py:func:`setSvgFilePath`
%End
2012-09-24 02:28:15 +02:00
void setPatternWidth( double width );
2018-10-15 09:38:58 +10:00
%Docstring
Sets the ``width`` to render the SVG content as within the fill (i.e. the pattern repeat/tile size).
Units are specified by setPatternWidthUnit()
.. seealso:: :py:func:`patternWidth`
.. seealso:: :py:func:`setPatternWidthUnit`
.. seealso:: :py:func:`setPatternWidthMapUnitScale`
%End
2012-09-24 02:28:15 +02:00
double patternWidth() const;
2018-10-15 09:38:58 +10:00
%Docstring
Returns the width of the rendered SVG content within the fill (i.e. the pattern repeat/tile size).
Units are retrieved by patternWidthUnit()
.. seealso:: :py:func:`setPatternWidth`
.. seealso:: :py:func:`patternWidthUnit`
.. seealso:: :py:func:`patternWidthMapUnitScale`
%End
2012-09-24 02:28:15 +02:00
2017-05-01 18:13:15 +02:00
void setSvgFillColor( const QColor &c );
2018-10-15 09:38:58 +10:00
%Docstring
Sets the fill color used for rendering the SVG content.
2018-10-15 11:06:11 +10:00
Fill color is only supported for parametrized SVG files. Color opacity is
ignored if the SVG file does not support parametrized fill opacity.
2018-10-15 09:38:58 +10:00
.. seealso:: :py:func:`svgFillColor`
.. seealso:: :py:func:`setSvgStrokeColor`
%End
2012-09-24 02:28:15 +02:00
QColor svgFillColor() const;
2018-10-15 09:38:58 +10:00
%Docstring
Returns the fill color used for rendering the SVG content.
2018-10-15 11:06:11 +10:00
Fill color is only supported for parametrized SVG files.
2018-10-15 09:38:58 +10:00
.. seealso:: :py:func:`setSvgFillColor`
.. seealso:: :py:func:`svgStrokeColor`
%End
2017-06-06 11:03:05 +02:00
2017-05-01 18:13:15 +02:00
void setSvgStrokeColor( const QColor &c );
2018-10-15 09:38:58 +10:00
%Docstring
Sets the stroke color used for rendering the SVG content.
2018-10-15 11:06:11 +10:00
Stroke color is only supported for parametrized SVG files. Color opacity is
ignored if the SVG file does not support parametrized outline opacity.
2018-10-15 09:38:58 +10:00
.. seealso:: :py:func:`svgStrokeColor`
.. seealso:: :py:func:`setSvgFillColor`
%End
2017-02-22 17:13:57 +10:00
QColor svgStrokeColor() const;
2018-10-15 09:38:58 +10:00
%Docstring
Returns the stroke color used for rendering the SVG content.
2018-10-15 11:06:11 +10:00
Stroke color is only supported for parametrized SVG files.
2018-10-15 09:38:58 +10:00
.. seealso:: :py:func:`setSvgStrokeColor`
.. seealso:: :py:func:`svgFillColor`
%End
2017-02-22 17:13:57 +10:00
void setSvgStrokeWidth( double w );
2018-10-15 09:38:58 +10:00
%Docstring
Sets the stroke width used for rendering the SVG content.
2018-10-15 11:06:11 +10:00
Stroke width is only supported for parametrized SVG files. Units are
2018-10-15 09:38:58 +10:00
specified via setSvgStrokeWidthUnit()
.. seealso:: :py:func:`svgStrokeWidth`
.. seealso:: :py:func:`setSvgStrokeWidthUnit`
.. seealso:: :py:func:`setSvgStrokeWidthMapUnitScale`
%End
2017-02-22 17:13:57 +10:00
double svgStrokeWidth() const;
2018-10-15 09:38:58 +10:00
%Docstring
Returns the stroke width used for rendering the SVG content.
2018-10-15 11:06:11 +10:00
Stroke width is only supported for parametrized SVG files. Units are
2018-10-15 09:38:58 +10:00
retrieved via setSvgStrokeWidthUnit()
.. seealso:: :py:func:`setSvgStrokeWidth`
.. seealso:: :py:func:`svgStrokeWidthUnit`
.. seealso:: :py:func:`svgStrokeWidthMapUnitScale`
%End
2013-04-19 15:20:44 +02:00
2016-07-17 22:11:17 +10:00
void setPatternWidthUnit( QgsUnitTypes::RenderUnit unit );
2017-06-06 11:03:05 +02:00
%Docstring
2018-10-15 09:38:58 +10:00
Sets the ``unit`` for the width of the SVG images in the pattern.
2017-12-15 10:36:55 -04:00
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`patternWidthUnit`
2018-10-15 09:38:58 +10:00
.. seealso:: :py:func:`setPatternWidth`
.. seealso:: :py:func:`setPatternWidthMapUnitScale`
2017-06-06 11:03:05 +02:00
%End
2016-07-18 09:42:45 +10:00
2016-07-17 22:11:17 +10:00
QgsUnitTypes::RenderUnit patternWidthUnit() const;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the units for the width of the SVG images in the pattern.
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`setPatternWidthUnit`
2018-10-15 09:38:58 +10:00
.. seealso:: :py:func:`patternWidth`
.. seealso:: :py:func:`patternWidthMapUnitScale`
2017-06-06 11:03:05 +02:00
%End
2014-05-07 19:02:11 +02:00
2017-06-06 11:03:05 +02:00
void setPatternWidthMapUnitScale( const QgsMapUnitScale &scale );
2018-10-15 09:38:58 +10:00
%Docstring
Sets the map unit ``scale`` for the pattern's width.
.. seealso:: :py:func:`patternWidthMapUnitScale`
.. seealso:: :py:func:`setPatternWidth`
.. seealso:: :py:func:`setPatternWidthUnit`
%End
2017-05-01 18:13:15 +02:00
const QgsMapUnitScale &patternWidthMapUnitScale() const;
2018-10-15 09:38:58 +10:00
%Docstring
Returns the map unit scale for the pattern's width.
.. seealso:: :py:func:`setPatternWidthMapUnitScale`
.. seealso:: :py:func:`patternWidth`
.. seealso:: :py:func:`patternWidthUnit`
%End
2013-04-19 15:20:44 +02:00
2017-02-22 17:13:57 +10:00
void setSvgStrokeWidthUnit( QgsUnitTypes::RenderUnit unit );
2017-06-06 11:03:05 +02:00
%Docstring
2018-10-15 09:38:58 +10:00
Sets the ``unit`` for the stroke width.
2017-12-15 10:36:55 -04:00
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`svgStrokeWidthUnit`
2018-10-15 09:38:58 +10:00
.. seealso:: :py:func:`setSvgStrokeWidth`
.. seealso:: :py:func:`setSvgStrokeWidthMapUnitScale`
2017-06-06 11:03:05 +02:00
%End
2016-07-18 09:42:45 +10:00
2017-02-22 17:13:57 +10:00
QgsUnitTypes::RenderUnit svgStrokeWidthUnit() const;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the units for the stroke width.
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`setSvgStrokeWidthUnit`
2018-10-15 09:38:58 +10:00
.. seealso:: :py:func:`svgStrokeWidth`
.. seealso:: :py:func:`svgStrokeWidthMapUnitScale`
2017-06-06 11:03:05 +02:00
%End
2014-05-07 19:02:11 +02:00
2017-06-06 11:03:05 +02:00
void setSvgStrokeWidthMapUnitScale( const QgsMapUnitScale &scale );
2018-10-15 09:38:58 +10:00
%Docstring
Sets the map unit ``scale`` for the pattern's stroke.
.. seealso:: :py:func:`svgStrokeWidthMapUnitScale`
.. seealso:: :py:func:`setSvgStrokeWidth`
.. seealso:: :py:func:`setSvgStrokeWidthUnit`
%End
2017-05-01 18:13:15 +02:00
const QgsMapUnitScale &svgStrokeWidthMapUnitScale() const;
2018-10-15 09:38:58 +10:00
%Docstring
Returns the map unit scale for the pattern's stroke.
.. seealso:: :py:func:`setSvgStrokeWidthMapUnitScale`
.. seealso:: :py:func:`svgStrokeWidth`
.. seealso:: :py:func:`svgStrokeWidthUnit`
%End
2017-06-06 11:03:05 +02:00
virtual void setOutputUnit( QgsUnitTypes::RenderUnit unit );
virtual QgsUnitTypes::RenderUnit outputUnit() const;
virtual void setMapUnitScale( const QgsMapUnitScale &scale );
2013-04-19 15:20:44 +02:00
2017-06-06 11:03:05 +02:00
virtual QgsMapUnitScale mapUnitScale() const;
2013-04-19 15:20:44 +02:00
2014-05-07 19:02:11 +02:00
2013-06-23 16:00:16 +02:00
protected:
2017-06-06 11:03:05 +02:00
virtual void applyDataDefinedSettings( QgsSymbolRenderContext &context );
2012-09-24 02:28:15 +02:00
};
class QgsLinePatternFillSymbolLayer: QgsImageFillSymbolLayer
{
2018-10-15 11:15:00 +10:00
%Docstring
A symbol fill consisting of repeated parallel lines.
%End
2017-06-06 11:03:05 +02:00
2012-09-24 02:28:15 +02:00
%TypeHeaderCode
2017-06-06 11:03:05 +02:00
#include "qgsfillsymbollayer.h"
2012-09-24 02:28:15 +02:00
%End
public:
QgsLinePatternFillSymbolLayer();
~QgsLinePatternFillSymbolLayer();
2017-05-01 18:13:15 +02:00
static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) /Factory/;
2018-10-15 11:15:00 +10:00
%Docstring
Creates a new QgsLinePatternFillSymbolLayer from a ``properties`` map. The caller takes
ownership of the returned object.
%End
2017-05-01 18:13:15 +02:00
static QgsSymbolLayer *createFromSld( QDomElement &element ) /Factory/;
2018-10-15 11:15:00 +10:00
%Docstring
Creates a new QgsLinePatternFillSymbolLayer from a SLD ``element``. The caller takes
ownership of the returned object.
%End
2017-06-06 11:03:05 +02:00
virtual QString layerType() const;
virtual void startRender( QgsSymbolRenderContext &context );
2012-09-24 02:28:15 +02:00
2017-06-06 11:03:05 +02:00
virtual void stopRender( QgsSymbolRenderContext &context );
2012-09-24 02:28:15 +02:00
2017-06-06 11:03:05 +02:00
virtual QgsStringMap properties() const;
2017-05-01 18:13:15 +02:00
virtual QgsLinePatternFillSymbolLayer *clone() const /Factory/;
2012-09-24 02:28:15 +02:00
2017-06-06 11:03:05 +02:00
virtual void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const;
virtual double estimateMaxBleed( const QgsRenderContext &context ) const;
2014-01-27 09:22:24 +01:00
2013-06-23 16:00:16 +02:00
QString ogrFeatureStyleWidth( double widthScaleFactor ) const;
2012-09-24 02:28:15 +02:00
void setLineAngle( double a );
2018-10-15 11:15:00 +10:00
%Docstring
Sets the angle for the parallel lines used to fill the symbol.
Angles are in degrees, clockwise from North.
.. seealso:: :py:func:`lineAngle`
%End
2012-09-24 02:28:15 +02:00
double lineAngle() const;
2018-10-15 11:15:00 +10:00
%Docstring
Returns the angle for the parallel lines used to fill the symbol.
Angles are in degrees, clockwise from North.
.. seealso:: :py:func:`setLineAngle`
%End
2016-07-18 09:42:45 +10:00
2012-09-24 02:28:15 +02:00
void setDistance( double d );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the distance between lines in the fill pattern.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param d: distance. Units are specified by setDistanceUnit()
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`distance`
2017-12-15 10:36:55 -04:00
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`setDistanceUnit`
2017-06-06 11:03:05 +02:00
%End
2016-07-18 09:42:45 +10:00
2012-09-24 02:28:15 +02:00
double distance() const;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the distance between lines in the fill pattern. Units are retrieved by distanceUnit().
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`setDistance`
2017-12-15 10:36:55 -04:00
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`distanceUnit`
2017-06-06 11:03:05 +02:00
%End
2012-09-24 02:28:15 +02:00
void setLineWidth( double w );
2018-10-15 11:15:00 +10:00
%Docstring
Sets the width of the line subsymbol used to render the parallel lines
in the fill.
.. seealso:: :py:func:`lineWidth`
%End
2012-09-24 02:28:15 +02:00
double lineWidth() const;
2018-10-15 11:15:00 +10:00
%Docstring
Returns the width of the line subsymbol used to render the parallel lines
in the fill.
.. seealso:: :py:func:`setLineWidth`
%End
2017-06-06 11:03:05 +02:00
virtual void setColor( const QColor &c );
virtual QColor color() const;
2018-10-15 11:15:00 +10:00
2012-09-24 02:28:15 +02:00
void setOffset( double offset );
2018-10-15 11:15:00 +10:00
%Docstring
Sets the ``offset`` distance for lines within the fill, which is
the distance to offset the parallel lines from their normal
position.
Units are specified via setOffsetUnit().
.. seealso:: :py:func:`offset`
.. seealso:: :py:func:`setOffsetUnit`
.. seealso:: :py:func:`setOffsetMapUnitScale`
%End
2012-09-24 02:28:15 +02:00
double offset() const;
2018-10-15 11:15:00 +10:00
%Docstring
Returns the offset distance for lines within the fill, which is
the distance to offset the parallel lines from their normal
position.
Units are retrieved via offsetUnit().
.. seealso:: :py:func:`setOffset`
.. seealso:: :py:func:`offsetUnit`
.. seealso:: :py:func:`offsetMapUnitScale`
%End
2013-04-19 15:20:44 +02:00
2016-07-17 22:11:17 +10:00
void setDistanceUnit( QgsUnitTypes::RenderUnit unit );
2017-06-06 11:03:05 +02:00
%Docstring
2018-10-15 11:15:00 +10:00
Sets the ``unit`` for the distance between lines in the fill pattern.
2017-12-15 10:36:55 -04:00
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`distanceUnit`
2017-12-15 10:36:55 -04:00
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`setDistance`
2017-06-06 11:03:05 +02:00
%End
2016-07-18 09:42:45 +10:00
2016-07-17 22:11:17 +10:00
QgsUnitTypes::RenderUnit distanceUnit() const;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the units for the distance between lines in the fill pattern.
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`setDistanceUnit`
2017-12-15 10:36:55 -04:00
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`distance`
2017-06-06 11:03:05 +02:00
%End
2014-05-07 19:02:11 +02:00
2017-06-06 11:03:05 +02:00
void setDistanceMapUnitScale( const QgsMapUnitScale &scale );
2018-10-15 11:15:00 +10:00
%Docstring
Sets the map unit ``scale`` for the pattern's line distance.
.. seealso:: :py:func:`distanceMapUnitScale`
.. seealso:: :py:func:`setDistance`
.. seealso:: :py:func:`setDistanceUnit`
%End
2017-05-01 18:13:15 +02:00
const QgsMapUnitScale &distanceMapUnitScale() const;
2018-10-15 11:15:00 +10:00
%Docstring
Returns the map unit scale for the pattern's line distance.
.. seealso:: :py:func:`setDistanceMapUnitScale`
.. seealso:: :py:func:`distance`
.. seealso:: :py:func:`distanceUnit`
%End
2013-04-19 15:20:44 +02:00
2016-07-17 22:11:17 +10:00
void setLineWidthUnit( QgsUnitTypes::RenderUnit unit );
2017-06-06 11:03:05 +02:00
%Docstring
2018-10-15 11:15:00 +10:00
Sets the ``unit`` for the line's width.
2017-12-15 10:36:55 -04:00
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`lineWidthUnit`
2017-06-06 11:03:05 +02:00
%End
2016-07-18 09:42:45 +10:00
2016-07-17 22:11:17 +10:00
QgsUnitTypes::RenderUnit lineWidthUnit() const;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the units for the line's width.
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`setLineWidthUnit`
2017-06-06 11:03:05 +02:00
%End
2014-05-07 19:02:11 +02:00
2017-06-06 11:03:05 +02:00
void setLineWidthMapUnitScale( const QgsMapUnitScale &scale );
2018-10-15 11:15:00 +10:00
%Docstring
Sets the map unit ``scale`` for the pattern's line width.
.. seealso:: :py:func:`lineWidthMapUnitScale`
.. seealso:: :py:func:`setLineWidth`
.. seealso:: :py:func:`setLineWidthUnit`
%End
2017-05-01 18:13:15 +02:00
const QgsMapUnitScale &lineWidthMapUnitScale() const;
2018-10-15 11:15:00 +10:00
%Docstring
Returns the map unit scale for the pattern's line width.
.. seealso:: :py:func:`setLineWidthMapUnitScale`
.. seealso:: :py:func:`lineWidth`
.. seealso:: :py:func:`lineWidthUnit`
%End
2013-04-19 15:20:44 +02:00
2016-07-17 22:11:17 +10:00
void setOffsetUnit( QgsUnitTypes::RenderUnit unit );
2017-06-06 11:03:05 +02:00
%Docstring
2018-10-15 11:15:00 +10:00
Sets the ``unit`` for the line pattern's offset.
2017-12-15 10:36:55 -04:00
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`offsetUnit`
2017-06-06 11:03:05 +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-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the units for the line pattern's offset.
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`setOffsetUnit`
2017-06-06 11:03:05 +02:00
%End
2014-05-07 19:02:11 +02:00
2017-06-06 11:03:05 +02:00
void setOffsetMapUnitScale( const QgsMapUnitScale &scale );
2018-10-15 11:15:00 +10:00
%Docstring
Sets the map unit ``scale`` for the pattern's line 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;
2018-10-15 11:15:00 +10:00
%Docstring
Returns the map unit scale for the pattern's line offset.
.. seealso:: :py:func:`setOffsetMapUnitScale`
.. seealso:: :py:func:`offset`
.. seealso:: :py:func:`offsetUnit`
%End
2013-04-19 15:20:44 +02:00
2017-06-06 11:03:05 +02:00
virtual void setOutputUnit( QgsUnitTypes::RenderUnit unit );
2014-05-07 19:02:11 +02:00
2017-06-06 11:03:05 +02:00
virtual QgsUnitTypes::RenderUnit outputUnit() const;
2014-01-27 09:22:24 +01:00
2017-06-06 11:03:05 +02:00
virtual void setMapUnitScale( const QgsMapUnitScale &scale );
2015-05-19 16:54:37 +10:00
2017-06-06 11:03:05 +02:00
virtual QgsMapUnitScale mapUnitScale() const;
2017-02-20 10:37:06 +10:00
2017-06-06 11:03:05 +02:00
virtual bool setSubSymbol( QgsSymbol *symbol /Transfer/ );
virtual QgsSymbol *subSymbol();
virtual QSet<QString> usedAttributes( const QgsRenderContext &context ) const;
2019-01-22 13:29:00 +10:00
virtual bool hasDataDefinedProperties() const;
2017-06-06 11:03:05 +02:00
protected:
virtual void applyDataDefinedSettings( QgsSymbolRenderContext &context );
private:
QgsLinePatternFillSymbolLayer( const QgsLinePatternFillSymbolLayer &other );
2012-09-24 02:28:15 +02:00
};
2017-06-06 11:03:05 +02:00
class QgsPointPatternFillSymbolLayer: QgsImageFillSymbolLayer
2012-09-24 02:28:15 +02:00
{
2017-06-06 11:03:05 +02:00
2012-09-24 02:28:15 +02:00
%TypeHeaderCode
2017-06-06 11:03:05 +02:00
#include "qgsfillsymbollayer.h"
2012-09-24 02:28:15 +02:00
%End
public:
QgsPointPatternFillSymbolLayer();
~QgsPointPatternFillSymbolLayer();
2017-05-01 18:13:15 +02:00
static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) /Factory/;
static QgsSymbolLayer *createFromSld( QDomElement &element ) /Factory/;
2012-09-24 02:28:15 +02:00
2017-06-06 11:03:05 +02:00
virtual QString layerType() const;
2012-09-24 02:28:15 +02:00
2017-06-06 11:03:05 +02:00
virtual void startRender( QgsSymbolRenderContext &context );
virtual void stopRender( QgsSymbolRenderContext &context );
virtual QgsStringMap properties() const;
2012-09-24 02:28:15 +02:00
2017-05-01 18:13:15 +02:00
virtual QgsPointPatternFillSymbolLayer *clone() const /Factory/;
2012-09-24 02:28:15 +02:00
2017-06-06 11:03:05 +02:00
virtual void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const;
virtual double estimateMaxBleed( const QgsRenderContext &context ) const;
2014-01-27 09:22:24 +01:00
2012-09-24 02:28:15 +02:00
double distanceX() const;
void setDistanceX( double d );
double distanceY() const;
void setDistanceY( double d );
double displacementX() const;
void setDisplacementX( double d );
double displacementY() const;
void setDisplacementY( double d );
2019-04-24 11:16:28 +07:00
void setOffsetX( double offset );
%Docstring
Sets the horizontal offset values for points in the pattern.
:param offset: offset value
.. seealso:: :py:func:`offsetX`
.. seealso:: :py:func:`setOffsetY`
2019-04-25 09:53:25 +07:00
.. versionadded:: 3.8
2019-04-24 11:16:28 +07:00
%End
double offsetX() const;
%Docstring
Returns the horizontal offset values for points in the pattern.
.. seealso:: :py:func:`setOffsetX`
.. seealso:: :py:func:`offsetY`
2019-04-25 09:53:25 +07:00
.. versionadded:: 3.8
2019-04-24 11:16:28 +07:00
%End
void setOffsetY( double offset );
%Docstring
Sets the vertical offset values for points in the pattern.
:param offset: offset value
.. seealso:: :py:func:`offsetY`
.. seealso:: :py:func:`setOffsetX`
2019-04-25 09:53:25 +07:00
.. versionadded:: 3.8
2019-04-24 11:16:28 +07:00
%End
double offsetY() const;
%Docstring
Returns the vertical offset values for points in the pattern.
.. seealso:: :py:func:`setOffsetY`
.. seealso:: :py:func:`offsetX`
2019-04-25 09:53:25 +07:00
.. versionadded:: 3.8
2019-04-24 11:16:28 +07:00
%End
2017-06-06 11:03:05 +02:00
virtual bool setSubSymbol( QgsSymbol *symbol /Transfer/ );
2017-05-01 18:13:15 +02:00
virtual QgsSymbol *subSymbol();
2013-04-19 15:20:44 +02:00
2016-07-17 22:11:17 +10:00
void setDistanceXUnit( QgsUnitTypes::RenderUnit unit );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the units for the horizontal distance between points in the pattern.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param unit: distance units
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`distanceXUnit`
2017-12-15 10:36:55 -04:00
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`setDistanceYUnit`
2017-06-06 11:03:05 +02:00
%End
2016-07-18 09:42:45 +10:00
2016-07-17 22:11:17 +10:00
QgsUnitTypes::RenderUnit distanceXUnit() const;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the units for the horizontal distance between points in the pattern.
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`setDistanceXUnit`
2017-12-15 10:36:55 -04:00
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`distanceYUnit`
2017-06-06 11:03:05 +02:00
%End
2014-05-07 19:02:11 +02:00
2017-06-06 11:03:05 +02:00
void setDistanceXMapUnitScale( const QgsMapUnitScale &scale );
2017-05-01 18:13:15 +02:00
const QgsMapUnitScale &distanceXMapUnitScale() const;
2013-04-19 15:20:44 +02:00
2016-07-17 22:11:17 +10:00
void setDistanceYUnit( QgsUnitTypes::RenderUnit unit );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the units for the vertical distance between points in the pattern.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param unit: distance units
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`distanceYUnit`
2017-12-15 10:36:55 -04:00
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`setDistanceXUnit`
2017-06-06 11:03:05 +02:00
%End
2016-07-18 09:42:45 +10:00
2016-07-17 22:11:17 +10:00
QgsUnitTypes::RenderUnit distanceYUnit() const;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the units for the vertical distance between points in the pattern.
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`setDistanceYUnit`
2017-12-15 10:36:55 -04:00
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`distanceXUnit`
2017-06-06 11:03:05 +02:00
%End
2014-05-07 19:02:11 +02:00
2017-06-06 11:03:05 +02:00
void setDistanceYMapUnitScale( const QgsMapUnitScale &scale );
2017-05-01 18:13:15 +02:00
const QgsMapUnitScale &distanceYMapUnitScale() const;
2013-04-19 15:20:44 +02:00
2016-07-17 22:11:17 +10:00
void setDisplacementXUnit( QgsUnitTypes::RenderUnit unit );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the units for the horizontal displacement between rows in the pattern.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param unit: displacement units
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`displacementXUnit`
2017-12-15 10:36:55 -04:00
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`setDisplacementYUnit`
2017-06-06 11:03:05 +02:00
%End
2016-07-17 22:11:17 +10:00
QgsUnitTypes::RenderUnit displacementXUnit() const;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the units for the horizontal displacement between rows in the pattern.
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`setDisplacementXUnit`
2017-12-15 10:36:55 -04:00
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`displacementYUnit`
2017-06-06 11:03:05 +02:00
%End
2014-05-07 19:02:11 +02:00
2017-06-06 11:03:05 +02:00
void setDisplacementXMapUnitScale( const QgsMapUnitScale &scale );
2017-05-01 18:13:15 +02:00
const QgsMapUnitScale &displacementXMapUnitScale() const;
2013-04-19 15:20:44 +02:00
2016-07-17 22:11:17 +10:00
void setDisplacementYUnit( QgsUnitTypes::RenderUnit unit );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets the units for the vertical displacement between rows in the pattern.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param unit: displacement units
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`displacementYUnit`
2017-12-15 10:36:55 -04:00
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`setDisplacementXUnit`
2017-06-06 11:03:05 +02:00
%End
2016-07-17 22:11:17 +10:00
QgsUnitTypes::RenderUnit displacementYUnit() const;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the units for the vertical displacement between rows in the pattern.
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`setDisplacementYUnit`
2017-12-15 10:36:55 -04:00
2018-01-09 17:26:37 -04:00
.. seealso:: :py:func:`displacementXUnit`
2017-06-06 11:03:05 +02:00
%End
2014-05-07 19:02:11 +02:00
2017-06-06 11:03:05 +02:00
void setDisplacementYMapUnitScale( const QgsMapUnitScale &scale );
2017-05-01 18:13:15 +02:00
const QgsMapUnitScale &displacementYMapUnitScale() const;
2017-06-06 11:03:05 +02:00
2019-04-24 11:16:28 +07:00
void setOffsetXUnit( QgsUnitTypes::RenderUnit unit );
%Docstring
Sets the units for the horizontal offset between rows in the pattern.
:param unit: offset units
.. seealso:: :py:func:`offsetXUnit`
.. seealso:: :py:func:`setOffsetYUnit`
2019-04-25 09:53:25 +07:00
.. versionadded:: 3.8
2019-04-24 11:16:28 +07:00
%End
QgsUnitTypes::RenderUnit offsetXUnit() const;
%Docstring
Returns the units for the horizontal offset for rows in the pattern.
.. seealso:: :py:func:`setOffsetXUnit`
.. seealso:: :py:func:`offsetYUnit`
2019-04-25 09:53:25 +07:00
.. versionadded:: 3.8
2019-04-24 11:16:28 +07:00
%End
void setOffsetXMapUnitScale( const QgsMapUnitScale &scale );
%Docstring
Sets the unit scale for the horizontal offset for rows in the pattern.
:param scale: offset unit scale
.. seealso:: :py:func:`offsetXMapUnitScale`
.. seealso:: :py:func:`setOffsetYMapUnitScale`
2019-04-25 09:53:25 +07:00
.. versionadded:: 3.8
2019-04-24 11:16:28 +07:00
%End
const QgsMapUnitScale &offsetXMapUnitScale() const;
%Docstring
Returns the unit scale for the horizontal offset for rows in the pattern.
.. seealso:: :py:func:`setOffsetXMapUnitScale`
.. seealso:: :py:func:`offsetYMapUnitScale`
2019-04-25 09:53:25 +07:00
.. versionadded:: 3.8
2019-04-24 11:16:28 +07:00
%End
void setOffsetYUnit( QgsUnitTypes::RenderUnit unit );
%Docstring
Sets the units for the vertical offset for rows in the pattern.
:param unit: offset units
.. seealso:: :py:func:`offsetYUnit`
.. seealso:: :py:func:`setOffsetXUnit`
2019-04-25 09:53:25 +07:00
.. versionadded:: 3.8
2019-04-24 11:16:28 +07:00
%End
QgsUnitTypes::RenderUnit offsetYUnit() const;
%Docstring
Returns the units for the vertical offset for rows in the pattern.
.. seealso:: :py:func:`setOffsetYUnit`
.. seealso:: :py:func:`offsetXUnit`
2019-04-25 09:53:25 +07:00
.. versionadded:: 3.8
2019-04-24 11:16:28 +07:00
%End
void setOffsetYMapUnitScale( const QgsMapUnitScale &scale );
%Docstring
Sets the unit scale for the vertical offset for rows in the pattern.
:param scale: offset unit scale
.. seealso:: :py:func:`offsetYMapUnitScale`
.. seealso:: :py:func:`setOffsetXMapUnitScale`
2019-04-25 09:53:25 +07:00
.. versionadded:: 3.8
2019-04-24 11:16:28 +07:00
%End
const QgsMapUnitScale &offsetYMapUnitScale() const;
%Docstring
Returns the unit scale for the vertical offset between rows in the pattern.
.. seealso:: :py:func:`setOffsetYMapUnitScale`
.. seealso:: :py:func:`offsetXMapUnitScale`
2019-04-25 09:53:25 +07:00
.. versionadded:: 3.8
2019-04-24 11:16:28 +07:00
%End
2017-06-06 11:03:05 +02:00
virtual void setOutputUnit( QgsUnitTypes::RenderUnit unit );
2013-04-19 15:20:44 +02:00
2017-06-06 11:03:05 +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-06-23 16:00:16 +02:00
2017-05-01 18:13:15 +02:00
virtual QSet<QString> usedAttributes( const QgsRenderContext &context ) const;
2017-12-15 08:57:22 +10:00
2019-01-22 13:29:00 +10:00
virtual bool hasDataDefinedProperties() const;
2017-06-06 11:03:05 +02:00
virtual void setColor( const QColor &c );
2014-01-27 09:22:24 +01:00
2016-05-07 21:52:05 +10:00
virtual QColor color() const;
2017-12-15 08:57:22 +10:00
2013-06-23 16:00:16 +02:00
protected:
2017-02-20 10:37:06 +10:00
2017-06-06 11:03:05 +02:00
virtual void applyDataDefinedSettings( QgsSymbolRenderContext &context );
2017-02-20 10:37:06 +10:00
2017-06-06 11:03:05 +02:00
private:
2017-05-01 18:13:15 +02:00
QgsPointPatternFillSymbolLayer( const QgsPointPatternFillSymbolLayer &other );
2012-09-24 02:28:15 +02:00
};
2016-08-06 11:01:42 +02:00
class QgsCentroidFillSymbolLayer : QgsFillSymbolLayer
2012-09-24 02:28:15 +02:00
{
2017-06-06 11:03:05 +02:00
2012-09-24 02:28:15 +02:00
%TypeHeaderCode
2017-06-06 11:03:05 +02:00
#include "qgsfillsymbollayer.h"
2012-09-24 02:28:15 +02:00
%End
public:
2016-08-06 11:01:42 +02:00
QgsCentroidFillSymbolLayer();
2012-09-24 02:28:15 +02:00
2017-05-01 18:13:15 +02:00
static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) /Factory/;
static QgsSymbolLayer *createFromSld( QDomElement &element ) /Factory/;
2017-06-06 11:03:05 +02:00
2012-09-24 02:28:15 +02:00
2017-06-06 11:03:05 +02:00
virtual QString layerType() const;
2012-09-24 02:28:15 +02:00
2017-06-06 11:03:05 +02:00
virtual void startRender( QgsSymbolRenderContext &context );
2012-09-24 02:28:15 +02:00
2017-06-06 11:03:05 +02:00
virtual void stopRender( QgsSymbolRenderContext &context );
virtual void renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context );
virtual QgsStringMap properties() const;
2012-09-24 02:28:15 +02:00
2017-05-01 18:13:15 +02:00
virtual QgsCentroidFillSymbolLayer *clone() const /Factory/;
2012-09-24 02:28:15 +02:00
2017-06-06 11:03:05 +02:00
virtual void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const;
2012-09-24 02:28:15 +02:00
2017-06-06 11:03:05 +02:00
virtual void setColor( const QColor &color );
2013-06-23 16:00:16 +02:00
2017-06-06 11:03:05 +02:00
virtual QColor color() const;
virtual QgsSymbol *subSymbol();
virtual bool setSubSymbol( QgsSymbol *symbol /Transfer/ );
virtual void setOutputUnit( QgsUnitTypes::RenderUnit unit );
virtual QgsUnitTypes::RenderUnit outputUnit() const;
virtual void setMapUnitScale( const QgsMapUnitScale &scale );
virtual QgsMapUnitScale mapUnitScale() const;
2014-05-07 19:02:11 +02:00
2014-01-27 09:22:24 +01:00
2017-05-01 18:13:15 +02:00
virtual QSet<QString> usedAttributes( const QgsRenderContext &context ) const;
2015-11-10 17:08:27 +11:00
2019-01-22 13:29:00 +10:00
virtual bool hasDataDefinedProperties() const;
2017-12-15 08:57:22 +10:00
2015-11-10 17:08:27 +11:00
void setPointOnSurface( bool pointOnSurface );
bool pointOnSurface() const;
2016-04-23 21:40:36 +07:00
void setPointOnAllParts( bool pointOnAllParts );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Sets whether a point is drawn for all parts or only on the biggest part of multi-part features.
2017-06-06 11:03:05 +02:00
.. versionadded:: 2.16
%End
2016-04-23 21:40:36 +07:00
bool pointOnAllParts() const;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns whether a point is drawn for all parts or only on the biggest part of multi-part features.
2017-06-06 11:03:05 +02:00
.. versionadded:: 2.16
%End
2017-02-20 10:37:06 +10:00
2017-06-06 11:03:05 +02:00
protected:
2017-02-20 10:37:06 +10:00
2017-06-06 11:03:05 +02:00
private:
2017-05-01 18:13:15 +02:00
QgsCentroidFillSymbolLayer( const QgsCentroidFillSymbolLayer &other );
2012-09-24 02:28:15 +02:00
};
2017-06-06 11:03:05 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
2017-08-06 13:39:03 +02:00
* src/core/symbology/qgsfillsymbollayer.h *
2017-06-06 11:03:05 +02:00
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/