QGIS API Documentation  3.18.1-Zürich (202f1bf7e5)
qgssymbol.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgssymbol.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 QGSSYMBOL_H
17 #define QGSSYMBOL_H
18 
19 #include "qgis_core.h"
20 #include "qgis.h"
21 #include <QList>
22 #include <QMap>
23 #include "qgsmapunitscale.h"
24 #include "qgsfields.h"
25 #include "qgsrendercontext.h"
26 #include "qgsproperty.h"
28 #include "qgspropertycollection.h"
29 
30 class QColor;
31 class QImage;
32 class QPainter;
33 class QSize;
34 class QPointF;
35 class QPolygonF;
36 class QDomDocument;
37 class QDomElement;
38 
39 class QgsFields;
40 class QgsSymbolLayer;
41 class QgsRenderContext;
42 class QgsVectorLayer;
43 class QgsPaintEffect;
45 class QgsLineSymbolLayer;
46 class QgsFillSymbolLayer;
48 class QgsFeature;
49 class QgsFeatureRenderer;
50 class QgsCurve;
51 class QgsPolygon;
53 class QgsPoint;
55 
56 typedef QList<QgsSymbolLayer *> QgsSymbolLayerList;
57 
64 class CORE_EXPORT QgsSymbol
65 {
66 
67 #ifdef SIP_RUN
69  switch ( sipCpp->type() )
70  {
71  case QgsSymbol::Marker: sipType = sipType_QgsMarkerSymbol; break;
72  case QgsSymbol::Line: sipType = sipType_QgsLineSymbol; break;
73  case QgsSymbol::Fill: sipType = sipType_QgsFillSymbol; break;
74  default: sipType = 0; break;
75  }
76  SIP_END
77 #endif
78 
79  friend class QgsFeatureRenderer;
80 
81  public:
82 
87  {
89  Line,
90  Fill,
91  Hybrid
92  };
93 
98  {
100  ScaleDiameter
101  };
102 
103 
106  {
107  DynamicRotation = 2,
108  };
109  Q_DECLARE_FLAGS( RenderHints, RenderHint )
110 
111 
115  enum Property
116  {
118  };
119 
124  static const QgsPropertiesDefinition &propertyDefinitions();
125 
126  virtual ~QgsSymbol();
127 
133  static QgsSymbol *defaultSymbol( QgsWkbTypes::GeometryType geomType ) SIP_FACTORY;
134 
138  SymbolType type() const { return mType; }
139 
140  // symbol layers handling
141 
149  QgsSymbolLayerList symbolLayers() { return mLayers; }
150 
151 #ifndef SIP_RUN
152 
159  QgsSymbolLayer *symbolLayer( int layer );
160 
167  const QgsSymbolLayer *symbolLayer( int layer ) const;
168 #else
169 
177  SIP_PYOBJECT symbolLayer( int layer ) SIP_TYPEHINT( QgsSymbolLayer );
178  % MethodCode
179  const int count = sipCpp->symbolLayerCount();
180  if ( a0 < 0 || a0 >= count )
181  {
182  PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
183  sipIsErr = 1;
184  }
185  else
186  {
187  sipRes = sipConvertFromType( sipCpp->symbolLayer( a0 ), sipType_QgsSymbolLayer, NULL );
188  }
189  % End
190 #endif
191 
199  int symbolLayerCount() const { return mLayers.count(); }
200 
201 #ifdef SIP_RUN
202 
206  int __len__() const;
207  % MethodCode
208  sipRes = sipCpp->symbolLayerCount();
209  % End
210 
212  int __bool__() const;
213  % MethodCode
214  sipRes = true;
215  % End
216 
225  SIP_PYOBJECT __getitem__( int index ) SIP_TYPEHINT( QgsSymbolLayer );
226  % MethodCode
227  const int count = sipCpp->symbolLayerCount();
228  if ( a0 < -count || a0 >= count )
229  {
230  PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
231  sipIsErr = 1;
232  }
233  else if ( a0 >= 0 )
234  {
235  return sipConvertFromType( sipCpp->symbolLayer( a0 ), sipType_QgsSymbolLayer, NULL );
236  }
237  else
238  {
239  return sipConvertFromType( sipCpp->symbolLayer( count + a0 ), sipType_QgsSymbolLayer, NULL );
240  }
241  % End
242 
251  void __delitem__( int index );
252  % MethodCode
253  const int count = sipCpp->symbolLayerCount();
254  if ( a0 >= 0 && a0 < count )
255  sipCpp->deleteSymbolLayer( a0 );
256  else if ( a0 < 0 && a0 >= -count )
257  sipCpp->deleteSymbolLayer( count + a0 );
258  else
259  {
260  PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
261  sipIsErr = 1;
262  }
263  % End
264 #endif
265 
273  bool insertSymbolLayer( int index, QgsSymbolLayer *layer SIP_TRANSFER );
274 
281  bool appendSymbolLayer( QgsSymbolLayer *layer SIP_TRANSFER );
282 
286  bool deleteSymbolLayer( int index );
287 
294  QgsSymbolLayer *takeSymbolLayer( int index ) SIP_TRANSFERBACK;
295 
303  bool changeSymbolLayer( int index, QgsSymbolLayer *layer SIP_TRANSFER );
304 
314  void startRender( QgsRenderContext &context, const QgsFields &fields = QgsFields() );
315 
322  void stopRender( QgsRenderContext &context );
323 
334  void setColor( const QColor &color );
335 
344  QColor color() const;
345 
363  void drawPreviewIcon( QPainter *painter, QSize size, QgsRenderContext *customContext = nullptr, bool selected = false, const QgsExpressionContext *expressionContext = nullptr,
364  const QgsLegendPatchShape *patchShape = nullptr );
365 
375  void exportImage( const QString &path, const QString &format, QSize size );
376 
386  QImage asImage( QSize size, QgsRenderContext *customContext = nullptr );
387 
394  {
395  FlagIncludeCrosshairsForMarkerSymbols = 1 << 0,
396  };
397  Q_DECLARE_FLAGS( PreviewFlags, PreviewFlag )
398 
399 
409  QImage bigSymbolPreviewImage( QgsExpressionContext *expressionContext = nullptr, QgsSymbol::PreviewFlags flags = QgsSymbol::FlagIncludeCrosshairsForMarkerSymbols );
410 
414  QString dump() const;
415 
421  virtual QgsSymbol *clone() const = 0 SIP_FACTORY;
422 
426  void toSld( QDomDocument &doc, QDomElement &element, QVariantMap props ) const;
427 
436  QgsUnitTypes::RenderUnit outputUnit() const;
437 
443  bool usesMapUnits() const;
444 
453  void setOutputUnit( QgsUnitTypes::RenderUnit unit );
454 
464  QgsMapUnitScale mapUnitScale() const;
465 
474  void setMapUnitScale( const QgsMapUnitScale &scale );
475 
481  qreal opacity() const { return mOpacity; }
482 
488  void setOpacity( qreal opacity ) { mOpacity = opacity; }
489 
494  void setRenderHints( RenderHints hints ) { mRenderHints = hints; }
495 
500  RenderHints renderHints() const { return mRenderHints; }
501 
511  void setClipFeaturesToExtent( bool clipFeaturesToExtent ) { mClipFeaturesToExtent = clipFeaturesToExtent; }
512 
522  bool clipFeaturesToExtent() const { return mClipFeaturesToExtent; }
523 
533  void setForceRHR( bool force ) { mForceRHR = force; }
534 
544  bool forceRHR() const { return mForceRHR; }
545 
551  QSet<QString> usedAttributes( const QgsRenderContext &context ) const;
552 
560  void setDataDefinedProperty( Property key, const QgsProperty &property );
561 
568  QgsPropertyCollection &dataDefinedProperties() { return mDataDefinedProperties; }
569 
575  const QgsPropertyCollection &dataDefinedProperties() const { return mDataDefinedProperties; } SIP_SKIP
576 
583  void setDataDefinedProperties( const QgsPropertyCollection &collection ) { mDataDefinedProperties = collection; }
584 
589  bool hasDataDefinedProperties() const;
590 
600  bool canCauseArtifactsBetweenAdjacentTiles() const;
601 
606  Q_DECL_DEPRECATED void setLayer( const QgsVectorLayer *layer ) SIP_DEPRECATED;
607 
611  Q_DECL_DEPRECATED const QgsVectorLayer *layer() const SIP_DEPRECATED;
612 
617  void renderFeature( const QgsFeature &feature, QgsRenderContext &context, int layer = -1, bool selected = false, bool drawVertexMarker = false, int currentVertexMarkerType = 0, double currentVertexMarkerSize = 0.0 ) SIP_THROW( QgsCsException );
618 
624  QgsSymbolRenderContext *symbolRenderContext();
625 
626  protected:
627  QgsSymbol( SymbolType type, const QgsSymbolLayerList &layers SIP_TRANSFER ); // can't be instantiated
628 
632  static inline QPointF _getPoint( QgsRenderContext &context, const QgsPoint &point )
633  {
634  QPointF pt;
635  if ( context.coordinateTransform().isValid() )
636  {
637  double x = point.x();
638  double y = point.y();
639  double z = 0.0;
640  context.coordinateTransform().transformInPlace( x, y, z );
641  pt = QPointF( x, y );
642 
643  }
644  else
645  pt = point.toQPointF();
646 
647  context.mapToPixel().transformInPlace( pt.rx(), pt.ry() );
648  return pt;
649  }
650 
654  static QPolygonF _getLineString( QgsRenderContext &context, const QgsCurve &curve, bool clipToExtent = true );
655 
662  static QPolygonF _getPolygonRing( QgsRenderContext &context, const QgsCurve &curve, bool clipToExtent, bool isExteriorRing = false, bool correctRingOrientation = false );
663 
671  static void _getPolygon( QPolygonF &pts, QVector<QPolygonF> &holes, QgsRenderContext &context, const QgsPolygon &polygon, bool clipToExtent = true, bool correctRingOrientation = false );
672 
677  QgsSymbolLayerList cloneLayers() const SIP_FACTORY;
678 
688  void renderUsingLayer( QgsSymbolLayer *layer, QgsSymbolRenderContext &context );
689 
694  void renderVertexMarker( QPointF pt, QgsRenderContext &context, int currentVertexMarkerType, double currentVertexMarkerSize );
695 
698 
700  qreal mOpacity = 1.0;
701 
702  RenderHints mRenderHints;
703  bool mClipFeaturesToExtent = true;
704  bool mForceRHR = false;
705 
706  Q_DECL_DEPRECATED const QgsVectorLayer *mLayer = nullptr; //current vectorlayer
707 
708  private:
709 #ifdef SIP_RUN
710  QgsSymbol( const QgsSymbol & );
711 #endif
712 
713  static void initPropertyDefinitions();
714 
716  static QgsPropertiesDefinition sPropertyDefinitions;
717 
722  bool mStarted = false;
723 
725  std::unique_ptr< QgsSymbolRenderContext > mSymbolRenderContext;
726 
727  QgsPropertyCollection mDataDefinedProperties;
728 
740  void startFeatureRender( const QgsFeature &feature, QgsRenderContext &context, int layer = -1 );
741 
753  void stopFeatureRender( const QgsFeature &feature, QgsRenderContext &context, int layer = -1 );
754 
755  Q_DISABLE_COPY( QgsSymbol )
756 
757 };
758 
759 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsSymbol::RenderHints )
760 
761 
767 class CORE_EXPORT QgsSymbolRenderContext
768 {
769  public:
770 
771  //TODO QGIS 4.0 - remove mapUnitScale and renderunit
772 
784  QgsSymbolRenderContext( QgsRenderContext &c, QgsUnitTypes::RenderUnit u, qreal opacity = 1.0, bool selected = false, QgsSymbol::RenderHints renderHints = QgsSymbol::RenderHints(), const QgsFeature *f = nullptr, const QgsFields &fields = QgsFields(), const QgsMapUnitScale &mapUnitScale = QgsMapUnitScale() );
785 
787 
790 
794  QgsRenderContext &renderContext() { return mRenderContext; }
795 
800  const QgsRenderContext &renderContext() const { return mRenderContext; } SIP_SKIP
801 
808  void setOriginalValueVariable( const QVariant &value );
809 
814  Q_DECL_DEPRECATED QgsUnitTypes::RenderUnit outputUnit() const SIP_DEPRECATED { return mOutputUnit; }
815 
820  Q_DECL_DEPRECATED void setOutputUnit( QgsUnitTypes::RenderUnit u ) SIP_DEPRECATED { mOutputUnit = u; }
821 
825  Q_DECL_DEPRECATED QgsMapUnitScale mapUnitScale() const SIP_DEPRECATED { return mMapUnitScale; }
826 
830  Q_DECL_DEPRECATED void setMapUnitScale( const QgsMapUnitScale &scale ) SIP_DEPRECATED { mMapUnitScale = scale; }
831 
837  qreal opacity() const { return mOpacity; }
838 
844  void setOpacity( qreal opacity ) { mOpacity = opacity; }
845 
850  bool selected() const { return mSelected; }
851 
856  void setSelected( bool selected ) { mSelected = selected; }
857 
862  QgsSymbol::RenderHints renderHints() const { return mRenderHints; }
863 
868  void setRenderHints( QgsSymbol::RenderHints hints ) { mRenderHints = hints; }
869 
870  void setFeature( const QgsFeature *f ) { mFeature = f; }
871 
875  const QgsFeature *feature() const { return mFeature; }
876 
882  void setOriginalGeometryType( QgsWkbTypes::GeometryType type ) { mOriginalGeometryType = type; }
883 
892  QgsWkbTypes::GeometryType originalGeometryType() const { return mOriginalGeometryType; }
893 
900  QgsFields fields() const { return mFields; }
901 
906  int geometryPartCount() const { return mGeometryPartCount; }
907 
912  void setGeometryPartCount( int count ) { mGeometryPartCount = count; }
913 
918  int geometryPartNum() const { return mGeometryPartNum; }
919 
924  void setGeometryPartNum( int num ) { mGeometryPartNum = num; }
925 
929  Q_DECL_DEPRECATED double outputLineWidth( double width ) const SIP_DEPRECATED;
930 
934  Q_DECL_DEPRECATED double outputPixelSize( double size ) const SIP_DEPRECATED;
935 
936  // workaround for sip 4.7. Don't use assignment - will fail with assertion error
937  QgsSymbolRenderContext &operator=( const QgsSymbolRenderContext & );
938 
944  QgsExpressionContextScope *expressionContextScope();
945 
953  void setExpressionContextScope( QgsExpressionContextScope *contextScope SIP_TRANSFER );
954 
961  const QgsLegendPatchShape *patchShape() const;
962 
969  void setPatchShape( const QgsLegendPatchShape &shape );
970 
971  private:
972 
973 #ifdef SIP_RUN
975 #endif
976 
977  QgsRenderContext &mRenderContext;
978  std::unique_ptr< QgsExpressionContextScope > mExpressionContextScope;
979  QgsUnitTypes::RenderUnit mOutputUnit;
980  QgsMapUnitScale mMapUnitScale;
981  qreal mOpacity = 1.0;
982  bool mSelected;
983  QgsSymbol::RenderHints mRenderHints;
984  const QgsFeature *mFeature; //current feature
985  QgsFields mFields;
986  int mGeometryPartCount;
987  int mGeometryPartNum;
989  std::unique_ptr< QgsLegendPatchShape > mPatchShape;
990 };
991 
992 
993 
995 
996 
1003 class CORE_EXPORT QgsMarkerSymbol : public QgsSymbol
1004 {
1005  public:
1006 
1011  static QgsMarkerSymbol *createSimple( const QVariantMap &properties ) SIP_FACTORY;
1012 
1019 
1026  void setAngle( double symbolAngle );
1027 
1035  double angle() const;
1036 
1042  void setDataDefinedAngle( const QgsProperty &property );
1043 
1051  QgsProperty dataDefinedAngle() const;
1052 
1060  void setLineAngle( double lineAngle );
1061 
1070  void setSize( double size );
1071 
1084  double size() const;
1085 
1099  double size( const QgsRenderContext &context ) const;
1100 
1109  void setSizeUnit( QgsUnitTypes::RenderUnit unit );
1110 
1119  QgsUnitTypes::RenderUnit sizeUnit() const;
1120 
1129  void setSizeMapUnitScale( const QgsMapUnitScale &scale );
1130 
1140  QgsMapUnitScale sizeMapUnitScale() const;
1141 
1147  void setDataDefinedSize( const QgsProperty &property );
1148 
1156  QgsProperty dataDefinedSize() const;
1157 
1158  void setScaleMethod( QgsSymbol::ScaleMethod scaleMethod );
1159  ScaleMethod scaleMethod();
1160 
1173  void renderPoint( QPointF point, const QgsFeature *f, QgsRenderContext &context, int layer = -1, bool selected = false );
1174 
1186  QRectF bounds( QPointF point, QgsRenderContext &context, const QgsFeature &feature = QgsFeature() ) const;
1187 
1188  QgsMarkerSymbol *clone() const override SIP_FACTORY;
1189 
1190  private:
1191 
1192  void renderPointUsingLayer( QgsMarkerSymbolLayer *layer, QPointF point, QgsSymbolRenderContext &context );
1193 
1194 };
1195 
1196 
1203 class CORE_EXPORT QgsLineSymbol : public QgsSymbol
1204 {
1205  public:
1206 
1211  static QgsLineSymbol *createSimple( const QVariantMap &properties ) SIP_FACTORY;
1212 
1219 
1226  void setWidth( double width );
1227 
1233  void setWidthUnit( QgsUnitTypes::RenderUnit unit );
1234 
1235 
1246  double width() const;
1247 
1259  double width( const QgsRenderContext &context ) const;
1260 
1266  void setDataDefinedWidth( const QgsProperty &property );
1267 
1275  QgsProperty dataDefinedWidth() const;
1276 
1289  void renderPolyline( const QPolygonF &points, const QgsFeature *f, QgsRenderContext &context, int layer = -1, bool selected = false );
1290 
1291  QgsLineSymbol *clone() const override SIP_FACTORY;
1292 
1293  private:
1294 
1295  void renderPolylineUsingLayer( QgsLineSymbolLayer *layer, const QPolygonF &points, QgsSymbolRenderContext &context );
1296 
1297 };
1298 
1299 
1306 class CORE_EXPORT QgsFillSymbol : public QgsSymbol
1307 {
1308  public:
1309 
1314  static QgsFillSymbol *createSimple( const QVariantMap &properties ) SIP_FACTORY;
1315 
1322  void setAngle( double angle );
1323 
1339  void renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings, const QgsFeature *f, QgsRenderContext &context, int layer = -1, bool selected = false );
1340 
1341  QgsFillSymbol *clone() const override SIP_FACTORY;
1342 
1343  private:
1344 
1345  void renderPolygonUsingLayer( QgsSymbolLayer *layer, const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context );
1347  QRectF polygonBounds( const QPolygonF &points, const QVector<QPolygonF> *rings ) const;
1349  QVector<QPolygonF> *translateRings( const QVector<QPolygonF> *rings, double dx, double dy ) const;
1350 };
1351 
1352 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsSymbol::PreviewFlags )
1353 
1354 #endif
1355 
Custom exception class for Coordinate Reference System related exceptions.
Definition: qgsexception.h:66
Abstract base class for curved geometry type.
Definition: qgscurve.h:36
Single scope for storing variables and functions for use within a QgsExpressionContext.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
static QPointF _getPoint(QgsRenderContext &context, const QgsPoint &point)
Creates a point in screen coordinates from a wkb string in map coordinates.
Definition: qgsrenderer.cpp:45
virtual void stopRender(QgsRenderContext &context)
Must be called when a render cycle has finished, to allow the renderer to clean up.
virtual void toSld(QDomDocument &doc, QDomElement &element, const QVariantMap &props=QVariantMap()) const
used from subclasses to create SLD Rule elements following SLD v1.1 specs
Definition: qgsrenderer.h:312
QString type() const
Definition: qgsrenderer.h:141
virtual QString dump() const
Returns debug information about this renderer.
virtual QSet< QString > usedAttributes(const QgsRenderContext &context) const =0
Returns a list of attributes required by this renderer.
void renderVertexMarker(QPointF pt, QgsRenderContext &context)
render editing vertex marker at specified point
virtual void startRender(QgsRenderContext &context, const QgsFields &fields)
Must be called when a new render cycle is started.
Definition: qgsrenderer.cpp:94
virtual bool renderFeature(const QgsFeature &feature, QgsRenderContext &context, int layer=-1, bool selected=false, bool drawVertexMarker=false) SIP_THROW(QgsCsException)
Render a feature using this renderer in the given context.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition: qgsfeature.h:56
Container of fields for a vector layer.
Definition: qgsfields.h:45
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
Definition: qgssymbol.h:1307
Represents a patch shape for use in map legends.
A line symbol type, for rendering LineString and MultiLineString geometries.
Definition: qgssymbol.h:1204
Struct for storing maximum and minimum scales for measurements in map units.
Abstract base class for marker symbol layers.
A marker symbol type, for rendering Point and MultiPoint geometries.
Definition: qgssymbol.h:1004
Base class for visual effects which can be applied to QPicture drawings.
Point geometry type, with support for z-dimension and m-values.
Definition: qgspoint.h:38
Polygon geometry type.
Definition: qgspolygon.h:34
A grouped map of multiple QgsProperty objects, each referenced by a integer key value.
A store for object properties.
Definition: qgsproperty.h:232
Contains information about the context of a rendering operation.
void setOpacity(qreal opacity)
Sets the opacity for the symbol.
Definition: qgssymbol.h:844
Q_DECL_DEPRECATED void setMapUnitScale(const QgsMapUnitScale &scale)
Definition: qgssymbol.h:830
QgsFields fields() const
Fields of the layer.
Definition: qgssymbol.h:900
void setSelected(bool selected)
Sets whether symbols should be rendered using the selected symbol coloring and style.
Definition: qgssymbol.h:856
Q_DECL_DEPRECATED QgsUnitTypes::RenderUnit outputUnit() const
Returns the output unit for the context.
Definition: qgssymbol.h:814
int geometryPartNum() const
Part number of current geometry.
Definition: qgssymbol.h:918
bool selected() const
Returns true if symbols should be rendered using the selected symbol coloring and style.
Definition: qgssymbol.h:850
void setRenderHints(QgsSymbol::RenderHints hints)
Sets rendering hint flags for the symbol.
Definition: qgssymbol.h:868
QgsRenderContext & renderContext()
Returns a reference to the context's render context.
Definition: qgssymbol.h:794
Q_DECL_DEPRECATED QgsMapUnitScale mapUnitScale() const
Definition: qgssymbol.h:825
int geometryPartCount() const
Part count of current geometry.
Definition: qgssymbol.h:906
QgsWkbTypes::GeometryType originalGeometryType() const
Returns the geometry type for the original feature geometry being rendered.
Definition: qgssymbol.h:892
const QgsFeature * feature() const
Returns the current feature being rendered.
Definition: qgssymbol.h:875
const QgsRenderContext & renderContext() const
Returns a reference to the context's render context.
Definition: qgssymbol.h:800
void setGeometryPartCount(int count)
Sets the part count of current geometry.
Definition: qgssymbol.h:912
void setGeometryPartNum(int num)
Sets the part number of current geometry.
Definition: qgssymbol.h:924
QgsSymbol::RenderHints renderHints() const
Returns the rendering hint flags for the symbol.
Definition: qgssymbol.h:862
void setOriginalGeometryType(QgsWkbTypes::GeometryType type)
Sets the geometry type for the original feature geometry being rendered.
Definition: qgssymbol.h:882
QgsSymbolRenderContext(const QgsSymbolRenderContext &rh)=delete
QgsSymbolRenderContext cannot be copied.
void setFeature(const QgsFeature *f)
Definition: qgssymbol.h:870
qreal opacity() const
Returns the opacity for the symbol.
Definition: qgssymbol.h:837
Q_DECL_DEPRECATED void setOutputUnit(QgsUnitTypes::RenderUnit u)
Sets the output unit for the context.
Definition: qgssymbol.h:820
Abstract base class for all rendered symbols.
Definition: qgssymbol.h:65
void setDataDefinedProperties(const QgsPropertyCollection &collection)
Sets the symbol's property collection, used for data defined overrides.
Definition: qgssymbol.h:583
void setRenderHints(RenderHints hints)
Sets rendering hint flags for the symbol.
Definition: qgssymbol.h:494
Property
Data definable properties.
Definition: qgssymbol.h:116
@ PropertyOpacity
Opacity.
Definition: qgssymbol.h:117
ScaleMethod
Scale method.
Definition: qgssymbol.h:98
@ ScaleArea
Calculate scale by the area.
Definition: qgssymbol.h:99
SymbolType type() const
Returns the symbol's type.
Definition: qgssymbol.h:138
RenderHint
Flags controlling behavior of symbols during rendering.
Definition: qgssymbol.h:106
qreal opacity() const
Returns the opacity for the symbol.
Definition: qgssymbol.h:481
bool clipFeaturesToExtent() const
Returns whether features drawn by the symbol will be clipped to the render context's extent.
Definition: qgssymbol.h:522
const QgsPropertyCollection & dataDefinedProperties() const
Returns a reference to the symbol's property collection, used for data defined overrides.
Definition: qgssymbol.h:575
RenderHints renderHints() const
Returns the rendering hint flags for the symbol.
Definition: qgssymbol.h:500
QgsPropertyCollection & dataDefinedProperties()
Returns a reference to the symbol's property collection, used for data defined overrides.
Definition: qgssymbol.h:568
QgsSymbolLayerList symbolLayers()
Returns the list of symbol layers contained in the symbol.
Definition: qgssymbol.h:149
SymbolType
Type of the symbol.
Definition: qgssymbol.h:87
@ Line
Line symbol.
Definition: qgssymbol.h:89
@ Fill
Fill symbol.
Definition: qgssymbol.h:90
@ Marker
Marker symbol.
Definition: qgssymbol.h:88
void setOpacity(qreal opacity)
Sets the opacity for the symbol.
Definition: qgssymbol.h:488
int symbolLayerCount() const
Returns the total number of symbol layers contained in the symbol.
Definition: qgssymbol.h:199
virtual QgsSymbol * clone() const =0
Returns a deep copy of this symbol.
bool forceRHR() const
Returns true if polygon features drawn by the symbol will be reoriented to follow the standard right-...
Definition: qgssymbol.h:544
void setClipFeaturesToExtent(bool clipFeaturesToExtent)
Sets whether features drawn by the symbol should be clipped to the render context's extent.
Definition: qgssymbol.h:511
void setForceRHR(bool force)
Sets whether polygon features drawn by the symbol should be reoriented to follow the standard right-h...
Definition: qgssymbol.h:533
PreviewFlag
Flags for controlling how symbol preview images are generated.
Definition: qgssymbol.h:394
@ FlagIncludeCrosshairsForMarkerSymbols
Include a crosshairs reference image in the background of marker symbol previews.
Definition: qgssymbol.h:395
RenderUnit
Rendering size units.
Definition: qgsunittypes.h:167
Represents a vector layer which manages a vector based data sets.
GeometryType
The geometry types are used to group QgsWkbTypes::Type in a coarse way.
Definition: qgswkbtypes.h:141
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
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
#define SIP_THROW(name)
Definition: qgis_sip.h:189
#define SIP_TYPEHINT(type)
Definition: qgis_sip.h:218
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition: qgis_sip.h:177
#define SIP_DEPRECATED
Definition: qgis_sip.h:106
#define SIP_FORCE
Definition: qgis_sip.h:131
#define SIP_SKIP
Definition: qgis_sip.h:126
#define SIP_TRANSFER
Definition: qgis_sip.h:36
#define SIP_TRANSFERBACK
Definition: qgis_sip.h:48
#define SIP_FACTORY
Definition: qgis_sip.h:76
#define SIP_END
Definition: qgis_sip.h:194
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsField::ConfigurationFlags) CORE_EXPORT QDataStream &operator<<(QDataStream &out
Writes the field to stream out. QGIS version compatibility is not guaranteed.
QMap< int, QgsPropertyDefinition > QgsPropertiesDefinition
Definition of available properties.
QList< QgsSymbolLayer * > QgsSymbolLayerList
Definition: qgssymbol.h:54