QGIS API Documentation  3.9.0-Master (224899f119)
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 
335  void drawPreviewIcon( QPainter *painter, QSize size, QgsRenderContext *customContext = nullptr, bool selected = false );
336 
346  void exportImage( const QString &path, const QString &format, QSize size );
347 
357  QImage asImage( QSize size, QgsRenderContext *customContext = nullptr );
358 
367  QImage bigSymbolPreviewImage( QgsExpressionContext *expressionContext = nullptr );
368 
372  QString dump() const;
373 
379  virtual QgsSymbol *clone() const = 0 SIP_FACTORY;
380 
384  void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const;
385 
394  QgsUnitTypes::RenderUnit outputUnit() const;
395 
404  void setOutputUnit( QgsUnitTypes::RenderUnit unit );
405 
415  QgsMapUnitScale mapUnitScale() const;
416 
425  void setMapUnitScale( const QgsMapUnitScale &scale );
426 
432  qreal opacity() const { return mOpacity; }
433 
439  void setOpacity( qreal opacity ) { mOpacity = opacity; }
440 
445  void setRenderHints( RenderHints hints ) { mRenderHints = hints; }
446 
451  RenderHints renderHints() const { return mRenderHints; }
452 
462  void setClipFeaturesToExtent( bool clipFeaturesToExtent ) { mClipFeaturesToExtent = clipFeaturesToExtent; }
463 
473  bool clipFeaturesToExtent() const { return mClipFeaturesToExtent; }
474 
484  void setForceRHR( bool force ) { mForceRHR = force; }
485 
495  bool forceRHR() const { return mForceRHR; }
496 
502  QSet<QString> usedAttributes( const QgsRenderContext &context ) const;
503 
508  bool hasDataDefinedProperties() const;
509 
514  Q_DECL_DEPRECATED void setLayer( const QgsVectorLayer *layer ) SIP_DEPRECATED;
515 
519  Q_DECL_DEPRECATED const QgsVectorLayer *layer() const SIP_DEPRECATED;
520 
525  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 );
526 
532  QgsSymbolRenderContext *symbolRenderContext();
533 
534  protected:
535  QgsSymbol( SymbolType type, const QgsSymbolLayerList &layers SIP_TRANSFER ); // can't be instantiated
536 
540  static inline QPointF _getPoint( QgsRenderContext &context, const QgsPoint &point )
541  {
542  QPointF pt;
543  if ( context.coordinateTransform().isValid() )
544  {
545  double x = point.x();
546  double y = point.y();
547  double z = 0.0;
548  context.coordinateTransform().transformInPlace( x, y, z );
549  pt = QPointF( x, y );
550 
551  }
552  else
553  pt = point.toQPointF();
554 
555  context.mapToPixel().transformInPlace( pt.rx(), pt.ry() );
556  return pt;
557  }
558 
562  static QPolygonF _getLineString( QgsRenderContext &context, const QgsCurve &curve, bool clipToExtent = true );
563 
570  static QPolygonF _getPolygonRing( QgsRenderContext &context, const QgsCurve &curve, bool clipToExtent, bool isExteriorRing = false, bool correctRingOrientation = false );
571 
579  static void _getPolygon( QPolygonF &pts, QList<QPolygonF> &holes, QgsRenderContext &context, const QgsPolygon &polygon, bool clipToExtent = true, bool correctRingOrientation = false );
580 
585  QgsSymbolLayerList cloneLayers() const SIP_FACTORY;
586 
596  void renderUsingLayer( QgsSymbolLayer *layer, QgsSymbolRenderContext &context );
597 
602  void renderVertexMarker( QPointF pt, QgsRenderContext &context, int currentVertexMarkerType, double currentVertexMarkerSize );
603 
606 
608  qreal mOpacity = 1.0;
609 
610  RenderHints mRenderHints = nullptr;
611  bool mClipFeaturesToExtent = true;
612  bool mForceRHR = false;
613 
614  Q_DECL_DEPRECATED const QgsVectorLayer *mLayer = nullptr; //current vectorlayer
615 
616  private:
617 #ifdef SIP_RUN
618  QgsSymbol( const QgsSymbol & );
619 #endif
620 
625  bool mStarted = false;
626 
628  std::unique_ptr< QgsSymbolRenderContext > mSymbolRenderContext;
629 
630  Q_DISABLE_COPY( QgsSymbol )
631 
632 };
633 
634 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsSymbol::RenderHints )
635 
636 
642 class CORE_EXPORT QgsSymbolRenderContext
643 {
644  public:
645 
646  //TODO QGIS 4.0 - remove mapUnitScale and renderunit
647 
659  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() );
660 
662  QgsSymbolRenderContext( const QgsSymbolRenderContext &rh ) = delete;
663 
667  QgsRenderContext &renderContext() { return mRenderContext; }
668 
673  const QgsRenderContext &renderContext() const { return mRenderContext; } SIP_SKIP
674 
681  void setOriginalValueVariable( const QVariant &value );
682 
687  Q_DECL_DEPRECATED QgsUnitTypes::RenderUnit outputUnit() const SIP_DEPRECATED { return mOutputUnit; }
688 
693  Q_DECL_DEPRECATED void setOutputUnit( QgsUnitTypes::RenderUnit u ) SIP_DEPRECATED { mOutputUnit = u; }
694 
698  Q_DECL_DEPRECATED QgsMapUnitScale mapUnitScale() const SIP_DEPRECATED { return mMapUnitScale; }
699 
703  Q_DECL_DEPRECATED void setMapUnitScale( const QgsMapUnitScale &scale ) SIP_DEPRECATED { mMapUnitScale = scale; }
704 
710  qreal opacity() const { return mOpacity; }
711 
717  void setOpacity( qreal opacity ) { mOpacity = opacity; }
718 
723  bool selected() const { return mSelected; }
724 
729  void setSelected( bool selected ) { mSelected = selected; }
730 
735  QgsSymbol::RenderHints renderHints() const { return mRenderHints; }
736 
741  void setRenderHints( QgsSymbol::RenderHints hints ) { mRenderHints = hints; }
742 
743  void setFeature( const QgsFeature *f ) { mFeature = f; }
744 
748  const QgsFeature *feature() const { return mFeature; }
749 
755  void setOriginalGeometryType( QgsWkbTypes::GeometryType type ) { mOriginalGeometryType = type; }
756 
765  QgsWkbTypes::GeometryType originalGeometryType() const { return mOriginalGeometryType; }
766 
773  QgsFields fields() const { return mFields; }
774 
779  int geometryPartCount() const { return mGeometryPartCount; }
780 
785  void setGeometryPartCount( int count ) { mGeometryPartCount = count; }
786 
791  int geometryPartNum() const { return mGeometryPartNum; }
792 
797  void setGeometryPartNum( int num ) { mGeometryPartNum = num; }
798 
802  Q_DECL_DEPRECATED double outputLineWidth( double width ) const SIP_DEPRECATED;
803 
807  Q_DECL_DEPRECATED double outputPixelSize( double size ) const SIP_DEPRECATED;
808 
809  // workaround for sip 4.7. Don't use assignment - will fail with assertion error
810  QgsSymbolRenderContext &operator=( const QgsSymbolRenderContext & );
811 
817  QgsExpressionContextScope *expressionContextScope();
818 
826  void setExpressionContextScope( QgsExpressionContextScope *contextScope SIP_TRANSFER );
827 
828  private:
829 
830 #ifdef SIP_RUN
831  QgsSymbolRenderContext( const QgsSymbolRenderContext &rh ) SIP_FORCE;
832 #endif
833 
834  QgsRenderContext &mRenderContext;
835  std::unique_ptr< QgsExpressionContextScope > mExpressionContextScope;
836  QgsUnitTypes::RenderUnit mOutputUnit;
837  QgsMapUnitScale mMapUnitScale;
838  qreal mOpacity = 1.0;
839  bool mSelected;
840  QgsSymbol::RenderHints mRenderHints;
841  const QgsFeature *mFeature; //current feature
842  QgsFields mFields;
843  int mGeometryPartCount;
844  int mGeometryPartNum;
846 };
847 
848 
849 
851 
852 
859 class CORE_EXPORT QgsMarkerSymbol : public QgsSymbol
860 {
861  public:
862 
867  static QgsMarkerSymbol *createSimple( const QgsStringMap &properties ) SIP_FACTORY;
868 
875 
882  void setAngle( double symbolAngle );
883 
891  double angle() const;
892 
898  void setDataDefinedAngle( const QgsProperty &property );
899 
907  QgsProperty dataDefinedAngle() const;
908 
916  void setLineAngle( double lineAngle );
917 
926  void setSize( double size );
927 
940  double size() const;
941 
955  double size( const QgsRenderContext &context ) const;
956 
965  void setSizeUnit( QgsUnitTypes::RenderUnit unit );
966 
975  QgsUnitTypes::RenderUnit sizeUnit() const;
976 
985  void setSizeMapUnitScale( const QgsMapUnitScale &scale );
986 
996  QgsMapUnitScale sizeMapUnitScale() const;
997 
1003  void setDataDefinedSize( const QgsProperty &property );
1004 
1012  QgsProperty dataDefinedSize() const;
1013 
1014  void setScaleMethod( QgsSymbol::ScaleMethod scaleMethod );
1015  ScaleMethod scaleMethod();
1016 
1029  void renderPoint( QPointF point, const QgsFeature *f, QgsRenderContext &context, int layer = -1, bool selected = false );
1030 
1042  QRectF bounds( QPointF point, QgsRenderContext &context, const QgsFeature &feature = QgsFeature() ) const;
1043 
1044  QgsMarkerSymbol *clone() const override SIP_FACTORY;
1045 
1046  private:
1047 
1048  void renderPointUsingLayer( QgsMarkerSymbolLayer *layer, QPointF point, QgsSymbolRenderContext &context );
1049 
1050 };
1051 
1052 
1059 class CORE_EXPORT QgsLineSymbol : public QgsSymbol
1060 {
1061  public:
1062 
1067  static QgsLineSymbol *createSimple( const QgsStringMap &properties ) SIP_FACTORY;
1068 
1075 
1082  void setWidth( double width );
1083 
1094  double width() const;
1095 
1107  double width( const QgsRenderContext &context ) const;
1108 
1114  void setDataDefinedWidth( const QgsProperty &property );
1115 
1123  QgsProperty dataDefinedWidth() const;
1124 
1137  void renderPolyline( const QPolygonF &points, const QgsFeature *f, QgsRenderContext &context, int layer = -1, bool selected = false );
1138 
1139  QgsLineSymbol *clone() const override SIP_FACTORY;
1140 
1141  private:
1142 
1143  void renderPolylineUsingLayer( QgsLineSymbolLayer *layer, const QPolygonF &points, QgsSymbolRenderContext &context );
1144 
1145 };
1146 
1147 
1154 class CORE_EXPORT QgsFillSymbol : public QgsSymbol
1155 {
1156  public:
1157 
1162  static QgsFillSymbol *createSimple( const QgsStringMap &properties ) SIP_FACTORY;
1163 
1170  void setAngle( double angle );
1171 
1187  void renderPolygon( const QPolygonF &points, QList<QPolygonF> *rings, const QgsFeature *f, QgsRenderContext &context, int layer = -1, bool selected = false );
1188 
1189  QgsFillSymbol *clone() const override SIP_FACTORY;
1190 
1191  private:
1192 
1193  void renderPolygonUsingLayer( QgsSymbolLayer *layer, const QPolygonF &points, QList<QPolygonF> *rings, QgsSymbolRenderContext &context );
1195  QRectF polygonBounds( const QPolygonF &points, const QList<QPolygonF> *rings ) const;
1197  QList<QPolygonF> *translateRings( const QList<QPolygonF> *rings, double dx, double dy ) const;
1198 };
1199 
1200 #endif
1201 
Q_DECL_DEPRECATED void setMapUnitScale(const QgsMapUnitScale &scale)
Definition: qgssymbol.h:703
double y
Definition: qgspoint.h:42
QgsFields fields() const
Fields of the layer.
Definition: qgssymbol.h:773
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:673
Q_DECL_DEPRECATED QgsMapUnitScale mapUnitScale() const
Definition: qgssymbol.h:698
static QPointF _getPoint(QgsRenderContext &context, const QgsPoint &point)
Creates a point in screen coordinates from a QgsPoint in map coordinates.
Definition: qgssymbol.h:540
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:473
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:785
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:597
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:859
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:1059
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:604
QgsSymbolLayerList mLayers
Definition: qgssymbol.h:605
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:755
bool forceRHR() const
Returns true if polygon features drawn by the symbol will be reoriented to follow the standard right-...
Definition: qgssymbol.h:495
#define SIP_SKIP
Definition: qgis_sip.h:126
void setOpacity(qreal opacity)
Sets the opacity for the symbol.
Definition: qgssymbol.h:439
void setGeometryPartNum(int num)
Sets the part number of current geometry.
Definition: qgssymbol.h:797
Calculate scale by the area.
Definition: qgssymbol.h:96
qreal opacity() const
Returns the opacity for the symbol.
Definition: qgssymbol.h:710
void setRenderHints(RenderHints hints)
Sets rendering hint flags for the symbol.
Definition: qgssymbol.h:445
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:729
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:667
#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:741
bool selected() const
Returns true if symbols should be rendered using the selected symbol coloring and style...
Definition: qgssymbol.h:723
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:765
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:743
int geometryPartNum() const
Part number of current geometry.
Definition: qgssymbol.h:791
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:687
RenderHints renderHints() const
Returns the rendering hint flags for the symbol.
Definition: qgssymbol.h:451
const QgsFeature * feature() const
Returns the current feature being rendered.
Definition: qgssymbol.h:748
void setOpacity(qreal opacity)
Sets the opacity for the symbol.
Definition: qgssymbol.h:717
#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:1154
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:693
void setClipFeaturesToExtent(bool clipFeaturesToExtent)
Sets whether features drawn by the symbol should be clipped to the render context&#39;s extent...
Definition: qgssymbol.h:462
qreal opacity() const
Returns the opacity for the symbol.
Definition: qgssymbol.h:432
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:484
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:779
RenderUnit
Rendering size units.
Definition: qgsunittypes.h:113
QgsSymbol::RenderHints renderHints() const
Returns the rendering hint flags for the symbol.
Definition: qgssymbol.h:735
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