QGIS/python/core/symbology/qgssymbollayerutils.sip

1071 lines
28 KiB
Plaintext
Raw Normal View History

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/qgssymbollayerutils.h *
2017-06-06 11:03:05 +02:00
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
typedef QMap<QString, QString> QgsStringMap;
typedef QMap<QString, QgsSymbol * > QgsSymbolMap;
2016-08-05 08:08:39 +02:00
class QgsSymbolLayerUtils
{
2017-06-06 11:03:05 +02:00
%TypeHeaderCode
2017-06-06 11:03:05 +02:00
#include "qgssymbollayerutils.h"
%End
public:
static QString encodeColor( const QColor &color );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: str
2017-06-06 11:03:05 +02:00
%End
static QColor decodeColor( const QString &str );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: QColor
2017-06-06 11:03:05 +02:00
%End
static QString encodeSldAlpha( int alpha );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: str
2017-06-06 11:03:05 +02:00
%End
static int decodeSldAlpha( const QString &str );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: int
2017-06-06 11:03:05 +02:00
%End
static QString encodeSldFontStyle( QFont::Style style );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: str
2017-06-06 11:03:05 +02:00
%End
static QFont::Style decodeSldFontStyle( const QString &str );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: QFont.Style
2017-06-06 11:03:05 +02:00
%End
static QString encodeSldFontWeight( int weight );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: str
2017-06-06 11:03:05 +02:00
%End
static int decodeSldFontWeight( const QString &str );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: int
2017-06-06 11:03:05 +02:00
%End
static QString encodePenStyle( Qt::PenStyle style );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: str
2017-06-06 11:03:05 +02:00
%End
static Qt::PenStyle decodePenStyle( const QString &str );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: Qt.PenStyle
2017-06-06 11:03:05 +02:00
%End
static QString encodePenJoinStyle( Qt::PenJoinStyle style );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: str
2017-06-06 11:03:05 +02:00
%End
static Qt::PenJoinStyle decodePenJoinStyle( const QString &str );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: Qt.PenJoinStyle
2017-06-06 11:03:05 +02:00
%End
static QString encodePenCapStyle( Qt::PenCapStyle style );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: str
2017-06-06 11:03:05 +02:00
%End
static Qt::PenCapStyle decodePenCapStyle( const QString &str );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: Qt.PenCapStyle
2017-06-06 11:03:05 +02:00
%End
static QString encodeSldLineJoinStyle( Qt::PenJoinStyle style );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: str
2017-06-06 11:03:05 +02:00
%End
static Qt::PenJoinStyle decodeSldLineJoinStyle( const QString &str );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: Qt.PenJoinStyle
2017-06-06 11:03:05 +02:00
%End
static QString encodeSldLineCapStyle( Qt::PenCapStyle style );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: str
2017-06-06 11:03:05 +02:00
%End
static Qt::PenCapStyle decodeSldLineCapStyle( const QString &str );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: Qt.PenCapStyle
2017-06-06 11:03:05 +02:00
%End
static QString encodeBrushStyle( Qt::BrushStyle style );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: str
2017-06-06 11:03:05 +02:00
%End
static Qt::BrushStyle decodeBrushStyle( const QString &str );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: Qt.BrushStyle
2017-06-06 11:03:05 +02:00
%End
static QString encodeSldBrushStyle( Qt::BrushStyle style );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: str
2017-06-06 11:03:05 +02:00
%End
static Qt::BrushStyle decodeSldBrushStyle( const QString &str );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: Qt.BrushStyle
2017-06-06 11:03:05 +02:00
%End
static QString encodePoint( QPointF point );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Encodes a QPointF to a string.
:rtype: str
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`decodePoint()`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`encodeSize()`
2017-06-06 11:03:05 +02:00
%End
static QPointF decodePoint( const QString &string );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Decodes a QSizeF from a string.
:rtype: QPointF
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`encodePoint()`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`decodeSize()`
2017-06-06 11:03:05 +02:00
%End
static QString encodeSize( QSizeF size );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Encodes a QSizeF to a string.
:rtype: str
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`decodeSize()`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`encodePoint()`
2017-12-15 10:36:55 -04:00
2017-06-06 11:03:05 +02:00
.. versionadded:: 3.0
%End
static QSizeF decodeSize( const QString &string );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Decodes a QSizeF from a string.
:rtype: QSizeF
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`encodeSize()`
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`decodePoint()`
2017-12-15 10:36:55 -04:00
2017-06-06 11:03:05 +02:00
.. versionadded:: 3.0
%End
static QString encodeMapUnitScale( const QgsMapUnitScale &mapUnitScale );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: str
2017-06-06 11:03:05 +02:00
%End
static QgsMapUnitScale decodeMapUnitScale( const QString &str );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: QgsMapUnitScale
2017-06-06 11:03:05 +02:00
%End
static QString encodeRealVector( const QVector<qreal> &v );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: str
2017-06-06 11:03:05 +02:00
%End
static QVector<qreal> decodeRealVector( const QString &s );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: list of qreal
2017-06-06 11:03:05 +02:00
%End
static QString encodeSldRealVector( const QVector<qreal> &v );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: str
2017-06-06 11:03:05 +02:00
%End
static QVector<qreal> decodeSldRealVector( const QString &s );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: list of qreal
2017-06-06 11:03:05 +02:00
%End
static QString encodeSldUom( QgsUnitTypes::RenderUnit unit, double *scaleFactor );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Encodes a render unit into an SLD unit of measure string.
:param unit: unit to encode
:param scaleFactor: if specified, will be set to scale factor for unit of measure
:return: encoded string
:rtype: str
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`decodeSldUom()`
2017-06-06 11:03:05 +02:00
%End
2016-07-18 09:42:45 +10:00
static QgsUnitTypes::RenderUnit decodeSldUom( const QString &str, double *scaleFactor );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Decodes a SLD unit of measure string to a render unit.
:param str: string to decode
:param scaleFactor: if specified, will be set to scale factor for unit of measure
:return: matching render unit
:rtype: QgsUnitTypes.RenderUnit
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`encodeSldUom()`
2017-06-06 11:03:05 +02:00
%End
2017-05-16 10:41:09 +02:00
static double sizeInPixelsFromSldUom( const QString &uom, double size );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the size scaled in pixels according to the uom attribute.
:param uom: The uom attribute from SLD 1.1 version
:param size: The original size
:return: the size in pixels
:rtype: float
2017-06-06 11:03:05 +02:00
.. versionadded:: 3.0
%End
2017-05-16 10:41:09 +02:00
2016-08-05 08:09:43 +02:00
static QString encodeScaleMethod( QgsSymbol::ScaleMethod scaleMethod );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: str
2017-06-06 11:03:05 +02:00
%End
static QgsSymbol::ScaleMethod decodeScaleMethod( const QString &str );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: QgsSymbol.ScaleMethod
2017-06-06 11:03:05 +02:00
%End
2014-08-17 13:37:26 +02:00
static QPainter::CompositionMode decodeBlendMode( const QString &s );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: QPainter.CompositionMode
2017-06-06 11:03:05 +02:00
%End
static QIcon symbolPreviewIcon( QgsSymbol *symbol, QSize size, int padding = 0 );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns an icon preview for a color ramp.
:param symbol: symbol
:param size: target pixmap size
:param padding: space between icon edge and symbol
:rtype: QIcon
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`symbolPreviewPixmap()`
2017-06-06 11:03:05 +02:00
%End
static QPixmap symbolPreviewPixmap( QgsSymbol *symbol, QSize size, int padding = 0, QgsRenderContext *customContext = 0 );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns a pixmap preview for a color ramp.
:param symbol: symbol
:param size: target pixmap size
:param padding: space between icon edge and symbol
:param customContext: render context to use when rendering symbol
:rtype: QPixmap
2017-06-06 11:03:05 +02:00
.. note::
Parameter customContext added in QGIS 2.6
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`symbolPreviewIcon()`
2017-06-06 11:03:05 +02:00
%End
static QPicture symbolLayerPreviewPicture( QgsSymbolLayer *layer, QgsUnitTypes::RenderUnit units, QSize size, const QgsMapUnitScale &scale = QgsMapUnitScale() );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Draws a symbol layer preview to a QPicture
:param layer: symbol layer to draw
:param units: size units
:param size: target size of preview picture
:param scale: map unit scale for preview
:return: QPicture containing symbol layer preview
:rtype: QPicture
2017-06-06 11:03:05 +02:00
.. versionadded:: 2.9
2017-12-15 10:36:55 -04:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`symbolLayerPreviewIcon()`
2017-06-06 11:03:05 +02:00
%End
static QIcon symbolLayerPreviewIcon( QgsSymbolLayer *layer, QgsUnitTypes::RenderUnit u, QSize size, const QgsMapUnitScale &scale = QgsMapUnitScale() );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Draws a symbol layer preview to an icon.
:param layer: symbol layer to draw
:param u: size units
:param size: target size of preview icon
:param scale: map unit scale for preview
:return: icon containing symbol layer preview
:rtype: QIcon
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`symbolLayerPreviewPicture()`
2017-06-06 11:03:05 +02:00
%End
2016-07-18 09:42:45 +10:00
static QIcon colorRampPreviewIcon( QgsColorRamp *ramp, QSize size, int padding = 0 );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns an icon preview for a color ramp.
:param ramp: color ramp
:param size: target icon size
:param padding: space between icon edge and color ramp
:rtype: QIcon
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`colorRampPreviewPixmap()`
2017-06-06 11:03:05 +02:00
%End
static QPixmap colorRampPreviewPixmap( QgsColorRamp *ramp, QSize size, int padding = 0 );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns a pixmap preview for a color ramp.
:param ramp: color ramp
:param size: target pixmap size
:param padding: space between icon edge and color ramp
:rtype: QPixmap
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`colorRampPreviewIcon()`
2017-06-06 11:03:05 +02:00
%End
static void drawStippledBackground( QPainter *painter, QRect rect );
static double estimateMaxSymbolBleed( QgsSymbol *symbol, const QgsRenderContext &context );
2017-06-06 11:03:05 +02:00
%Docstring
Returns the maximum estimated bleed for the symbol
2017-12-15 10:36:55 -04:00
:rtype: float
2017-06-06 11:03:05 +02:00
%End
static QgsSymbol *loadSymbol( const QDomElement &element, const QgsReadWriteContext &context ) /Factory/;
%Docstring
2017-12-15 10:36:55 -04:00
Attempts to load a symbol from a DOM element
:param element: DOM element representing symbol
:param context: object to transform relative to absolute paths
:return: decoded symbol, if possible
:rtype: QgsSymbol
2017-06-06 11:03:05 +02:00
%End
static QgsSymbolLayer *loadSymbolLayer( QDomElement &element, const QgsReadWriteContext &context ) /Factory/;
%Docstring
Reads and returns symbol layer from XML. Caller is responsible for deleting the returned object
2017-12-15 10:36:55 -04:00
:rtype: QgsSymbolLayer
2017-06-06 11:03:05 +02:00
%End
static QDomElement saveSymbol( const QString &symbolName, QgsSymbol *symbol, QDomDocument &doc, const QgsReadWriteContext &context );
%Docstring
Writes a symbol definition to XML
2017-12-15 10:36:55 -04:00
:rtype: QDomElement
2017-06-06 11:03:05 +02:00
%End
2014-01-26 18:35:21 +01:00
static QString symbolProperties( QgsSymbol *symbol );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns a string representing the symbol. Can be used to test for equality
between symbols.
:rtype: str
2017-06-06 11:03:05 +02:00
.. versionadded:: 2.12
%End
static bool createSymbolLayerListFromSld( QDomElement &element, QgsWkbTypes::GeometryType geomType, QgsSymbolLayerList &layers );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: bool
2017-06-06 11:03:05 +02:00
%End
2017-07-24 13:02:20 +10:00
static QgsSymbolLayer *createFillLayerFromSld( QDomElement &element ) /Factory/;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: QgsSymbolLayer
2017-06-06 11:03:05 +02:00
%End
2017-07-24 13:02:20 +10:00
static QgsSymbolLayer *createLineLayerFromSld( QDomElement &element ) /Factory/;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: QgsSymbolLayer
2017-06-06 11:03:05 +02:00
%End
2017-07-24 13:02:20 +10:00
static QgsSymbolLayer *createMarkerLayerFromSld( QDomElement &element ) /Factory/;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: QgsSymbolLayer
2017-06-06 11:03:05 +02:00
%End
2016-08-05 08:08:39 +02:00
static bool convertPolygonSymbolizerToPointMarker( QDomElement &element, QgsSymbolLayerList &layerList );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: bool
2017-06-06 11:03:05 +02:00
%End
static bool hasExternalGraphic( QDomElement &element );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: bool
2017-06-06 11:03:05 +02:00
%End
static bool hasWellKnownMark( QDomElement &element );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: bool
2017-06-06 11:03:05 +02:00
%End
static bool needFontMarker( QDomElement &element );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: bool
2017-06-06 11:03:05 +02:00
%End
static bool needSvgMarker( QDomElement &element );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: bool
2017-06-06 11:03:05 +02:00
%End
static bool needEllipseMarker( QDomElement &element );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: bool
2017-06-06 11:03:05 +02:00
%End
static bool needMarkerLine( QDomElement &element );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: bool
2017-06-06 11:03:05 +02:00
%End
static bool needLinePatternFill( QDomElement &element );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: bool
2017-06-06 11:03:05 +02:00
%End
static bool needPointPatternFill( QDomElement &element );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: bool
2017-06-06 11:03:05 +02:00
%End
static bool needSvgFill( QDomElement &element );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: bool
2017-06-06 11:03:05 +02:00
%End
static void fillToSld( QDomDocument &doc, QDomElement &element,
Qt::BrushStyle brushStyle, const QColor &color = QColor() );
static bool fillFromSld( QDomElement &element,
Qt::BrushStyle &brushStyle, QColor &color );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: bool
2017-06-06 11:03:05 +02:00
%End
static bool lineFromSld( QDomElement &element,
Qt::PenStyle &penStyle, QColor &color, double &width,
Qt::PenJoinStyle *penJoinStyle = 0, Qt::PenCapStyle *penCapStyle = 0,
QVector<qreal> *customDashPattern = 0, double *dashOffset = 0 );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: bool
2017-06-06 11:03:05 +02:00
%End
static void externalGraphicToSld( QDomDocument &doc, QDomElement &element,
2017-06-06 11:03:05 +02:00
const QString &path, const QString &mime,
const QColor &color, double size = -1 );
static bool externalGraphicFromSld( QDomElement &element,
QString &path, QString &mime,
QColor &color, double &size );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: bool
2017-06-06 11:03:05 +02:00
%End
static void wellKnownMarkerToSld( QDomDocument &doc, QDomElement &element,
2017-06-06 11:03:05 +02:00
const QString &name, const QColor &color, const QColor &strokeColor, Qt::PenStyle strokeStyle,
double strokeWidth = -1, double size = -1 );
static bool wellKnownMarkerFromSld( QDomElement &element,
QString &name, QColor &color, QColor &strokeColor, Qt::PenStyle &strokeStyle,
double &strokeWidth, double &size ) /PyName=wellKnownMarkerFromSld2/;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: bool
2017-06-06 11:03:05 +02:00
.. note::
available in Python as wellKnownMarkerFromSld2
%End
static void externalMarkerToSld( QDomDocument &doc, QDomElement &element,
2017-06-06 11:03:05 +02:00
const QString &path, const QString &format, int *markIndex = 0,
const QColor &color = QColor(), double size = -1 );
static bool externalMarkerFromSld( QDomElement &element,
QString &path, QString &format, int &markIndex,
QColor &color, double &size );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: bool
2017-06-06 11:03:05 +02:00
%End
2017-06-06 11:03:05 +02:00
static void labelTextToSld( QDomDocument &doc, QDomElement &element, const QString &label,
const QFont &font, const QColor &color = QColor(), double size = -1 );
2017-06-06 11:03:05 +02:00
static QString ogrFeatureStylePen( double width, double mmScaleFactor, double mapUnitsScaleFactor, const QColor &c,
2013-06-23 16:00:16 +02:00
Qt::PenJoinStyle joinStyle = Qt::MiterJoin,
Qt::PenCapStyle capStyle = Qt::FlatCap,
double offset = 0.0,
const QVector<qreal> *dashPattern = 0 );
2017-06-06 11:03:05 +02:00
%Docstring
Create ogr feature style string for pen
2017-12-15 10:36:55 -04:00
:rtype: str
2017-06-06 11:03:05 +02:00
%End
static QString ogrFeatureStyleBrush( const QColor &fillColr );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Create ogr feature style string for brush
:param fillColr: fill color*
:rtype: str
2017-06-06 11:03:05 +02:00
%End
2013-06-23 16:00:16 +02:00
static void createRotationElement( QDomDocument &doc, QDomElement &element, const QString &rotationFunc );
static bool rotationFromSldElement( QDomElement &element, QString &rotationFunc );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: bool
2017-06-06 11:03:05 +02:00
%End
static void createOpacityElement( QDomDocument &doc, QDomElement &element, const QString &alphaFunc );
static bool opacityFromSldElement( QDomElement &element, QString &alphaFunc );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: bool
2017-06-06 11:03:05 +02:00
%End
static void createDisplacementElement( QDomDocument &doc, QDomElement &element, QPointF offset );
static bool displacementFromSldElement( QDomElement &element, QPointF &offset );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: bool
2017-06-06 11:03:05 +02:00
%End
static void createAnchorPointElement( QDomDocument &doc, QDomElement &element, QPointF anchor );
%Docstring
Creates a SE 1.1 anchor point element as a child of the specified element
2017-12-15 10:36:55 -04:00
:param doc: The document
:param element: The parent element
:param anchor: An anchor specification, with values between 0 and 1
%End
static void createOnlineResourceElement( QDomDocument &doc, QDomElement &element, const QString &path, const QString &format );
static bool onlineResourceFromSldElement( QDomElement &element, QString &path, QString &format );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: bool
2017-06-06 11:03:05 +02:00
%End
static void createGeometryElement( QDomDocument &doc, QDomElement &element, const QString &geomFunc );
static bool geometryFromSldElement( QDomElement &element, QString &geomFunc );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: bool
2017-06-06 11:03:05 +02:00
%End
static bool createExpressionElement( QDomDocument &doc, QDomElement &element, const QString &function );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Creates a OGC Expression element based on the provided function expression
:param doc: The document owning the element
:param element: The element parent
:param function: The expression to be encoded
:return:
:rtype: bool
2017-06-06 11:03:05 +02:00
%End
static bool createFunctionElement( QDomDocument &doc, QDomElement &element, const QString &function );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: bool
2017-06-06 11:03:05 +02:00
%End
static bool functionFromSldElement( QDomElement &element, QString &function );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: bool
2017-06-06 11:03:05 +02:00
%End
static QDomElement createSvgParameterElement( QDomDocument &doc, const QString &name, const QString &value );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: QDomElement
2017-06-06 11:03:05 +02:00
%End
static QgsStringMap getSvgParameterList( QDomElement &element );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: QgsStringMap
2017-06-06 11:03:05 +02:00
%End
static QDomElement createVendorOptionElement( QDomDocument &doc, const QString &name, const QString &value );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: QDomElement
2017-06-06 11:03:05 +02:00
%End
static QgsStringMap getVendorOptionList( QDomElement &element );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: QgsStringMap
2017-06-06 11:03:05 +02:00
%End
static QgsStringMap parseProperties( QDomElement &element );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
:rtype: QgsStringMap
2017-06-06 11:03:05 +02:00
%End
static void saveProperties( QgsStringMap props, QDomDocument &doc, QDomElement &element );
2017-06-06 11:03:05 +02:00
static QgsSymbolMap loadSymbols( QDomElement &element, const QgsReadWriteContext &context ) /Factory/;
%Docstring
Reads a collection of symbols from XML and returns them in a map. Caller is responsible for deleting returned symbols.
2017-12-15 10:36:55 -04:00
:rtype: QgsSymbolMap
2017-06-06 11:03:05 +02:00
%End
static QDomElement saveSymbols( QgsSymbolMap &symbols, const QString &tagName, QDomDocument &doc, const QgsReadWriteContext &context );
%Docstring
Writes a collection of symbols to XML with specified tagName for the top-level element
2017-12-15 10:36:55 -04:00
:rtype: QDomElement
2017-06-06 11:03:05 +02:00
%End
static void clearSymbolMap( QgsSymbolMap &symbols );
static QMimeData *symbolToMimeData( QgsSymbol *symbol ) /Factory/;
%Docstring
2017-12-15 10:36:55 -04:00
Creates new mime data from a ``symbol``.
This also sets the mime color data to match the symbol's color, so that copied symbols
can be paste in places where a color is expected.
:rtype: QMimeData
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`symbolFromMimeData()`
2017-12-15 10:36:55 -04:00
.. versionadded:: 3.0
%End
static QgsSymbol *symbolFromMimeData( const QMimeData *data ) /Factory/;
%Docstring
2017-12-15 10:36:55 -04:00
Attempts to parse ``mime`` data as a symbol. A new symbol instance will be returned
if the data was successfully converted to a symbol.
:rtype: QgsSymbol
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`symbolToMimeData()`
2017-12-15 10:36:55 -04:00
.. versionadded:: 3.0
%End
static QgsColorRamp *loadColorRamp( QDomElement &element ) /Factory/;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Creates a color ramp from the settings encoded in an XML element
:param element: DOM element
:return: new color ramp. Caller takes responsibility for deleting the returned value.
:rtype: QgsColorRamp
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`saveColorRamp()`
2017-06-06 11:03:05 +02:00
%End
static QDomElement saveColorRamp( const QString &name, QgsColorRamp *ramp, QDomDocument &doc );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Encodes a color ramp's settings to an XML element
:param name: name of ramp
:param ramp: color ramp to save
:param doc: XML document
:return: DOM element representing state of color ramp
:rtype: QDomElement
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`loadColorRamp()`
2017-06-06 11:03:05 +02:00
%End
static QVariant colorRampToVariant( const QString &name, QgsColorRamp *ramp );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Saves a color ramp to a QVariantMap, wrapped in a QVariant.
You can use QgsXmlUtils.writeVariant to save it to an XML document.
:rtype: QVariant
2017-06-06 11:03:05 +02:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`loadColorRamp`
2017-06-06 11:03:05 +02:00
%End
2017-07-24 13:02:20 +10:00
static QgsColorRamp *loadColorRamp( const QVariant &value ) /Factory/;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Load a color ramp from a QVariantMap, wrapped in a QVariant.
You can use QgsXmlUtils.readVariant to load it from an XML document.
:rtype: QgsColorRamp
2017-06-06 11:03:05 +02:00
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`colorRampToVariant()`
2017-06-06 11:03:05 +02:00
%End
static QString colorToName( const QColor &color );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns a friendly display name for a color
:param color: source color
:return: display name for color
:rtype: str
2017-06-06 11:03:05 +02:00
.. versionadded:: 2.5
%End
2014-11-13 23:13:13 +01:00
static QList< QColor > parseColorList( const QString &colorStr );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Attempts to parse a string as a list of colors using a variety of common formats, including hex
codes, rgb and rgba strings.
:param colorStr: string representing the color list
:return: list of parsed colors
:rtype: list of QColor
2017-06-06 11:03:05 +02:00
.. versionadded:: 2.5
%End
2014-08-17 13:37:26 +02:00
2017-07-24 13:02:20 +10:00
static QMimeData *colorToMimeData( const QColor &color ) /Factory/;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Creates mime data from a color. Sets both the mime data's color data, and the
mime data's text with the color's hex code.
:param color: color to encode as mime data
:rtype: QMimeData
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`colorFromMimeData`
2017-12-15 10:36:55 -04:00
2017-06-06 11:03:05 +02:00
.. versionadded:: 2.5
%End
static QColor colorFromMimeData( const QMimeData *data, bool &hasAlpha );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Attempts to parse mime data as a color
:param data: mime data to parse
:param hasAlpha: will be set to true if mime data was interpreted as a color containing
an explicit alpha value
:return: valid color if mimedata could be interpreted as a color, otherwise an
:rtype: QColor
invalid color
2017-06-06 11:03:05 +02:00
.. versionadded:: 2.5
%End
2014-11-13 23:13:13 +01:00
static QgsNamedColorList colorListFromMimeData( const QMimeData *data );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Attempts to parse mime data as a list of named colors
:param data: mime data to parse
:return: list of parsed colors
:rtype: QgsNamedColorList
2017-06-06 11:03:05 +02:00
.. versionadded:: 2.5
%End
2017-07-24 13:02:20 +10:00
static QMimeData *colorListToMimeData( const QgsNamedColorList &colorList, const bool allFormats = true ) /Factory/;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Creates mime data from a list of named colors
:param colorList: list of named colors
:param allFormats: set to true to include additional mime formats, include text/plain and application/x-color
:return: mime data containing encoded colors
:rtype: QMimeData
2017-06-06 11:03:05 +02:00
.. versionadded:: 2.5
%End
2014-08-17 13:37:26 +02:00
static bool saveColorsToGpl( QFile &file, const QString &paletteName, const QgsNamedColorList &colors );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Exports colors to a gpl GIMP palette file
:param file: destination file
:param paletteName: name of palette, which is stored in gpl file
:param colors: colors to export
:return: true if export was successful
:rtype: bool
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`importColorsFromGpl`
2017-06-06 11:03:05 +02:00
%End
static QgsNamedColorList importColorsFromGpl( QFile &file, bool &ok, QString &name );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Imports colors from a gpl GIMP palette file
:param file: source gpl file
:param ok: will be true if file was successfully read
:param name: will be set to palette name from gpl file, if present
:return: list of imported colors
:rtype: QgsNamedColorList
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`saveColorsToGpl`
2017-06-06 11:03:05 +02:00
%End
2014-08-17 13:37:26 +02:00
static QColor parseColor( const QString &colorStr, bool strictEval = false );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Attempts to parse a string as a color using a variety of common formats, including hex
codes, rgb and rgba strings.
:param colorStr: string representing the color
:param strictEval: set to true for stricter color parsing rules
:return: parsed color
:rtype: QColor
2017-06-06 11:03:05 +02:00
.. versionadded:: 2.3
%End
static QColor parseColorWithAlpha( const QString &colorStr, bool &containsAlpha, bool strictEval = false );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Attempts to parse a string as a color using a variety of common formats, including hex
codes, rgb and rgba strings.
:param colorStr: string representing the color
:param containsAlpha: if colorStr contains an explicit alpha value then containsAlpha will be set to true
:param strictEval: set to true for stricter color parsing rules
:return: parsed color
:rtype: QColor
2017-06-06 11:03:05 +02:00
.. versionadded:: 2.3
%End
2017-06-06 11:03:05 +02:00
static void multiplyImageOpacity( QImage *image, qreal opacity );
%Docstring
2017-12-15 10:36:55 -04:00
Multiplies opacity of image pixel values with a (global) transparency value.
2017-06-06 11:03:05 +02:00
%End
static void blurImageInPlace( QImage &image, QRect rect, int radius, bool alphaOnly );
2017-06-06 11:03:05 +02:00
%Docstring
Blurs an image in place, e.g. creating Qt-independent drop shadows
%End
static void premultiplyColor( QColor &rgb, int alpha );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Converts a QColor into a premultiplied ARGB QColor value using a specified alpha value
2017-06-06 11:03:05 +02:00
.. versionadded:: 2.3
%End
static void sortVariantList( QList<QVariant> &list, Qt::SortOrder order );
2017-06-06 11:03:05 +02:00
%Docstring
Sorts the passed list in requested order
%End
static QPointF pointOnLineWithDistance( QPointF startPoint, QPointF directionPoint, double distance );
2017-06-06 11:03:05 +02:00
%Docstring
Returns a point on the line from startPoint to directionPoint that is a certain distance away from the starting point
2017-12-15 10:36:55 -04:00
:rtype: QPointF
2017-06-06 11:03:05 +02:00
%End
static QStringList listSvgFiles();
2017-06-06 11:03:05 +02:00
%Docstring
Return a list of all available svg files
2017-12-15 10:36:55 -04:00
:rtype: list of str
2017-06-06 11:03:05 +02:00
%End
static QStringList listSvgFilesAt( const QString &directory );
2017-06-06 11:03:05 +02:00
%Docstring
Return a list of svg files at the specified directory
2017-12-15 10:36:55 -04:00
:rtype: list of str
2017-06-06 11:03:05 +02:00
%End
2017-06-06 11:03:05 +02:00
static QString svgSymbolNameToPath( QString name, const QgsPathResolver &pathResolver );
%Docstring
2017-12-15 10:36:55 -04:00
Get SVG symbol's path from its name.
If the name is not absolute path the file is searched in SVG paths specified
in settings svg/searchPathsForSVG.
:rtype: str
2017-06-06 11:03:05 +02:00
%End
2017-06-06 11:03:05 +02:00
static QString svgSymbolPathToName( QString path, const QgsPathResolver &pathResolver );
%Docstring
Get SVG symbols's name from its path
2017-12-15 10:36:55 -04:00
:rtype: str
2017-06-06 11:03:05 +02:00
%End
2014-01-26 18:35:21 +01:00
static QPointF polygonCentroid( const QPolygonF &points );
2017-06-06 11:03:05 +02:00
%Docstring
Calculate the centroid point of a QPolygonF
2017-12-15 10:36:55 -04:00
:rtype: QPointF
2017-06-06 11:03:05 +02:00
%End
static QPointF polygonPointOnSurface( const QPolygonF &points );
2017-06-06 11:03:05 +02:00
%Docstring
Calculate a point within of a QPolygonF
2017-12-15 10:36:55 -04:00
:rtype: QPointF
2017-06-06 11:03:05 +02:00
%End
static bool pointInPolygon( const QPolygonF &points, QPointF point );
2017-06-06 11:03:05 +02:00
%Docstring
Calculate whether a point is within of a QPolygonF
2017-12-15 10:36:55 -04:00
:rtype: bool
2017-06-06 11:03:05 +02:00
%End
static QgsExpression *fieldOrExpressionToExpression( const QString &fieldOrExpression ) /Factory/;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Return a new valid expression instance for given field or expression string.
If the input is not a valid expression, it is assumed that it is a field name and gets properly quoted.
If the string is empty, returns null pointer.
This is useful when accepting input which could be either a non-quoted field name or expression.
:rtype: QgsExpression
2017-06-06 11:03:05 +02:00
.. versionadded:: 2.2
%End
static QString fieldOrExpressionFromExpression( QgsExpression *expression );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Return a field name if the whole expression is just a name of the field .
Returns full expression string if the expression is more complex than just one field.
Using just expression->expression() method may return quoted field name, but that is not
wanted for saving (due to backward compatibility) or display in GUI.
:rtype: str
2017-06-06 11:03:05 +02:00
.. versionadded:: 2.2
%End
static QList<double> prettyBreaks( double minimum, double maximum, int classes );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Computes a sequence of about 'classes' equally spaced round values
which cover the range of values from 'minimum' to 'maximum'.
The values are chosen so that they are 1, 2 or 5 times a power of 10.
:rtype: list of float
2017-06-06 11:03:05 +02:00
.. versionadded:: 2.10
%End
static double rescaleUom( double size, QgsUnitTypes::RenderUnit unit, const QgsStringMap &props );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Rescales the given size based on the uomScale found in the props, if any is found, otherwise
returns the value un-modified
:rtype: float
2017-06-06 11:03:05 +02:00
.. versionadded:: 3.0
%End
static QPointF rescaleUom( QPointF point, QgsUnitTypes::RenderUnit unit, const QgsStringMap &props ) /PyName=rescalePointUom/;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Rescales the given point based on the uomScale found in the props, if any is found, otherwise
returns a copy of the original point
:rtype: QPointF
2017-06-06 11:03:05 +02:00
.. versionadded:: 3.0
%End
static QVector<qreal> rescaleUom( const QVector<qreal> &array, QgsUnitTypes::RenderUnit unit, const QgsStringMap &props ) /PyName=rescaleArrayUom/;
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Rescales the given array based on the uomScale found in the props, if any is found, otherwise
returns a copy of the original point
:rtype: list of qreal
2017-06-06 11:03:05 +02:00
.. versionadded:: 3.0
%End
static void applyScaleDependency( QDomDocument &doc, QDomElement &ruleElem, QgsStringMap &props );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Checks if the properties contain scaleMinDenom and scaleMaxDenom, if available, they are added into the SE Rule element
2017-06-06 11:03:05 +02:00
.. versionadded:: 3.0
%End
static void mergeScaleDependencies( int mScaleMinDenom, int mScaleMaxDenom, QgsStringMap &props );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Merges the local scale limits, if any, with the ones already in the map, if any
2017-06-06 11:03:05 +02:00
.. versionadded:: 3.0
%End
static void parametricSvgToSld( QDomDocument &doc, QDomElement &graphicElem,
2017-06-06 11:03:05 +02:00
const QString &path,
const QColor &fillColor, double size, const QColor &strokeColor, double strokeWidth );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Encodes a reference to a parametric SVG into SLD, as a succession of parametric SVG using URL parameters,
a fallback SVG without parameters, and a final fallback as a mark with the right colors and stroke for systems
that cannot do SVG at all
2017-06-06 11:03:05 +02:00
.. versionadded:: 3.0
%End
static QString getSvgParametricPath( const QString &basePath, const QColor &fillColor, const QColor &strokeColor, double strokeWidth );
2017-06-06 11:03:05 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Encodes a reference to a parametric SVG into a path with parameters according to the SVG Parameters spec
:rtype: str
2017-06-06 11:03:05 +02:00
.. versionadded:: 3.0
%End
};
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/qgssymbollayerutils.h *
2017-06-06 11:03:05 +02:00
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/