1/************************************************************************
2 * This file has been generated automatically from                      *
3 *                                                                      *
4 * src/core/symbology/qgsmarkersymbollayer.h                            *
5 *                                                                      *
6 * Do not edit manually ! Edit header and run scripts/sipify.pl again   *
7 ************************************************************************/
8
9
10
11
12
13
14class QgsSimpleMarkerSymbolLayerBase : QgsMarkerSymbolLayer
15{
16%Docstring(signature="appended")
17Abstract base class for simple marker symbol layers. Handles creation of the symbol shapes but
18leaves the actual drawing of the symbols to subclasses.
19
20.. versionadded:: 2.16
21%End
22
23%TypeHeaderCode
24#include "qgsmarkersymbollayer.h"
25%End
26  public:
27
28    enum Shape
29    {
30      Square,
31      Diamond,
32      Pentagon,
33      Hexagon,
34      Triangle,
35      EquilateralTriangle,
36      Star,
37      Arrow,
38      Circle,
39      Cross,
40      CrossFill,
41      Cross2,
42      Line,
43      ArrowHead,
44      ArrowHeadFilled,
45      SemiCircle,
46      ThirdCircle,
47      QuarterCircle,
48      QuarterSquare,
49      HalfSquare,
50      DiagonalHalfSquare,
51      RightHalfTriangle,
52      LeftHalfTriangle,
53      Octagon,
54      SquareWithCorners,
55      AsteriskFill,
56      HalfArc,
57      ThirdArc,
58      QuarterArc,
59    };
60
61    static QList< QgsSimpleMarkerSymbolLayerBase::Shape > availableShapes();
62%Docstring
63Returns a list of all available shape types.
64%End
65
66    static bool shapeIsFilled( QgsSimpleMarkerSymbolLayerBase::Shape shape );
67%Docstring
68Returns ``True`` if a symbol shape has a fill.
69
70:param shape: shape to test
71
72:return: ``True`` if shape uses a fill, or ``False`` if shape uses lines only
73%End
74
75    QgsSimpleMarkerSymbolLayerBase( QgsSimpleMarkerSymbolLayerBase::Shape shape = Circle,
76                                    double size = DEFAULT_SIMPLEMARKER_SIZE,
77                                    double angle = DEFAULT_SIMPLEMARKER_ANGLE,
78                                    Qgis::ScaleMethod scaleMethod = DEFAULT_SCALE_METHOD );
79%Docstring
80Constructor for QgsSimpleMarkerSymbolLayerBase.
81
82:param shape: symbol shape for markers
83:param size: symbol size (in mm)
84:param angle: symbol rotation angle
85:param scaleMethod: scaling method for data defined scaling
86%End
87
88    ~QgsSimpleMarkerSymbolLayerBase();
89
90    QgsSimpleMarkerSymbolLayerBase::Shape shape() const;
91%Docstring
92Returns the shape for the rendered marker symbol.
93
94.. seealso:: :py:func:`setShape`
95%End
96
97    void setShape( QgsSimpleMarkerSymbolLayerBase::Shape shape );
98%Docstring
99Sets the rendered marker shape.
100
101:param shape: new marker shape
102
103.. seealso:: :py:func:`shape`
104%End
105
106    static QgsSimpleMarkerSymbolLayerBase::Shape decodeShape( const QString &name, bool *ok = 0 );
107%Docstring
108Attempts to decode a string representation of a shape name to the corresponding
109shape.
110
111:param name: encoded shape name
112:param ok: if specified, will be set to ``True`` if shape was successfully decoded
113
114:return: decoded name
115
116.. seealso:: :py:func:`encodeShape`
117%End
118
119    static QString encodeShape( QgsSimpleMarkerSymbolLayerBase::Shape shape );
120%Docstring
121Encodes a shape to its string representation.
122
123:param shape: shape to encode
124
125:return: encoded string
126
127.. seealso:: :py:func:`decodeShape`
128%End
129
130    virtual void startRender( QgsSymbolRenderContext &context );
131
132    virtual void stopRender( QgsSymbolRenderContext &context );
133
134    virtual void renderPoint( QPointF point, QgsSymbolRenderContext &context );
135
136    virtual QRectF bounds( QPointF point, QgsSymbolRenderContext &context );
137
138
139  protected:
140
141    bool prepareMarkerShape( Shape shape );
142%Docstring
143Prepares the layer for drawing the specified shape (QPolygonF version)
144%End
145
146    bool prepareMarkerPath( Shape symbol );
147%Docstring
148Prepares the layer for drawing the specified shape (QPainterPath version)
149%End
150
151    bool shapeToPolygon( Shape shape, QPolygonF &polygon ) const;
152%Docstring
153Creates a polygon representing the specified shape.
154
155:param shape: shape to create
156:param polygon: destination polygon for shape
157
158:return: ``True`` if shape was successfully stored in polygon
159%End
160
161    double calculateSize( QgsSymbolRenderContext &context, bool &hasDataDefinedSize ) const;
162%Docstring
163Calculates the desired size of the marker, considering data defined size overrides.
164
165:param context: symbol render context
166:param hasDataDefinedSize: will be set to ``True`` if marker uses data defined sizes
167
168:return: marker size, in original size units
169%End
170
171    void calculateOffsetAndRotation( QgsSymbolRenderContext &context, double scaledSize, bool &hasDataDefinedRotation, QPointF &offset, double &angle ) const;
172%Docstring
173Calculates the marker offset and rotation.
174
175:param context: symbol render context
176:param scaledSize: size of symbol to render
177:param hasDataDefinedRotation: will be set to ``True`` if marker has data defined rotation
178:param offset: will be set to calculated marker offset (in painter units)
179:param angle: will be set to calculated marker angle
180%End
181
182
183
184
185  private:
186    virtual void draw( QgsSymbolRenderContext &context, QgsSimpleMarkerSymbolLayerBase::Shape shape, const QPolygonF &polygon, const QPainterPath &path ) = 0;
187%Docstring
188Derived classes must implement :py:func:`~QgsSimpleMarkerSymbolLayerBase.draw` to handle drawing the generated shape onto the painter surface.
189
190:param context: symbol render context
191:param shape: shape to draw
192:param polygon: polygon representing transformed marker shape. May be empty, in which case the shape will be specified
193                in the path argument.
194:param path: transformed painter path representing shape to draw
195%End
196};
197
198class QgsSimpleMarkerSymbolLayer : QgsSimpleMarkerSymbolLayerBase
199{
200%Docstring(signature="appended")
201Simple marker symbol layer, consisting of a rendered shape with solid fill color and an stroke.
202%End
203
204%TypeHeaderCode
205#include "qgsmarkersymbollayer.h"
206%End
207  public:
208
209    QgsSimpleMarkerSymbolLayer( QgsSimpleMarkerSymbolLayerBase::Shape shape = Circle,
210                                double size = DEFAULT_SIMPLEMARKER_SIZE,
211                                double angle = DEFAULT_SIMPLEMARKER_ANGLE,
212                                Qgis::ScaleMethod scaleMethod = DEFAULT_SCALE_METHOD,
213                                const QColor &color = DEFAULT_SIMPLEMARKER_COLOR,
214                                const QColor &strokeColor = DEFAULT_SIMPLEMARKER_BORDERCOLOR,
215                                Qt::PenJoinStyle penJoinStyle = DEFAULT_SIMPLEMARKER_JOINSTYLE );
216%Docstring
217Constructor for QgsSimpleMarkerSymbolLayer.
218
219:param shape: symbol shape
220:param size: symbol size (in mm)
221:param angle: symbol rotation angle
222:param scaleMethod: scaling method for data defined scaling
223:param color: fill color for symbol
224:param strokeColor: stroke color for symbol
225:param penJoinStyle: join style for stroke pen
226%End
227
228    ~QgsSimpleMarkerSymbolLayer();
229
230
231    static QgsSymbolLayer *create( const QVariantMap &properties = QVariantMap() ) /Factory/;
232%Docstring
233Creates a new QgsSimpleMarkerSymbolLayer.
234
235:param properties: a property map containing symbol properties (see :py:func:`~QgsSimpleMarkerSymbolLayer.properties`)
236
237:return: new QgsSimpleMarkerSymbolLayer
238%End
239
240    static QgsSymbolLayer *createFromSld( QDomElement &element ) /Factory/;
241%Docstring
242Creates a new QgsSimpleMarkerSymbolLayer from an SLD XML element.
243
244:param element: XML element containing SLD definition of symbol
245
246:return: new QgsSimpleMarkerSymbolLayer
247%End
248
249
250    virtual QString layerType() const;
251
252    virtual void startRender( QgsSymbolRenderContext &context );
253
254    virtual void renderPoint( QPointF point, QgsSymbolRenderContext &context );
255
256    virtual QVariantMap properties() const;
257
258    virtual QgsSimpleMarkerSymbolLayer *clone() const /Factory/;
259
260    virtual void writeSldMarker( QDomDocument &doc, QDomElement &element, const QVariantMap &props ) const;
261
262    virtual QString ogrFeatureStyle( double mmScaleFactor, double mapUnitScaleFactor ) const;
263
264    virtual bool writeDxf( QgsDxfExport &e, double mmMapUnitScaleFactor, const QString &layerName, QgsSymbolRenderContext &context, QPointF shift = QPointF( 0.0, 0.0 ) ) const;
265
266    virtual void setOutputUnit( QgsUnitTypes::RenderUnit unit );
267
268    virtual QgsUnitTypes::RenderUnit outputUnit() const;
269
270    virtual void setMapUnitScale( const QgsMapUnitScale &scale );
271
272    virtual QgsMapUnitScale mapUnitScale() const;
273
274    virtual bool usesMapUnits() const;
275
276    virtual QRectF bounds( QPointF point, QgsSymbolRenderContext &context );
277
278    virtual QColor fillColor() const;
279    virtual void setFillColor( const QColor &color );
280    virtual void setColor( const QColor &color );
281
282    virtual QColor color() const;
283
284
285
286    virtual QColor strokeColor() const;
287%Docstring
288Returns the marker's stroke color.
289
290.. seealso:: :py:func:`setStrokeColor`
291
292.. seealso:: :py:func:`strokeStyle`
293
294.. seealso:: :py:func:`penJoinStyle`
295%End
296
297    virtual void setStrokeColor( const QColor &color );
298%Docstring
299Sets the marker's stroke color.
300
301:param color: stroke color
302
303.. seealso:: :py:func:`strokeColor`
304
305.. seealso:: :py:func:`setStrokeStyle`
306
307.. seealso:: :py:func:`setPenJoinStyle`
308%End
309
310    Qt::PenStyle strokeStyle() const;
311%Docstring
312Returns the marker's stroke style (e.g., solid, dashed, etc)
313
314.. seealso:: :py:func:`setStrokeStyle`
315
316.. seealso:: :py:func:`strokeColor`
317
318.. seealso:: :py:func:`penJoinStyle`
319
320.. versionadded:: 2.4
321%End
322
323    void setStrokeStyle( Qt::PenStyle strokeStyle );
324%Docstring
325Sets the marker's stroke style (e.g., solid, dashed, etc)
326
327:param strokeStyle: style
328
329.. seealso:: :py:func:`strokeStyle`
330
331.. seealso:: :py:func:`setStrokeColor`
332
333.. seealso:: :py:func:`setPenJoinStyle`
334
335.. versionadded:: 2.4
336%End
337
338    Qt::PenJoinStyle penJoinStyle() const;
339%Docstring
340Returns the marker's stroke join style (e.g., miter, bevel, etc).
341
342.. seealso:: :py:func:`setPenJoinStyle`
343
344.. seealso:: :py:func:`penCapStyle`
345
346.. seealso:: :py:func:`strokeColor`
347
348.. seealso:: :py:func:`strokeStyle`
349
350.. versionadded:: 2.16
351%End
352
353    void setPenJoinStyle( Qt::PenJoinStyle style );
354%Docstring
355Sets the marker's stroke join style (e.g., miter, bevel, etc).
356
357:param style: join style
358
359.. seealso:: :py:func:`penJoinStyle`
360
361.. seealso:: :py:func:`setPenCapStyle`
362
363.. seealso:: :py:func:`setStrokeColor`
364
365.. seealso:: :py:func:`setStrokeStyle`
366
367.. versionadded:: 2.16
368%End
369
370    Qt::PenCapStyle penCapStyle() const;
371%Docstring
372Returns the marker's stroke cap style (e.g., flat, round, etc).
373
374.. seealso:: :py:func:`setPenCapStyle`
375
376.. seealso:: :py:func:`penJoinStyle`
377
378.. seealso:: :py:func:`strokeColor`
379
380.. seealso:: :py:func:`strokeStyle`
381
382.. versionadded:: 3.20
383%End
384
385    void setPenCapStyle( Qt::PenCapStyle style );
386%Docstring
387Sets the marker's stroke cap ``style`` (e.g., flat, round, etc).
388
389.. seealso:: :py:func:`penCapStyle`
390
391.. seealso:: :py:func:`penJoinStyle`
392
393.. seealso:: :py:func:`setStrokeColor`
394
395.. seealso:: :py:func:`setStrokeStyle`
396
397.. versionadded:: 3.20
398%End
399
400    double strokeWidth() const;
401%Docstring
402Returns the width of the marker's stroke.
403
404.. seealso:: :py:func:`setStrokeWidth`
405
406.. seealso:: :py:func:`strokeWidthUnit`
407
408.. seealso:: :py:func:`strokeWidthMapUnitScale`
409%End
410
411    void setStrokeWidth( double w );
412%Docstring
413Sets the width of the marker's stroke.
414
415:param w: stroke width. See :py:func:`~QgsSimpleMarkerSymbolLayer.strokeWidthUnit` for units.
416
417.. seealso:: :py:func:`strokeWidth`
418
419.. seealso:: :py:func:`setStrokeWidthUnit`
420
421.. seealso:: :py:func:`setStrokeWidthMapUnitScale`
422%End
423
424    void setStrokeWidthUnit( QgsUnitTypes::RenderUnit u );
425%Docstring
426Sets the unit for the width of the marker's stroke.
427
428:param u: stroke width unit
429
430.. seealso:: :py:func:`strokeWidthUnit`
431
432.. seealso:: :py:func:`setStrokeWidth`
433
434.. seealso:: :py:func:`setStrokeWidthMapUnitScale`
435%End
436
437    QgsUnitTypes::RenderUnit strokeWidthUnit() const;
438%Docstring
439Returns the unit for the width of the marker's stroke.
440
441.. seealso:: :py:func:`setStrokeWidthUnit`
442
443.. seealso:: :py:func:`strokeWidth`
444
445.. seealso:: :py:func:`strokeWidthMapUnitScale`
446%End
447
448    void setStrokeWidthMapUnitScale( const QgsMapUnitScale &scale );
449%Docstring
450Sets the map scale for the width of the marker's stroke.
451
452:param scale: stroke width map unit scale
453
454.. seealso:: :py:func:`strokeWidthMapUnitScale`
455
456.. seealso:: :py:func:`setStrokeWidth`
457
458.. seealso:: :py:func:`setStrokeWidthUnit`
459%End
460
461    const QgsMapUnitScale &strokeWidthMapUnitScale() const;
462%Docstring
463Returns the map scale for the width of the marker's stroke.
464
465.. seealso:: :py:func:`setStrokeWidthMapUnitScale`
466
467.. seealso:: :py:func:`strokeWidth`
468
469.. seealso:: :py:func:`strokeWidthUnit`
470%End
471
472  protected:
473
474    void drawMarker( QPainter *p, QgsSymbolRenderContext &context );
475%Docstring
476Draws the marker shape in the specified painter.
477
478:param p: destination QPainter
479:param context: symbol context
480
481.. note::
482
483   this method does not handle setting the painter pen or brush to match the symbol's fill or stroke
484%End
485
486    bool prepareCache( QgsSymbolRenderContext &context );
487%Docstring
488Prepares cache image
489
490:return: ``True`` in case of success, ``False`` if cache image size too large
491%End
492
493
494
495
496
497  private:
498    virtual void draw( QgsSymbolRenderContext &context, QgsSimpleMarkerSymbolLayerBase::Shape shape, const QPolygonF &polygon, const QPainterPath &path );
499
500};
501
502class QgsFilledMarkerSymbolLayer : QgsSimpleMarkerSymbolLayerBase
503{
504%Docstring(signature="appended")
505Filled marker symbol layer, consisting of a shape which is rendered using a :py:class:`QgsFillSymbol`. This allows
506the symbol to support advanced styling of the interior and stroke of the shape.
507
508.. versionadded:: 2.16
509%End
510
511%TypeHeaderCode
512#include "qgsmarkersymbollayer.h"
513%End
514  public:
515
516    QgsFilledMarkerSymbolLayer( QgsSimpleMarkerSymbolLayerBase::Shape shape = Circle,
517                                double size = DEFAULT_SIMPLEMARKER_SIZE,
518                                double angle = DEFAULT_SIMPLEMARKER_ANGLE,
519                                Qgis::ScaleMethod scaleMethod = DEFAULT_SCALE_METHOD );
520%Docstring
521Constructor for QgsFilledMarkerSymbolLayer.
522
523:param shape: symbol shape
524:param size: symbol size (in mm)
525:param angle: symbol rotation angle
526:param scaleMethod: size scaling method
527%End
528
529    ~QgsFilledMarkerSymbolLayer();
530
531    static QgsSymbolLayer *create( const QVariantMap &properties = QVariantMap() ) /Factory/;
532%Docstring
533Creates a new QgsFilledMarkerSymbolLayer.
534
535:param properties: a property map containing symbol properties (see :py:func:`~QgsFilledMarkerSymbolLayer.properties`)
536
537:return: new QgsFilledMarkerSymbolLayer
538%End
539
540    virtual QString layerType() const;
541
542    virtual void startRender( QgsSymbolRenderContext &context );
543
544    virtual void stopRender( QgsSymbolRenderContext &context );
545
546    virtual QVariantMap properties() const;
547
548    virtual QgsFilledMarkerSymbolLayer *clone() const /Factory/;
549
550    virtual QgsSymbol *subSymbol();
551
552    virtual bool setSubSymbol( QgsSymbol *symbol /Transfer/ );
553
554    virtual double estimateMaxBleed( const QgsRenderContext &context ) const;
555
556    virtual QSet<QString> usedAttributes( const QgsRenderContext &context ) const;
557
558    virtual bool hasDataDefinedProperties() const;
559
560    virtual void setColor( const QColor &c );
561
562    virtual QColor color() const;
563
564    virtual bool usesMapUnits() const;
565
566
567  private:
568    QgsFilledMarkerSymbolLayer( const QgsFilledMarkerSymbolLayer & );
569    virtual void draw( QgsSymbolRenderContext &context, QgsSimpleMarkerSymbolLayerBase::Shape shape, const QPolygonF &polygon, const QPainterPath &path );
570
571};
572
573
574
575class QgsSvgMarkerSymbolLayer : QgsMarkerSymbolLayer
576{
577
578%TypeHeaderCode
579#include "qgsmarkersymbollayer.h"
580%End
581  public:
582    QgsSvgMarkerSymbolLayer( const QString &path,
583                             double size = DEFAULT_SVGMARKER_SIZE,
584                             double angle = DEFAULT_SVGMARKER_ANGLE,
585                             Qgis::ScaleMethod scaleMethod = DEFAULT_SCALE_METHOD );
586%Docstring
587Constructs SVG marker symbol layer with picture from given absolute path to a SVG file
588%End
589
590    ~QgsSvgMarkerSymbolLayer();
591
592
593    static QgsSymbolLayer *create( const QVariantMap &properties = QVariantMap() ) /Factory/;
594%Docstring
595Creates the symbol
596%End
597    static QgsSymbolLayer *createFromSld( QDomElement &element ) /Factory/;
598
599    static void resolvePaths( QVariantMap &properties, const QgsPathResolver &pathResolver, bool saving );
600%Docstring
601Turns relative paths in properties map to absolute when reading and vice versa when writing.
602Used internally when reading/writing symbols.
603
604.. versionadded:: 3.0
605%End
606
607
608    virtual QString layerType() const;
609
610
611    virtual void startRender( QgsSymbolRenderContext &context );
612
613
614    virtual void stopRender( QgsSymbolRenderContext &context );
615
616
617    virtual void renderPoint( QPointF point, QgsSymbolRenderContext &context );
618
619
620    virtual QVariantMap properties() const;
621
622    virtual bool usesMapUnits() const;
623
624
625    virtual QgsSvgMarkerSymbolLayer *clone() const /Factory/;
626
627
628    virtual void writeSldMarker( QDomDocument &doc, QDomElement &element, const QVariantMap &props ) const;
629
630
631    QString path() const;
632%Docstring
633Returns the marker SVG path.
634
635.. seealso:: :py:func:`setPath`
636%End
637
638    void setPath( const QString &path );
639%Docstring
640Set the marker SVG path.
641
642:param path: SVG path
643
644.. seealso:: :py:func:`path`
645%End
646
647    double defaultAspectRatio() const;
648%Docstring
649Returns the default marker aspect ratio between width and height, 0 if not yet calculated.
650
651.. seealso:: :py:func:`updateDefaultAspectRatio`
652%End
653
654    double updateDefaultAspectRatio();
655%Docstring
656Calculates the default marker aspect ratio between width and height.
657
658:return: the default aspect ratio value
659
660.. seealso:: :py:func:`defaultAspectRatio`
661%End
662
663    bool preservedAspectRatio() const;
664%Docstring
665Returns the preserved aspect ratio value, ``True`` if fixed aspect ratio has been lower or equal to 0.
666
667.. seealso:: :py:func:`setPreservedAspectRatio`
668%End
669
670    bool setPreservedAspectRatio( bool par );
671%Docstring
672Set preserved the marker aspect ratio between width and height.
673
674:param par: Preserved Aspect Ratio
675
676:return: the preserved aspect ratio value, ``True`` if fixed aspect ratio has been lower or equal to 0
677
678.. seealso:: :py:func:`preservedAspectRatio`
679%End
680
681    double fixedAspectRatio() const;
682%Docstring
683Returns the marker aspect ratio between width and height to be used in rendering,
684if the value set is lower or equal to 0 the aspect ratio will be preserved in rendering
685
686.. seealso:: :py:func:`setFixedAspectRatio`
687%End
688
689    void setFixedAspectRatio( double ratio );
690%Docstring
691Set the marker aspect ratio between width and height to be used in rendering,
692if the value set is lower or equal to 0 the aspect ratio will be preserved in rendering
693
694:param ratio: Fixed Aspect Ratio
695
696.. seealso:: :py:func:`fixedAspectRatio`
697%End
698
699    virtual QColor fillColor() const;
700    virtual void setFillColor( const QColor &color );
701
702    virtual QColor strokeColor() const;
703    virtual void setStrokeColor( const QColor &c );
704
705    double strokeWidth() const;
706    void setStrokeWidth( double w );
707
708    QMap<QString, QgsProperty> parameters() const;
709%Docstring
710Returns the dynamic SVG parameters
711
712.. versionadded:: 3.18
713%End
714
715    void setParameters( const QMap<QString, QgsProperty> &parameters );
716%Docstring
717Sets the dynamic SVG parameters
718
719.. versionadded:: 3.18
720%End
721
722    void setStrokeWidthUnit( QgsUnitTypes::RenderUnit unit );
723%Docstring
724Sets the units for the stroke width.
725
726:param unit: width units
727
728.. seealso:: :py:func:`strokeWidthUnit`
729%End
730
731    QgsUnitTypes::RenderUnit strokeWidthUnit() const;
732%Docstring
733Returns the units for the stroke width.
734
735.. seealso:: :py:func:`strokeWidthUnit`
736%End
737
738    void setStrokeWidthMapUnitScale( const QgsMapUnitScale &scale );
739    const QgsMapUnitScale &strokeWidthMapUnitScale() const;
740
741    virtual void setOutputUnit( QgsUnitTypes::RenderUnit unit );
742
743    virtual QgsUnitTypes::RenderUnit outputUnit() const;
744
745
746    virtual void setMapUnitScale( const QgsMapUnitScale &scale );
747
748    virtual QgsMapUnitScale mapUnitScale() const;
749
750
751    virtual bool writeDxf( QgsDxfExport &e, double mmMapUnitScaleFactor, const QString &layerName, QgsSymbolRenderContext &context, QPointF shift = QPointF( 0.0, 0.0 ) ) const;
752
753
754    virtual QRectF bounds( QPointF point, QgsSymbolRenderContext &context );
755
756
757    virtual void prepareExpressions( const QgsSymbolRenderContext &context );
758
759
760    virtual QSet<QString> usedAttributes( const QgsRenderContext &context ) const;
761
762
763  protected:
764
765    double calculateAspectRatio( QgsSymbolRenderContext &context, double scaledSize, bool &hasDataDefinedAspectRatio ) const;
766%Docstring
767Calculates the marker aspect ratio between width and height.
768
769:param context: symbol render context
770:param scaledSize: size of symbol to render
771:param hasDataDefinedAspectRatio: will be set to ``True`` if marker has data defined aspectRatio
772%End
773
774
775
776
777};
778
779
780
781
782class QgsRasterMarkerSymbolLayer : QgsMarkerSymbolLayer
783{
784%Docstring(signature="appended")
785Raster marker symbol layer class.
786
787.. versionadded:: 3.6
788%End
789
790%TypeHeaderCode
791#include "qgsmarkersymbollayer.h"
792%End
793  public:
794    QgsRasterMarkerSymbolLayer( const QString &path = QString(),
795                                double size = DEFAULT_SVGMARKER_SIZE,
796                                double angle = DEFAULT_SVGMARKER_ANGLE,
797                                Qgis::ScaleMethod scaleMethod = DEFAULT_SCALE_METHOD );
798%Docstring
799Constructs raster marker symbol layer with picture from given absolute path to a raster image file
800%End
801
802    ~QgsRasterMarkerSymbolLayer();
803
804
805    static QgsSymbolLayer *create( const QVariantMap &properties = QVariantMap() ) /Factory/;
806%Docstring
807Creates a raster marker symbol layer from a string map of properties.
808
809:param properties: QVariantMap properties object
810%End
811
812    static void resolvePaths( QVariantMap &properties, const QgsPathResolver &pathResolver, bool saving );
813%Docstring
814Turns relative paths in properties map to absolute when reading and vice versa when writing.
815Used internally when reading/writing symbols.
816
817.. versionadded:: 3.0
818%End
819
820
821    virtual QString layerType() const;
822
823
824    virtual void renderPoint( QPointF point, QgsSymbolRenderContext &context );
825
826
827    virtual QVariantMap properties() const;
828
829
830    virtual QgsRasterMarkerSymbolLayer *clone() const /Factory/;
831
832    virtual bool usesMapUnits() const;
833
834
835    double calculateAspectRatio( QgsSymbolRenderContext &context, double scaledSize, bool &hasDataDefinedAspectRatio ) const;
836%Docstring
837Calculates the marker aspect ratio between width and height.
838
839:param context: symbol render context
840:param scaledSize: size of symbol to render
841:param hasDataDefinedAspectRatio: will be set to ``True`` if marker has data defined aspectRatio
842%End
843
844    QString path() const;
845%Docstring
846Returns the marker raster image path.
847
848.. seealso:: :py:func:`setPath`
849%End
850
851    void setPath( const QString &path );
852%Docstring
853Set the marker raster image path.
854
855:param path: raster image path
856
857.. seealso:: :py:func:`path`
858%End
859
860    double opacity() const;
861%Docstring
862Returns the marker opacity.
863
864:return: opacity value between 0 (fully transparent) and 1 (fully opaque)
865
866.. seealso:: :py:func:`setOpacity`
867%End
868
869    void setOpacity( double opacity );
870%Docstring
871Set the marker opacity.
872
873:param opacity: opacity value between 0 (fully transparent) and 1 (fully opaque)
874
875.. seealso:: :py:func:`opacity`
876%End
877
878    double defaultAspectRatio() const;
879%Docstring
880Returns the default marker aspect ratio between width and height, 0 if not yet calculated.
881
882.. seealso:: :py:func:`updateDefaultAspectRatio`
883%End
884
885    double updateDefaultAspectRatio();
886%Docstring
887Calculates the default marker aspect ratio between width and height.
888
889:return: the default aspect ratio value
890
891.. seealso:: :py:func:`defaultAspectRatio`
892%End
893
894    bool preservedAspectRatio() const;
895%Docstring
896Returns the preserved aspect ratio value, ``True`` if fixed aspect ratio has been lower or equal to 0.
897
898.. seealso:: :py:func:`setPreservedAspectRatio`
899%End
900
901    bool setPreservedAspectRatio( bool par );
902%Docstring
903Set preserved the marker aspect ratio between width and height.
904
905:param par: Preserved Aspect Ratio
906
907:return: the preserved aspect ratio value, ``True`` if fixed aspect ratio has been lower or equal to 0
908
909.. seealso:: :py:func:`preservedAspectRatio`
910%End
911
912    double fixedAspectRatio() const;
913%Docstring
914Returns the marker aspect ratio between width and height to be used in rendering,
915if the value set is lower or equal to 0 the aspect ratio will be preserved in rendering
916
917.. seealso:: :py:func:`setFixedAspectRatio`
918%End
919
920    void setFixedAspectRatio( double ratio );
921%Docstring
922Set the marker aspect ratio between width and height to be used in rendering,
923if the value set is lower or equal to 0 the aspect ratio will be preserved in rendering
924
925:param ratio: Fixed Aspect Ratio
926
927.. seealso:: :py:func:`fixedAspectRatio`
928%End
929
930    virtual void setMapUnitScale( const QgsMapUnitScale &scale );
931
932    virtual QgsMapUnitScale mapUnitScale() const;
933
934
935    virtual QRectF bounds( QPointF point, QgsSymbolRenderContext &context );
936
937
938  protected:
939
940
941};
942
943
944
945
946
947class QgsFontMarkerSymbolLayer : QgsMarkerSymbolLayer
948{
949
950%TypeHeaderCode
951#include "qgsmarkersymbollayer.h"
952%End
953  public:
954
955    QgsFontMarkerSymbolLayer( const QString &fontFamily = DEFAULT_FONTMARKER_FONT,
956                              QString chr = DEFAULT_FONTMARKER_CHR,
957                              double pointSize = DEFAULT_FONTMARKER_SIZE,
958                              const QColor &color = DEFAULT_FONTMARKER_COLOR,
959                              double angle = DEFAULT_FONTMARKER_ANGLE );
960%Docstring
961Constructs a font marker symbol layer.
962%End
963
964    ~QgsFontMarkerSymbolLayer();
965
966
967    static QgsSymbolLayer *create( const QVariantMap &properties = QVariantMap() ) /Factory/;
968%Docstring
969Creates a new QgsFontMarkerSymbolLayer from a property map (see :py:func:`~QgsFontMarkerSymbolLayer.properties`)
970%End
971
972    static QgsSymbolLayer *createFromSld( QDomElement &element ) /Factory/;
973%Docstring
974Creates a new QgsFontMarkerSymbolLayer from an SLD XML ``element``.
975%End
976
977    static void resolveFonts( const QVariantMap &properties, const QgsReadWriteContext &context );
978%Docstring
979Resolves fonts from a ``properties`` map, raising warnings in the specified ``context`` if the
980required fonts are not available on the system.
981
982.. versionadded:: 3.20
983%End
984
985
986    virtual QString layerType() const;
987
988
989    virtual void startRender( QgsSymbolRenderContext &context );
990
991
992    virtual void stopRender( QgsSymbolRenderContext &context );
993
994
995    virtual void renderPoint( QPointF point, QgsSymbolRenderContext &context );
996
997
998    virtual QVariantMap properties() const;
999
1000
1001    virtual QgsFontMarkerSymbolLayer *clone() const /Factory/;
1002
1003
1004    virtual void writeSldMarker( QDomDocument &doc, QDomElement &element, const QVariantMap &props ) const;
1005
1006    virtual bool usesMapUnits() const;
1007
1008
1009
1010    QString fontFamily() const;
1011%Docstring
1012Returns the font family name for the associated font which will be used to render the point.
1013
1014.. seealso:: :py:func:`setFontFamily`
1015%End
1016
1017    void setFontFamily( const QString &family );
1018%Docstring
1019Sets the font ``family`` for the font which will be used to render the point.
1020
1021.. seealso:: :py:func:`fontFamily`
1022%End
1023
1024    QString fontStyle() const;
1025%Docstring
1026Returns the font style for the associated font which will be used to render the point.
1027
1028.. seealso:: :py:func:`setFontStyle`
1029
1030.. versionadded:: 3.14
1031%End
1032
1033    void setFontStyle( const QString &style );
1034%Docstring
1035Sets the font ``style`` for the font which will be used to render the point.
1036
1037.. seealso:: :py:func:`fontStyle`
1038
1039.. versionadded:: 3.14
1040%End
1041
1042    QString character() const;
1043%Docstring
1044Returns the character(s) used when rendering points.
1045
1046.. seealso:: :py:func:`setCharacter`
1047%End
1048
1049    void setCharacter( QString chr );
1050%Docstring
1051Sets the character(s) used when rendering points.
1052
1053.. seealso:: :py:func:`character`
1054%End
1055
1056    virtual QColor strokeColor() const;
1057    virtual void setStrokeColor( const QColor &color );
1058
1059    double strokeWidth() const;
1060%Docstring
1061Returns the marker's stroke width. Units are retrieved by :py:func:`~QgsFontMarkerSymbolLayer.strokeWidthUnit`
1062
1063.. seealso:: :py:func:`setStrokeWidth`
1064
1065.. seealso:: :py:func:`strokeWidthUnit`
1066
1067.. seealso:: :py:func:`strokeWidthMapUnitScale`
1068
1069.. versionadded:: 2.16
1070%End
1071
1072    void setStrokeWidth( double width );
1073%Docstring
1074Set's the marker's stroke ``width``. Units are set by :py:func:`~QgsFontMarkerSymbolLayer.setStrokeWidthUnit`.
1075
1076.. seealso:: :py:func:`strokeWidth`
1077
1078.. seealso:: :py:func:`setStrokeWidthUnit`
1079
1080.. seealso:: :py:func:`setStrokeWidthMapUnitScale`
1081
1082.. versionadded:: 2.16
1083%End
1084
1085    QgsUnitTypes::RenderUnit strokeWidthUnit() const;
1086%Docstring
1087Returns the stroke width unit.
1088
1089.. seealso:: :py:func:`setStrokeWidthUnit`
1090
1091.. seealso:: :py:func:`strokeWidth`
1092
1093.. seealso:: :py:func:`strokeWidthMapUnitScale`
1094
1095.. versionadded:: 2.16
1096%End
1097
1098    void setStrokeWidthUnit( QgsUnitTypes::RenderUnit unit );
1099%Docstring
1100Sets the stroke width ``unit``.
1101
1102.. seealso:: :py:func:`strokeWidthUnit`
1103
1104.. seealso:: :py:func:`setStrokeWidth`
1105
1106.. seealso:: :py:func:`setStrokeWidthMapUnitScale`
1107
1108.. versionadded:: 2.16
1109%End
1110
1111    const QgsMapUnitScale &strokeWidthMapUnitScale() const;
1112%Docstring
1113Returns the stroke width map unit scale.
1114
1115.. seealso:: :py:func:`setStrokeWidthMapUnitScale`
1116
1117.. seealso:: :py:func:`strokeWidth`
1118
1119.. seealso:: :py:func:`strokeWidthUnit`
1120
1121.. versionadded:: 2.16
1122%End
1123
1124    void setStrokeWidthMapUnitScale( const QgsMapUnitScale &scale );
1125%Docstring
1126Sets the stroke width map unit ``scale``.
1127
1128.. seealso:: :py:func:`strokeWidthMapUnitScale`
1129
1130.. seealso:: :py:func:`setStrokeWidth`
1131
1132.. seealso:: :py:func:`setStrokeWidthUnit`
1133
1134.. versionadded:: 2.16
1135%End
1136
1137    Qt::PenJoinStyle penJoinStyle() const;
1138%Docstring
1139Returns the stroke join style.
1140
1141.. seealso:: :py:func:`setPenJoinStyle`
1142
1143.. versionadded:: 2.16
1144%End
1145
1146    void setPenJoinStyle( Qt::PenJoinStyle style );
1147%Docstring
1148Sets the stroke join ``style``.
1149
1150.. seealso:: :py:func:`penJoinStyle`
1151
1152.. versionadded:: 2.16
1153%End
1154
1155    virtual QRectF bounds( QPointF point, QgsSymbolRenderContext &context );
1156
1157
1158};
1159
1160
1161
1162
1163/************************************************************************
1164 * This file has been generated automatically from                      *
1165 *                                                                      *
1166 * src/core/symbology/qgsmarkersymbollayer.h                            *
1167 *                                                                      *
1168 * Do not edit manually ! Edit header and run scripts/sipify.pl again   *
1169 ************************************************************************/
1170