QGIS API Documentation  3.12.1-BucureČ™ti (121cc00ff0)
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 
29 class QColor;
30 class QImage;
31 class QPainter;
32 class QSize;
33 class QPointF;
34 class QPolygonF;
35 class QDomDocument;
36 class QDomElement;
37 
38 class QgsFields;
39 class QgsSymbolLayer;
40 class QgsRenderContext;
41 class QgsVectorLayer;
42 class QgsPaintEffect;
44 class QgsLineSymbolLayer;
45 class QgsFillSymbolLayer;
47 class QgsFeature;
48 class QgsFeatureRenderer;
49 class QgsCurve;
50 class QgsPolygon;
52 class QgsPoint;
53 
54 typedef QList<QgsSymbolLayer *> QgsSymbolLayerList;
55 
62 class CORE_EXPORT QgsSymbol
63 {
64 
65 #ifdef SIP_RUN
67  switch ( sipCpp->type() )
68  {
69  case QgsSymbol::Marker: sipType = sipType_QgsMarkerSymbol; break;
70  case QgsSymbol::Line: sipType = sipType_QgsLineSymbol; break;
71  case QgsSymbol::Fill: sipType = sipType_QgsFillSymbol; break;
72  default: sipType = 0; break;
73  }
74  SIP_END
75 #endif
76 
77  friend class QgsFeatureRenderer;
78 
79  public:
80 
85  {
87  Line,
88  Fill,
89  Hybrid
90  };
91 
96  {
98  ScaleDiameter
99  };
100 
101 
104  {
105  DynamicRotation = 2,
106  };
107  Q_DECLARE_FLAGS( RenderHints, RenderHint )
108 
109  virtual ~QgsSymbol();
110 
116  static QgsSymbol *defaultSymbol( QgsWkbTypes::GeometryType geomType ) SIP_FACTORY;
117 
121  SymbolType type() const { return mType; }
122 
123  // symbol layers handling
124 
132  QgsSymbolLayerList symbolLayers() { return mLayers; }
133 
134 #ifndef SIP_RUN
135 
142  QgsSymbolLayer *symbolLayer( int layer );
143 
150  const QgsSymbolLayer *symbolLayer( int layer ) const;
151 #else
152 
160  SIP_PYOBJECT symbolLayer( int layer ) SIP_TYPEHINT( QgsSymbolLayer );
161  % MethodCode
162  const int count = sipCpp->symbolLayerCount();
163  if ( a0 < 0 || a0 >= count )
164  {
165  PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
166  sipIsErr = 1;
167  }
168  else
169  {
170  sipRes = sipConvertFromType( sipCpp->symbolLayer( a0 ), sipType_QgsSymbolLayer, NULL );
171  }
172  % End
173 #endif
174 
182  int symbolLayerCount() const { return mLayers.count(); }
183 
184 #ifdef SIP_RUN
185 
189  int __len__() const;
190  % MethodCode
191  sipRes = sipCpp->symbolLayerCount();
192  % End
193 
195  int __bool__() const;
196  % MethodCode
197  sipRes = true;
198  % End
199 
208  SIP_PYOBJECT __getitem__( int index ) SIP_TYPEHINT( QgsSymbolLayer );
209  % MethodCode
210  const int count = sipCpp->symbolLayerCount();
211  if ( a0 < -count || a0 >= count )
212  {
213  PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
214  sipIsErr = 1;
215  }
216  else if ( a0 >= 0 )
217  {
218  return sipConvertFromType( sipCpp->symbolLayer( a0 ), sipType_QgsSymbolLayer, NULL );
219  }
220  else
221  {
222  return sipConvertFromType( sipCpp->symbolLayer( count + a0 ), sipType_QgsSymbolLayer, NULL );
223  }
224  % End
225 
234  void __delitem__( int index );
235  % MethodCode
236  const int count = sipCpp->symbolLayerCount();
237  if ( a0 >= 0 && a0 < count )
238  sipCpp->deleteSymbolLayer( a0 );
239  else if ( a0 < 0 && a0 >= -count )
240  sipCpp->deleteSymbolLayer( count + a0 );
241  else
242  {
243  PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
244  sipIsErr = 1;
245  }
246  % End
247 #endif
248 
256  bool insertSymbolLayer( int index, QgsSymbolLayer *layer SIP_TRANSFER );
257 
264  bool appendSymbolLayer( QgsSymbolLayer *layer SIP_TRANSFER );
265 
269  bool deleteSymbolLayer( int index );
270 
277  QgsSymbolLayer *takeSymbolLayer( int index ) SIP_TRANSFERBACK;
278 
286  bool changeSymbolLayer( int index, QgsSymbolLayer *layer SIP_TRANSFER );
287 
297  void startRender( QgsRenderContext &context, const QgsFields &fields = QgsFields() );
298 
305  void stopRender( QgsRenderContext &context );
306 
317  void setColor( const QColor &color );
318 
327  QColor color() const;
328 
345  void drawPreviewIcon( QPainter *painter, QSize size, QgsRenderContext *customContext = nullptr, bool selected = false, const QgsExpressionContext *expressionContext = nullptr );
346 
356  void exportImage( const QString &path, const QString &format, QSize size );
357 
367  QImage asImage( QSize size, QgsRenderContext *customContext = nullptr );
368 
377  QImage bigSymbolPreviewImage( QgsExpressionContext *expressionContext = nullptr );
378 
382  QString dump() const;
383 
389  virtual QgsSymbol *clone() const = 0 SIP_FACTORY;
390 
394  void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const;
395 
404  QgsUnitTypes::RenderUnit outputUnit() const;
405 
414  void setOutputUnit( QgsUnitTypes::RenderUnit unit );
415 
425  QgsMapUnitScale mapUnitScale() const;
426 
435  void setMapUnitScale( const QgsMapUnitScale &scale );
436 
442  qreal opacity() const { return mOpacity; }
443 
449  void setOpacity( qreal opacity ) { mOpacity = opacity; }
450 
455  void setRenderHints( RenderHints hints ) { mRenderHints = hints; }
456 
461  RenderHints renderHints() const { return mRenderHints; }
462 
472  void setClipFeaturesToExtent( bool clipFeaturesToExtent ) { mClipFeaturesToExtent = clipFeaturesToExtent; }
473 
483  bool clipFeaturesToExtent() const { return mClipFeaturesToExtent; }
484 
494  void setForceRHR( bool force ) { mForceRHR = force; }
495 
505  bool forceRHR() const { return mForceRHR; }
506 
512  QSet<QString> usedAttributes( const QgsRenderContext &context ) const;
513 
518  bool hasDataDefinedProperties() const;
519 
524  Q_DECL_DEPRECATED void setLayer( const QgsVectorLayer *layer ) SIP_DEPRECATED;
525 
529  Q_DECL_DEPRECATED const QgsVectorLayer *layer() const SIP_DEPRECATED;
530 
535  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 );
536 
542  QgsSymbolRenderContext *symbolRenderContext();
543 
544  protected:
545  QgsSymbol( SymbolType type, const QgsSymbolLayerList &layers SIP_TRANSFER ); // can't be instantiated
546 
550  static inline QPointF _getPoint( QgsRenderContext &context, const QgsPoint &point )
551  {
552  QPointF pt;
553  if ( context.coordinateTransform().isValid() )
554  {
555  double x = point.x();
556  double y = point.y();
557  double z = 0.0;
558  context.coordinateTransform().transformInPlace( x, y, z );
559  pt = QPointF( x, y );
560 
561  }
562  else
563  pt = point.toQPointF();
564 
565  context.mapToPixel().transformInPlace( pt.rx(), pt.ry() );
566  return pt;
567  }
568 
572  static QPolygonF _getLineString( QgsRenderContext &context, const QgsCurve &curve, bool clipToExtent = true );
573 
580  static QPolygonF _getPolygonRing( QgsRenderContext &context, const QgsCurve &curve, bool clipToExtent, bool isExteriorRing = false, bool correctRingOrientation = false );
581 
589  static void _getPolygon( QPolygonF &pts, QList<QPolygonF> &holes, QgsRenderContext &context, const QgsPolygon &polygon, bool clipToExtent = true, bool correctRingOrientation = false );
590 
595  QgsSymbolLayerList cloneLayers() const SIP_FACTORY;
596 
606  void renderUsingLayer( QgsSymbolLayer *layer, QgsSymbolRenderContext &context );
607 
612  void renderVertexMarker( QPointF pt, QgsRenderContext &context, int currentVertexMarkerType, double currentVertexMarkerSize );
613 
616 
618  qreal mOpacity = 1.0;
619 
620  RenderHints mRenderHints = nullptr;
621  bool mClipFeaturesToExtent = true;
622  bool mForceRHR = false;
623 
624  Q_DECL_DEPRECATED const QgsVectorLayer *mLayer = nullptr; //current vectorlayer
625 
626  private:
627 #ifdef SIP_RUN
628  QgsSymbol( const QgsSymbol & );
629 #endif
630 
635  bool mStarted = false;
636 
638  std::unique_ptr< QgsSymbolRenderContext > mSymbolRenderContext;
639 
651  void startFeatureRender( const QgsFeature &feature, QgsRenderContext &context, int layer = -1 );
652 
664  void stopFeatureRender( const QgsFeature &feature, QgsRenderContext &context, int layer = -1 );
665 
666  Q_DISABLE_COPY( QgsSymbol )
667 
668 };
669 
670 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsSymbol::RenderHints )
671 
672 
678 class CORE_EXPORT QgsSymbolRenderContext
679 {
680  public:
681 
682  //TODO QGIS 4.0 - remove mapUnitScale and renderunit
683 
695  QgsSymbolRenderContext( QgsRenderContext &c, QgsUnitTypes::RenderUnit u, qreal opacity = 1.0, bool selected = false, QgsSymbol::RenderHints renderHints = nullptr, const QgsFeature *f = nullptr, const QgsFields &fields = QgsFields(), const QgsMapUnitScale &mapUnitScale = QgsMapUnitScale() );
696 
698  QgsSymbolRenderContext( const QgsSymbolRenderContext &rh ) = delete;
699 
703  QgsRenderContext &renderContext() { return mRenderContext; }
704 
709  const QgsRenderContext &renderContext() const { return mRenderContext; } SIP_SKIP
710 
717  void setOriginalValueVariable( const QVariant &value );
718 
723  Q_DECL_DEPRECATED QgsUnitTypes::RenderUnit outputUnit() const SIP_DEPRECATED { return mOutputUnit; }
724 
729  Q_DECL_DEPRECATED void setOutputUnit( QgsUnitTypes::RenderUnit u ) SIP_DEPRECATED { mOutputUnit = u; }
730 
734  Q_DECL_DEPRECATED QgsMapUnitScale mapUnitScale() const SIP_DEPRECATED { return mMapUnitScale; }
735 
739  Q_DECL_DEPRECATED void setMapUnitScale( const QgsMapUnitScale &scale ) SIP_DEPRECATED { mMapUnitScale = scale; }
740 
746  qreal opacity() const { return mOpacity; }
747 
753  void setOpacity( qreal opacity ) { mOpacity = opacity; }
754 
759  bool selected() const { return mSelected; }
760 
765  void setSelected( bool selected ) { mSelected = selected; }
766 
771  QgsSymbol::RenderHints renderHints() const { return mRenderHints; }
772 
777  void setRenderHints( QgsSymbol::RenderHints hints ) { mRenderHints = hints; }
778 
779  void setFeature( const QgsFeature *f ) { mFeature = f; }
780 
784  const QgsFeature *feature() const { return mFeature; }
785 
791  void setOriginalGeometryType( QgsWkbTypes::GeometryType type ) { mOriginalGeometryType = type; }
792 
801  QgsWkbTypes::GeometryType originalGeometryType() const { return mOriginalGeometryType; }
802 
809  QgsFields fields() const { return mFields; }
810 
815  int geometryPartCount() const { return mGeometryPartCount; }
816 
821  void setGeometryPartCount( int count ) { mGeometryPartCount = count; }
822 
827  int geometryPartNum() const { return mGeometryPartNum; }
828 
833  void setGeometryPartNum( int num ) { mGeometryPartNum = num; }
834 
838  Q_DECL_DEPRECATED double outputLineWidth( double width ) const SIP_DEPRECATED;
839 
843  Q_DECL_DEPRECATED double outputPixelSize( double size ) const SIP_DEPRECATED;
844 
845  // workaround for sip 4.7. Don't use assignment - will fail with assertion error
846  QgsSymbolRenderContext &operator=( const QgsSymbolRenderContext & );
847 
853  QgsExpressionContextScope *expressionContextScope();
854 
862  void setExpressionContextScope( QgsExpressionContextScope *contextScope SIP_TRANSFER );
863 
864  private:
865 
866 #ifdef SIP_RUN
867  QgsSymbolRenderContext( const QgsSymbolRenderContext &rh ) SIP_FORCE;
868 #endif
869 
870  QgsRenderContext &mRenderContext;
871  std::unique_ptr< QgsExpressionContextScope > mExpressionContextScope;
872  QgsUnitTypes::RenderUnit mOutputUnit;
873  QgsMapUnitScale mMapUnitScale;
874  qreal mOpacity = 1.0;
875  bool mSelected;
876  QgsSymbol::RenderHints mRenderHints;
877  const QgsFeature *mFeature; //current feature
878  QgsFields mFields;
879  int mGeometryPartCount;
880  int mGeometryPartNum;
882 };
883 
884 
885 
887 
888 
895 class CORE_EXPORT QgsMarkerSymbol : public QgsSymbol
896 {
897  public:
898 
903  static QgsMarkerSymbol *createSimple( const QgsStringMap &properties ) SIP_FACTORY;
904 
911 
918  void setAngle( double symbolAngle );
919 
927  double angle() const;
928 
934  void setDataDefinedAngle( const QgsProperty &property );
935 
943  QgsProperty dataDefinedAngle() const;
944 
952  void setLineAngle( double lineAngle );
953 
962  void setSize( double size );
963 
976  double size() const;
977 
991  double size( const QgsRenderContext &context ) const;
992 
1001  void setSizeUnit( QgsUnitTypes::RenderUnit unit );
1002 
1011  QgsUnitTypes::RenderUnit sizeUnit() const;
1012 
1021  void setSizeMapUnitScale( const QgsMapUnitScale &scale );
1022 
1032  QgsMapUnitScale sizeMapUnitScale() const;
1033 
1039  void setDataDefinedSize( const QgsProperty &property );
1040 
1048  QgsProperty dataDefinedSize() const;
1049 
1050  void setScaleMethod( QgsSymbol::ScaleMethod scaleMethod );
1051  ScaleMethod scaleMethod();
1052 
1065  void renderPoint( QPointF point, const QgsFeature *f, QgsRenderContext &context, int layer = -1, bool selected = false );
1066 
1078  QRectF bounds( QPointF point, QgsRenderContext &context, const QgsFeature &feature = QgsFeature() ) const;
1079 
1080  QgsMarkerSymbol *clone() const override SIP_FACTORY;
1081 
1082  private:
1083 
1084  void renderPointUsingLayer( QgsMarkerSymbolLayer *layer, QPointF point, QgsSymbolRenderContext &context );
1085 
1086 };
1087 
1088 
1095 class CORE_EXPORT QgsLineSymbol : public QgsSymbol
1096 {
1097  public:
1098 
1103  static QgsLineSymbol *createSimple( const QgsStringMap &properties ) SIP_FACTORY;
1104 
1111 
1118  void setWidth( double width );
1119 
1130  double width() const;
1131 
1143  double width( const QgsRenderContext &context ) const;
1144 
1150  void setDataDefinedWidth( const QgsProperty &property );
1151 
1159  QgsProperty dataDefinedWidth() const;
1160 
1173  void renderPolyline( const QPolygonF &points, const QgsFeature *f, QgsRenderContext &context, int layer = -1, bool selected = false );
1174 
1175  QgsLineSymbol *clone() const override SIP_FACTORY;
1176 
1177  private:
1178 
1179  void renderPolylineUsingLayer( QgsLineSymbolLayer *layer, const QPolygonF &points, QgsSymbolRenderContext &context );
1180 
1181 };
1182 
1183 
1190 class CORE_EXPORT QgsFillSymbol : public QgsSymbol
1191 {
1192  public:
1193 
1198  static QgsFillSymbol *createSimple( const QgsStringMap &properties ) SIP_FACTORY;
1199 
1206  void setAngle( double angle );
1207 
1223  void renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, const QgsFeature *f, QgsRenderContext &context, int layer = -1, bool selected = false );
1224 
1225  QgsFillSymbol *clone() const override SIP_FACTORY;
1226 
1227  private:
1228 
1229  void renderPolygonUsingLayer( QgsSymbolLayer *layer, const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context );
1231  QRectF polygonBounds( const QPolygonF &points, const QList<QPolygonF> *rings ) const;
1233  QList<QPolygonF> *translateRings( const QList<QPolygonF> *rings, double dx, double dy ) const;
1234 };
1235 
1236 #endif
1237 
Q_DECL_DEPRECATED void setMapUnitScale(const QgsMapUnitScale &scale)
Definition: qgssymbol.h:739
double y
Definition: qgspoint.h:42
QgsFields fields() const
Fields of the layer.
Definition: qgssymbol.h:809
Abstract base class for all rendered symbols.
Definition: qgssymbol.h:62
QPointF toQPointF() const
Returns the point as a QPointF.
Definition: qgspoint.h:320
virtual void toSld(QDomDocument &doc, QDomElement &element, const QgsStringMap &props=QgsStringMap()) const
used from subclasses to create SLD Rule elements following SLD v1.1 specs
Definition: qgsrenderer.h:312
const QgsRenderContext & renderContext() const
Returns a reference to the context&#39;s render context.
Definition: qgssymbol.h:709
Q_DECL_DEPRECATED QgsMapUnitScale mapUnitScale() const
Definition: qgssymbol.h:734
static QPointF _getPoint(QgsRenderContext &context, const QgsPoint &point)
Creates a point in screen coordinates from a QgsPoint in map coordinates.
Definition: qgssymbol.h:550
Base class for visual effects which can be applied to QPicture drawings.
bool clipFeaturesToExtent() const
Returns whether features drawn by the symbol will be clipped to the render context&#39;s extent...
Definition: qgssymbol.h:483
Container of fields for a vector layer.
Definition: qgsfields.h:42
void setGeometryPartCount(int count)
Sets the part count of current geometry.
Definition: qgssymbol.h:821
int symbolLayerCount() const
Returns the total number of symbol layers contained in the symbol.
Definition: qgssymbol.h:182
Line symbol.
Definition: qgssymbol.h:87
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition: qgsfeature.h:55
#define SIP_TRANSFERBACK
Definition: qgis_sip.h:48
#define SIP_TYPEHINT(type)
Definition: qgis_sip.h:213
QMap< QString, QString > QgsStringMap
Definition: qgis.h:694
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
A marker symbol type, for rendering Point and MultiPoint geometries.
Definition: qgssymbol.h:895
bool isValid() const
Returns true if the coordinate transform is valid, ie both the source and destination CRS have been s...
A line symbol type, for rendering LineString and MultiLineString geometries.
Definition: qgssymbol.h:1095
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
void transformInPlace(double &x, double &y) const
Transform device coordinates to map coordinates.
SymbolType
Type of the symbol.
Definition: qgssymbol.h:84
virtual QSet< QString > usedAttributes(const QgsRenderContext &context) const =0
Returns a list of attributes required by this renderer.
SymbolType mType
Definition: qgssymbol.h:614
QgsSymbolLayerList mLayers
Definition: qgssymbol.h:615
QString type() const
Definition: qgsrenderer.h:141
void setOriginalGeometryType(QgsWkbTypes::GeometryType type)
Sets the geometry type for the original feature geometry being rendered.
Definition: qgssymbol.h:791
bool forceRHR() const
Returns true if polygon features drawn by the symbol will be reoriented to follow the standard right-...
Definition: qgssymbol.h:505
#define SIP_SKIP
Definition: qgis_sip.h:126
void setOpacity(qreal opacity)
Sets the opacity for the symbol.
Definition: qgssymbol.h:449
void setGeometryPartNum(int num)
Sets the part number of current geometry.
Definition: qgssymbol.h:833
Calculate scale by the area.
Definition: qgssymbol.h:97
qreal opacity() const
Returns the opacity for the symbol.
Definition: qgssymbol.h:746
void setRenderHints(RenderHints hints)
Sets rendering hint flags for the symbol.
Definition: qgssymbol.h:455
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
#define SIP_FORCE
Definition: qgis_sip.h:131
#define SIP_TRANSFER
Definition: qgis_sip.h:36
#define SIP_END
Definition: qgis_sip.h:189
QList< QgsSymbolLayer * > QgsSymbolLayerList
Definition: qgssymbol.h:52
QgsCoordinateTransform coordinateTransform() const
Returns the current coordinate transform for the context.
void setSelected(bool selected)
Sets whether symbols should be rendered using the selected symbol coloring and style.
Definition: qgssymbol.h:765
Abstract base class for curved geometry type.
Definition: qgscurve.h:35
#define SIP_FACTORY
Definition: qgis_sip.h:76
ScaleMethod
Scale method.
Definition: qgssymbol.h:95
Single scope for storing variables and functions for use within a QgsExpressionContext.
A store for object properties.
Definition: qgsproperty.h:229
QgsRenderContext & renderContext()
Returns a reference to the context&#39;s render context.
Definition: qgssymbol.h:703
#define SIP_DEPRECATED
Definition: qgis_sip.h:106
Point geometry type, with support for z-dimension and m-values.
Definition: qgspoint.h:37
void setRenderHints(QgsSymbol::RenderHints hints)
Sets rendering hint flags for the symbol.
Definition: qgssymbol.h:777
bool selected() const
Returns true if symbols should be rendered using the selected symbol coloring and style...
Definition: qgssymbol.h:759
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.
QgsWkbTypes::GeometryType originalGeometryType() const
Returns the geometry type for the original feature geometry being rendered.
Definition: qgssymbol.h:801
void transformInPlace(double &x, double &y, double &z, TransformDirection direction=ForwardTransform) const SIP_THROW(QgsCsException)
Transforms an array of x, y and z double coordinates in place, from the source CRS to the destination...
void setFeature(const QgsFeature *f)
Definition: qgssymbol.h:779
int geometryPartNum() const
Part number of current geometry.
Definition: qgssymbol.h:827
GeometryType
The geometry types are used to group QgsWkbTypes::Type in a coarse way.
Definition: qgswkbtypes.h:139
Marker symbol.
Definition: qgssymbol.h:86
RenderHint
Flags controlling behavior of symbols during rendering.
Definition: qgssymbol.h:103
Fill symbol.
Definition: qgssymbol.h:88
Contains information about the context of a rendering operation.
Abstract base class for marker symbol layers.
const QgsMapToPixel & mapToPixel() const
Returns the context&#39;s map to pixel transform, which transforms between map coordinates and device coo...
SymbolType type() const
Returns the symbol&#39;s type.
Definition: qgssymbol.h:121
Struct for storing maximum and minimum scales for measurements in map units.
virtual void startRender(QgsRenderContext &context, const QgsFields &fields)
Must be called when a new render cycle is started.
Definition: qgsrenderer.cpp:93
virtual QgsSymbol * clone() const =0
Returns a deep copy of this symbol.
Q_DECL_DEPRECATED QgsUnitTypes::RenderUnit outputUnit() const
Returns the output unit for the context.
Definition: qgssymbol.h:723
RenderHints renderHints() const
Returns the rendering hint flags for the symbol.
Definition: qgssymbol.h:461
const QgsFeature * feature() const
Returns the current feature being rendered.
Definition: qgssymbol.h:784
void setOpacity(qreal opacity)
Sets the opacity for the symbol.
Definition: qgssymbol.h:753
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition: qgis_sip.h:172
virtual void stopRender(QgsRenderContext &context)
Must be called when a render cycle has finished, to allow the renderer to clean up.
QgsSymbolLayerList symbolLayers()
Returns the list of symbol layers contained in the symbol.
Definition: qgssymbol.h:132
#define SIP_THROW(name)
Definition: qgis_sip.h:184
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
Definition: qgssymbol.h:1190
Custom exception class for Coordinate Reference System related exceptions.
Definition: qgsexception.h:65
Q_DECL_DEPRECATED void setOutputUnit(QgsUnitTypes::RenderUnit u)
Sets the output unit for the context.
Definition: qgssymbol.h:729
void setClipFeaturesToExtent(bool clipFeaturesToExtent)
Sets whether features drawn by the symbol should be clipped to the render context&#39;s extent...
Definition: qgssymbol.h:472
qreal opacity() const
Returns the opacity for the symbol.
Definition: qgssymbol.h:442
Polygon geometry type.
Definition: qgspolygon.h:31
void setForceRHR(bool force)
Sets whether polygon features drawn by the symbol should be reoriented to follow the standard right-h...
Definition: qgssymbol.h:494
Represents a vector layer which manages a vector based data sets.
virtual QgsFeatureRenderer * clone() const =0
Create a deep copy of this renderer.
int geometryPartCount() const
Part count of current geometry.
Definition: qgssymbol.h:815
RenderUnit
Rendering size units.
Definition: qgsunittypes.h:145
QgsSymbol::RenderHints renderHints() const
Returns the rendering hint flags for the symbol.
Definition: qgssymbol.h:771
void renderVertexMarker(QPointF pt, QgsRenderContext &context)
render editing vertex marker at specified point
virtual QString dump() const
Returns debug information about this renderer.
double x
Definition: qgspoint.h:41