QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
qgsmarkersymbollayer.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsmarkersymbollayer.h
3  ---------------------
4  begin : November 2009
5  copyright : (C) 2009 by Martin Dobias
6  email : wonder dot sk at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #ifndef QGSMARKERSYMBOLLAYER_H
17 #define QGSMARKERSYMBOLLAYER_H
18 
19 #include "qgis_core.h"
20 #include "qgis_sip.h"
21 #include "qgssymbollayer.h"
22 
23 #define DEFAULT_SIMPLEMARKER_NAME "circle"
24 #define DEFAULT_SIMPLEMARKER_COLOR QColor(255,0,0)
25 #define DEFAULT_SIMPLEMARKER_BORDERCOLOR QColor( 35, 35, 35 )
26 #define DEFAULT_SIMPLEMARKER_JOINSTYLE Qt::BevelJoin
27 #define DEFAULT_SIMPLEMARKER_SIZE DEFAULT_POINT_SIZE
28 #define DEFAULT_SIMPLEMARKER_ANGLE 0
29 
30 #include <QPen>
31 #include <QBrush>
32 #include <QPicture>
33 #include <QPolygonF>
34 #include <QFont>
35 
44 {
45  public:
46 
48  enum Shape
49  {
56  Star,
62  Line,
73  };
74 
76  static QList< QgsSimpleMarkerSymbolLayerBase::Shape > availableShapes();
77 
83  static bool shapeIsFilled( QgsSimpleMarkerSymbolLayerBase::Shape shape );
84 
93  double size = DEFAULT_SIMPLEMARKER_SIZE,
96 
101  QgsSimpleMarkerSymbolLayerBase::Shape shape() const { return mShape; }
102 
108  void setShape( QgsSimpleMarkerSymbolLayerBase::Shape shape ) { mShape = shape; }
109 
118  static QgsSimpleMarkerSymbolLayerBase::Shape decodeShape( const QString &name, bool *ok = nullptr );
119 
126  static QString encodeShape( QgsSimpleMarkerSymbolLayerBase::Shape shape );
127 
128  void startRender( QgsSymbolRenderContext &context ) override;
129  void stopRender( QgsSymbolRenderContext &context ) override;
130  void renderPoint( QPointF point, QgsSymbolRenderContext &context ) override;
131  QRectF bounds( QPointF point, QgsSymbolRenderContext &context ) override;
132 
133  protected:
134 
138  bool prepareMarkerShape( Shape shape );
139 
143  bool prepareMarkerPath( Shape symbol );
144 
151  bool shapeToPolygon( Shape shape, QPolygonF &polygon ) const;
152 
159  double calculateSize( QgsSymbolRenderContext &context, bool &hasDataDefinedSize ) const;
160 
169  void calculateOffsetAndRotation( QgsSymbolRenderContext &context, double scaledSize, bool &hasDataDefinedRotation, QPointF &offset, double &angle ) const;
170 
172  QPolygonF mPolygon;
173 
175  QPainterPath mPath;
176 
179 
180  private:
181 
190  virtual void draw( QgsSymbolRenderContext &context, QgsSimpleMarkerSymbolLayerBase::Shape shape, const QPolygonF &polygon, const QPainterPath &path ) = 0 SIP_FORCE;
191 };
192 
199 {
200  public:
201 
213  double size = DEFAULT_SIMPLEMARKER_SIZE,
216  const QColor &color = DEFAULT_SIMPLEMARKER_COLOR,
217  const QColor &strokeColor = DEFAULT_SIMPLEMARKER_BORDERCOLOR,
218  Qt::PenJoinStyle penJoinStyle = DEFAULT_SIMPLEMARKER_JOINSTYLE );
219 
220  // static methods
221 
227  static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;
228 
234  static QgsSymbolLayer *createFromSld( QDomElement &element ) SIP_FACTORY;
235 
236  // reimplemented from base classes
237 
238  QString layerType() const override;
239  void startRender( QgsSymbolRenderContext &context ) override;
240  void renderPoint( QPointF point, QgsSymbolRenderContext &context ) override;
241  QgsStringMap properties() const override;
242  QgsSimpleMarkerSymbolLayer *clone() const override SIP_FACTORY;
243  void writeSldMarker( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const override;
244  QString ogrFeatureStyle( double mmScaleFactor, double mapUnitScaleFactor ) const override;
245  bool writeDxf( QgsDxfExport &e, double mmMapUnitScaleFactor, const QString &layerName, QgsSymbolRenderContext &context, QPointF shift = QPointF( 0.0, 0.0 ) ) const override;
246  void setOutputUnit( QgsUnitTypes::RenderUnit unit ) override;
247  QgsUnitTypes::RenderUnit outputUnit() const override;
248  void setMapUnitScale( const QgsMapUnitScale &scale ) override;
249  QgsMapUnitScale mapUnitScale() const override;
250  QRectF bounds( QPointF point, QgsSymbolRenderContext &context ) override;
251  QColor fillColor() const override { return mColor; }
252  void setFillColor( const QColor &color ) override { mColor = color; }
253  void setColor( const QColor &color ) override;
254  QColor color() const override;
255 
256  // new methods
257 
264  QColor strokeColor() const override { return mStrokeColor; }
265 
273  void setStrokeColor( const QColor &color ) override { mStrokeColor = color; }
274 
282  Qt::PenStyle strokeStyle() const { return mStrokeStyle; }
283 
292  void setStrokeStyle( Qt::PenStyle strokeStyle ) { mStrokeStyle = strokeStyle; }
293 
301  Qt::PenJoinStyle penJoinStyle() const { return mPenJoinStyle; }
302 
311  void setPenJoinStyle( Qt::PenJoinStyle style ) { mPenJoinStyle = style; }
312 
319  double strokeWidth() const { return mStrokeWidth; }
320 
328  void setStrokeWidth( double w ) { mStrokeWidth = w; }
329 
337  void setStrokeWidthUnit( QgsUnitTypes::RenderUnit u ) { mStrokeWidthUnit = u; }
338 
345  QgsUnitTypes::RenderUnit strokeWidthUnit() const { return mStrokeWidthUnit; }
346 
354  void setStrokeWidthMapUnitScale( const QgsMapUnitScale &scale ) { mStrokeWidthMapUnitScale = scale; }
355 
362  const QgsMapUnitScale &strokeWidthMapUnitScale() const { return mStrokeWidthMapUnitScale; }
363 
364  protected:
365 
372  void drawMarker( QPainter *p, QgsSymbolRenderContext &context );
373 
378  bool prepareCache( QgsSymbolRenderContext &context );
379 
381  QColor mStrokeColor;
383  Qt::PenStyle mStrokeStyle = Qt::SolidLine;
385  double mStrokeWidth = 0;
391  Qt::PenJoinStyle mPenJoinStyle;
393  QPen mPen;
395  QBrush mBrush;
396 
398  QImage mCache;
400  QPen mSelPen;
402  QBrush mSelBrush;
404  QImage mSelCache;
405 
410  bool mUsingCache = false;
412  static const int MAXIMUM_CACHE_WIDTH = 3000;
413 
414  private:
415 
416  void draw( QgsSymbolRenderContext &context, QgsSimpleMarkerSymbolLayerBase::Shape shape, const QPolygonF &polygon, const QPainterPath &path ) override SIP_FORCE;
417 };
418 
427 {
428  public:
429 
438  double size = DEFAULT_SIMPLEMARKER_SIZE,
441 
447  static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;
448 
449  QString layerType() const override;
450  void startRender( QgsSymbolRenderContext &context ) override;
451  void stopRender( QgsSymbolRenderContext &context ) override;
452  QgsStringMap properties() const override;
453  QgsFilledMarkerSymbolLayer *clone() const override SIP_FACTORY;
454  QgsSymbol *subSymbol() override;
455  bool setSubSymbol( QgsSymbol *symbol SIP_TRANSFER ) override;
456  double estimateMaxBleed( const QgsRenderContext &context ) const override;
457  QSet<QString> usedAttributes( const QgsRenderContext &context ) const override;
458  bool hasDataDefinedProperties() const override;
459  void setColor( const QColor &c ) override;
460  QColor color() const override;
461 
462  private:
463 #ifdef SIP_RUN
465 #endif
466 
467  void draw( QgsSymbolRenderContext &context, QgsSimpleMarkerSymbolLayerBase::Shape shape, const QPolygonF &polygon, const QPainterPath &path ) override SIP_FORCE;
468 
470  std::unique_ptr< QgsFillSymbol > mFill;
471 };
472 
474 
475 #define DEFAULT_SVGMARKER_SIZE 2*DEFAULT_POINT_SIZE
476 #define DEFAULT_SVGMARKER_ANGLE 0
477 
483 {
484  public:
486  QgsSvgMarkerSymbolLayer( const QString &path,
487  double size = DEFAULT_SVGMARKER_SIZE,
490 
491  // static stuff
492 
493  static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;
494  static QgsSymbolLayer *createFromSld( QDomElement &element ) SIP_FACTORY;
495 
501  static void resolvePaths( QgsStringMap &properties, const QgsPathResolver &pathResolver, bool saving );
502 
503  // implemented from base classes
504 
505  QString layerType() const override;
506 
507  void startRender( QgsSymbolRenderContext &context ) override;
508 
509  void stopRender( QgsSymbolRenderContext &context ) override;
510 
511  void renderPoint( QPointF point, QgsSymbolRenderContext &context ) override;
512 
513  QgsStringMap properties() const override;
514 
515  QgsSvgMarkerSymbolLayer *clone() const override SIP_FACTORY;
516 
517  void writeSldMarker( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const override;
518 
523  QString path() const { return mPath; }
524 
530  void setPath( const QString &path );
531 
536  double defaultAspectRatio() const { return mDefaultAspectRatio; }
537 
543  double updateDefaultAspectRatio();
544 
549  bool preservedAspectRatio() const { return mFixedAspectRatio <= 0.0; }
550 
557  bool setPreservedAspectRatio( bool par );
558 
564  double fixedAspectRatio() const { return mFixedAspectRatio; }
565 
572  void setFixedAspectRatio( double ratio ) { mFixedAspectRatio = ratio; }
573 
574  QColor fillColor() const override { return color(); }
575  void setFillColor( const QColor &color ) override { setColor( color ); }
576 
577  QColor strokeColor() const override { return mStrokeColor; }
578  void setStrokeColor( const QColor &c ) override { mStrokeColor = c; }
579 
580  double strokeWidth() const { return mStrokeWidth; }
581  void setStrokeWidth( double w ) { mStrokeWidth = w; }
582 
588  void setStrokeWidthUnit( QgsUnitTypes::RenderUnit unit ) { mStrokeWidthUnit = unit; }
589 
594  QgsUnitTypes::RenderUnit strokeWidthUnit() const { return mStrokeWidthUnit; }
595 
596  void setStrokeWidthMapUnitScale( const QgsMapUnitScale &scale ) { mStrokeWidthMapUnitScale = scale; }
597  const QgsMapUnitScale &strokeWidthMapUnitScale() const { return mStrokeWidthMapUnitScale; }
598 
599  void setOutputUnit( QgsUnitTypes::RenderUnit unit ) override;
600  QgsUnitTypes::RenderUnit outputUnit() const override;
601 
602  void setMapUnitScale( const QgsMapUnitScale &scale ) override;
603  QgsMapUnitScale mapUnitScale() const override;
604 
605  bool writeDxf( QgsDxfExport &e, double mmMapUnitScaleFactor, const QString &layerName, QgsSymbolRenderContext &context, QPointF shift = QPointF( 0.0, 0.0 ) ) const override;
606 
607  QRectF bounds( QPointF point, QgsSymbolRenderContext &context ) override;
608 
609  protected:
610 
617  double calculateAspectRatio( QgsSymbolRenderContext &context, double scaledSize, bool &hasDataDefinedAspectRatio ) const;
618 
619  QString mPath;
620 
622  double mDefaultAspectRatio = 0.0;
624  double mFixedAspectRatio = 0.0;
625  //param(fill), param(stroke), param(stroke-width) are going
626  //to be replaced in memory
627  bool mHasFillParam = false;
628  QColor mStrokeColor;
629  double mStrokeWidth;
630 
633 
634  private:
635  double calculateSize( QgsSymbolRenderContext &context, bool &hasDataDefinedSize ) const;
636  void calculateOffsetAndRotation( QgsSymbolRenderContext &context, double scaledWidth, double scaledHeight, QPointF &offset, double &angle ) const;
637 
638 };
639 
640 
642 
643 #define DEFAULT_RASTERMARKER_SIZE 2*DEFAULT_POINT_SIZE
644 #define DEFAULT_RASTERMARKER_ANGLE 0
645 
653 {
654  public:
656  QgsRasterMarkerSymbolLayer( const QString &path = QString(),
657  double size = DEFAULT_SVGMARKER_SIZE,
660 
661  // static stuff
662 
667  static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;
668 
674  static void resolvePaths( QgsStringMap &properties, const QgsPathResolver &pathResolver, bool saving );
675 
676  // implemented from base classes
677 
678  QString layerType() const override;
679 
680  void renderPoint( QPointF point, QgsSymbolRenderContext &context ) override;
681 
682  QgsStringMap properties() const override;
683 
684  QgsRasterMarkerSymbolLayer *clone() const override SIP_FACTORY;
685 
692  double calculateAspectRatio( QgsSymbolRenderContext &context, double scaledSize, bool &hasDataDefinedAspectRatio ) const;
693 
698  QString path() const { return mPath; }
699 
705  void setPath( const QString &path );
706 
712  double opacity() const { return mOpacity; }
713 
719  void setOpacity( double opacity ) { mOpacity = opacity; }
720 
725  double defaultAspectRatio() const { return mDefaultAspectRatio; }
726 
732  double updateDefaultAspectRatio();
733 
738  bool preservedAspectRatio() const { return mFixedAspectRatio <= 0.0; }
739 
746  bool setPreservedAspectRatio( bool par );
747 
753  double fixedAspectRatio() const { return mFixedAspectRatio; }
754 
761  void setFixedAspectRatio( double ratio ) { mFixedAspectRatio = ratio; }
762 
763  void setMapUnitScale( const QgsMapUnitScale &scale ) override;
764  QgsMapUnitScale mapUnitScale() const override;
765 
766  QRectF bounds( QPointF point, QgsSymbolRenderContext &context ) override;
767 
768  protected:
769 
770  QString mPath;
772  double mOpacity = 1.0;
774  double mDefaultAspectRatio = 0.0;
776  double mFixedAspectRatio = 0.0;
777 
778  private:
779  double calculateSize( QgsSymbolRenderContext &context, bool &hasDataDefinedSize ) const;
780  void calculateOffsetAndRotation( QgsSymbolRenderContext &context, double scaledWidth, double scaledHeight, QPointF &offset, double &angle ) const;
781 
782 };
783 
784 
786 
787 #define POINT2MM(x) ( (x) * 25.4 / 72 ) // point is 1/72 of inch
788 #define MM2POINT(x) ( (x) * 72 / 25.4 )
789 
790 #define DEFAULT_FONTMARKER_FONT "Dingbats"
791 #define DEFAULT_FONTMARKER_CHR QChar('A')
792 #define DEFAULT_FONTMARKER_SIZE POINT2MM(12)
793 #define DEFAULT_FONTMARKER_COLOR QColor( 35, 35, 35 )
794 #define DEFAULT_FONTMARKER_BORDERCOLOR QColor(Qt::white)
795 #define DEFAULT_FONTMARKER_JOINSTYLE Qt::MiterJoin
796 #define DEFAULT_FONTMARKER_ANGLE 0
797 
803 {
804  public:
805 
807  QgsFontMarkerSymbolLayer( const QString &fontFamily = DEFAULT_FONTMARKER_FONT,
808  QString chr = DEFAULT_FONTMARKER_CHR,
809  double pointSize = DEFAULT_FONTMARKER_SIZE,
810  const QColor &color = DEFAULT_FONTMARKER_COLOR,
811  double angle = DEFAULT_FONTMARKER_ANGLE );
812 
813  // static stuff
814 
818  static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;
819 
823  static QgsSymbolLayer *createFromSld( QDomElement &element ) SIP_FACTORY;
824 
825  // implemented from base classes
826 
827  QString layerType() const override;
828 
829  void startRender( QgsSymbolRenderContext &context ) override;
830 
831  void stopRender( QgsSymbolRenderContext &context ) override;
832 
833  void renderPoint( QPointF point, QgsSymbolRenderContext &context ) override;
834 
835  QgsStringMap properties() const override;
836 
837  QgsFontMarkerSymbolLayer *clone() const override SIP_FACTORY;
838 
839  void writeSldMarker( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const override;
840 
841  // new methods
842 
848  QString fontFamily() const { return mFontFamily; }
849 
855  void setFontFamily( const QString &family ) { mFontFamily = family; }
856 
863  QString fontStyle() const { return mFontStyle; }
864 
871  void setFontStyle( const QString &style ) { mFontStyle = style; }
872 
878  QString character() const { return mString; }
879 
885  void setCharacter( QString chr ) { mString = chr; }
886 
887  QColor strokeColor() const override { return mStrokeColor; }
888  void setStrokeColor( const QColor &color ) override { mStrokeColor = color; }
889 
899  double strokeWidth() const { return mStrokeWidth; }
900 
910  void setStrokeWidth( double width ) { mStrokeWidth = width; }
911 
921  QgsUnitTypes::RenderUnit strokeWidthUnit() const { return mStrokeWidthUnit; }
922 
931  void setStrokeWidthUnit( QgsUnitTypes::RenderUnit unit ) { mStrokeWidthUnit = unit; }
932 
942  const QgsMapUnitScale &strokeWidthMapUnitScale() const { return mStrokeWidthMapUnitScale; }
943 
953  void setStrokeWidthMapUnitScale( const QgsMapUnitScale &scale ) { mStrokeWidthMapUnitScale = scale; }
954 
962  Qt::PenJoinStyle penJoinStyle() const { return mPenJoinStyle; }
963 
971  void setPenJoinStyle( Qt::PenJoinStyle style ) { mPenJoinStyle = style; }
972 
973  QRectF bounds( QPointF point, QgsSymbolRenderContext &context ) override;
974 
975  private:
976 
977  QString mFontFamily;
978  QString mFontStyle;
979  QFont mFont;
980  std::unique_ptr< QFontMetrics >mFontMetrics;
981 
982  QString mString;
983 
984  double mChrWidth = 0;
985  QPointF mChrOffset;
986  double mOrigSize;
987 
988  QColor mStrokeColor;
989  double mStrokeWidth;
990  QgsUnitTypes::RenderUnit mStrokeWidthUnit;
991  QgsMapUnitScale mStrokeWidthMapUnitScale;
992  Qt::PenJoinStyle mPenJoinStyle;
993 
994  QPen mPen;
995  QBrush mBrush;
996 
997  bool mUseCachedPath = false;
998  QPainterPath mCachedPath;
999 
1000  // If font has a zero (or nearly zero) size, we skip rendering altogether..
1001  bool mNonZeroFontSize = true;
1002 
1003  QString characterToRender( QgsSymbolRenderContext &context, QPointF &charOffset, double &charWidth );
1004  void calculateOffsetAndRotation( QgsSymbolRenderContext &context, double scaledSize, bool &hasDataDefinedRotation, QPointF &offset, double &angle ) const;
1005  double calculateSize( QgsSymbolRenderContext &context );
1006 };
1007 
1008 // clazy:excludeall=qstring-allocations
1009 
1010 #endif
1011 
1012 
QgsSimpleMarkerSymbolLayerBase::Arrow
@ Arrow
Arrow.
Definition: qgsmarkersymbollayer.h:57
QgsRasterMarkerSymbolLayer::defaultAspectRatio
double defaultAspectRatio() const
Returns the default marker aspect ratio between width and height, 0 if not yet calculated.
Definition: qgsmarkersymbollayer.h:725
QgsSymbolLayer::setSubSymbol
virtual bool setSubSymbol(QgsSymbol *symbol)
Sets layer's subsymbol. takes ownership of the passed symbol.
Definition: qgssymbollayer.h:356
QgsSymbolLayer::mColor
QColor mColor
Definition: qgssymbollayer.h:527
QgsFilledMarkerSymbolLayer
Filled marker symbol layer, consisting of a shape which is rendered using a QgsFillSymbol.
Definition: qgsmarkersymbollayer.h:427
QgsSimpleMarkerSymbolLayer::setStrokeWidthMapUnitScale
void setStrokeWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map scale for the width of the marker's stroke.
Definition: qgsmarkersymbollayer.h:354
DEFAULT_SIMPLEMARKER_ANGLE
#define DEFAULT_SIMPLEMARKER_ANGLE
Definition: qgsmarkersymbollayer.h:28
QgsFontMarkerSymbolLayer::strokeColor
QColor strokeColor() const override
Gets stroke color.
Definition: qgsmarkersymbollayer.h:887
QgsRasterMarkerSymbolLayer::opacity
double opacity() const
Returns the marker opacity.
Definition: qgsmarkersymbollayer.h:712
QgsUnitTypes::RenderUnit
RenderUnit
Rendering size units.
Definition: qgsunittypes.h:167
QgsSimpleMarkerSymbolLayer::strokeStyle
Qt::PenStyle strokeStyle() const
Returns the marker's stroke style (e.g., solid, dashed, etc)
Definition: qgsmarkersymbollayer.h:282
QgsDxfExport
Definition: qgsdxfexport.h:63
QgsFontMarkerSymbolLayer::setStrokeWidth
void setStrokeWidth(double width)
Set's the marker's stroke width.
Definition: qgsmarkersymbollayer.h:910
QgsSimpleMarkerSymbolLayer::penJoinStyle
Qt::PenJoinStyle penJoinStyle() const
Returns the marker's stroke join style (e.g., miter, bevel, etc).
Definition: qgsmarkersymbollayer.h:301
QgsMarkerSymbolLayer::mapUnitScale
QgsMapUnitScale mapUnitScale() const override
Definition: qgssymbollayer.cpp:631
QgsSimpleMarkerSymbolLayerBase::Line
@ Line
Vertical line.
Definition: qgsmarkersymbollayer.h:62
QgsSimpleMarkerSymbolLayer::strokeWidthMapUnitScale
const QgsMapUnitScale & strokeWidthMapUnitScale() const
Returns the map scale for the width of the marker's stroke.
Definition: qgsmarkersymbollayer.h:362
QgsFontMarkerSymbolLayer::character
QString character() const
Returns the character(s) used when rendering points.
Definition: qgsmarkersymbollayer.h:878
QgsSimpleMarkerSymbolLayerBase::Triangle
@ Triangle
Triangle.
Definition: qgsmarkersymbollayer.h:54
QgsSimpleMarkerSymbolLayer::mPenJoinStyle
Qt::PenJoinStyle mPenJoinStyle
Stroke pen join style.
Definition: qgsmarkersymbollayer.h:391
QgsSymbolLayer::setColor
virtual void setColor(const QColor &color)
The fill color.
Definition: qgssymbollayer.h:232
QgsSimpleMarkerSymbolLayer::mSelCache
QImage mSelCache
Cached image of selected marker, if using cached version.
Definition: qgsmarkersymbollayer.h:404
QgsSymbolLayer::color
virtual QColor color() const
The fill color.
Definition: qgssymbollayer.h:227
QgsSimpleMarkerSymbolLayerBase::startRender
void startRender(QgsSymbolRenderContext &context) override
Called before a set of rendering operations commences on the supplied render context.
Definition: qgsmarkersymbollayer.cpp:134
QgsSimpleMarkerSymbolLayerBase::Hexagon
@ Hexagon
Hexagon.
Definition: qgsmarkersymbollayer.h:53
QgsSimpleMarkerSymbolLayerBase::SemiCircle
@ SemiCircle
Semi circle (top half)
Definition: qgsmarkersymbollayer.h:65
DEFAULT_FONTMARKER_ANGLE
#define DEFAULT_FONTMARKER_ANGLE
Definition: qgsmarkersymbollayer.h:796
QgsSymbolLayer::hasDataDefinedProperties
virtual bool hasDataDefinedProperties() const
Returns true if the symbol layer (or any of its sub-symbols) contains data defined properties.
Definition: qgssymbollayer.cpp:216
QgsSvgMarkerSymbolLayer::fixedAspectRatio
double fixedAspectRatio() const
Returns the marker aspect ratio between width and height to be used in rendering, if the value set is...
Definition: qgsmarkersymbollayer.h:564
QgsSimpleMarkerSymbolLayerBase::QuarterSquare
@ QuarterSquare
Quarter square (top left quarter)
Definition: qgsmarkersymbollayer.h:68
QgsMarkerSymbolLayer::startRender
void startRender(QgsSymbolRenderContext &context) override
Called before a set of rendering operations commences on the supplied render context.
Definition: qgssymbollayer.cpp:447
QgsRenderContext
Contains information about the context of a rendering operation.
Definition: qgsrendercontext.h:58
QgsSimpleMarkerSymbolLayer::setStrokeStyle
void setStrokeStyle(Qt::PenStyle strokeStyle)
Sets the marker's stroke style (e.g., solid, dashed, etc)
Definition: qgsmarkersymbollayer.h:292
QgsUnitTypes::RenderMillimeters
@ RenderMillimeters
Millimeters.
Definition: qgsunittypes.h:168
DEFAULT_FONTMARKER_FONT
#define DEFAULT_FONTMARKER_FONT
Definition: qgsmarkersymbollayer.h:790
QgsMarkerSymbolLayer
Abstract base class for marker symbol layers.
Definition: qgssymbollayer.h:582
QgsSymbolLayer::estimateMaxBleed
virtual double estimateMaxBleed(const QgsRenderContext &context) const
Returns the estimated maximum distance which the layer style will bleed outside the drawn shape when ...
Definition: qgssymbollayer.h:373
QgsFontMarkerSymbolLayer::setCharacter
void setCharacter(QString chr)
Sets the character(s) used when rendering points.
Definition: qgsmarkersymbollayer.h:885
QgsRasterMarkerSymbolLayer::setOpacity
void setOpacity(double opacity)
Set the marker opacity.
Definition: qgsmarkersymbollayer.h:719
QgsSymbol::ScaleMethod
ScaleMethod
Scale method.
Definition: qgssymbol.h:97
QgsFontMarkerSymbolLayer::setStrokeColor
void setStrokeColor(const QColor &color) override
Set stroke color.
Definition: qgsmarkersymbollayer.h:888
DEFAULT_SIMPLEMARKER_JOINSTYLE
#define DEFAULT_SIMPLEMARKER_JOINSTYLE
Definition: qgsmarkersymbollayer.h:26
QgsSymbol
Abstract base class for all rendered symbols.
Definition: qgssymbol.h:64
QgsMarkerSymbolLayer::setMapUnitScale
void setMapUnitScale(const QgsMapUnitScale &scale) override
Definition: qgssymbollayer.cpp:625
QgsSymbolLayer::ogrFeatureStyle
virtual QString ogrFeatureStyle(double mmScaleFactor, double mapUnitScaleFactor) const
Definition: qgssymbollayer.h:339
QgsFontMarkerSymbolLayer::setFontStyle
void setFontStyle(const QString &style)
Sets the font style for the font which will be used to render the point.
Definition: qgsmarkersymbollayer.h:871
QgsSymbolLayer::properties
virtual QgsStringMap properties() const =0
Should be reimplemented by subclasses to return a string map that contains the configuration informat...
QgsSimpleMarkerSymbolLayer::setStrokeWidthUnit
void setStrokeWidthUnit(QgsUnitTypes::RenderUnit u)
Sets the unit for the width of the marker's stroke.
Definition: qgsmarkersymbollayer.h:337
QgsSimpleMarkerSymbolLayer::mSelBrush
QBrush mSelBrush
QBrush to use as fill of selected symbols.
Definition: qgsmarkersymbollayer.h:402
SIP_FACTORY
#define SIP_FACTORY
Definition: qgis_sip.h:76
QgsSvgMarkerSymbolLayer::setStrokeWidthUnit
void setStrokeWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the stroke width.
Definition: qgsmarkersymbollayer.h:588
QgsSymbolRenderContext
Definition: qgssymbol.h:695
QgsRasterMarkerSymbolLayer::setFixedAspectRatio
void setFixedAspectRatio(double ratio)
Set the marker aspect ratio between width and height to be used in rendering, if the value set is low...
Definition: qgsmarkersymbollayer.h:761
QgsSvgMarkerSymbolLayer::strokeWidth
double strokeWidth() const
Definition: qgsmarkersymbollayer.h:580
QgsMarkerSymbolLayer::setOutputUnit
void setOutputUnit(QgsUnitTypes::RenderUnit unit) override
Sets the units to use for sizes and widths within the symbol layer.
Definition: qgssymbollayer.cpp:610
QgsFontMarkerSymbolLayer::setStrokeWidthUnit
void setStrokeWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the stroke width unit.
Definition: qgsmarkersymbollayer.h:931
QgsSimpleMarkerSymbolLayerBase::setShape
void setShape(QgsSimpleMarkerSymbolLayerBase::Shape shape)
Sets the rendered marker shape.
Definition: qgsmarkersymbollayer.h:108
QgsSymbolLayer::writeDxf
virtual bool writeDxf(QgsDxfExport &e, double mmMapUnitScaleFactor, const QString &layerName, QgsSymbolRenderContext &context, QPointF shift=QPointF(0.0, 0.0)) const
write as DXF
Definition: qgssymbollayer.cpp:128
QgsSvgMarkerSymbolLayer::setStrokeColor
void setStrokeColor(const QColor &c) override
Set stroke color.
Definition: qgsmarkersymbollayer.h:578
QgsSymbolLayer::clone
virtual QgsSymbolLayer * clone() const =0
Shall be reimplemented by subclasses to create a deep copy of the instance.
QgsSimpleMarkerSymbolLayerBase
Abstract base class for simple marker symbol layers.
Definition: qgsmarkersymbollayer.h:44
QgsSvgMarkerSymbolLayer::strokeColor
QColor strokeColor() const override
Gets stroke color.
Definition: qgsmarkersymbollayer.h:577
QgsSimpleMarkerSymbolLayer::mBrush
QBrush mBrush
QBrush corresponding to marker's fill style.
Definition: qgsmarkersymbollayer.h:395
DEFAULT_SVGMARKER_ANGLE
#define DEFAULT_SVGMARKER_ANGLE
Definition: qgsmarkersymbollayer.h:476
QgsSimpleMarkerSymbolLayerBase::mShape
Shape mShape
Symbol shape.
Definition: qgsmarkersymbollayer.h:178
QgsSymbolLayer
Definition: qgssymbollayer.h:53
QgsSimpleMarkerSymbolLayerBase::Shape
Shape
Marker symbol shapes.
Definition: qgsmarkersymbollayer.h:49
QgsSimpleMarkerSymbolLayer::fillColor
QColor fillColor() const override
Gets fill color.
Definition: qgsmarkersymbollayer.h:251
QgsRasterMarkerSymbolLayer::preservedAspectRatio
bool preservedAspectRatio() const
Returns the preserved aspect ratio value, true if fixed aspect ratio has been lower or equal to 0.
Definition: qgsmarkersymbollayer.h:738
QgsSimpleMarkerSymbolLayerBase::RightHalfTriangle
@ RightHalfTriangle
Right half of triangle.
Definition: qgsmarkersymbollayer.h:71
QgsSvgMarkerSymbolLayer::mStrokeWidthMapUnitScale
QgsMapUnitScale mStrokeWidthMapUnitScale
Definition: qgsmarkersymbollayer.h:632
QgsSimpleMarkerSymbolLayerBase::DiagonalHalfSquare
@ DiagonalHalfSquare
Diagonal half square (bottom left half)
Definition: qgsmarkersymbollayer.h:70
QgsSvgMarkerSymbolLayer::fillColor
QColor fillColor() const override
Gets fill color.
Definition: qgsmarkersymbollayer.h:574
QgsSimpleMarkerSymbolLayerBase::Star
@ Star
Star.
Definition: qgsmarkersymbollayer.h:56
QgsSvgMarkerSymbolLayer::setStrokeWidth
void setStrokeWidth(double w)
Definition: qgsmarkersymbollayer.h:581
QgsSimpleMarkerSymbolLayerBase::Pentagon
@ Pentagon
Pentagon.
Definition: qgsmarkersymbollayer.h:52
QgsSvgMarkerSymbolLayer::path
QString path() const
Returns the marker SVG path.
Definition: qgsmarkersymbollayer.h:523
QgsSimpleMarkerSymbolLayerBase::ArrowHeadFilled
@ ArrowHeadFilled
Right facing filled arrow head.
Definition: qgsmarkersymbollayer.h:64
DEFAULT_FONTMARKER_SIZE
#define DEFAULT_FONTMARKER_SIZE
Definition: qgsmarkersymbollayer.h:792
QgsSimpleMarkerSymbolLayerBase::LeftHalfTriangle
@ LeftHalfTriangle
Left half of triangle.
Definition: qgsmarkersymbollayer.h:72
QgsSimpleMarkerSymbolLayer
Simple marker symbol layer, consisting of a rendered shape with solid fill color and an stroke.
Definition: qgsmarkersymbollayer.h:199
QgsSimpleMarkerSymbolLayerBase::mPolygon
QPolygonF mPolygon
Polygon of points in shape. If polygon is empty then shape is using mPath.
Definition: qgsmarkersymbollayer.h:172
DEFAULT_FONTMARKER_CHR
#define DEFAULT_FONTMARKER_CHR
Definition: qgsmarkersymbollayer.h:791
QgsSvgMarkerSymbolLayer::mStrokeWidth
double mStrokeWidth
Definition: qgsmarkersymbollayer.h:629
QgsSvgMarkerSymbolLayer
Definition: qgsmarkersymbollayer.h:483
qgis_sip.h
QgsMarkerSymbolLayer::outputUnit
QgsUnitTypes::RenderUnit outputUnit() const override
Returns the units to use for sizes and widths within the symbol layer.
Definition: qgssymbollayer.cpp:616
SIP_TRANSFER
#define SIP_TRANSFER
Definition: qgis_sip.h:36
QgsSimpleMarkerSymbolLayerBase::Circle
@ Circle
Circle.
Definition: qgsmarkersymbollayer.h:58
DEFAULT_SIMPLEMARKER_BORDERCOLOR
#define DEFAULT_SIMPLEMARKER_BORDERCOLOR
Definition: qgsmarkersymbollayer.h:25
QgsSimpleMarkerSymbolLayer::strokeWidth
double strokeWidth() const
Returns the width of the marker's stroke.
Definition: qgsmarkersymbollayer.h:319
QgsFontMarkerSymbolLayer::setPenJoinStyle
void setPenJoinStyle(Qt::PenJoinStyle style)
Sets the stroke join style.
Definition: qgsmarkersymbollayer.h:971
QgsRasterMarkerSymbolLayer
Raster marker symbol layer class.
Definition: qgsmarkersymbollayer.h:653
QgsSimpleMarkerSymbolLayer::mStrokeColor
QColor mStrokeColor
Stroke color.
Definition: qgsmarkersymbollayer.h:381
qgssymbollayer.h
QgsSvgMarkerSymbolLayer::mStrokeWidthUnit
QgsUnitTypes::RenderUnit mStrokeWidthUnit
Definition: qgsmarkersymbollayer.h:631
QgsRasterMarkerSymbolLayer::mPath
QString mPath
Definition: qgsmarkersymbollayer.h:770
QgsSimpleMarkerSymbolLayerBase::ThirdCircle
@ ThirdCircle
One third circle (top left third)
Definition: qgsmarkersymbollayer.h:66
QgsMapUnitScale
Struct for storing maximum and minimum scales for measurements in map units.
Definition: qgsmapunitscale.h:38
QgsSimpleMarkerSymbolLayerBase::CrossFill
@ CrossFill
Solid filled cross.
Definition: qgsmarkersymbollayer.h:60
QgsSimpleMarkerSymbolLayer::strokeWidthUnit
QgsUnitTypes::RenderUnit strokeWidthUnit() const
Returns the unit for the width of the marker's stroke.
Definition: qgsmarkersymbollayer.h:345
QgsSimpleMarkerSymbolLayer::setStrokeWidth
void setStrokeWidth(double w)
Sets the width of the marker's stroke.
Definition: qgsmarkersymbollayer.h:328
QgsFontMarkerSymbolLayer::setFontFamily
void setFontFamily(const QString &family)
Sets the font family for the font which will be used to render the point.
Definition: qgsmarkersymbollayer.h:855
QgsSimpleMarkerSymbolLayerBase::bounds
QRectF bounds(QPointF point, QgsSymbolRenderContext &context) override
Returns the approximate bounding box of the marker symbol layer, taking into account any data defined...
Definition: qgsmarkersymbollayer.cpp:268
QgsRasterMarkerSymbolLayer::path
QString path() const
Returns the marker raster image path.
Definition: qgsmarkersymbollayer.h:698
QgsSymbolLayer::subSymbol
virtual QgsSymbol * subSymbol()
Returns the symbol's sub symbol, if present.
Definition: qgssymbollayer.h:353
QgsSvgMarkerSymbolLayer::defaultAspectRatio
double defaultAspectRatio() const
Returns the default marker aspect ratio between width and height, 0 if not yet calculated.
Definition: qgsmarkersymbollayer.h:536
QgsSymbolLayer::usedAttributes
virtual QSet< QString > usedAttributes(const QgsRenderContext &context) const
Returns the set of attributes referenced by the layer.
Definition: qgssymbollayer.cpp:247
QgsSvgMarkerSymbolLayer::setStrokeWidthMapUnitScale
void setStrokeWidthMapUnitScale(const QgsMapUnitScale &scale)
Definition: qgsmarkersymbollayer.h:596
QgsSimpleMarkerSymbolLayer::strokeColor
QColor strokeColor() const override
Returns the marker's stroke color.
Definition: qgsmarkersymbollayer.h:264
QgsSimpleMarkerSymbolLayerBase::Square
@ Square
Square.
Definition: qgsmarkersymbollayer.h:50
QgsSimpleMarkerSymbolLayer::mSelPen
QPen mSelPen
QPen to use as stroke of selected symbols.
Definition: qgsmarkersymbollayer.h:400
QgsRasterMarkerSymbolLayer::fixedAspectRatio
double fixedAspectRatio() const
Returns the marker aspect ratio between width and height to be used in rendering, if the value set is...
Definition: qgsmarkersymbollayer.h:753
QgsStringMap
QMap< QString, QString > QgsStringMap
Definition: qgis.h:758
QgsFontMarkerSymbolLayer::fontStyle
QString fontStyle() const
Returns the font style for the associated font which will be used to render the point.
Definition: qgsmarkersymbollayer.h:863
QgsSimpleMarkerSymbolLayerBase::renderPoint
void renderPoint(QPointF point, QgsSymbolRenderContext &context) override
Renders a marker at the specified point.
Definition: qgsmarkersymbollayer.cpp:182
QgsSvgMarkerSymbolLayer::setFillColor
void setFillColor(const QColor &color) override
Set fill color.
Definition: qgsmarkersymbollayer.h:575
QgsSvgMarkerSymbolLayer::strokeWidthMapUnitScale
const QgsMapUnitScale & strokeWidthMapUnitScale() const
Definition: qgsmarkersymbollayer.h:597
QgsSvgMarkerSymbolLayer::setFixedAspectRatio
void setFixedAspectRatio(double ratio)
Set the marker aspect ratio between width and height to be used in rendering, if the value set is low...
Definition: qgsmarkersymbollayer.h:572
QgsSimpleMarkerSymbolLayerBase::QuarterCircle
@ QuarterCircle
Quarter circle (top left quarter)
Definition: qgsmarkersymbollayer.h:67
SIP_FORCE
#define SIP_FORCE
Definition: qgis_sip.h:131
c
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into c
Definition: porting_processing.dox:1
QgsSimpleMarkerSymbolLayerBase::mPath
QPainterPath mPath
Painter path representing shape. If mPolygon is empty then the shape is stored in mPath.
Definition: qgsmarkersymbollayer.h:175
QgsSimpleMarkerSymbolLayerBase::Cross2
@ Cross2
Rotated cross (lines only), "x" shape.
Definition: qgsmarkersymbollayer.h:61
DEFAULT_SVGMARKER_SIZE
#define DEFAULT_SVGMARKER_SIZE
Definition: qgsmarkersymbollayer.h:475
QgsSimpleMarkerSymbolLayer::setStrokeColor
void setStrokeColor(const QColor &color) override
Sets the marker's stroke color.
Definition: qgsmarkersymbollayer.h:273
QgsSimpleMarkerSymbolLayerBase::Cross
@ Cross
Cross (lines only)
Definition: qgsmarkersymbollayer.h:59
QgsFontMarkerSymbolLayer
Definition: qgsmarkersymbollayer.h:803
DEFAULT_SCALE_METHOD
#define DEFAULT_SCALE_METHOD
Definition: qgssymbollayer.h:19
QgsMarkerSymbolLayer::renderPoint
virtual void renderPoint(QPointF point, QgsSymbolRenderContext &context)=0
Renders a marker at the specified point.
QgsSvgMarkerSymbolLayer::preservedAspectRatio
bool preservedAspectRatio() const
Returns the preserved aspect ratio value, true if fixed aspect ratio has been lower or equal to 0.
Definition: qgsmarkersymbollayer.h:549
QgsMarkerSymbolLayer::writeSldMarker
virtual void writeSldMarker(QDomDocument &doc, QDomElement &element, const QgsStringMap &props) const
Writes the symbol layer definition as a SLD XML element.
Definition: qgssymbollayer.h:805
QgsMarkerSymbolLayer::bounds
virtual QRectF bounds(QPointF point, QgsSymbolRenderContext &context)=0
Returns the approximate bounding box of the marker symbol layer, taking into account any data defined...
QgsFontMarkerSymbolLayer::penJoinStyle
Qt::PenJoinStyle penJoinStyle() const
Returns the stroke join style.
Definition: qgsmarkersymbollayer.h:962
QgsSimpleMarkerSymbolLayer::mCache
QImage mCache
Cached image of marker, if using cached version.
Definition: qgsmarkersymbollayer.h:398
QgsSymbolLayer::layerType
virtual QString layerType() const =0
Returns a string that represents this layer type.
QgsSvgMarkerSymbolLayer::mPath
QString mPath
Definition: qgsmarkersymbollayer.h:619
QgsFontMarkerSymbolLayer::setStrokeWidthMapUnitScale
void setStrokeWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the stroke width map unit scale.
Definition: qgsmarkersymbollayer.h:953
QgsSimpleMarkerSymbolLayer::setPenJoinStyle
void setPenJoinStyle(Qt::PenJoinStyle style)
Sets the marker's stroke join style (e.g., miter, bevel, etc).
Definition: qgsmarkersymbollayer.h:311
QgsSvgMarkerSymbolLayer::strokeWidthUnit
QgsUnitTypes::RenderUnit strokeWidthUnit() const
Returns the units for the stroke width.
Definition: qgsmarkersymbollayer.h:594
QgsSimpleMarkerSymbolLayerBase::HalfSquare
@ HalfSquare
Half square (left half)
Definition: qgsmarkersymbollayer.h:69
DEFAULT_FONTMARKER_COLOR
#define DEFAULT_FONTMARKER_COLOR
Definition: qgsmarkersymbollayer.h:793
DEFAULT_SIMPLEMARKER_COLOR
#define DEFAULT_SIMPLEMARKER_COLOR
Definition: qgsmarkersymbollayer.h:24
QgsSimpleMarkerSymbolLayerBase::EquilateralTriangle
@ EquilateralTriangle
Equilateral triangle.
Definition: qgsmarkersymbollayer.h:55
MathUtils::angle
double ANALYSIS_EXPORT angle(QgsPoint *p1, QgsPoint *p2, QgsPoint *p3, QgsPoint *p4)
Calculates the angle between two segments (in 2 dimension, z-values are ignored)
Definition: MathUtils.cpp:786
QgsMarkerSymbolLayer::stopRender
void stopRender(QgsSymbolRenderContext &context) override
Called after a set of rendering operations has finished on the supplied render context.
Definition: qgssymbollayer.cpp:452
QgsFontMarkerSymbolLayer::strokeWidthMapUnitScale
const QgsMapUnitScale & strokeWidthMapUnitScale() const
Returns the stroke width map unit scale.
Definition: qgsmarkersymbollayer.h:942
QgsPathResolver
Resolves relative paths into absolute paths and vice versa.
Definition: qgspathresolver.h:32
QgsFontMarkerSymbolLayer::strokeWidthUnit
QgsUnitTypes::RenderUnit strokeWidthUnit() const
Returns the stroke width unit.
Definition: qgsmarkersymbollayer.h:921
QgsSimpleMarkerSymbolLayerBase::shape
QgsSimpleMarkerSymbolLayerBase::Shape shape() const
Returns the shape for the rendered marker symbol.
Definition: qgsmarkersymbollayer.h:101
QgsFontMarkerSymbolLayer::fontFamily
QString fontFamily() const
Returns the font family name for the associated font which will be used to render the point.
Definition: qgsmarkersymbollayer.h:848
QgsSimpleMarkerSymbolLayerBase::ArrowHead
@ ArrowHead
Right facing arrow head (unfilled, lines only)
Definition: qgsmarkersymbollayer.h:63
QgsSimpleMarkerSymbolLayer::mPen
QPen mPen
QPen corresponding to marker's stroke style.
Definition: qgsmarkersymbollayer.h:393
QgsSimpleMarkerSymbolLayer::setFillColor
void setFillColor(const QColor &color) override
Set fill color.
Definition: qgsmarkersymbollayer.h:252
QgsFontMarkerSymbolLayer::strokeWidth
double strokeWidth() const
Returns the marker's stroke width.
Definition: qgsmarkersymbollayer.h:899
QgsSvgMarkerSymbolLayer::mStrokeColor
QColor mStrokeColor
Definition: qgsmarkersymbollayer.h:628
QgsSimpleMarkerSymbolLayerBase::stopRender
void stopRender(QgsSymbolRenderContext &context) override
Called after a set of rendering operations has finished on the supplied render context.
Definition: qgsmarkersymbollayer.cpp:177
QgsSimpleMarkerSymbolLayerBase::Diamond
@ Diamond
Diamond.
Definition: qgsmarkersymbollayer.h:51
QgsSimpleMarkerSymbolLayer::mStrokeWidthMapUnitScale
QgsMapUnitScale mStrokeWidthMapUnitScale
Stroke width map unit scale.
Definition: qgsmarkersymbollayer.h:389
DEFAULT_SIMPLEMARKER_SIZE
#define DEFAULT_SIMPLEMARKER_SIZE
Definition: qgsmarkersymbollayer.h:27