QGIS API Documentation  3.2.0-Bonn (bc43194)
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 
322  virtual void setDataDefinedProperty( Property key, const QgsProperty &property );
323 
325  virtual bool writeDxf( QgsDxfExport &e, double mmMapUnitScaleFactor, const QString &layerName, QgsSymbolRenderContext &context, QPointF shift = QPointF( 0.0, 0.0 ) ) const;
326 
328  virtual double dxfWidth( const QgsDxfExport &e, QgsSymbolRenderContext &context ) const;
329 
331  virtual double dxfOffset( const QgsDxfExport &e, QgsSymbolRenderContext &context ) const;
332 
334  virtual QColor dxfColor( QgsSymbolRenderContext &context ) const;
335 
337  virtual double dxfAngle( QgsSymbolRenderContext &context ) const;
338 
340  virtual QVector<qreal> dxfCustomDashPattern( QgsUnitTypes::RenderUnit &unit ) const;
341 
343  virtual Qt::PenStyle dxfPenStyle() const;
344 
346  virtual QColor dxfBrushColor( QgsSymbolRenderContext &context ) const;
347 
349  virtual Qt::BrushStyle dxfBrushStyle() const;
350 
357  QgsPaintEffect *paintEffect() const;
358 
365  void setPaintEffect( QgsPaintEffect *effect SIP_TRANSFER );
366 
373  virtual void prepareExpressions( const QgsSymbolRenderContext &context );
374 
380  QgsPropertyCollection &dataDefinedProperties() { return mDataDefinedProperties; }
381 
387  const QgsPropertyCollection &dataDefinedProperties() const { return mDataDefinedProperties; } SIP_SKIP
388 
395  void setDataDefinedProperties( const QgsPropertyCollection &collection ) { mDataDefinedProperties = collection; }
396 
397  protected:
398 
399  QgsSymbolLayer( QgsSymbol::SymbolType type, bool locked = false );
400 
402 
404  bool mEnabled;
405 
406  bool mLocked;
407  QColor mColor;
409 
411 
412  QgsPaintEffect *mPaintEffect = nullptr;
414 
415  // Configuration of selected symbology implementation
417  static const bool SELECTION_IS_OPAQUE = true;
419  static const bool SELECT_FILL_BORDER = false;
421  static const bool SELECT_FILL_STYLE = false;
422 
427  void restoreOldDataDefinedProperties( const QgsStringMap &stringMap );
428 
433  void copyDataDefinedProperties( QgsSymbolLayer *destLayer ) const;
434 
440  void copyPaintEffect( QgsSymbolLayer *destLayer ) const;
441 
442  private:
443  static void initPropertyDefinitions();
444 
446  static QgsPropertiesDefinition sPropertyDefinitions;
447 
448 };
449 
451 
457 class CORE_EXPORT QgsMarkerSymbolLayer : public QgsSymbolLayer
458 {
459  public:
460 
463  {
467  };
468 
471  {
472  Top,
475  };
476 
477  void startRender( QgsSymbolRenderContext &context ) override;
478 
485  virtual void renderPoint( QPointF point, QgsSymbolRenderContext &context ) = 0;
486 
487  void drawPreviewIcon( QgsSymbolRenderContext &context, QSize size ) override;
488 
495  void setAngle( double angle ) { mAngle = angle; }
496 
501  double angle() const { return mAngle; }
502 
512  void setLineAngle( double lineAngle ) { mLineAngle = lineAngle; }
513 
521  void setSize( double size ) { mSize = size; }
522 
529  double size() const { return mSize; }
530 
538  void setSizeUnit( QgsUnitTypes::RenderUnit unit ) { mSizeUnit = unit; }
539 
546  QgsUnitTypes::RenderUnit sizeUnit() const { return mSizeUnit; }
547 
555  void setSizeMapUnitScale( const QgsMapUnitScale &scale ) { mSizeMapUnitScale = scale; }
556 
563  const QgsMapUnitScale &sizeMapUnitScale() const { return mSizeMapUnitScale; }
564 
570  void setScaleMethod( QgsSymbol::ScaleMethod scaleMethod ) { mScaleMethod = scaleMethod; }
571 
576  QgsSymbol::ScaleMethod scaleMethod() const { return mScaleMethod; }
577 
586  void setOffset( QPointF offset ) { mOffset = offset; }
587 
595  QPointF offset() const { return mOffset; }
596 
604  void setOffsetUnit( QgsUnitTypes::RenderUnit unit ) { mOffsetUnit = unit; }
605 
612  QgsUnitTypes::RenderUnit offsetUnit() const { return mOffsetUnit; }
613 
621  void setOffsetMapUnitScale( const QgsMapUnitScale &scale ) { mOffsetMapUnitScale = scale; }
622 
629  const QgsMapUnitScale &offsetMapUnitScale() const { return mOffsetMapUnitScale; }
630 
638  void setHorizontalAnchorPoint( HorizontalAnchorPoint h ) { mHorizontalAnchorPoint = h; }
639 
646  HorizontalAnchorPoint horizontalAnchorPoint() const { return mHorizontalAnchorPoint; }
647 
655  void setVerticalAnchorPoint( VerticalAnchorPoint v ) { mVerticalAnchorPoint = v; }
656 
663  VerticalAnchorPoint verticalAnchorPoint() const { return mVerticalAnchorPoint; }
664 
665  void toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const override;
666 
673  virtual void writeSldMarker( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const
674  { Q_UNUSED( props ); element.appendChild( doc.createComment( QStringLiteral( "QgsMarkerSymbolLayer %1 not implemented yet" ).arg( layerType() ) ) ); }
675 
676  void setOutputUnit( QgsUnitTypes::RenderUnit unit ) override;
677  QgsUnitTypes::RenderUnit outputUnit() const override;
678  void setMapUnitScale( const QgsMapUnitScale &scale ) override;
679  QgsMapUnitScale mapUnitScale() const override;
680 
687  virtual QRectF bounds( QPointF point, QgsSymbolRenderContext &context ) = 0;
688 
689  protected:
690 
695  QgsMarkerSymbolLayer( bool locked = false );
696 
704  void markerOffset( QgsSymbolRenderContext &context, double &offsetX, double &offsetY ) const;
705 
716  void markerOffset( QgsSymbolRenderContext &context, double width, double height, double &offsetX, double &offsetY ) const SIP_PYNAME( markerOffsetWithWidthAndHeight );
717 
719  void markerOffset( QgsSymbolRenderContext &context, double width, double height,
721  double &offsetX, double &offsetY,
722  const QgsMapUnitScale &widthMapUnitScale, const QgsMapUnitScale &heightMapUnitScale ) const SIP_PYNAME( markerOffset2 );
723 
730  static QPointF _rotatedOffset( QPointF offset, double angle );
731 
733  double mAngle = 0;
735  double mLineAngle = 0;
737  double mSize = 2.0;
743  QPointF mOffset;
751  HorizontalAnchorPoint mHorizontalAnchorPoint = HCenter;
753  VerticalAnchorPoint mVerticalAnchorPoint = VCenter;
754 
755  private:
756  static QgsMarkerSymbolLayer::HorizontalAnchorPoint decodeHorizontalAnchorPoint( const QString &str );
757  static QgsMarkerSymbolLayer::VerticalAnchorPoint decodeVerticalAnchorPoint( const QString &str );
758 };
759 
764 class CORE_EXPORT QgsLineSymbolLayer : public QgsSymbolLayer
765 {
766  public:
767  virtual void renderPolyline( const QPolygonF &points, QgsSymbolRenderContext &context ) = 0;
768 
769  virtual void renderPolygonStroke( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context );
770 
771  virtual void setWidth( double width ) { mWidth = width; }
772  virtual double width() const { return mWidth; }
773 
774  double offset() const { return mOffset; }
775  void setOffset( double offset ) { mOffset = offset; }
776 
782  void setWidthUnit( QgsUnitTypes::RenderUnit unit ) { mWidthUnit = unit; }
783 
788  QgsUnitTypes::RenderUnit widthUnit() const { return mWidthUnit; }
789 
790  void setWidthMapUnitScale( const QgsMapUnitScale &scale ) { mWidthMapUnitScale = scale; }
791  const QgsMapUnitScale &widthMapUnitScale() const { return mWidthMapUnitScale; }
792 
798  void setOffsetUnit( QgsUnitTypes::RenderUnit unit ) { mOffsetUnit = unit; }
799 
804  QgsUnitTypes::RenderUnit offsetUnit() const { return mOffsetUnit; }
805 
806  void setOffsetMapUnitScale( const QgsMapUnitScale &scale ) { mOffsetMapUnitScale = scale; }
807  const QgsMapUnitScale &offsetMapUnitScale() const { return mOffsetMapUnitScale; }
808 
809  void setOutputUnit( QgsUnitTypes::RenderUnit unit ) override;
810  QgsUnitTypes::RenderUnit outputUnit() const override;
811 
812  void setMapUnitScale( const QgsMapUnitScale &scale ) override;
813  QgsMapUnitScale mapUnitScale() const override;
814 
815  void drawPreviewIcon( QgsSymbolRenderContext &context, QSize size ) override;
816 
817  double dxfWidth( const QgsDxfExport &e, QgsSymbolRenderContext &context ) const override;
818 
819  protected:
820  QgsLineSymbolLayer( bool locked = false );
821 
822  double mWidth = 0;
825  double mOffset = 0;
828 };
829 
834 class CORE_EXPORT QgsFillSymbolLayer : public QgsSymbolLayer
835 {
836  public:
837  virtual void renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context ) = 0;
838 
839  void drawPreviewIcon( QgsSymbolRenderContext &context, QSize size ) override;
840 
841  void setAngle( double angle ) { mAngle = angle; }
842  double angle() const { return mAngle; }
843 
844  protected:
845  QgsFillSymbolLayer( bool locked = false );
847  void _renderPolygon( QPainter *p, const QPolygonF &points, const QList<QPolygonF> *rings, QgsSymbolRenderContext &context );
848 
849  double mAngle = 0.0;
850 };
851 
852 class QgsSymbolLayerWidget; // why does SIP fail, when this isn't here
853 
854 #endif
855 
856 
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
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
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:501
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
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.
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
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.
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
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:100
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.