QGIS API Documentation  3.4.15-Madeira (e83d02e274)
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 QGSMARKERSYMBOLLAYERV2_H
17 #define QGSMARKERSYMBOLLAYERV2_H
18 
19 #include "qgis_core.h"
20 #include "qgis_sip.h"
21 #include "qgis.h"
22 #include "qgssymbollayer.h"
23 
24 #define DEFAULT_SIMPLEMARKER_NAME "circle"
25 #define DEFAULT_SIMPLEMARKER_COLOR QColor(255,0,0)
26 #define DEFAULT_SIMPLEMARKER_BORDERCOLOR QColor( 35, 35, 35 )
27 #define DEFAULT_SIMPLEMARKER_JOINSTYLE Qt::BevelJoin
28 #define DEFAULT_SIMPLEMARKER_SIZE DEFAULT_POINT_SIZE
29 #define DEFAULT_SIMPLEMARKER_ANGLE 0
30 
31 #include <QPen>
32 #include <QBrush>
33 #include <QPicture>
34 #include <QPolygonF>
35 #include <QFont>
36 
45 {
46  public:
47 
49  enum Shape
50  {
57  Star,
63  Line,
74  };
75 
77  static QList< QgsSimpleMarkerSymbolLayerBase::Shape > availableShapes();
78 
84  static bool shapeIsFilled( QgsSimpleMarkerSymbolLayerBase::Shape shape );
85 
94  double size = DEFAULT_SIMPLEMARKER_SIZE,
97 
102  QgsSimpleMarkerSymbolLayerBase::Shape shape() const { return mShape; }
103 
109  void setShape( QgsSimpleMarkerSymbolLayerBase::Shape shape ) { mShape = shape; }
110 
119  static QgsSimpleMarkerSymbolLayerBase::Shape decodeShape( const QString &name, bool *ok = nullptr );
120 
127  static QString encodeShape( QgsSimpleMarkerSymbolLayerBase::Shape shape );
128 
129  void startRender( QgsSymbolRenderContext &context ) override;
130  void stopRender( QgsSymbolRenderContext &context ) override;
131  void renderPoint( QPointF point, QgsSymbolRenderContext &context ) override;
132  QRectF bounds( QPointF point, QgsSymbolRenderContext &context ) override;
133 
134  protected:
135 
139  bool prepareMarkerShape( Shape shape );
140 
144  bool prepareMarkerPath( Shape symbol );
145 
152  bool shapeToPolygon( Shape shape, QPolygonF &polygon ) const;
153 
160  double calculateSize( QgsSymbolRenderContext &context, bool &hasDataDefinedSize ) const;
161 
170  void calculateOffsetAndRotation( QgsSymbolRenderContext &context, double scaledSize, bool &hasDataDefinedRotation, QPointF &offset, double &angle ) const;
171 
173  QPolygonF mPolygon;
174 
176  QPainterPath mPath;
177 
180 
181  private:
182 
191  virtual void draw( QgsSymbolRenderContext &context, QgsSimpleMarkerSymbolLayerBase::Shape shape, const QPolygonF &polygon, const QPainterPath &path ) = 0 SIP_FORCE;
192 };
193 
200 {
201  public:
202 
214  double size = DEFAULT_SIMPLEMARKER_SIZE,
217  const QColor &color = DEFAULT_SIMPLEMARKER_COLOR,
218  const QColor &strokeColor = DEFAULT_SIMPLEMARKER_BORDERCOLOR,
219  Qt::PenJoinStyle penJoinStyle = DEFAULT_SIMPLEMARKER_JOINSTYLE );
220 
221  // static methods
222 
228  static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;
229 
235  static QgsSymbolLayer *createFromSld( QDomElement &element ) SIP_FACTORY;
236 
237  // reimplemented from base classes
238 
239  QString layerType() const override;
240  void startRender( QgsSymbolRenderContext &context ) override;
241  void renderPoint( QPointF point, QgsSymbolRenderContext &context ) override;
242  QgsStringMap properties() const override;
243  QgsSimpleMarkerSymbolLayer *clone() const override SIP_FACTORY;
244  void writeSldMarker( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const override;
245  QString ogrFeatureStyle( double mmScaleFactor, double mapUnitScaleFactor ) const override;
246  bool writeDxf( QgsDxfExport &e, double mmMapUnitScaleFactor, const QString &layerName, QgsSymbolRenderContext &context, QPointF shift = QPointF( 0.0, 0.0 ) ) const override;
247  void setOutputUnit( QgsUnitTypes::RenderUnit unit ) override;
248  QgsUnitTypes::RenderUnit outputUnit() const override;
249  void setMapUnitScale( const QgsMapUnitScale &scale ) override;
250  QgsMapUnitScale mapUnitScale() const override;
251  QRectF bounds( QPointF point, QgsSymbolRenderContext &context ) override;
252  QColor fillColor() const override { return mColor; }
253  void setFillColor( const QColor &color ) override { mColor = color; }
254  void setColor( const QColor &color ) override;
255  QColor color() const override;
256 
257  // new methods
258 
265  QColor strokeColor() const override { return mStrokeColor; }
266 
274  void setStrokeColor( const QColor &color ) override { mStrokeColor = color; }
275 
283  Qt::PenStyle strokeStyle() const { return mStrokeStyle; }
284 
293  void setStrokeStyle( Qt::PenStyle strokeStyle ) { mStrokeStyle = strokeStyle; }
294 
302  Qt::PenJoinStyle penJoinStyle() const { return mPenJoinStyle; }
303 
312  void setPenJoinStyle( Qt::PenJoinStyle style ) { mPenJoinStyle = style; }
313 
320  double strokeWidth() const { return mStrokeWidth; }
321 
329  void setStrokeWidth( double w ) { mStrokeWidth = w; }
330 
338  void setStrokeWidthUnit( QgsUnitTypes::RenderUnit u ) { mStrokeWidthUnit = u; }
339 
346  QgsUnitTypes::RenderUnit strokeWidthUnit() const { return mStrokeWidthUnit; }
347 
355  void setStrokeWidthMapUnitScale( const QgsMapUnitScale &scale ) { mStrokeWidthMapUnitScale = scale; }
356 
363  const QgsMapUnitScale &strokeWidthMapUnitScale() const { return mStrokeWidthMapUnitScale; }
364 
365  protected:
366 
373  void drawMarker( QPainter *p, QgsSymbolRenderContext &context );
374 
379  bool prepareCache( QgsSymbolRenderContext &context );
380 
382  QColor mStrokeColor;
384  Qt::PenStyle mStrokeStyle = Qt::SolidLine;
386  double mStrokeWidth = 0;
392  Qt::PenJoinStyle mPenJoinStyle;
394  QPen mPen;
396  QBrush mBrush;
397 
399  QImage mCache;
401  QPen mSelPen;
403  QBrush mSelBrush;
405  QImage mSelCache;
406 
411  bool mUsingCache = false;
413  static const int MAXIMUM_CACHE_WIDTH = 3000;
414 
415  private:
416 
417  void draw( QgsSymbolRenderContext &context, QgsSimpleMarkerSymbolLayerBase::Shape shape, const QPolygonF &polygon, const QPainterPath &path ) override SIP_FORCE;
418 };
419 
428 {
429  public:
430 
439  double size = DEFAULT_SIMPLEMARKER_SIZE,
442 
448  static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;
449 
450  QString layerType() const override;
451  void startRender( QgsSymbolRenderContext &context ) override;
452  void stopRender( QgsSymbolRenderContext &context ) override;
453  QgsStringMap properties() const override;
454  QgsFilledMarkerSymbolLayer *clone() const override SIP_FACTORY;
455  QgsSymbol *subSymbol() override;
456  bool setSubSymbol( QgsSymbol *symbol SIP_TRANSFER ) override;
457  double estimateMaxBleed( const QgsRenderContext &context ) const override;
458  QSet<QString> usedAttributes( const QgsRenderContext &context ) const override;
459  bool hasDataDefinedProperties() const override;
460  void setColor( const QColor &c ) override;
461  QColor color() const override;
462 
463  private:
464 #ifdef SIP_RUN
466 #endif
467 
468  void draw( QgsSymbolRenderContext &context, QgsSimpleMarkerSymbolLayerBase::Shape shape, const QPolygonF &polygon, const QPainterPath &path ) override SIP_FORCE;
469 
471  std::unique_ptr< QgsFillSymbol > mFill;
472 };
473 
475 
476 #define DEFAULT_SVGMARKER_SIZE 2*DEFAULT_POINT_SIZE
477 #define DEFAULT_SVGMARKER_ANGLE 0
478 
484 {
485  public:
487  QgsSvgMarkerSymbolLayer( const QString &path,
488  double size = DEFAULT_SVGMARKER_SIZE,
491 
492  // static stuff
493 
494  static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;
495  static QgsSymbolLayer *createFromSld( QDomElement &element ) SIP_FACTORY;
496 
502  static void resolvePaths( QgsStringMap &properties, const QgsPathResolver &pathResolver, bool saving );
503 
504  // implemented from base classes
505 
506  QString layerType() const override;
507 
508  void startRender( QgsSymbolRenderContext &context ) override;
509 
510  void stopRender( QgsSymbolRenderContext &context ) override;
511 
512  void renderPoint( QPointF point, QgsSymbolRenderContext &context ) override;
513 
514  QgsStringMap properties() const override;
515 
516  QgsSvgMarkerSymbolLayer *clone() const override SIP_FACTORY;
517 
518  void writeSldMarker( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const override;
519 
524  QString path() const { return mPath; }
525 
531  void setPath( const QString &path );
532 
537  double defaultAspectRatio() const { return mDefaultAspectRatio; }
538 
544  double updateDefaultAspectRatio();
545 
550  bool preservedAspectRatio() const { return mFixedAspectRatio <= 0.0; }
551 
558  bool setPreservedAspectRatio( bool par );
559 
565  double fixedAspectRatio() const { return mFixedAspectRatio; }
566 
573  void setFixedAspectRatio( double ratio ) { mFixedAspectRatio = ratio; }
574 
575  QColor fillColor() const override { return color(); }
576  void setFillColor( const QColor &color ) override { setColor( color ); }
577 
578  QColor strokeColor() const override { return mStrokeColor; }
579  void setStrokeColor( const QColor &c ) override { mStrokeColor = c; }
580 
581  double strokeWidth() const { return mStrokeWidth; }
582  void setStrokeWidth( double w ) { mStrokeWidth = w; }
583 
589  void setStrokeWidthUnit( QgsUnitTypes::RenderUnit unit ) { mStrokeWidthUnit = unit; }
590 
595  QgsUnitTypes::RenderUnit strokeWidthUnit() const { return mStrokeWidthUnit; }
596 
597  void setStrokeWidthMapUnitScale( const QgsMapUnitScale &scale ) { mStrokeWidthMapUnitScale = scale; }
598  const QgsMapUnitScale &strokeWidthMapUnitScale() const { return mStrokeWidthMapUnitScale; }
599 
600  void setOutputUnit( QgsUnitTypes::RenderUnit unit ) override;
601  QgsUnitTypes::RenderUnit outputUnit() const override;
602 
603  void setMapUnitScale( const QgsMapUnitScale &scale ) override;
604  QgsMapUnitScale mapUnitScale() const override;
605 
606  bool writeDxf( QgsDxfExport &e, double mmMapUnitScaleFactor, const QString &layerName, QgsSymbolRenderContext &context, QPointF shift = QPointF( 0.0, 0.0 ) ) const override;
607 
608  QRectF bounds( QPointF point, QgsSymbolRenderContext &context ) override;
609 
610  protected:
611 
618  double calculateAspectRatio( QgsSymbolRenderContext &context, double scaledSize, bool &hasDataDefinedAspectRatio ) const;
619 
620  QString mPath;
621 
623  double mDefaultAspectRatio = 0.0;
625  double mFixedAspectRatio = 0.0;
626  //param(fill), param(stroke), param(stroke-width) are going
627  //to be replaced in memory
628  QColor mStrokeColor;
629  double mStrokeWidth;
632 
633  private:
634  double calculateSize( QgsSymbolRenderContext &context, bool &hasDataDefinedSize ) const;
635  void calculateOffsetAndRotation( QgsSymbolRenderContext &context, double scaledSize, QPointF &offset, double &angle ) const;
636 
637 };
638 
639 
641 
642 #define POINT2MM(x) ( (x) * 25.4 / 72 ) // point is 1/72 of inch
643 #define MM2POINT(x) ( (x) * 72 / 25.4 )
644 
645 #define DEFAULT_FONTMARKER_FONT "Dingbats"
646 #define DEFAULT_FONTMARKER_CHR QChar('A')
647 #define DEFAULT_FONTMARKER_SIZE POINT2MM(12)
648 #define DEFAULT_FONTMARKER_COLOR QColor( 35, 35, 35 )
649 #define DEFAULT_FONTMARKER_BORDERCOLOR QColor(Qt::white)
650 #define DEFAULT_FONTMARKER_JOINSTYLE Qt::MiterJoin
651 #define DEFAULT_FONTMARKER_ANGLE 0
652 
658 {
659  public:
660  QgsFontMarkerSymbolLayer( const QString &fontFamily = DEFAULT_FONTMARKER_FONT,
661  QChar chr = DEFAULT_FONTMARKER_CHR,
662  double pointSize = DEFAULT_FONTMARKER_SIZE,
663  const QColor &color = DEFAULT_FONTMARKER_COLOR,
664  double angle = DEFAULT_FONTMARKER_ANGLE );
665 
666  ~QgsFontMarkerSymbolLayer() override;
667 
668  // static stuff
669 
673  static QgsSymbolLayer *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;
674 
678  static QgsSymbolLayer *createFromSld( QDomElement &element ) SIP_FACTORY;
679 
680  // implemented from base classes
681 
682  QString layerType() const override;
683 
684  void startRender( QgsSymbolRenderContext &context ) override;
685 
686  void stopRender( QgsSymbolRenderContext &context ) override;
687 
688  void renderPoint( QPointF point, QgsSymbolRenderContext &context ) override;
689 
690  QgsStringMap properties() const override;
691 
692  QgsFontMarkerSymbolLayer *clone() const override SIP_FACTORY;
693 
694  void writeSldMarker( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const override;
695 
696  // new methods
697 
703  QString fontFamily() const { return mFontFamily; }
704 
710  void setFontFamily( const QString &family ) { mFontFamily = family; }
711 
717  QChar character() const { return mChr; }
718 
724  void setCharacter( QChar ch ) { mChr = ch; }
725 
726  QColor strokeColor() const override { return mStrokeColor; }
727  void setStrokeColor( const QColor &color ) override { mStrokeColor = color; }
728 
738  double strokeWidth() const { return mStrokeWidth; }
739 
749  void setStrokeWidth( double width ) { mStrokeWidth = width; }
750 
760  QgsUnitTypes::RenderUnit strokeWidthUnit() const { return mStrokeWidthUnit; }
761 
770  void setStrokeWidthUnit( QgsUnitTypes::RenderUnit unit ) { mStrokeWidthUnit = unit; }
771 
781  const QgsMapUnitScale &strokeWidthMapUnitScale() const { return mStrokeWidthMapUnitScale; }
782 
792  void setStrokeWidthMapUnitScale( const QgsMapUnitScale &scale ) { mStrokeWidthMapUnitScale = scale; }
793 
801  Qt::PenJoinStyle penJoinStyle() const { return mPenJoinStyle; }
802 
810  void setPenJoinStyle( Qt::PenJoinStyle style ) { mPenJoinStyle = style; }
811 
812  QRectF bounds( QPointF point, QgsSymbolRenderContext &context ) override;
813 
814  protected:
815 
816  QString mFontFamily;
817  QFontMetrics *mFontMetrics = nullptr;
818  QChar mChr;
819 
820  double mChrWidth = 0;
821  QPointF mChrOffset;
822  QFont mFont;
823  double mOrigSize;
824 
825  private:
826 
827  QColor mStrokeColor;
828  double mStrokeWidth;
829  QgsUnitTypes::RenderUnit mStrokeWidthUnit;
830  QgsMapUnitScale mStrokeWidthMapUnitScale;
831  Qt::PenJoinStyle mPenJoinStyle;
832 
833  QPen mPen;
834  QBrush mBrush;
835 
836  bool mUseCachedPath = false;
837  QPainterPath mCachedPath;
838 
839  // If font has a zero (or nearly zero) size, we skip rendering altogether..
840  bool mNonZeroFontSize = true;
841 
842  QString characterToRender( QgsSymbolRenderContext &context, QPointF &charOffset, double &charWidth );
843  void calculateOffsetAndRotation( QgsSymbolRenderContext &context, double scaledSize, bool &hasDataDefinedRotation, QPointF &offset, double &angle ) const;
844  double calculateSize( QgsSymbolRenderContext &context );
845 };
846 
847 // clazy:excludeall=qstring-allocations
848 
849 #endif
850 
851 
#define DEFAULT_SIMPLEMARKER_SIZE
QgsMapUnitScale mapUnitScale() const override
virtual QString ogrFeatureStyle(double mmScaleFactor, double mapUnitScaleFactor) const
QRectF bounds(QPointF point, QgsSymbolRenderContext &context) override
Returns the approximate bounding box of the marker symbol layer, taking into account any data defined...
void setPenJoinStyle(Qt::PenJoinStyle style)
Sets the marker&#39;s stroke join style (e.g., miter, bevel, etc).
double defaultAspectRatio() const
Returns the default marker aspect ratio between width and height, 0 if not yet calculated.
void setStrokeWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the stroke width map unit scale.
QColor mStrokeColor
Stroke color.
QgsUnitTypes::RenderUnit strokeWidthUnit() const
Returns the stroke width unit.
QgsUnitTypes::RenderUnit outputUnit() const override
Returns the units to use for sizes and widths within the symbol layer.
const QgsMapUnitScale & strokeWidthMapUnitScale() const
Returns the map scale for the width of the marker&#39;s stroke.
Abstract base class for all rendered symbols.
Definition: qgssymbol.h:61
virtual QgsSymbol * subSymbol()
Returns the symbol&#39;s sub symbol, if present.
void setStrokeWidthUnit(QgsUnitTypes::RenderUnit u)
Sets the unit for the width of the marker&#39;s stroke.
QgsUnitTypes::RenderUnit strokeWidthUnit() const
Returns the units for the stroke width.
void setStrokeStyle(Qt::PenStyle strokeStyle)
Sets the marker&#39;s stroke style (e.g., solid, dashed, etc)
Simple marker symbol layer, consisting of a rendered shape with solid fill color and an stroke...
Abstract base class for simple marker symbol layers.
Right facing arrow head (unfilled, lines only)
void startRender(QgsSymbolRenderContext &context) override
QgsMapUnitScale mStrokeWidthMapUnitScale
Stroke width map unit scale.
void setStrokeColor(const QColor &color) override
Sets the marker&#39;s stroke color.
void setStrokeColor(const QColor &c) override
Set stroke color.
void setStrokeWidth(double w)
Sets the width of the marker&#39;s stroke.
#define DEFAULT_FONTMARKER_COLOR
QBrush mSelBrush
QBrush to use as fill of selected symbols.
void setStrokeWidth(double width)
Set&#39;s the marker&#39;s stroke width.
bool preservedAspectRatio() const
Returns the preserved aspect ratio value, true if fixed aspect ratio has been lower or equal to 0...
QColor strokeColor() const override
Returns the marker&#39;s stroke color.
#define DEFAULT_SIMPLEMARKER_JOINSTYLE
virtual QgsStringMap properties() const =0
Should be reimplemented by subclasses to return a string map that contains the configuration informat...
virtual void writeSldMarker(QDomDocument &doc, QDomElement &element, const QgsStringMap &props) const
Writes the symbol layer definition as a SLD XML element.
QMap< QString, QString > QgsStringMap
Definition: qgis.h:577
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
void renderPoint(QPointF point, QgsSymbolRenderContext &context) override
Renders a marker at the specified point.
#define DEFAULT_FONTMARKER_SIZE
QColor strokeColor() const override
Gets stroke color.
Qt::PenJoinStyle penJoinStyle() const
Returns the stroke join style.
void setPenJoinStyle(Qt::PenJoinStyle style)
Sets the stroke join style.
QPainterPath mPath
Painter path representing shape. If mPolygon is empty then the shape is stored in mPath...
Diagonal half square (bottom left half)
QChar character() const
Returns the character used when rendering points.
virtual void setColor(const QColor &color)
The fill color.
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
virtual QRectF bounds(QPointF point, QgsSymbolRenderContext &context)=0
Returns the approximate bounding box of the marker symbol layer, taking into account any data defined...
One third circle (top left third)
void setStrokeWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the stroke width.
virtual bool setSubSymbol(QgsSymbol *symbol)
Sets layer&#39;s subsymbol. takes ownership of the passed symbol.
void setStrokeColor(const QColor &color) override
Set stroke color.
double strokeWidth() const
Returns the marker&#39;s stroke width.
QPen mPen
QPen corresponding to marker&#39;s stroke style.
void setStrokeWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map scale for the width of the marker&#39;s stroke.
#define DEFAULT_SCALE_METHOD
QgsUnitTypes::RenderUnit strokeWidthUnit() const
Returns the unit for the width of the marker&#39;s stroke.
virtual bool hasDataDefinedProperties() const
Returns true if the symbol layer (or any of its sub-symbols) contains data defined properties...
virtual void renderPoint(QPointF point, QgsSymbolRenderContext &context)=0
Renders a marker at the specified point.
QBrush mBrush
QBrush corresponding to marker&#39;s fill style.
QgsMapUnitScale mStrokeWidthMapUnitScale
#define SIP_FORCE
Definition: qgis_sip.h:124
virtual QgsSymbolLayer * clone() const =0
Shall be reimplemented by subclasses to create a deep copy of the instance.
#define SIP_TRANSFER
Definition: qgis_sip.h:36
void setFillColor(const QColor &color) override
Set fill color.
QColor fillColor() const override
Gets fill color.
#define DEFAULT_FONTMARKER_ANGLE
void setStrokeWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the stroke width unit.
void setCharacter(QChar ch)
Sets the character used when rendering points.
#define SIP_FACTORY
Definition: qgis_sip.h:69
virtual bool writeDxf(QgsDxfExport &e, double mmMapUnitScaleFactor, const QString &layerName, QgsSymbolRenderContext &context, QPointF shift=QPointF(0.0, 0.0)) const
write as DXF
ScaleMethod
Scale method.
Definition: qgssymbol.h:94
QPen mSelPen
QPen to use as stroke of selected symbols.
double strokeWidth() const
Returns the width of the marker&#39;s stroke.
QString path() const
Returns the marker SVG path.
void startRender(QgsSymbolRenderContext &context) override
void stopRender(QgsSymbolRenderContext &context) override
void setFixedAspectRatio(double ratio)
Set the marker aspect ratio between width and height to be used in rendering, if the value set is low...
Qt::PenStyle strokeStyle() const
Returns the marker&#39;s stroke style (e.g., solid, dashed, etc)
#define DEFAULT_SIMPLEMARKER_BORDERCOLOR
Contains information about the context of a rendering operation.
Abstract base class for marker symbol layers.
void setShape(QgsSimpleMarkerSymbolLayerBase::Shape shape)
Sets the rendered marker shape.
QgsUnitTypes::RenderUnit mStrokeWidthUnit
QImage mCache
Cached image of marker, if using cached version.
double fixedAspectRatio() const
Returns the marker aspect ratio between width and height to be used in rendering, if the value set is...
Struct for storing maximum and minimum scales for measurements in map units.
virtual void stopRender(QgsSymbolRenderContext &context)=0
void setMapUnitScale(const QgsMapUnitScale &scale) override
#define DEFAULT_SIMPLEMARKER_ANGLE
#define DEFAULT_SIMPLEMARKER_COLOR
const QgsMapUnitScale & strokeWidthMapUnitScale() const
Qt::PenJoinStyle mPenJoinStyle
Stroke pen join style.
virtual QSet< QString > usedAttributes(const QgsRenderContext &context) const
Returns the set of attributes referenced by the layer.
QColor fillColor() const override
Gets fill color.
QImage mSelCache
Cached image of selected marker, if using cached version.
#define DEFAULT_FONTMARKER_CHR
void setStrokeWidthMapUnitScale(const QgsMapUnitScale &scale)
virtual double estimateMaxBleed(const QgsRenderContext &context) const
Returns the estimated maximum distance which the layer style will bleed outside the drawn shape when ...
void setFontFamily(const QString &family)
Sets the font family for the font which will be used to render the point.
QString fontFamily() const
Returns the font family name for the associated font which will be used to render the point...
Qt::PenJoinStyle penJoinStyle() const
Returns the marker&#39;s stroke join style (e.g., miter, bevel, etc).
void setFillColor(const QColor &color) override
Set fill color.
QColor strokeColor() const override
Gets stroke color.
Resolves relative paths into absolute paths and vice versa.
QgsSimpleMarkerSymbolLayerBase::Shape shape() const
Returns the shape for the rendered marker symbol.
#define DEFAULT_SVGMARKER_SIZE
const QgsMapUnitScale & strokeWidthMapUnitScale() const
Returns the stroke width map unit scale.
Filled marker symbol layer, consisting of a shape which is rendered using a QgsFillSymbol.
#define DEFAULT_SVGMARKER_ANGLE
virtual QColor color() const
The fill color.
Rotated cross (lines only), "x" shape.
void setOutputUnit(QgsUnitTypes::RenderUnit unit) override
Sets the units to use for sizes and widths within the symbol layer.
QPolygonF mPolygon
Polygon of points in shape. If polygon is empty then shape is using mPath.
#define DEFAULT_FONTMARKER_FONT
RenderUnit
Rendering size units.
Definition: qgsunittypes.h:110
virtual QString layerType() const =0
Returns a string that represents this layer type.