Skip to content

Commit

Permalink
Merge pull request #42303 from nirvn/ellipse_fixes
Browse files Browse the repository at this point in the history
Ellipse marker symbol layer fixes and code improvements
  • Loading branch information
nirvn committed Mar 19, 2021
2 parents 4cd1b5b + ad99857 commit 0b75c6c
Show file tree
Hide file tree
Showing 5 changed files with 438 additions and 180 deletions.
97 changes: 91 additions & 6 deletions python/core/auto_generated/symbology/qgsellipsesymbollayer.sip.in
Expand Up @@ -19,6 +19,35 @@ A symbol layer for rendering objects with major and minor axis (e.g. ellipse, re
#include "qgsellipsesymbollayer.h" #include "qgsellipsesymbollayer.h"
%End %End
public: public:

enum Shape
{
Circle,
Rectangle,
Diamond,
Cross,
Arrow,
HalfArc,
Triangle,
RightHalfTriangle,
LeftHalfTriangle,
SemiCircle,
};

static QList< QgsEllipseSymbolLayer::Shape > availableShapes();
%Docstring
Returns a list of all available shape types.
%End

static bool shapeIsFilled( const QgsEllipseSymbolLayer::Shape &shape );
%Docstring
Returns ``True`` if a ``shape`` has a fill.

:return: ``True`` if shape uses a fill, or ``False`` if shape uses lines only

.. versionadded:: 3.20
%End

QgsEllipseSymbolLayer(); QgsEllipseSymbolLayer();


static QgsSymbolLayer *create( const QVariantMap &properties = QVariantMap() ) /Factory/; static QgsSymbolLayer *create( const QVariantMap &properties = QVariantMap() ) /Factory/;
Expand Down Expand Up @@ -48,16 +77,72 @@ Creates the symbol layer
virtual bool writeDxf( QgsDxfExport &e, double mmMapUnitScaleFactor, const QString &layerName, QgsSymbolRenderContext &context, QPointF shift = QPointF( 0.0, 0.0 ) ) const; virtual bool writeDxf( QgsDxfExport &e, double mmMapUnitScaleFactor, const QString &layerName, QgsSymbolRenderContext &context, QPointF shift = QPointF( 0.0, 0.0 ) ) const;




void setSymbolName( const QString &name ); void setSymbolName( const QString &name ) /Deprecated/;
QString symbolName() const; %Docstring
Sets the rendered ellipse marker shape using a symbol ``name``.


bool shapeIsFilled( const QString &symbolName ) const; .. seealso:: :py:func:`setShape`

.. seealso:: :py:func:`shape`

.. deprecated:: QGIS 3.20
%End

QString symbolName() const /Deprecated/;
%Docstring %Docstring
Returns ``True`` if a shape has a fill. Returns the shape name for the rendered ellipse marker symbol.


:param symbolName: name of shape to test .. seealso:: :py:func:`shape`


:return: ``True`` if shape uses a fill, or ``False`` if shape uses lines only .. seealso:: :py:func:`setShape`

.. deprecated:: QGIS 3.20
%End

QgsEllipseSymbolLayer::Shape shape() const;
%Docstring
Returns the shape for the rendered ellipse marker symbol.

.. seealso:: :py:func:`setShape`

.. versionadded:: 3.20
%End

void setShape( QgsEllipseSymbolLayer::Shape shape );
%Docstring
Sets the rendered ellipse marker shape.

:param shape: new ellipse marker shape

.. seealso:: :py:func:`shape`

.. versionadded:: 3.20
%End

static QgsEllipseSymbolLayer::Shape decodeShape( const QString &name, bool *ok = 0 );
%Docstring
Attempts to decode a string representation of a shape name to the corresponding
shape.

:param name: encoded shape name
:param ok: if specified, will be set to ``True`` if shape was successfully decoded

:return: decoded name

.. seealso:: :py:func:`encodeShape`

.. versionadded:: 3.20
%End

static QString encodeShape( QgsEllipseSymbolLayer::Shape shape );
%Docstring
Encodes a shape to its string representation.

:param shape: shape to encode

:return: encoded string

.. seealso:: :py:func:`decodeShape`


.. versionadded:: 3.20 .. versionadded:: 3.20
%End %End
Expand Down

0 comments on commit 0b75c6c

Please sign in to comment.