QGIS API Documentation  3.6.0-Noosa (5873452)
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() == "RasterMarker" )
74  sipType = sipType_QgsRasterMarkerSymbolLayer;
75  else if ( sipCpp->layerType() == "VectorField" )
76  sipType = sipType_QgsVectorFieldSymbolLayer;
77  else
78  sipType = sipType_QgsMarkerSymbolLayer;
79  break;
80 
81  case QgsSymbol::Line:
82  if ( sipCpp->layerType() == "MarkerLine" )
83  sipType = sipType_QgsMarkerLineSymbolLayer;
84  else if ( sipCpp->layerType() == "SimpleLine" )
85  sipType = sipType_QgsSimpleLineSymbolLayer;
86  else if ( sipCpp->layerType() == "ArrowLine" )
87  sipType = sipType_QgsArrowSymbolLayer;
88  else
89  sipType = sipType_QgsLineSymbolLayer;
90  break;
91 
92  case QgsSymbol::Fill:
93  if ( sipCpp->layerType() == "SimpleFill" )
94  sipType = sipType_QgsSimpleFillSymbolLayer;
95  else if ( sipCpp->layerType() == "LinePatternFill" )
96  sipType = sipType_QgsLinePatternFillSymbolLayer;
97  else if ( sipCpp->layerType() == "PointPatternFill" )
98  sipType = sipType_QgsPointPatternFillSymbolLayer;
99  else if ( sipCpp->layerType() == "SVGFill" )
100  sipType = sipType_QgsSVGFillSymbolLayer;
101  else if ( sipCpp->layerType() == "RasterFill" )
102  sipType = sipType_QgsRasterFillSymbolLayer;
103  else if ( sipCpp->layerType() == "CentroidFill" )
104  sipType = sipType_QgsCentroidFillSymbolLayer;
105  else if ( sipCpp->layerType() == "GradientFill" )
106  sipType = sipType_QgsGradientFillSymbolLayer;
107  else if ( sipCpp->layerType() == "ShapeburstFill" )
108  sipType = sipType_QgsShapeburstFillSymbolLayer;
109  else
110  sipType = sipType_QgsFillSymbolLayer;
111  break;
112 
113  case QgsSymbol::Hybrid:
114  sipType = sipType_QgsGeometryGeneratorSymbolLayer;
115  break;
116  }
117  SIP_END
118 #endif
119  public:
120 
125  enum Property
126  {
127  PropertySize = 0,
177  };
178 
183  static const QgsPropertiesDefinition &propertyDefinitions();
184 
185  virtual ~QgsSymbolLayer();
186 
192  bool enabled() const { return mEnabled; }
193 
201  void setEnabled( bool enabled ) { mEnabled = enabled; }
202 
206  virtual QColor color() const { return mColor; }
207 
211  virtual void setColor( const QColor &color ) { mColor = color; }
212 
216  virtual void setStrokeColor( const QColor &color ) { Q_UNUSED( color ); }
217 
221  virtual QColor strokeColor() const { return QColor(); }
222 
226  virtual void setFillColor( const QColor &color ) { Q_UNUSED( color ); }
227 
231  virtual QColor fillColor() const { return QColor(); }
232 
237  virtual QString layerType() const = 0;
238 
239  virtual void startRender( QgsSymbolRenderContext &context ) = 0;
240  virtual void stopRender( QgsSymbolRenderContext &context ) = 0;
241 
245  virtual QgsSymbolLayer *clone() const = 0 SIP_FACTORY;
246 
247  virtual void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const
248  { Q_UNUSED( props ); element.appendChild( doc.createComment( QStringLiteral( "SymbolLayerV2 %1 not implemented yet" ).arg( layerType() ) ) ); }
249 
250  virtual QString ogrFeatureStyle( double mmScaleFactor, double mapUnitScaleFactor ) const { Q_UNUSED( mmScaleFactor ); Q_UNUSED( mapUnitScaleFactor ); return QString(); }
251 
257  virtual QgsStringMap properties() const = 0;
258 
259  virtual void drawPreviewIcon( QgsSymbolRenderContext &context, QSize size ) = 0;
260 
264  virtual QgsSymbol *subSymbol() { return nullptr; }
265 
267  virtual bool setSubSymbol( QgsSymbol *symbol SIP_TRANSFER ) { delete symbol; return false; }
268 
269  QgsSymbol::SymbolType type() const { return mType; }
270 
272  virtual bool isCompatibleWithSymbol( QgsSymbol *symbol ) const;
273 
274  void setLocked( bool locked ) { mLocked = locked; }
275  bool isLocked() const { return mLocked; }
276 
283  virtual double estimateMaxBleed( const QgsRenderContext &context ) const { Q_UNUSED( context ); return 0; }
284 
293  virtual void setOutputUnit( QgsUnitTypes::RenderUnit unit ) { Q_UNUSED( unit ); }
294 
304 
305  virtual void setMapUnitScale( const QgsMapUnitScale &scale ) { Q_UNUSED( scale ); }
306  virtual QgsMapUnitScale mapUnitScale() const { return QgsMapUnitScale(); }
307 
308  // used only with rending with symbol levels is turned on (0 = first pass, 1 = second, ...)
309  void setRenderingPass( int renderingPass ) { mRenderingPass = renderingPass; }
310  int renderingPass() const { return mRenderingPass; }
311 
316  virtual QSet<QString> usedAttributes( const QgsRenderContext &context ) const;
317 
325  virtual void setDataDefinedProperty( Property key, const QgsProperty &property );
326 
328  virtual bool writeDxf( QgsDxfExport &e, double mmMapUnitScaleFactor, const QString &layerName, QgsSymbolRenderContext &context, QPointF shift = QPointF( 0.0, 0.0 ) ) const;
329 
331  virtual double dxfWidth( const QgsDxfExport &e, QgsSymbolRenderContext &context ) const;
332 
334  virtual double dxfOffset( const QgsDxfExport &e, QgsSymbolRenderContext &context ) const;
335 
337  virtual QColor dxfColor( QgsSymbolRenderContext &context ) const;
338 
340  virtual double dxfAngle( QgsSymbolRenderContext &context ) const;
341 
343  virtual QVector<qreal> dxfCustomDashPattern( QgsUnitTypes::RenderUnit &unit ) const;
344 
346  virtual Qt::PenStyle dxfPenStyle() const;
347 
349  virtual QColor dxfBrushColor( QgsSymbolRenderContext &context ) const;
350 
352  virtual Qt::BrushStyle dxfBrushStyle() const;
353 
360  QgsPaintEffect *paintEffect() const;
361 
368  void setPaintEffect( QgsPaintEffect *effect SIP_TRANSFER );
369 
376  virtual void prepareExpressions( const QgsSymbolRenderContext &context );
377 
384  QgsPropertyCollection &dataDefinedProperties() { return mDataDefinedProperties; }
385 
391  const QgsPropertyCollection &dataDefinedProperties() const { return mDataDefinedProperties; } SIP_SKIP
392 
399  void setDataDefinedProperties( const QgsPropertyCollection &collection ) { mDataDefinedProperties = collection; }
400 
406  virtual bool hasDataDefinedProperties() const;
407 
408  protected:
409 
410  QgsSymbolLayer( QgsSymbol::SymbolType type, bool locked = false );
411 
413 
415  bool mEnabled;
416 
417  bool mLocked;
418  QColor mColor;
420 
422 
423  QgsPaintEffect *mPaintEffect = nullptr;
425 
426  // Configuration of selected symbology implementation
428  static const bool SELECTION_IS_OPAQUE = true;
430  static const bool SELECT_FILL_BORDER = false;
432  static const bool SELECT_FILL_STYLE = false;
433 
438  void restoreOldDataDefinedProperties( const QgsStringMap &stringMap );
439 
444  void copyDataDefinedProperties( QgsSymbolLayer *destLayer ) const;
445 
451  void copyPaintEffect( QgsSymbolLayer *destLayer ) const;
452 
453  private:
454  static void initPropertyDefinitions();
455 
457  static QgsPropertiesDefinition sPropertyDefinitions;
458 
459 };
460 
462 
468 class CORE_EXPORT QgsMarkerSymbolLayer : public QgsSymbolLayer
469 {
470  public:
471 
474  {
478  };
479 
482  {
483  Top,
486  };
487 
488  void startRender( QgsSymbolRenderContext &context ) override;
489 
490  void stopRender( QgsSymbolRenderContext &context ) override;
491 
498  virtual void renderPoint( QPointF point, QgsSymbolRenderContext &context ) = 0;
499 
500  void drawPreviewIcon( QgsSymbolRenderContext &context, QSize size ) override;
501 
508  void setAngle( double angle ) { mAngle = angle; }
509 
514  double angle() const { return mAngle; }
515 
525  void setLineAngle( double lineAngle ) { mLineAngle = lineAngle; }
526 
534  void setSize( double size ) { mSize = size; }
535 
542  double size() const { return mSize; }
543 
551  void setSizeUnit( QgsUnitTypes::RenderUnit unit ) { mSizeUnit = unit; }
552 
559  QgsUnitTypes::RenderUnit sizeUnit() const { return mSizeUnit; }
560 
568  void setSizeMapUnitScale( const QgsMapUnitScale &scale ) { mSizeMapUnitScale = scale; }
569 
576  const QgsMapUnitScale &sizeMapUnitScale() const { return mSizeMapUnitScale; }
577 
583  void setScaleMethod( QgsSymbol::ScaleMethod scaleMethod ) { mScaleMethod = scaleMethod; }
584 
589  QgsSymbol::ScaleMethod scaleMethod() const { return mScaleMethod; }
590 
599  void setOffset( QPointF offset ) { mOffset = offset; }
600 
608  QPointF offset() const { return mOffset; }
609 
617  void setOffsetUnit( QgsUnitTypes::RenderUnit unit ) { mOffsetUnit = unit; }
618 
625  QgsUnitTypes::RenderUnit offsetUnit() const { return mOffsetUnit; }
626 
634  void setOffsetMapUnitScale( const QgsMapUnitScale &scale ) { mOffsetMapUnitScale = scale; }
635 
642  const QgsMapUnitScale &offsetMapUnitScale() const { return mOffsetMapUnitScale; }
643 
651  void setHorizontalAnchorPoint( HorizontalAnchorPoint h ) { mHorizontalAnchorPoint = h; }
652 
659  HorizontalAnchorPoint horizontalAnchorPoint() const { return mHorizontalAnchorPoint; }
660 
668  void setVerticalAnchorPoint( VerticalAnchorPoint v ) { mVerticalAnchorPoint = v; }
669 
676  VerticalAnchorPoint verticalAnchorPoint() const { return mVerticalAnchorPoint; }
677 
678  void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const override;
679 
686  virtual void writeSldMarker( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const
687  { Q_UNUSED( props ); element.appendChild( doc.createComment( QStringLiteral( "QgsMarkerSymbolLayer %1 not implemented yet" ).arg( layerType() ) ) ); }
688 
689  void setOutputUnit( QgsUnitTypes::RenderUnit unit ) override;
690  QgsUnitTypes::RenderUnit outputUnit() const override;
691  void setMapUnitScale( const QgsMapUnitScale &scale ) override;
692  QgsMapUnitScale mapUnitScale() const override;
693 
700  virtual QRectF bounds( QPointF point, QgsSymbolRenderContext &context ) = 0;
701 
702  protected:
703 
708  QgsMarkerSymbolLayer( bool locked = false );
709 
717  void markerOffset( QgsSymbolRenderContext &context, double &offsetX, double &offsetY ) const;
718 
729  void markerOffset( QgsSymbolRenderContext &context, double width, double height, double &offsetX, double &offsetY ) const SIP_PYNAME( markerOffsetWithWidthAndHeight );
730 
732  void markerOffset( QgsSymbolRenderContext &context, double width, double height,
734  double &offsetX, double &offsetY,
735  const QgsMapUnitScale &widthMapUnitScale, const QgsMapUnitScale &heightMapUnitScale ) const SIP_PYNAME( markerOffset2 );
736 
743  static QPointF _rotatedOffset( QPointF offset, double angle );
744 
746  double mAngle = 0;
748  double mLineAngle = 0;
750  double mSize = 2.0;
756  QPointF mOffset;
764  HorizontalAnchorPoint mHorizontalAnchorPoint = HCenter;
766  VerticalAnchorPoint mVerticalAnchorPoint = VCenter;
767 
768  private:
769  static QgsMarkerSymbolLayer::HorizontalAnchorPoint decodeHorizontalAnchorPoint( const QString &str );
770  static QgsMarkerSymbolLayer::VerticalAnchorPoint decodeVerticalAnchorPoint( const QString &str );
771 };
772 
777 class CORE_EXPORT QgsLineSymbolLayer : public QgsSymbolLayer
778 {
779  public:
780 
783  {
787  };
788 
789  virtual void renderPolyline( const QPolygonF &points, QgsSymbolRenderContext &context ) = 0;
790 
791  virtual void renderPolygonStroke( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context );
792 
793  virtual void setWidth( double width ) { mWidth = width; }
794 
804  virtual double width() const { return mWidth; }
805 
816  virtual double width( const QgsRenderContext &context ) const;
817 
818  double offset() const { return mOffset; }
819  void setOffset( double offset ) { mOffset = offset; }
820 
826  void setWidthUnit( QgsUnitTypes::RenderUnit unit ) { mWidthUnit = unit; }
827 
832  QgsUnitTypes::RenderUnit widthUnit() const { return mWidthUnit; }
833 
834  void setWidthMapUnitScale( const QgsMapUnitScale &scale ) { mWidthMapUnitScale = scale; }
835  const QgsMapUnitScale &widthMapUnitScale() const { return mWidthMapUnitScale; }
836 
842  void setOffsetUnit( QgsUnitTypes::RenderUnit unit ) { mOffsetUnit = unit; }
843 
848  QgsUnitTypes::RenderUnit offsetUnit() const { return mOffsetUnit; }
849 
850  void setOffsetMapUnitScale( const QgsMapUnitScale &scale ) { mOffsetMapUnitScale = scale; }
851  const QgsMapUnitScale &offsetMapUnitScale() const { return mOffsetMapUnitScale; }
852 
853  void setOutputUnit( QgsUnitTypes::RenderUnit unit ) override;
854  QgsUnitTypes::RenderUnit outputUnit() const override;
855 
856  void setMapUnitScale( const QgsMapUnitScale &scale ) override;
857  QgsMapUnitScale mapUnitScale() const override;
858 
859  void drawPreviewIcon( QgsSymbolRenderContext &context, QSize size ) override;
860 
861  double dxfWidth( const QgsDxfExport &e, QgsSymbolRenderContext &context ) const override;
862 
873  RenderRingFilter ringFilter() const;
874 
885  void setRingFilter( QgsLineSymbolLayer::RenderRingFilter filter );
886 
887  protected:
888  QgsLineSymbolLayer( bool locked = false );
889 
890  double mWidth = 0;
893  double mOffset = 0;
896 
897  RenderRingFilter mRingFilter = AllRings;
898 };
899 
904 class CORE_EXPORT QgsFillSymbolLayer : public QgsSymbolLayer
905 {
906  public:
907  virtual void renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context ) = 0;
908 
909  void drawPreviewIcon( QgsSymbolRenderContext &context, QSize size ) override;
910 
911  void setAngle( double angle ) { mAngle = angle; }
912  double angle() const { return mAngle; }
913 
914  protected:
915  QgsFillSymbolLayer( bool locked = false );
917  void _renderPolygon( QPainter *p, const QPolygonF &points, const QList<QPolygonF> *rings, QgsSymbolRenderContext &context );
918 
919  double mAngle = 0.0;
920 };
921 
922 class QgsSymbolLayerWidget; // why does SIP fail, when this isn't here
923 
924 #endif
925 
926 
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").
Gradient reference point 1 is centroid.
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the symbol&#39;s offset.
void setLineAngle(double lineAngle)
Sets the line angle modification for the symbol&#39;s angle.
void setRenderingPass(int renderingPass)
virtual QString ogrFeatureStyle(double mmScaleFactor, double mapUnitScaleFactor) const
void setLocked(bool locked)
Gradient reference point 1 x.
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)
const QgsMapUnitScale & offsetMapUnitScale() const
const QgsMapUnitScale & sizeMapUnitScale() const
Returns the map unit scale for the symbol&#39;s size.
Align to right side of symbol.
double angle() const
Render both exterior and interior rings.
void setAngle(double angle)
virtual QColor strokeColor() const
Gets stroke color.
Base class for visual effects which can be applied to QPicture drawings.
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.
VerticalAnchorPoint verticalAnchorPoint() const
Returns the vertical anchor point for positioning the symbol.
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the symbol&#39;s offset.
QPointF mOffset
Marker offset.
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the line&#39;s offset.
virtual double dxfWidth(const QgsDxfExport &e, QgsSymbolRenderContext &context) const
Gets line width.
bool isLocked() const
Line symbol.
Definition: qgssymbol.h:86
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:587
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
virtual double width() const
Returns the estimated width for the line symbol layer.
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.
virtual void setColor(const QColor &color)
The fill color.
SymbolType
Type of the symbol.
Definition: qgssymbol.h:83
HorizontalAnchorPoint horizontalAnchorPoint() const
Returns the horizontal anchor point for positioning the symbol.
virtual QgsUnitTypes::RenderUnit outputUnit() const
Returns the units to use for sizes and widths within the symbol layer.
virtual void writeSldMarker(QDomDocument &doc, QDomElement &element, const QgsStringMap &props) const
Writes the symbol layer definition as a SLD XML element.
int renderingPass() const
Align to bottom of symbol.
virtual bool setSubSymbol(QgsSymbol *symbol)
Sets layer&#39;s subsymbol. takes ownership of the passed symbol.
double angle() const
Returns the rotation angle for the marker, in degrees clockwise from north.
virtual void setOutputUnit(QgsUnitTypes::RenderUnit unit)
Sets the units to use for sizes and widths within the symbol layer.
QgsUnitTypes::RenderUnit widthUnit() const
Returns the units for the line&#39;s width.
#define SIP_SKIP
Definition: qgis_sip.h:119
double size() const
Returns the symbol size.
Render the interior rings only.
QgsPropertyCollection & dataDefinedProperties()
Returns a reference to the symbol layer&#39;s property collection, used for data defined overrides...
void setSize(double size)
Sets the symbol size.
void setHorizontalAnchorPoint(HorizontalAnchorPoint h)
Sets the horizontal anchor point for positioning the symbol.
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
virtual QColor color() const
The fill color.
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.
QgsSymbol::SymbolType type() const
#define SIP_FACTORY
Definition: qgis_sip.h:69
QgsMapUnitScale mSizeMapUnitScale
Marker size map unit scale.
Character, eg for font marker symbol layers.
double offset() const
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
const QgsPropertyCollection & dataDefinedProperties() const
Returns a reference to the symbol layer&#39;s property collection, used for data defined overrides...
QgsMapUnitScale mWidthMapUnitScale
RenderRingFilter
Options for filtering rings when the line symbol layer is being used to render a polygon&#39;s rings...
virtual double estimateMaxBleed(const QgsRenderContext &context) const
Returns the estimated maximum distance which the layer style will bleed outside the drawn shape when ...
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.
QgsSymbol::ScaleMethod scaleMethod() const
Returns the method to use for scaling the marker&#39;s size.
virtual void toSld(QDomDocument &doc, QDomElement &element, const QgsStringMap &props) const
void setSizeUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the symbol&#39;s size.
Marker symbol.
Definition: qgssymbol.h:85
virtual QgsMapUnitScale mapUnitScale() const
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.
bool enabled() const
Returns true if symbol layer is enabled and will be drawn.
virtual void stopRender(QgsSymbolRenderContext &context)=0
Struct for storing maximum and minimum scales for measurements in map units.
QgsUnitTypes::RenderUnit sizeUnit() const
Returns the units for the symbol&#39;s size.
void setWidthMapUnitScale(const QgsMapUnitScale &scale)
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the line&#39;s offset.
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition: qgis_sip.h:165
Align to vertical center of symbol.
Secondary color (eg for gradient fills)
bool mEnabled
True if layer is enabled and should be drawn.
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.
const QgsMapUnitScale & widthMapUnitScale() const
Render the exterior ring only.
QgsMapUnitScale mOffsetMapUnitScale
Offset map unit scale.
Shapeburst blur radius.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
QPointF offset() const
Returns the marker&#39;s offset, which is the horizontal and vertical displacement which the rendered mar...
Fill style (eg solid, dots)
virtual QColor fillColor() const
Gets fill color.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the symbol&#39;s offset.
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:111
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.