QGIS API Documentation  3.4.15-Madeira (e83d02e274)
qgssymbollayer.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgssymbollayer.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 #ifndef QGSSYMBOLLAYER_H
16 #define QGSSYMBOLLAYER_H
17 
18 #define DEG2RAD(x) ((x)*M_PI/180)
19 #define DEFAULT_SCALE_METHOD QgsSymbol::ScaleDiameter
20 
21 #include "qgis_core.h"
22 #include "qgis.h"
23 #include <QColor>
24 #include <QMap>
25 #include <QPointF>
26 #include <QSet>
27 #include <QDomDocument>
28 #include <QDomElement>
29 
30 #include "qgssymbol.h"
31 #include "qgsfields.h"
32 #include "qgspropertycollection.h"
33 
34 class QPainter;
35 class QSize;
36 class QPolygonF;
37 
38 class QgsDxfExport;
39 class QgsExpression;
40 class QgsRenderContext;
42 
43 #ifndef SIP_RUN
44 typedef QMap<QString, QString> QgsStringMap;
45 #endif
46 
51 class CORE_EXPORT QgsSymbolLayer
52 {
53 #ifdef SIP_RUN
54 #include <qgslinesymbollayer.h>
55 #endif
56 
57 
58 #ifdef SIP_RUN
60  switch ( sipCpp->type() )
61  {
62  case QgsSymbol::Marker:
63  if ( sipCpp->layerType() == "EllipseMarker" )
64  sipType = sipType_QgsEllipseSymbolLayer;
65  else if ( sipCpp->layerType() == "FontMarker" )
66  sipType = sipType_QgsFontMarkerSymbolLayer;
67  else if ( sipCpp->layerType() == "SimpleMarker" )
68  sipType = sipType_QgsSimpleMarkerSymbolLayer;
69  else if ( sipCpp->layerType() == "FilledMarker" )
70  sipType = sipType_QgsFilledMarkerSymbolLayer;
71  else if ( sipCpp->layerType() == "SvgMarker" )
72  sipType = sipType_QgsSvgMarkerSymbolLayer;
73  else if ( sipCpp->layerType() == "VectorField" )
74  sipType = sipType_QgsVectorFieldSymbolLayer;
75  else
76  sipType = sipType_QgsMarkerSymbolLayer;
77  break;
78 
79  case QgsSymbol::Line:
80  if ( sipCpp->layerType() == "MarkerLine" )
81  sipType = sipType_QgsMarkerLineSymbolLayer;
82  else if ( sipCpp->layerType() == "SimpleLine" )
83  sipType = sipType_QgsSimpleLineSymbolLayer;
84  else if ( sipCpp->layerType() == "ArrowLine" )
85  sipType = sipType_QgsArrowSymbolLayer;
86  else
87  sipType = sipType_QgsLineSymbolLayer;
88  break;
89 
90  case QgsSymbol::Fill:
91  if ( sipCpp->layerType() == "SimpleFill" )
92  sipType = sipType_QgsSimpleFillSymbolLayer;
93  else if ( sipCpp->layerType() == "LinePatternFill" )
94  sipType = sipType_QgsLinePatternFillSymbolLayer;
95  else if ( sipCpp->layerType() == "PointPatternFill" )
96  sipType = sipType_QgsPointPatternFillSymbolLayer;
97  else if ( sipCpp->layerType() == "SVGFill" )
98  sipType = sipType_QgsSVGFillSymbolLayer;
99  else if ( sipCpp->layerType() == "RasterFill" )
100  sipType = sipType_QgsRasterFillSymbolLayer;
101  else if ( sipCpp->layerType() == "CentroidFill" )
102  sipType = sipType_QgsCentroidFillSymbolLayer;
103  else if ( sipCpp->layerType() == "GradientFill" )
104  sipType = sipType_QgsGradientFillSymbolLayer;
105  else if ( sipCpp->layerType() == "ShapeburstFill" )
106  sipType = sipType_QgsShapeburstFillSymbolLayer;
107  else
108  sipType = sipType_QgsFillSymbolLayer;
109  break;
110 
111  case QgsSymbol::Hybrid:
112  sipType = sipType_QgsGeometryGeneratorSymbolLayer;
113  break;
114  }
115  SIP_END
116 #endif
117  public:
118 
123  enum Property
124  {
125  PropertySize = 0,
175  };
176 
181  static const QgsPropertiesDefinition &propertyDefinitions();
182 
183  virtual ~QgsSymbolLayer();
184 
190  bool enabled() const { return mEnabled; }
191 
199  void setEnabled( bool enabled ) { mEnabled = enabled; }
200 
204  virtual QColor color() const { return mColor; }
205 
209  virtual void setColor( const QColor &color ) { mColor = color; }
210 
214  virtual void setStrokeColor( const QColor &color ) { Q_UNUSED( color ); }
215 
219  virtual QColor strokeColor() const { return QColor(); }
220 
224  virtual void setFillColor( const QColor &color ) { Q_UNUSED( color ); }
225 
229  virtual QColor fillColor() const { return QColor(); }
230 
235  virtual QString layerType() const = 0;
236 
237  virtual void startRender( QgsSymbolRenderContext &context ) = 0;
238  virtual void stopRender( QgsSymbolRenderContext &context ) = 0;
239 
243  virtual QgsSymbolLayer *clone() const = 0 SIP_FACTORY;
244 
245  virtual void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const
246  { Q_UNUSED( props ); element.appendChild( doc.createComment( QStringLiteral( "SymbolLayerV2 %1 not implemented yet" ).arg( layerType() ) ) ); }
247 
248  virtual QString ogrFeatureStyle( double mmScaleFactor, double mapUnitScaleFactor ) const { Q_UNUSED( mmScaleFactor ); Q_UNUSED( mapUnitScaleFactor ); return QString(); }
249 
255  virtual QgsStringMap properties() const = 0;
256 
257  virtual void drawPreviewIcon( QgsSymbolRenderContext &context, QSize size ) = 0;
258 
262  virtual QgsSymbol *subSymbol() { return nullptr; }
263 
265  virtual bool setSubSymbol( QgsSymbol *symbol SIP_TRANSFER ) { delete symbol; return false; }
266 
267  QgsSymbol::SymbolType type() const { return mType; }
268 
270  virtual bool isCompatibleWithSymbol( QgsSymbol *symbol ) const;
271 
272  void setLocked( bool locked ) { mLocked = locked; }
273  bool isLocked() const { return mLocked; }
274 
281  virtual double estimateMaxBleed( const QgsRenderContext &context ) const { Q_UNUSED( context ); return 0; }
282 
291  virtual void setOutputUnit( QgsUnitTypes::RenderUnit unit ) { Q_UNUSED( unit ); }
292 
302 
303  virtual void setMapUnitScale( const QgsMapUnitScale &scale ) { Q_UNUSED( scale ); }
304  virtual QgsMapUnitScale mapUnitScale() const { return QgsMapUnitScale(); }
305 
306  // used only with rending with symbol levels is turned on (0 = first pass, 1 = second, ...)
307  void setRenderingPass( int renderingPass ) { mRenderingPass = renderingPass; }
308  int renderingPass() const { return mRenderingPass; }
309 
314  virtual QSet<QString> usedAttributes( const QgsRenderContext &context ) const;
315 
323  virtual void setDataDefinedProperty( Property key, const QgsProperty &property );
324 
326  virtual bool writeDxf( QgsDxfExport &e, double mmMapUnitScaleFactor, const QString &layerName, QgsSymbolRenderContext &context, QPointF shift = QPointF( 0.0, 0.0 ) ) const;
327 
329  virtual double dxfWidth( const QgsDxfExport &e, QgsSymbolRenderContext &context ) const;
330 
332  virtual double dxfOffset( const QgsDxfExport &e, QgsSymbolRenderContext &context ) const;
333 
335  virtual QColor dxfColor( QgsSymbolRenderContext &context ) const;
336 
338  virtual double dxfAngle( QgsSymbolRenderContext &context ) const;
339 
341  virtual QVector<qreal> dxfCustomDashPattern( QgsUnitTypes::RenderUnit &unit ) const;
342 
344  virtual Qt::PenStyle dxfPenStyle() const;
345 
347  virtual QColor dxfBrushColor( QgsSymbolRenderContext &context ) const;
348 
350  virtual Qt::BrushStyle dxfBrushStyle() const;
351 
358  QgsPaintEffect *paintEffect() const;
359 
366  void setPaintEffect( QgsPaintEffect *effect SIP_TRANSFER );
367 
374  virtual void prepareExpressions( const QgsSymbolRenderContext &context );
375 
382  QgsPropertyCollection &dataDefinedProperties() { return mDataDefinedProperties; }
383 
389  const QgsPropertyCollection &dataDefinedProperties() const { return mDataDefinedProperties; } SIP_SKIP
390 
397  void setDataDefinedProperties( const QgsPropertyCollection &collection ) { mDataDefinedProperties = collection; }
398 
404  virtual bool hasDataDefinedProperties() const;
405 
406  protected:
407 
408  QgsSymbolLayer( QgsSymbol::SymbolType type, bool locked = false );
409 
411 
413  bool mEnabled;
414 
415  bool mLocked;
416  QColor mColor;
418 
420 
421  QgsPaintEffect *mPaintEffect = nullptr;
423 
424  // Configuration of selected symbology implementation
426  static const bool SELECTION_IS_OPAQUE = true;
428  static const bool SELECT_FILL_BORDER = false;
430  static const bool SELECT_FILL_STYLE = false;
431 
436  void restoreOldDataDefinedProperties( const QgsStringMap &stringMap );
437 
442  void copyDataDefinedProperties( QgsSymbolLayer *destLayer ) const;
443 
449  void copyPaintEffect( QgsSymbolLayer *destLayer ) const;
450 
451  private:
452  static void initPropertyDefinitions();
453 
455  static QgsPropertiesDefinition sPropertyDefinitions;
456 
457 };
458 
460 
466 class CORE_EXPORT QgsMarkerSymbolLayer : public QgsSymbolLayer
467 {
468  public:
469 
472  {
476  };
477 
480  {
481  Top,
484  };
485 
486  void startRender( QgsSymbolRenderContext &context ) override;
487 
494  virtual void renderPoint( QPointF point, QgsSymbolRenderContext &context ) = 0;
495 
496  void drawPreviewIcon( QgsSymbolRenderContext &context, QSize size ) override;
497 
504  void setAngle( double angle ) { mAngle = angle; }
505 
510  double angle() const { return mAngle; }
511 
521  void setLineAngle( double lineAngle ) { mLineAngle = lineAngle; }
522 
530  virtual void setSize( double size ) { mSize = size; }
531 
538  double size() const { return mSize; }
539 
547  void setSizeUnit( QgsUnitTypes::RenderUnit unit ) { mSizeUnit = unit; }
548 
555  QgsUnitTypes::RenderUnit sizeUnit() const { return mSizeUnit; }
556 
564  void setSizeMapUnitScale( const QgsMapUnitScale &scale ) { mSizeMapUnitScale = scale; }
565 
572  const QgsMapUnitScale &sizeMapUnitScale() const { return mSizeMapUnitScale; }
573 
579  void setScaleMethod( QgsSymbol::ScaleMethod scaleMethod ) { mScaleMethod = scaleMethod; }
580 
585  QgsSymbol::ScaleMethod scaleMethod() const { return mScaleMethod; }
586 
595  void setOffset( QPointF offset ) { mOffset = offset; }
596 
604  QPointF offset() const { return mOffset; }
605 
613  void setOffsetUnit( QgsUnitTypes::RenderUnit unit ) { mOffsetUnit = unit; }
614 
621  QgsUnitTypes::RenderUnit offsetUnit() const { return mOffsetUnit; }
622 
630  void setOffsetMapUnitScale( const QgsMapUnitScale &scale ) { mOffsetMapUnitScale = scale; }
631 
638  const QgsMapUnitScale &offsetMapUnitScale() const { return mOffsetMapUnitScale; }
639 
647  void setHorizontalAnchorPoint( HorizontalAnchorPoint h ) { mHorizontalAnchorPoint = h; }
648 
655  HorizontalAnchorPoint horizontalAnchorPoint() const { return mHorizontalAnchorPoint; }
656 
664  void setVerticalAnchorPoint( VerticalAnchorPoint v ) { mVerticalAnchorPoint = v; }
665 
672  VerticalAnchorPoint verticalAnchorPoint() const { return mVerticalAnchorPoint; }
673 
674  void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const override;
675 
682  virtual void writeSldMarker( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const
683  { Q_UNUSED( props ); element.appendChild( doc.createComment( QStringLiteral( "QgsMarkerSymbolLayer %1 not implemented yet" ).arg( layerType() ) ) ); }
684 
685  void setOutputUnit( QgsUnitTypes::RenderUnit unit ) override;
686  QgsUnitTypes::RenderUnit outputUnit() const override;
687  void setMapUnitScale( const QgsMapUnitScale &scale ) override;
688  QgsMapUnitScale mapUnitScale() const override;
689 
696  virtual QRectF bounds( QPointF point, QgsSymbolRenderContext &context ) = 0;
697 
698  protected:
699 
704  QgsMarkerSymbolLayer( bool locked = false );
705 
713  void markerOffset( QgsSymbolRenderContext &context, double &offsetX, double &offsetY ) const;
714 
725  void markerOffset( QgsSymbolRenderContext &context, double width, double height, double &offsetX, double &offsetY ) const SIP_PYNAME( markerOffsetWithWidthAndHeight );
726 
728  void markerOffset( QgsSymbolRenderContext &context, double width, double height,
730  double &offsetX, double &offsetY,
731  const QgsMapUnitScale &widthMapUnitScale, const QgsMapUnitScale &heightMapUnitScale ) const SIP_PYNAME( markerOffset2 );
732 
739  static QPointF _rotatedOffset( QPointF offset, double angle );
740 
742  double mAngle = 0;
744  double mLineAngle = 0;
746  double mSize = 2.0;
752  QPointF mOffset;
760  HorizontalAnchorPoint mHorizontalAnchorPoint = HCenter;
762  VerticalAnchorPoint mVerticalAnchorPoint = VCenter;
763 
764  private:
765  static QgsMarkerSymbolLayer::HorizontalAnchorPoint decodeHorizontalAnchorPoint( const QString &str );
766  static QgsMarkerSymbolLayer::VerticalAnchorPoint decodeVerticalAnchorPoint( const QString &str );
767 };
768 
773 class CORE_EXPORT QgsLineSymbolLayer : public QgsSymbolLayer
774 {
775  public:
776 
779  {
783  };
784 
785  virtual void renderPolyline( const QPolygonF &points, QgsSymbolRenderContext &context ) = 0;
786 
787  virtual void renderPolygonStroke( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context );
788 
789  virtual void setWidth( double width ) { mWidth = width; }
790 
800  virtual double width() const { return mWidth; }
801 
812  virtual double width( const QgsRenderContext &context ) const;
813 
814  double offset() const { return mOffset; }
815  void setOffset( double offset ) { mOffset = offset; }
816 
822  void setWidthUnit( QgsUnitTypes::RenderUnit unit ) { mWidthUnit = unit; }
823 
828  QgsUnitTypes::RenderUnit widthUnit() const { return mWidthUnit; }
829 
830  void setWidthMapUnitScale( const QgsMapUnitScale &scale ) { mWidthMapUnitScale = scale; }
831  const QgsMapUnitScale &widthMapUnitScale() const { return mWidthMapUnitScale; }
832 
838  void setOffsetUnit( QgsUnitTypes::RenderUnit unit ) { mOffsetUnit = unit; }
839 
844  QgsUnitTypes::RenderUnit offsetUnit() const { return mOffsetUnit; }
845 
846  void setOffsetMapUnitScale( const QgsMapUnitScale &scale ) { mOffsetMapUnitScale = scale; }
847  const QgsMapUnitScale &offsetMapUnitScale() const { return mOffsetMapUnitScale; }
848 
849  void setOutputUnit( QgsUnitTypes::RenderUnit unit ) override;
850  QgsUnitTypes::RenderUnit outputUnit() const override;
851 
852  void setMapUnitScale( const QgsMapUnitScale &scale ) override;
853  QgsMapUnitScale mapUnitScale() const override;
854 
855  void drawPreviewIcon( QgsSymbolRenderContext &context, QSize size ) override;
856 
857  double dxfWidth( const QgsDxfExport &e, QgsSymbolRenderContext &context ) const override;
858 
869  RenderRingFilter ringFilter() const;
870 
881  void setRingFilter( QgsLineSymbolLayer::RenderRingFilter filter );
882 
883  protected:
884  QgsLineSymbolLayer( bool locked = false );
885 
886  double mWidth = 0;
889  double mOffset = 0;
892 
893  RenderRingFilter mRingFilter = AllRings;
894 };
895 
900 class CORE_EXPORT QgsFillSymbolLayer : public QgsSymbolLayer
901 {
902  public:
903  virtual void renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context ) = 0;
904 
905  void drawPreviewIcon( QgsSymbolRenderContext &context, QSize size ) override;
906 
907  void setAngle( double angle ) { mAngle = angle; }
908  double angle() const { return mAngle; }
909 
910  protected:
911  QgsFillSymbolLayer( bool locked = false );
913  void _renderPolygon( QPainter *p, const QPolygonF &points, const QList<QPolygonF> *rings, QgsSymbolRenderContext &context );
914 
915  double mAngle = 0.0;
916 };
917 
918 class QgsSymbolLayerWidget; // why does SIP fail, when this isn't here
919 
920 #endif
921 
922 
QgsUnitTypes::RenderUnit widthUnit() const
Returns the units for the line&#39;s width.
void setOffset(QPointF offset)
Sets the marker&#39;s offset, which is the horizontal and vertical displacement which the rendered marker...
Class for parsing and evaluation of expressions (formerly called "search strings").
virtual QString ogrFeatureStyle(double mmScaleFactor, double mapUnitScaleFactor) const
Gradient reference point 1 is centroid.
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the symbol&#39;s offset.
HorizontalAnchorPoint horizontalAnchorPoint() const
Returns the horizontal anchor point for positioning the symbol.
void setLineAngle(double lineAngle)
Sets the line angle modification for the symbol&#39;s angle.
void setRenderingPass(int renderingPass)
void setLocked(bool locked)
Gradient reference point 1 x.
virtual QColor strokeColor() const
Gets stroke color.
Calculate scale by the diameter.
Definition: qgssymbol.h:97
Abstract base class for all rendered symbols.
Definition: qgssymbol.h:61
virtual QgsSymbol * subSymbol()
Returns the symbol&#39;s sub symbol, if present.
virtual void setWidth(double width)
Align to right side of symbol.
QPointF offset() const
Returns the marker&#39;s offset, which is the horizontal and vertical displacement which the rendered mar...
Render both exterior and interior rings.
void setAngle(double angle)
double size() const
Returns the symbol size.
bool isLocked() const
Base class for visual effects which can be applied to QPicture drawings.
bool enabled() const
Returns true if symbol layer is enabled and will be drawn.
Container of fields for a vector layer.
Definition: qgsfields.h:42
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the symbol&#39;s offset.
QPointF mOffset
Marker offset.
Line symbol.
Definition: qgssymbol.h:86
const QgsMapUnitScale & widthMapUnitScale() const
virtual void writeSldMarker(QDomDocument &doc, QDomElement &element, const QgsStringMap &props) const
Writes the symbol layer definition as a SLD XML element.
void setScaleMethod(QgsSymbol::ScaleMethod scaleMethod)
Sets the method to use for scaling the marker&#39;s size.
Align to horizontal center of symbol.
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
Name, eg shape name for simple markers.
void setWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the line&#39;s width.
Gradient reference point 2 y.
const QgsMapUnitScale & offsetMapUnitScale() const
virtual QgsUnitTypes::RenderUnit outputUnit() const
Returns the units to use for sizes and widths within the symbol layer.
double angle() const
virtual void setColor(const QColor &color)
The fill color.
double angle() const
Returns the rotation angle for the marker, in degrees clockwise from north.
SymbolType
Type of the symbol.
Definition: qgssymbol.h:83
Align to bottom of symbol.
virtual bool setSubSymbol(QgsSymbol *symbol)
Sets layer&#39;s subsymbol. takes ownership of the passed symbol.
virtual void setOutputUnit(QgsUnitTypes::RenderUnit unit)
Sets the units to use for sizes and widths within the symbol layer.
QgsSymbol::ScaleMethod scaleMethod() const
Returns the method to use for scaling the marker&#39;s size.
virtual QgsMapUnitScale mapUnitScale() const
#define SIP_SKIP
Definition: qgis_sip.h:119
QgsSymbol::SymbolType type() const
Render the interior rings only.
QgsPropertyCollection & dataDefinedProperties()
Returns a reference to the symbol layer&#39;s property collection, used for data defined overrides...
void setHorizontalAnchorPoint(HorizontalAnchorPoint h)
Sets the horizontal anchor point for positioning the symbol.
const QgsMapUnitScale & sizeMapUnitScale() const
Returns the map unit scale for the symbol&#39;s size.
void setSizeMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the symbol&#39;s size.
#define SIP_TRANSFER
Definition: qgis_sip.h:36
QgsMapUnitScale mOffsetMapUnitScale
Filename, eg for svg files.
#define SIP_END
Definition: qgis_sip.h:182
Align to left side of symbol.
virtual void drawPreviewIcon(QgsSymbolRenderContext &context, QSize size)=0
Shapeburst fill from edge distance.
int renderingPass() const
#define SIP_FACTORY
Definition: qgis_sip.h:69
QgsMapUnitScale mSizeMapUnitScale
Marker size map unit scale.
Character, eg for font marker symbol layers.
ScaleMethod
Scale method.
Definition: qgssymbol.h:94
QMap< QString, QString > QgsStringMap
Align to top of symbol.
void setEnabled(bool enabled)
Sets whether symbol layer is enabled and should be drawn.
A store for object properties.
Definition: qgsproperty.h:229
QgsMapUnitScale mWidthMapUnitScale
virtual void toSld(QDomDocument &doc, QDomElement &element, const QgsStringMap &props) const
RenderRingFilter
Options for filtering rings when the line symbol layer is being used to render a polygon&#39;s rings...
HorizontalAnchorPoint
Symbol horizontal anchor points.
virtual void setStrokeColor(const QColor &color)
Set stroke color.
Gradient reference point 1 y.
QMap< int, QgsPropertyDefinition > QgsPropertiesDefinition
Definition of available properties.
VerticalAnchorPoint
Symbol vertical anchor points.
virtual QColor fillColor() const
Gets fill color.
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the symbol&#39;s offset.
virtual double width() const
Returns the estimated width for the line symbol layer.
void setSizeUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the symbol&#39;s size.
Marker symbol.
Definition: qgssymbol.h:85
Stroke style (eg solid, dashed)
Preserve aspect ratio between width and height.
Fill symbol.
Definition: qgssymbol.h:87
Contains information about the context of a rendering operation.
Abstract base class for marker symbol layers.
virtual void setMapUnitScale(const QgsMapUnitScale &scale)
virtual void setFillColor(const QColor &color)
Set fill color.
const QgsPropertyCollection & dataDefinedProperties() const
Returns a reference to the symbol layer&#39;s property collection, used for data defined overrides...
Struct for storing maximum and minimum scales for measurements in map units.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the symbol&#39;s offset.
void setWidthMapUnitScale(const QgsMapUnitScale &scale)
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the line&#39;s offset.
virtual void setSize(double size)
Sets the symbol size.
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition: qgis_sip.h:165
virtual double dxfWidth(const QgsDxfExport &e, QgsSymbolRenderContext &context) const
Gets line width.
virtual double estimateMaxBleed(const QgsRenderContext &context) const
Returns the estimated maximum distance which the layer style will bleed outside the drawn shape when ...
Align to vertical center of symbol.
Secondary color (eg for gradient fills)
bool mEnabled
True if layer is enabled and should be drawn.
QgsUnitTypes::RenderUnit sizeUnit() const
Returns the units for the symbol&#39;s size.
A grouped map of multiple QgsProperty objects, each referenced by a integer key value.
void setAngle(double angle)
Sets the rotation angle for the marker.
Render the exterior ring only.
QgsMapUnitScale mOffsetMapUnitScale
Offset map unit scale.
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the line&#39;s offset.
double offset() const
Shapeburst blur radius.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Fill style (eg solid, dots)
VerticalAnchorPoint verticalAnchorPoint() const
Returns the vertical anchor point for positioning the symbol.
virtual QColor color() const
The fill color.
QgsFields mFields
Whether symbol layer is enabled.
Hybrid symbol.
Definition: qgssymbol.h:88
Gradient reference point 2 is centroid.
QgsSymbol::SymbolType mType
Gradient reference point 2 x.
QgsPropertyCollection mDataDefinedProperties
void setDataDefinedProperties(const QgsPropertyCollection &collection)
Sets the symbol layer&#39;s property collection, used for data defined overrides.
Property
Data definable properties.
RenderUnit
Rendering size units.
Definition: qgsunittypes.h:110
void setVerticalAnchorPoint(VerticalAnchorPoint v)
Sets the vertical anchor point for positioning the symbol.
#define SIP_PYNAME(name)
Definition: qgis_sip.h:74
void setOffset(double offset)
virtual void startRender(QgsSymbolRenderContext &context)=0
Horizontal distance between points.
virtual QString layerType() const =0
Returns a string that represents this layer type.
Vertical distance between points.