QGIS API Documentation  3.10.0-A Coruña (6c816b4204)
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"
27 
28 class QColor;
29 class QImage;
30 class QPainter;
31 class QSize;
32 class QPointF;
33 class QPolygonF;
34 class QDomDocument;
35 class QDomElement;
36 
37 class QgsFields;
38 class QgsSymbolLayer;
39 class QgsRenderContext;
40 class QgsVectorLayer;
41 class QgsPaintEffect;
43 class QgsLineSymbolLayer;
44 class QgsFillSymbolLayer;
46 class QgsFeature;
47 class QgsFeatureRenderer;
48 class QgsCurve;
49 class QgsPolygon;
51 class QgsPoint;
52 
53 typedef QList<QgsSymbolLayer *> QgsSymbolLayerList;
54 
61 class CORE_EXPORT QgsSymbol
62 {
63 
64 #ifdef SIP_RUN
66  switch ( sipCpp->type() )
67  {
68  case QgsSymbol::Marker: sipType = sipType_QgsMarkerSymbol; break;
69  case QgsSymbol::Line: sipType = sipType_QgsLineSymbol; break;
70  case QgsSymbol::Fill: sipType = sipType_QgsFillSymbol; break;
71  default: sipType = 0; break;
72  }
73  SIP_END
74 #endif
75 
76  friend class QgsFeatureRenderer;
77 
78  public:
79 
84  {
86  Line,
87  Fill,
88  Hybrid
89  };
90 
95  {
97  ScaleDiameter
98  };
99 
100 
103  {
104  DynamicRotation = 2,
105  };
106  Q_DECLARE_FLAGS( RenderHints, RenderHint )
107 
108  virtual ~QgsSymbol();
109 
115  static QgsSymbol *defaultSymbol( QgsWkbTypes::GeometryType geomType ) SIP_FACTORY;
116 
120  SymbolType type() const { return mType; }
121 
122  // symbol layers handling
123 
131  QgsSymbolLayerList symbolLayers() { return mLayers; }
132 
133 #ifndef SIP_RUN
134 
141  QgsSymbolLayer *symbolLayer( int layer );
142 #else
143 
151  SIP_PYOBJECT symbolLayer( int layer ) SIP_TYPEHINT( QgsSymbolLayer );
152  % MethodCode
153  const int count = sipCpp->symbolLayerCount();
154  if ( a0 < 0 || a0 >= count )
155  {
156  PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
157  sipIsErr = 1;
158  }
159  else
160  {
161  sipRes = sipConvertFromType( sipCpp->symbolLayer( a0 ), sipType_QgsSymbolLayer, NULL );
162  }
163  % End
164 #endif
165 
173  int symbolLayerCount() const { return mLayers.count(); }
174 
175 #ifdef SIP_RUN
176 
180  int __len__() const;
181  % MethodCode
182  sipRes = sipCpp->symbolLayerCount();
183  % End
184 
186  int __bool__() const;
187  % MethodCode
188  sipRes = true;
189  % End
190 
199  SIP_PYOBJECT __getitem__( int index ) SIP_TYPEHINT( QgsSymbolLayer );
200  % MethodCode
201  const int count = sipCpp->symbolLayerCount();
202  if ( a0 < -count || a0 >= count )
203  {
204  PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
205  sipIsErr = 1;
206  }
207  else if ( a0 >= 0 )
208  {
209  return sipConvertFromType( sipCpp->symbolLayer( a0 ), sipType_QgsSymbolLayer, NULL );
210  }
211  else
212  {
213  return sipConvertFromType( sipCpp->symbolLayer( count + a0 ), sipType_QgsSymbolLayer, NULL );
214  }
215  % End
216 
225  void __delitem__( int index );
226  % MethodCode
227  const int count = sipCpp->symbolLayerCount();
228  if ( a0 >= 0 && a0 < count )
229  sipCpp->deleteSymbolLayer( a0 );
230  else if ( a0 < 0 && a0 >= -count )
231  sipCpp->deleteSymbolLayer( count + a0 );
232  else
233  {
234  PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
235  sipIsErr = 1;
236  }
237  % End
238 #endif
239 
247  bool insertSymbolLayer( int index, QgsSymbolLayer *layer SIP_TRANSFER );
248 
255  bool appendSymbolLayer( QgsSymbolLayer *layer SIP_TRANSFER );
256 
260  bool deleteSymbolLayer( int index );
261 
268  QgsSymbolLayer *takeSymbolLayer( int index ) SIP_TRANSFERBACK;
269 
277  bool changeSymbolLayer( int index, QgsSymbolLayer *layer SIP_TRANSFER );
278 
288  void startRender( QgsRenderContext &context, const QgsFields &fields = QgsFields() );
289 
296  void stopRender( QgsRenderContext &context );
297 
308  void setColor( const QColor &color );
309 
318  QColor color() const;
319 
336  void drawPreviewIcon( QPainter *painter, QSize size, QgsRenderContext *customContext = nullptr, bool selected = false, const QgsExpressionContext *expressionContext = nullptr );
337 
347  void exportImage( const QString &path, const QString &format, QSize size );
348 
358  QImage asImage( QSize size, QgsRenderContext *customContext = nullptr );
359 
368  QImage bigSymbolPreviewImage( QgsExpressionContext *expressionContext = nullptr );
369 
373  QString dump() const;
374 
380  virtual QgsSymbol *clone() const = 0 SIP_FACTORY;
381 
385  void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const;
386 
395  QgsUnitTypes::RenderUnit outputUnit() const;
396 
405  void setOutputUnit( QgsUnitTypes::RenderUnit unit );
406 
416  QgsMapUnitScale mapUnitScale() const;
417 
426  void setMapUnitScale( const QgsMapUnitScale &scale );
427 
433  qreal opacity() const { return mOpacity; }
434 
440  void setOpacity( qreal opacity ) { mOpacity = opacity; }
441 
446  void setRenderHints( RenderHints hints ) { mRenderHints = hints; }
447 
452  RenderHints renderHints() const { return mRenderHints; }
453 
463  void setClipFeaturesToExtent( bool clipFeaturesToExtent ) { mClipFeaturesToExtent = clipFeaturesToExtent; }
464 
474  bool clipFeaturesToExtent() const { return mClipFeaturesToExtent; }
475 
485  void setForceRHR( bool force ) { mForceRHR = force; }
486 
496  bool forceRHR() const { return mForceRHR; }
497 
503  QSet<QString> usedAttributes( const QgsRenderContext &context ) const;
504 
509  bool hasDataDefinedProperties() const;
510 
515  Q_DECL_DEPRECATED void setLayer( const QgsVectorLayer *layer ) SIP_DEPRECATED;
516 
520  Q_DECL_DEPRECATED const QgsVectorLayer *layer() const SIP_DEPRECATED;
521 
526  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 );
527 
533  QgsSymbolRenderContext *symbolRenderContext();
534 
535  protected:
536  QgsSymbol( SymbolType type, const QgsSymbolLayerList &layers SIP_TRANSFER ); // can't be instantiated
537 
541  static inline QPointF _getPoint( QgsRenderContext &context, const QgsPoint &point )
542  {
543  QPointF pt;
544  if ( context.coordinateTransform().isValid() )
545  {
546  double x = point.x();
547  double y = point.y();
548  double z = 0.0;
549  context.coordinateTransform().transformInPlace( x, y, z );
550  pt = QPointF( x, y );
551 
552  }
553  else
554  pt = point.toQPointF();
555 
556  context.mapToPixel().transformInPlace( pt.rx(), pt.ry() );
557  return pt;
558  }
559 
563  static QPolygonF _getLineString( QgsRenderContext &context, const QgsCurve &curve, bool clipToExtent = true );
564 
571  static QPolygonF _getPolygonRing( QgsRenderContext &context, const QgsCurve &curve, bool clipToExtent, bool isExteriorRing = false, bool correctRingOrientation = false );
572 
580  static void _getPolygon( QPolygonF &pts, QList<QPolygonF> &holes, QgsRenderContext &context, const QgsPolygon &polygon, bool clipToExtent = true, bool correctRingOrientation = false );
581 
586  QgsSymbolLayerList cloneLayers() const SIP_FACTORY;
587 
597  void renderUsingLayer( QgsSymbolLayer *layer, QgsSymbolRenderContext &context );
598 
603  void renderVertexMarker( QPointF pt, QgsRenderContext &context, int currentVertexMarkerType, double currentVertexMarkerSize );
604 
607 
609  qreal mOpacity = 1.0;
610 
611  RenderHints mRenderHints = nullptr;
612  bool mClipFeaturesToExtent = true;
613  bool mForceRHR = false;
614 
615  Q_DECL_DEPRECATED const QgsVectorLayer *mLayer = nullptr; //current vectorlayer
616 
617  private:
618 #ifdef SIP_RUN
619  QgsSymbol( const QgsSymbol & );
620 #endif
621 
626  bool mStarted = false;
627 
629  std::unique_ptr< QgsSymbolRenderContext > mSymbolRenderContext;
630 
631  Q_DISABLE_COPY( QgsSymbol )
632 
633 };
634 
635 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsSymbol::RenderHints )
636 
637 
643 class CORE_EXPORT QgsSymbolRenderContext
644 {
645  public:
646 
647  //TODO QGIS 4.0 - remove mapUnitScale and renderunit
648 
660  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() );
661 
663  QgsSymbolRenderContext( const QgsSymbolRenderContext &rh ) = delete;
664 
668  QgsRenderContext &renderContext() { return mRenderContext; }
669 
674  const QgsRenderContext &renderContext() const { return mRenderContext; } SIP_SKIP
675 
682  void setOriginalValueVariable( const QVariant &value );
683 
688  Q_DECL_DEPRECATED QgsUnitTypes::RenderUnit outputUnit() const SIP_DEPRECATED { return mOutputUnit; }
689 
694  Q_DECL_DEPRECATED void setOutputUnit( QgsUnitTypes::RenderUnit u ) SIP_DEPRECATED { mOutputUnit = u; }
695 
699  Q_DECL_DEPRECATED QgsMapUnitScale mapUnitScale() const SIP_DEPRECATED { return mMapUnitScale; }
700 
704  Q_DECL_DEPRECATED void setMapUnitScale( const QgsMapUnitScale &scale ) SIP_DEPRECATED { mMapUnitScale = scale; }
705 
711  qreal opacity() const { return mOpacity; }
712 
718  void setOpacity( qreal opacity ) { mOpacity = opacity; }
719 
724  bool selected() const { return mSelected; }
725 
730  void setSelected( bool selected ) { mSelected = selected; }
731 
736  QgsSymbol::RenderHints renderHints() const { return mRenderHints; }
737 
742  void setRenderHints( QgsSymbol::RenderHints hints ) { mRenderHints = hints; }
743 
744  void setFeature( const QgsFeature *f ) { mFeature = f; }
745 
749  const QgsFeature *feature() const { return mFeature; }
750 
756  void setOriginalGeometryType( QgsWkbTypes::GeometryType type ) { mOriginalGeometryType = type; }
757 
766  QgsWkbTypes::GeometryType originalGeometryType() const { return mOriginalGeometryType; }
767 
774  QgsFields fields() const { return mFields; }
775 
780  int geometryPartCount() const { return mGeometryPartCount; }
781 
786  void setGeometryPartCount( int count ) { mGeometryPartCount = count; }
787 
792  int geometryPartNum() const { return mGeometryPartNum; }
793 
798  void setGeometryPartNum( int num ) { mGeometryPartNum = num; }
799 
803  Q_DECL_DEPRECATED double outputLineWidth( double width ) const SIP_DEPRECATED;
804 
808  Q_DECL_DEPRECATED double outputPixelSize( double size ) const SIP_DEPRECATED;
809 
810  // workaround for sip 4.7. Don't use assignment - will fail with assertion error
811  QgsSymbolRenderContext &operator=( const QgsSymbolRenderContext & );
812 
818  QgsExpressionContextScope *expressionContextScope();
819 
827  void setExpressionContextScope( QgsExpressionContextScope *contextScope SIP_TRANSFER );
828 
829  private:
830 
831 #ifdef SIP_RUN
832  QgsSymbolRenderContext( const QgsSymbolRenderContext &rh ) SIP_FORCE;
833 #endif
834 
835  QgsRenderContext &mRenderContext;
836  std::unique_ptr< QgsExpressionContextScope > mExpressionContextScope;
837  QgsUnitTypes::RenderUnit mOutputUnit;
838  QgsMapUnitScale mMapUnitScale;
839  qreal mOpacity = 1.0;
840  bool mSelected;
841  QgsSymbol::RenderHints mRenderHints;
842  const QgsFeature *mFeature; //current feature
843  QgsFields mFields;
844  int mGeometryPartCount;
845  int mGeometryPartNum;
847 };
848 
849 
850 
852 
853 
860 class CORE_EXPORT QgsMarkerSymbol : public QgsSymbol
861 {
862  public:
863 
868  static QgsMarkerSymbol *createSimple( const QgsStringMap &properties ) SIP_FACTORY;
869 
876 
883  void setAngle( double symbolAngle );
884 
892  double angle() const;
893 
899  void setDataDefinedAngle( const QgsProperty &property );
900 
908  QgsProperty dataDefinedAngle() const;
909 
917  void setLineAngle( double lineAngle );
918 
927  void setSize( double size );
928 
941  double size() const;
942 
956  double size( const QgsRenderContext &context ) const;
957 
966  void setSizeUnit( QgsUnitTypes::RenderUnit unit );
967 
976  QgsUnitTypes::RenderUnit sizeUnit() const;
977 
986  void setSizeMapUnitScale( const QgsMapUnitScale &scale );
987 
997  QgsMapUnitScale sizeMapUnitScale() const;
998 
1004  void setDataDefinedSize( const QgsProperty &property );
1005 
1013  QgsProperty dataDefinedSize() const;
1014 
1015  void setScaleMethod( QgsSymbol::ScaleMethod scaleMethod );
1016  ScaleMethod scaleMethod();
1017 
1030  void renderPoint( QPointF point, const QgsFeature *f, QgsRenderContext &context, int layer = -1, bool selected = false );
1031 
1043  QRectF bounds( QPointF point, QgsRenderContext &context, const QgsFeature &feature = QgsFeature() ) const;
1044 
1045  QgsMarkerSymbol *clone() const override SIP_FACTORY;
1046 
1047  private:
1048 
1049  void renderPointUsingLayer( QgsMarkerSymbolLayer *layer, QPointF point, QgsSymbolRenderContext &context );
1050 
1051 };
1052 
1053 
1060 class CORE_EXPORT QgsLineSymbol : public QgsSymbol
1061 {
1062  public:
1063 
1068  static QgsLineSymbol *createSimple( const QgsStringMap &properties ) SIP_FACTORY;
1069 
1076 
1083  void setWidth( double width );
1084 
1095  double width() const;
1096 
1108  double width( const QgsRenderContext &context ) const;
1109 
1115  void setDataDefinedWidth( const QgsProperty &property );
1116 
1124  QgsProperty dataDefinedWidth() const;
1125 
1138  void renderPolyline( const QPolygonF &points, const QgsFeature *f, QgsRenderContext &context, int layer = -1, bool selected = false );
1139 
1140  QgsLineSymbol *clone() const override SIP_FACTORY;
1141 
1142  private:
1143 
1144  void renderPolylineUsingLayer( QgsLineSymbolLayer *layer, const QPolygonF &points, QgsSymbolRenderContext &context );
1145 
1146 };
1147 
1148 
1155 class CORE_EXPORT QgsFillSymbol : public QgsSymbol
1156 {
1157  public:
1158 
1163  static QgsFillSymbol *createSimple( const QgsStringMap &properties ) SIP_FACTORY;
1164 
1171  void setAngle( double angle );
1172 
1188  void renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, const QgsFeature *f, QgsRenderContext &context, int layer = -1, bool selected = false );
1189 
1190  QgsFillSymbol *clone() const override SIP_FACTORY;
1191 
1192  private:
1193 
1194  void renderPolygonUsingLayer( QgsSymbolLayer *layer, const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context );
1196  QRectF polygonBounds( const QPolygonF &points, const QList<QPolygonF> *rings ) const;
1198  QList<QPolygonF> *translateRings( const QList<QPolygonF> *rings, double dx, double dy ) const;
1199 };
1200 
1201 #endif
1202 
Q_DECL_DEPRECATED void setMapUnitScale(const QgsMapUnitScale &scale)
Definition: qgssymbol.h:704
double y
Definition: qgspoint.h:42
QgsFields fields() const
Fields of the layer.
Definition: qgssymbol.h:774
Abstract base class for all rendered symbols.
Definition: qgssymbol.h:61
QPointF toQPointF() const
Returns the point as a QPointF.
Definition: qgspoint.h:313
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:301
const QgsRenderContext & renderContext() const
Returns a reference to the context&#39;s render context.
Definition: qgssymbol.h:674
Q_DECL_DEPRECATED QgsMapUnitScale mapUnitScale() const
Definition: qgssymbol.h:699
static QPointF _getPoint(QgsRenderContext &context, const QgsPoint &point)
Creates a point in screen coordinates from a QgsPoint in map coordinates.
Definition: qgssymbol.h:541
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:474
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:786
int symbolLayerCount() const
Returns the total number of symbol layers contained in the symbol.
Definition: qgssymbol.h:173
Line symbol.
Definition: qgssymbol.h:86
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:612
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:860
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:1060
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:83
virtual QSet< QString > usedAttributes(const QgsRenderContext &context) const =0
Returns a list of attributes required by this renderer.
SymbolType mType
Definition: qgssymbol.h:605
QgsSymbolLayerList mLayers
Definition: qgssymbol.h:606
QString type() const
Definition: qgsrenderer.h:130
void setOriginalGeometryType(QgsWkbTypes::GeometryType type)
Sets the geometry type for the original feature geometry being rendered.
Definition: qgssymbol.h:756
bool forceRHR() const
Returns true if polygon features drawn by the symbol will be reoriented to follow the standard right-...
Definition: qgssymbol.h:496
#define SIP_SKIP
Definition: qgis_sip.h:126
void setOpacity(qreal opacity)
Sets the opacity for the symbol.
Definition: qgssymbol.h:440
void setGeometryPartNum(int num)
Sets the part number of current geometry.
Definition: qgssymbol.h:798
Calculate scale by the area.
Definition: qgssymbol.h:96
qreal opacity() const
Returns the opacity for the symbol.
Definition: qgssymbol.h:711
void setRenderHints(RenderHints hints)
Sets rendering hint flags for the symbol.
Definition: qgssymbol.h:446
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:51
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:730
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:94
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:668
#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:742
bool selected() const
Returns true if symbols should be rendered using the selected symbol coloring and style...
Definition: qgssymbol.h:724
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:766
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:744
int geometryPartNum() const
Part number of current geometry.
Definition: qgssymbol.h:792
GeometryType
The geometry types are used to group QgsWkbTypes::Type in a coarse way.
Definition: qgswkbtypes.h:139
Marker symbol.
Definition: qgssymbol.h:85
RenderHint
Flags controlling behavior of symbols during rendering.
Definition: qgssymbol.h:102
Fill symbol.
Definition: qgssymbol.h:87
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:120
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:688
RenderHints renderHints() const
Returns the rendering hint flags for the symbol.
Definition: qgssymbol.h:452
const QgsFeature * feature() const
Returns the current feature being rendered.
Definition: qgssymbol.h:749
void setOpacity(qreal opacity)
Sets the opacity for the symbol.
Definition: qgssymbol.h:718
#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:131
#define SIP_THROW(name)
Definition: qgis_sip.h:184
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
Definition: qgssymbol.h:1155
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:694
void setClipFeaturesToExtent(bool clipFeaturesToExtent)
Sets whether features drawn by the symbol should be clipped to the render context&#39;s extent...
Definition: qgssymbol.h:463
qreal opacity() const
Returns the opacity for the symbol.
Definition: qgssymbol.h:433
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:485
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:780
RenderUnit
Rendering size units.
Definition: qgsunittypes.h:145
QgsSymbol::RenderHints renderHints() const
Returns the rendering hint flags for the symbol.
Definition: qgssymbol.h:736
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