QGIS API Documentation  3.17.0-Master (8af46bc54f)
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, QgsStringMap props ) const;
427 
436  QgsUnitTypes::RenderUnit outputUnit() const;
437 
446  void setOutputUnit( QgsUnitTypes::RenderUnit unit );
447 
457  QgsMapUnitScale mapUnitScale() const;
458 
467  void setMapUnitScale( const QgsMapUnitScale &scale );
468 
474  qreal opacity() const { return mOpacity; }
475 
481  void setOpacity( qreal opacity ) { mOpacity = opacity; }
482 
487  void setRenderHints( RenderHints hints ) { mRenderHints = hints; }
488 
493  RenderHints renderHints() const { return mRenderHints; }
494 
504  void setClipFeaturesToExtent( bool clipFeaturesToExtent ) { mClipFeaturesToExtent = clipFeaturesToExtent; }
505 
515  bool clipFeaturesToExtent() const { return mClipFeaturesToExtent; }
516 
526  void setForceRHR( bool force ) { mForceRHR = force; }
527 
537  bool forceRHR() const { return mForceRHR; }
538 
544  QSet<QString> usedAttributes( const QgsRenderContext &context ) const;
545 
553  void setDataDefinedProperty( Property key, const QgsProperty &property );
554 
561  QgsPropertyCollection &dataDefinedProperties() { return mDataDefinedProperties; }
562 
568  const QgsPropertyCollection &dataDefinedProperties() const { return mDataDefinedProperties; } SIP_SKIP
569 
576  void setDataDefinedProperties( const QgsPropertyCollection &collection ) { mDataDefinedProperties = collection; }
577 
582  bool hasDataDefinedProperties() const;
583 
588  Q_DECL_DEPRECATED void setLayer( const QgsVectorLayer *layer ) SIP_DEPRECATED;
589 
593  Q_DECL_DEPRECATED const QgsVectorLayer *layer() const SIP_DEPRECATED;
594 
599  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 );
600 
606  QgsSymbolRenderContext *symbolRenderContext();
607 
608  protected:
609  QgsSymbol( SymbolType type, const QgsSymbolLayerList &layers SIP_TRANSFER ); // can't be instantiated
610 
614  static inline QPointF _getPoint( QgsRenderContext &context, const QgsPoint &point )
615  {
616  QPointF pt;
617  if ( context.coordinateTransform().isValid() )
618  {
619  double x = point.x();
620  double y = point.y();
621  double z = 0.0;
622  context.coordinateTransform().transformInPlace( x, y, z );
623  pt = QPointF( x, y );
624 
625  }
626  else
627  pt = point.toQPointF();
628 
629  context.mapToPixel().transformInPlace( pt.rx(), pt.ry() );
630  return pt;
631  }
632 
636  static QPolygonF _getLineString( QgsRenderContext &context, const QgsCurve &curve, bool clipToExtent = true );
637 
644  static QPolygonF _getPolygonRing( QgsRenderContext &context, const QgsCurve &curve, bool clipToExtent, bool isExteriorRing = false, bool correctRingOrientation = false );
645 
653  static void _getPolygon( QPolygonF &pts, QVector<QPolygonF> &holes, QgsRenderContext &context, const QgsPolygon &polygon, bool clipToExtent = true, bool correctRingOrientation = false );
654 
659  QgsSymbolLayerList cloneLayers() const SIP_FACTORY;
660 
670  void renderUsingLayer( QgsSymbolLayer *layer, QgsSymbolRenderContext &context );
671 
676  void renderVertexMarker( QPointF pt, QgsRenderContext &context, int currentVertexMarkerType, double currentVertexMarkerSize );
677 
680 
682  qreal mOpacity = 1.0;
683 
684  RenderHints mRenderHints;
685  bool mClipFeaturesToExtent = true;
686  bool mForceRHR = false;
687 
688  Q_DECL_DEPRECATED const QgsVectorLayer *mLayer = nullptr; //current vectorlayer
689 
690  private:
691 #ifdef SIP_RUN
692  QgsSymbol( const QgsSymbol & );
693 #endif
694 
695  static void initPropertyDefinitions();
696 
698  static QgsPropertiesDefinition sPropertyDefinitions;
699 
704  bool mStarted = false;
705 
707  std::unique_ptr< QgsSymbolRenderContext > mSymbolRenderContext;
708 
709  QgsPropertyCollection mDataDefinedProperties;
710 
722  void startFeatureRender( const QgsFeature &feature, QgsRenderContext &context, int layer = -1 );
723 
735  void stopFeatureRender( const QgsFeature &feature, QgsRenderContext &context, int layer = -1 );
736 
737  Q_DISABLE_COPY( QgsSymbol )
738 
739 };
740 
741 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsSymbol::RenderHints )
742 
743 
749 class CORE_EXPORT QgsSymbolRenderContext
750 {
751  public:
752 
753  //TODO QGIS 4.0 - remove mapUnitScale and renderunit
754 
766  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() );
767 
768  ~QgsSymbolRenderContext();
769 
771  QgsSymbolRenderContext( const QgsSymbolRenderContext &rh ) = delete;
772 
776  QgsRenderContext &renderContext() { return mRenderContext; }
777 
782  const QgsRenderContext &renderContext() const { return mRenderContext; } SIP_SKIP
783 
790  void setOriginalValueVariable( const QVariant &value );
791 
796  Q_DECL_DEPRECATED QgsUnitTypes::RenderUnit outputUnit() const SIP_DEPRECATED { return mOutputUnit; }
797 
802  Q_DECL_DEPRECATED void setOutputUnit( QgsUnitTypes::RenderUnit u ) SIP_DEPRECATED { mOutputUnit = u; }
803 
807  Q_DECL_DEPRECATED QgsMapUnitScale mapUnitScale() const SIP_DEPRECATED { return mMapUnitScale; }
808 
812  Q_DECL_DEPRECATED void setMapUnitScale( const QgsMapUnitScale &scale ) SIP_DEPRECATED { mMapUnitScale = scale; }
813 
819  qreal opacity() const { return mOpacity; }
820 
826  void setOpacity( qreal opacity ) { mOpacity = opacity; }
827 
832  bool selected() const { return mSelected; }
833 
838  void setSelected( bool selected ) { mSelected = selected; }
839 
844  QgsSymbol::RenderHints renderHints() const { return mRenderHints; }
845 
850  void setRenderHints( QgsSymbol::RenderHints hints ) { mRenderHints = hints; }
851 
852  void setFeature( const QgsFeature *f ) { mFeature = f; }
853 
857  const QgsFeature *feature() const { return mFeature; }
858 
864  void setOriginalGeometryType( QgsWkbTypes::GeometryType type ) { mOriginalGeometryType = type; }
865 
874  QgsWkbTypes::GeometryType originalGeometryType() const { return mOriginalGeometryType; }
875 
882  QgsFields fields() const { return mFields; }
883 
888  int geometryPartCount() const { return mGeometryPartCount; }
889 
894  void setGeometryPartCount( int count ) { mGeometryPartCount = count; }
895 
900  int geometryPartNum() const { return mGeometryPartNum; }
901 
906  void setGeometryPartNum( int num ) { mGeometryPartNum = num; }
907 
911  Q_DECL_DEPRECATED double outputLineWidth( double width ) const SIP_DEPRECATED;
912 
916  Q_DECL_DEPRECATED double outputPixelSize( double size ) const SIP_DEPRECATED;
917 
918  // workaround for sip 4.7. Don't use assignment - will fail with assertion error
919  QgsSymbolRenderContext &operator=( const QgsSymbolRenderContext & );
920 
926  QgsExpressionContextScope *expressionContextScope();
927 
935  void setExpressionContextScope( QgsExpressionContextScope *contextScope SIP_TRANSFER );
936 
943  const QgsLegendPatchShape *patchShape() const;
944 
951  void setPatchShape( const QgsLegendPatchShape &shape );
952 
953  private:
954 
955 #ifdef SIP_RUN
956  QgsSymbolRenderContext( const QgsSymbolRenderContext &rh ) SIP_FORCE;
957 #endif
958 
959  QgsRenderContext &mRenderContext;
960  std::unique_ptr< QgsExpressionContextScope > mExpressionContextScope;
961  QgsUnitTypes::RenderUnit mOutputUnit;
962  QgsMapUnitScale mMapUnitScale;
963  qreal mOpacity = 1.0;
964  bool mSelected;
965  QgsSymbol::RenderHints mRenderHints;
966  const QgsFeature *mFeature; //current feature
967  QgsFields mFields;
968  int mGeometryPartCount;
969  int mGeometryPartNum;
971  std::unique_ptr< QgsLegendPatchShape > mPatchShape;
972 };
973 
974 
975 
977 
978 
985 class CORE_EXPORT QgsMarkerSymbol : public QgsSymbol
986 {
987  public:
988 
993  static QgsMarkerSymbol *createSimple( const QgsStringMap &properties ) SIP_FACTORY;
994 
1001 
1008  void setAngle( double symbolAngle );
1009 
1017  double angle() const;
1018 
1024  void setDataDefinedAngle( const QgsProperty &property );
1025 
1033  QgsProperty dataDefinedAngle() const;
1034 
1042  void setLineAngle( double lineAngle );
1043 
1052  void setSize( double size );
1053 
1066  double size() const;
1067 
1081  double size( const QgsRenderContext &context ) const;
1082 
1091  void setSizeUnit( QgsUnitTypes::RenderUnit unit );
1092 
1101  QgsUnitTypes::RenderUnit sizeUnit() const;
1102 
1111  void setSizeMapUnitScale( const QgsMapUnitScale &scale );
1112 
1122  QgsMapUnitScale sizeMapUnitScale() const;
1123 
1129  void setDataDefinedSize( const QgsProperty &property );
1130 
1138  QgsProperty dataDefinedSize() const;
1139 
1140  void setScaleMethod( QgsSymbol::ScaleMethod scaleMethod );
1141  ScaleMethod scaleMethod();
1142 
1155  void renderPoint( QPointF point, const QgsFeature *f, QgsRenderContext &context, int layer = -1, bool selected = false );
1156 
1168  QRectF bounds( QPointF point, QgsRenderContext &context, const QgsFeature &feature = QgsFeature() ) const;
1169 
1170  QgsMarkerSymbol *clone() const override SIP_FACTORY;
1171 
1172  private:
1173 
1174  void renderPointUsingLayer( QgsMarkerSymbolLayer *layer, QPointF point, QgsSymbolRenderContext &context );
1175 
1176 };
1177 
1178 
1185 class CORE_EXPORT QgsLineSymbol : public QgsSymbol
1186 {
1187  public:
1188 
1193  static QgsLineSymbol *createSimple( const QgsStringMap &properties ) SIP_FACTORY;
1194 
1201 
1208  void setWidth( double width );
1209 
1215  void setWidthUnit( QgsUnitTypes::RenderUnit unit );
1216 
1217 
1228  double width() const;
1229 
1241  double width( const QgsRenderContext &context ) const;
1242 
1248  void setDataDefinedWidth( const QgsProperty &property );
1249 
1257  QgsProperty dataDefinedWidth() const;
1258 
1271  void renderPolyline( const QPolygonF &points, const QgsFeature *f, QgsRenderContext &context, int layer = -1, bool selected = false );
1272 
1273  QgsLineSymbol *clone() const override SIP_FACTORY;
1274 
1275  private:
1276 
1277  void renderPolylineUsingLayer( QgsLineSymbolLayer *layer, const QPolygonF &points, QgsSymbolRenderContext &context );
1278 
1279 };
1280 
1281 
1288 class CORE_EXPORT QgsFillSymbol : public QgsSymbol
1289 {
1290  public:
1291 
1296  static QgsFillSymbol *createSimple( const QgsStringMap &properties ) SIP_FACTORY;
1297 
1304  void setAngle( double angle );
1305 
1321  void renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings, const QgsFeature *f, QgsRenderContext &context, int layer = -1, bool selected = false );
1322 
1323  QgsFillSymbol *clone() const override SIP_FACTORY;
1324 
1325  private:
1326 
1327  void renderPolygonUsingLayer( QgsSymbolLayer *layer, const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context );
1329  QRectF polygonBounds( const QPolygonF &points, const QVector<QPolygonF> *rings ) const;
1331  QVector<QPolygonF> *translateRings( const QVector<QPolygonF> *rings, double dx, double dy ) const;
1332 };
1333 
1334 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsSymbol::PreviewFlags )
1335 
1336 #endif
1337 
Q_DECL_DEPRECATED void setMapUnitScale(const QgsMapUnitScale &scale)
Definition: qgssymbol.h:812
double y
Definition: qgspoint.h:42
QPointF toQPointF() const SIP_HOLDGIL
Returns the point as a QPointF.
Definition: qgspoint.h:320
QgsFields fields() const
Fields of the layer.
Definition: qgssymbol.h:882
Abstract base class for all rendered symbols.
Definition: qgssymbol.h:64
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:782
Q_DECL_DEPRECATED QgsMapUnitScale mapUnitScale() const
Definition: qgssymbol.h:807
static QPointF _getPoint(QgsRenderContext &context, const QgsPoint &point)
Creates a point in screen coordinates from a QgsPoint in map coordinates.
Definition: qgssymbol.h:614
Base class for visual effects which can be applied to QPicture drawings.
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.
bool clipFeaturesToExtent() const
Returns whether features drawn by the symbol will be clipped to the render context&#39;s extent...
Definition: qgssymbol.h:515
Container of fields for a vector layer.
Definition: qgsfields.h:44
void setGeometryPartCount(int count)
Sets the part count of current geometry.
Definition: qgssymbol.h:894
int symbolLayerCount() const
Returns the total number of symbol layers contained in the symbol.
Definition: qgssymbol.h:199
Line symbol.
Definition: qgssymbol.h:89
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:218
QMap< QString, QString > QgsStringMap
Definition: qgis.h:759
Represents a patch shape for use in map legends.
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:985
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:1185
Include a crosshairs reference image in the background of marker symbol previews. ...
Definition: qgssymbol.h:395
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:86
virtual QSet< QString > usedAttributes(const QgsRenderContext &context) const =0
Returns a list of attributes required by this renderer.
SymbolType mType
Definition: qgssymbol.h:678
QgsSymbolLayerList mLayers
Definition: qgssymbol.h:679
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:864
Property
Data definable properties.
Definition: qgssymbol.h:115
bool forceRHR() const
Returns true if polygon features drawn by the symbol will be reoriented to follow the standard right-...
Definition: qgssymbol.h:537
#define SIP_SKIP
Definition: qgis_sip.h:126
void setOpacity(qreal opacity)
Sets the opacity for the symbol.
Definition: qgssymbol.h:481
void setGeometryPartNum(int num)
Sets the part number of current geometry.
Definition: qgssymbol.h:906
Calculate scale by the area.
Definition: qgssymbol.h:99
qreal opacity() const
Returns the opacity for the symbol.
Definition: qgssymbol.h:819
void setRenderHints(RenderHints hints)
Sets rendering hint flags for the symbol.
Definition: qgssymbol.h:487
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:194
QList< QgsSymbolLayer * > QgsSymbolLayerList
Definition: qgssymbol.h:54
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:838
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:97
const QgsPropertyCollection & dataDefinedProperties() const
Returns a reference to the symbol&#39;s property collection, used for data defined overrides.
Definition: qgssymbol.h:568
Single scope for storing variables and functions for use within a QgsExpressionContext.
A store for object properties.
Definition: qgsproperty.h:231
QgsRenderContext & renderContext()
Returns a reference to the context&#39;s render context.
Definition: qgssymbol.h:776
#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:850
bool selected() const
Returns true if symbols should be rendered using the selected symbol coloring and style...
Definition: qgssymbol.h:832
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.
QMap< int, QgsPropertyDefinition > QgsPropertiesDefinition
Definition of available properties.
QgsWkbTypes::GeometryType originalGeometryType() const
Returns the geometry type for the original feature geometry being rendered.
Definition: qgssymbol.h:874
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:852
int geometryPartNum() const
Part number of current geometry.
Definition: qgssymbol.h:900
GeometryType
The geometry types are used to group QgsWkbTypes::Type in a coarse way.
Definition: qgswkbtypes.h:140
Marker symbol.
Definition: qgssymbol.h:88
RenderHint
Flags controlling behavior of symbols during rendering.
Definition: qgssymbol.h:105
Fill symbol.
Definition: qgssymbol.h:90
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:138
Struct for storing maximum and minimum scales for measurements in map units.
RenderHints mRenderHints
Definition: qgssymbol.h:684
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:796
PreviewFlag
Flags for controlling how symbol preview images are generated.
Definition: qgssymbol.h:393
RenderHints renderHints() const
Returns the rendering hint flags for the symbol.
Definition: qgssymbol.h:493
QgsPropertyCollection & dataDefinedProperties()
Returns a reference to the symbol&#39;s property collection, used for data defined overrides.
Definition: qgssymbol.h:561
const QgsFeature * feature() const
Returns the current feature being rendered.
Definition: qgssymbol.h:857
void setOpacity(qreal opacity)
Sets the opacity for the symbol.
Definition: qgssymbol.h:826
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition: qgis_sip.h:177
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:149
A grouped map of multiple QgsProperty objects, each referenced by a integer key value.
#define SIP_THROW(name)
Definition: qgis_sip.h:189
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
Definition: qgssymbol.h:1288
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:802
void setClipFeaturesToExtent(bool clipFeaturesToExtent)
Sets whether features drawn by the symbol should be clipped to the render context&#39;s extent...
Definition: qgssymbol.h:504
qreal opacity() const
Returns the opacity for the symbol.
Definition: qgssymbol.h:474
Polygon geometry type.
Definition: qgspolygon.h:33
void setForceRHR(bool force)
Sets whether polygon features drawn by the symbol should be reoriented to follow the standard right-h...
Definition: qgssymbol.h:526
Represents a vector layer which manages a vector based data sets.
void setDataDefinedProperties(const QgsPropertyCollection &collection)
Sets the symbol&#39;s property collection, used for data defined overrides.
Definition: qgssymbol.h:576
virtual QgsFeatureRenderer * clone() const =0
Create a deep copy of this renderer.
int geometryPartCount() const
Part count of current geometry.
Definition: qgssymbol.h:888
RenderUnit
Rendering size units.
Definition: qgsunittypes.h:166
QgsSymbol::RenderHints renderHints() const
Returns the rendering hint flags for the symbol.
Definition: qgssymbol.h:844
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