QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
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;
54 
55 typedef QList<QgsSymbolLayer *> QgsSymbolLayerList;
56 
63 class CORE_EXPORT QgsSymbol
64 {
65 
66 #ifdef SIP_RUN
68  switch ( sipCpp->type() )
69  {
70  case QgsSymbol::Marker: sipType = sipType_QgsMarkerSymbol; break;
71  case QgsSymbol::Line: sipType = sipType_QgsLineSymbol; break;
72  case QgsSymbol::Fill: sipType = sipType_QgsFillSymbol; break;
73  default: sipType = 0; break;
74  }
75  SIP_END
76 #endif
77 
78  friend class QgsFeatureRenderer;
79 
80  public:
81 
86  {
88  Line,
89  Fill,
90  Hybrid
91  };
92 
97  {
99  ScaleDiameter
100  };
101 
102 
105  {
106  DynamicRotation = 2,
107  };
108  Q_DECLARE_FLAGS( RenderHints, RenderHint )
109 
110  virtual ~QgsSymbol();
111 
117  static QgsSymbol *defaultSymbol( QgsWkbTypes::GeometryType geomType ) SIP_FACTORY;
118 
122  SymbolType type() const { return mType; }
123 
124  // symbol layers handling
125 
133  QgsSymbolLayerList symbolLayers() { return mLayers; }
134 
135 #ifndef SIP_RUN
136 
143  QgsSymbolLayer *symbolLayer( int layer );
144 
151  const QgsSymbolLayer *symbolLayer( int layer ) const;
152 #else
153 
161  SIP_PYOBJECT symbolLayer( int layer ) SIP_TYPEHINT( QgsSymbolLayer );
162  % MethodCode
163  const int count = sipCpp->symbolLayerCount();
164  if ( a0 < 0 || a0 >= count )
165  {
166  PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
167  sipIsErr = 1;
168  }
169  else
170  {
171  sipRes = sipConvertFromType( sipCpp->symbolLayer( a0 ), sipType_QgsSymbolLayer, NULL );
172  }
173  % End
174 #endif
175 
183  int symbolLayerCount() const { return mLayers.count(); }
184 
185 #ifdef SIP_RUN
186 
190  int __len__() const;
191  % MethodCode
192  sipRes = sipCpp->symbolLayerCount();
193  % End
194 
196  int __bool__() const;
197  % MethodCode
198  sipRes = true;
199  % End
200 
209  SIP_PYOBJECT __getitem__( int index ) SIP_TYPEHINT( QgsSymbolLayer );
210  % MethodCode
211  const int count = sipCpp->symbolLayerCount();
212  if ( a0 < -count || a0 >= count )
213  {
214  PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
215  sipIsErr = 1;
216  }
217  else if ( a0 >= 0 )
218  {
219  return sipConvertFromType( sipCpp->symbolLayer( a0 ), sipType_QgsSymbolLayer, NULL );
220  }
221  else
222  {
223  return sipConvertFromType( sipCpp->symbolLayer( count + a0 ), sipType_QgsSymbolLayer, NULL );
224  }
225  % End
226 
235  void __delitem__( int index );
236  % MethodCode
237  const int count = sipCpp->symbolLayerCount();
238  if ( a0 >= 0 && a0 < count )
239  sipCpp->deleteSymbolLayer( a0 );
240  else if ( a0 < 0 && a0 >= -count )
241  sipCpp->deleteSymbolLayer( count + a0 );
242  else
243  {
244  PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
245  sipIsErr = 1;
246  }
247  % End
248 #endif
249 
257  bool insertSymbolLayer( int index, QgsSymbolLayer *layer SIP_TRANSFER );
258 
265  bool appendSymbolLayer( QgsSymbolLayer *layer SIP_TRANSFER );
266 
270  bool deleteSymbolLayer( int index );
271 
278  QgsSymbolLayer *takeSymbolLayer( int index ) SIP_TRANSFERBACK;
279 
287  bool changeSymbolLayer( int index, QgsSymbolLayer *layer SIP_TRANSFER );
288 
298  void startRender( QgsRenderContext &context, const QgsFields &fields = QgsFields() );
299 
306  void stopRender( QgsRenderContext &context );
307 
318  void setColor( const QColor &color );
319 
328  QColor color() const;
329 
347  void drawPreviewIcon( QPainter *painter, QSize size, QgsRenderContext *customContext = nullptr, bool selected = false, const QgsExpressionContext *expressionContext = nullptr,
348  const QgsLegendPatchShape *patchShape = nullptr );
349 
359  void exportImage( const QString &path, const QString &format, QSize size );
360 
370  QImage asImage( QSize size, QgsRenderContext *customContext = nullptr );
371 
378  {
379  FlagIncludeCrosshairsForMarkerSymbols = 1 << 0,
380  };
381  Q_DECLARE_FLAGS( PreviewFlags, PreviewFlag )
382 
383 
393  QImage bigSymbolPreviewImage( QgsExpressionContext *expressionContext = nullptr, QgsSymbol::PreviewFlags flags = QgsSymbol::FlagIncludeCrosshairsForMarkerSymbols );
394 
398  QString dump() const;
399 
405  virtual QgsSymbol *clone() const = 0 SIP_FACTORY;
406 
410  void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const;
411 
420  QgsUnitTypes::RenderUnit outputUnit() const;
421 
430  void setOutputUnit( QgsUnitTypes::RenderUnit unit );
431 
441  QgsMapUnitScale mapUnitScale() const;
442 
451  void setMapUnitScale( const QgsMapUnitScale &scale );
452 
458  qreal opacity() const { return mOpacity; }
459 
465  void setOpacity( qreal opacity ) { mOpacity = opacity; }
466 
471  void setRenderHints( RenderHints hints ) { mRenderHints = hints; }
472 
477  RenderHints renderHints() const { return mRenderHints; }
478 
488  void setClipFeaturesToExtent( bool clipFeaturesToExtent ) { mClipFeaturesToExtent = clipFeaturesToExtent; }
489 
499  bool clipFeaturesToExtent() const { return mClipFeaturesToExtent; }
500 
510  void setForceRHR( bool force ) { mForceRHR = force; }
511 
521  bool forceRHR() const { return mForceRHR; }
522 
528  QSet<QString> usedAttributes( const QgsRenderContext &context ) const;
529 
534  bool hasDataDefinedProperties() const;
535 
540  Q_DECL_DEPRECATED void setLayer( const QgsVectorLayer *layer ) SIP_DEPRECATED;
541 
545  Q_DECL_DEPRECATED const QgsVectorLayer *layer() const SIP_DEPRECATED;
546 
551  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 );
552 
558  QgsSymbolRenderContext *symbolRenderContext();
559 
560  protected:
561  QgsSymbol( SymbolType type, const QgsSymbolLayerList &layers SIP_TRANSFER ); // can't be instantiated
562 
566  static inline QPointF _getPoint( QgsRenderContext &context, const QgsPoint &point )
567  {
568  QPointF pt;
569  if ( context.coordinateTransform().isValid() )
570  {
571  double x = point.x();
572  double y = point.y();
573  double z = 0.0;
574  context.coordinateTransform().transformInPlace( x, y, z );
575  pt = QPointF( x, y );
576 
577  }
578  else
579  pt = point.toQPointF();
580 
581  context.mapToPixel().transformInPlace( pt.rx(), pt.ry() );
582  return pt;
583  }
584 
588  static QPolygonF _getLineString( QgsRenderContext &context, const QgsCurve &curve, bool clipToExtent = true );
589 
596  static QPolygonF _getPolygonRing( QgsRenderContext &context, const QgsCurve &curve, bool clipToExtent, bool isExteriorRing = false, bool correctRingOrientation = false );
597 
605  static void _getPolygon( QPolygonF &pts, QVector<QPolygonF> &holes, QgsRenderContext &context, const QgsPolygon &polygon, bool clipToExtent = true, bool correctRingOrientation = false );
606 
611  QgsSymbolLayerList cloneLayers() const SIP_FACTORY;
612 
622  void renderUsingLayer( QgsSymbolLayer *layer, QgsSymbolRenderContext &context );
623 
628  void renderVertexMarker( QPointF pt, QgsRenderContext &context, int currentVertexMarkerType, double currentVertexMarkerSize );
629 
632 
634  qreal mOpacity = 1.0;
635 
636  RenderHints mRenderHints;
637  bool mClipFeaturesToExtent = true;
638  bool mForceRHR = false;
639 
640  Q_DECL_DEPRECATED const QgsVectorLayer *mLayer = nullptr; //current vectorlayer
641 
642  private:
643 #ifdef SIP_RUN
644  QgsSymbol( const QgsSymbol & );
645 #endif
646 
651  bool mStarted = false;
652 
654  std::unique_ptr< QgsSymbolRenderContext > mSymbolRenderContext;
655 
667  void startFeatureRender( const QgsFeature &feature, QgsRenderContext &context, int layer = -1 );
668 
680  void stopFeatureRender( const QgsFeature &feature, QgsRenderContext &context, int layer = -1 );
681 
682  Q_DISABLE_COPY( QgsSymbol )
683 
684 };
685 
686 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsSymbol::RenderHints )
687 
688 
694 class CORE_EXPORT QgsSymbolRenderContext
695 {
696  public:
697 
698  //TODO QGIS 4.0 - remove mapUnitScale and renderunit
699 
711  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() );
712 
714 
717 
721  QgsRenderContext &renderContext() { return mRenderContext; }
722 
727  const QgsRenderContext &renderContext() const { return mRenderContext; } SIP_SKIP
728 
735  void setOriginalValueVariable( const QVariant &value );
736 
741  Q_DECL_DEPRECATED QgsUnitTypes::RenderUnit outputUnit() const SIP_DEPRECATED { return mOutputUnit; }
742 
747  Q_DECL_DEPRECATED void setOutputUnit( QgsUnitTypes::RenderUnit u ) SIP_DEPRECATED { mOutputUnit = u; }
748 
752  Q_DECL_DEPRECATED QgsMapUnitScale mapUnitScale() const SIP_DEPRECATED { return mMapUnitScale; }
753 
757  Q_DECL_DEPRECATED void setMapUnitScale( const QgsMapUnitScale &scale ) SIP_DEPRECATED { mMapUnitScale = scale; }
758 
764  qreal opacity() const { return mOpacity; }
765 
771  void setOpacity( qreal opacity ) { mOpacity = opacity; }
772 
777  bool selected() const { return mSelected; }
778 
783  void setSelected( bool selected ) { mSelected = selected; }
784 
789  QgsSymbol::RenderHints renderHints() const { return mRenderHints; }
790 
795  void setRenderHints( QgsSymbol::RenderHints hints ) { mRenderHints = hints; }
796 
797  void setFeature( const QgsFeature *f ) { mFeature = f; }
798 
802  const QgsFeature *feature() const { return mFeature; }
803 
809  void setOriginalGeometryType( QgsWkbTypes::GeometryType type ) { mOriginalGeometryType = type; }
810 
819  QgsWkbTypes::GeometryType originalGeometryType() const { return mOriginalGeometryType; }
820 
827  QgsFields fields() const { return mFields; }
828 
833  int geometryPartCount() const { return mGeometryPartCount; }
834 
839  void setGeometryPartCount( int count ) { mGeometryPartCount = count; }
840 
845  int geometryPartNum() const { return mGeometryPartNum; }
846 
851  void setGeometryPartNum( int num ) { mGeometryPartNum = num; }
852 
856  Q_DECL_DEPRECATED double outputLineWidth( double width ) const SIP_DEPRECATED;
857 
861  Q_DECL_DEPRECATED double outputPixelSize( double size ) const SIP_DEPRECATED;
862 
863  // workaround for sip 4.7. Don't use assignment - will fail with assertion error
864  QgsSymbolRenderContext &operator=( const QgsSymbolRenderContext & );
865 
871  QgsExpressionContextScope *expressionContextScope();
872 
880  void setExpressionContextScope( QgsExpressionContextScope *contextScope SIP_TRANSFER );
881 
888  const QgsLegendPatchShape *patchShape() const;
889 
896  void setPatchShape( const QgsLegendPatchShape &shape );
897 
898  private:
899 
900 #ifdef SIP_RUN
902 #endif
903 
904  QgsRenderContext &mRenderContext;
905  std::unique_ptr< QgsExpressionContextScope > mExpressionContextScope;
906  QgsUnitTypes::RenderUnit mOutputUnit;
907  QgsMapUnitScale mMapUnitScale;
908  qreal mOpacity = 1.0;
909  bool mSelected;
910  QgsSymbol::RenderHints mRenderHints;
911  const QgsFeature *mFeature; //current feature
912  QgsFields mFields;
913  int mGeometryPartCount;
914  int mGeometryPartNum;
916  std::unique_ptr< QgsLegendPatchShape > mPatchShape;
917 };
918 
919 
920 
922 
923 
930 class CORE_EXPORT QgsMarkerSymbol : public QgsSymbol
931 {
932  public:
933 
938  static QgsMarkerSymbol *createSimple( const QgsStringMap &properties ) SIP_FACTORY;
939 
946 
953  void setAngle( double symbolAngle );
954 
962  double angle() const;
963 
969  void setDataDefinedAngle( const QgsProperty &property );
970 
978  QgsProperty dataDefinedAngle() const;
979 
987  void setLineAngle( double lineAngle );
988 
997  void setSize( double size );
998 
1011  double size() const;
1012 
1026  double size( const QgsRenderContext &context ) const;
1027 
1036  void setSizeUnit( QgsUnitTypes::RenderUnit unit );
1037 
1046  QgsUnitTypes::RenderUnit sizeUnit() const;
1047 
1056  void setSizeMapUnitScale( const QgsMapUnitScale &scale );
1057 
1067  QgsMapUnitScale sizeMapUnitScale() const;
1068 
1074  void setDataDefinedSize( const QgsProperty &property );
1075 
1083  QgsProperty dataDefinedSize() const;
1084 
1085  void setScaleMethod( QgsSymbol::ScaleMethod scaleMethod );
1086  ScaleMethod scaleMethod();
1087 
1100  void renderPoint( QPointF point, const QgsFeature *f, QgsRenderContext &context, int layer = -1, bool selected = false );
1101 
1113  QRectF bounds( QPointF point, QgsRenderContext &context, const QgsFeature &feature = QgsFeature() ) const;
1114 
1115  QgsMarkerSymbol *clone() const override SIP_FACTORY;
1116 
1117  private:
1118 
1119  void renderPointUsingLayer( QgsMarkerSymbolLayer *layer, QPointF point, QgsSymbolRenderContext &context );
1120 
1121 };
1122 
1123 
1130 class CORE_EXPORT QgsLineSymbol : public QgsSymbol
1131 {
1132  public:
1133 
1138  static QgsLineSymbol *createSimple( const QgsStringMap &properties ) SIP_FACTORY;
1139 
1146 
1153  void setWidth( double width );
1154 
1160  void setWidthUnit( QgsUnitTypes::RenderUnit unit );
1161 
1162 
1173  double width() const;
1174 
1186  double width( const QgsRenderContext &context ) const;
1187 
1193  void setDataDefinedWidth( const QgsProperty &property );
1194 
1202  QgsProperty dataDefinedWidth() const;
1203 
1216  void renderPolyline( const QPolygonF &points, const QgsFeature *f, QgsRenderContext &context, int layer = -1, bool selected = false );
1217 
1218  QgsLineSymbol *clone() const override SIP_FACTORY;
1219 
1220  private:
1221 
1222  void renderPolylineUsingLayer( QgsLineSymbolLayer *layer, const QPolygonF &points, QgsSymbolRenderContext &context );
1223 
1224 };
1225 
1226 
1233 class CORE_EXPORT QgsFillSymbol : public QgsSymbol
1234 {
1235  public:
1236 
1241  static QgsFillSymbol *createSimple( const QgsStringMap &properties ) SIP_FACTORY;
1242 
1249  void setAngle( double angle );
1250 
1266  void renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings, const QgsFeature *f, QgsRenderContext &context, int layer = -1, bool selected = false );
1267 
1268  QgsFillSymbol *clone() const override SIP_FACTORY;
1269 
1270  private:
1271 
1272  void renderPolygonUsingLayer( QgsSymbolLayer *layer, const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context );
1274  QRectF polygonBounds( const QPolygonF &points, const QVector<QPolygonF> *rings ) const;
1276  QVector<QPolygonF> *translateRings( const QVector<QPolygonF> *rings, double dx, double dy ) const;
1277 };
1278 
1279 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsSymbol::PreviewFlags )
1280 
1281 #endif
1282 
QgsCurve
Abstract base class for curved geometry type.
Definition: qgscurve.h:36
QgsLineSymbolLayer
Definition: qgssymbollayer.h:901
QgsExpressionContext
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Definition: qgsexpressioncontext.h:370
qgsfields.h
QgsSymbolRenderContext::setOpacity
void setOpacity(qreal opacity)
Sets the opacity for the symbol.
Definition: qgssymbol.h:771
QgsProperty
A store for object properties.
Definition: qgsproperty.h:232
QgsUnitTypes::RenderUnit
RenderUnit
Rendering size units.
Definition: qgsunittypes.h:167
QgsPolygon
Polygon geometry type.
Definition: qgspolygon.h:34
QgsPoint
Point geometry type, with support for z-dimension and m-values.
Definition: qgspoint.h:38
QgsSymbolRenderContext::outputUnit
Q_DECL_DEPRECATED QgsUnitTypes::RenderUnit outputUnit() const
Returns the output unit for the context.
Definition: qgssymbol.h:741
QgsSymbolRenderContext::feature
const QgsFeature * feature() const
Returns the current feature being rendered.
Definition: qgssymbol.h:802
QgsFields
Container of fields for a vector layer.
Definition: qgsfields.h:45
QgsSymbolRenderContext::setSelected
void setSelected(bool selected)
Sets whether symbols should be rendered using the selected symbol coloring and style.
Definition: qgssymbol.h:783
QgsSymbol::RenderHint
RenderHint
Flags controlling behavior of symbols during rendering.
Definition: qgssymbol.h:105
QgsSymbolRenderContext::setGeometryPartNum
void setGeometryPartNum(int num)
Sets the part number of current geometry.
Definition: qgssymbol.h:851
QgsSymbolRenderContext::opacity
qreal opacity() const
Returns the opacity for the symbol.
Definition: qgssymbol.h:764
QgsFeatureRenderer::type
QString type() const
Definition: qgsrenderer.h:141
qgis.h
QgsSymbolRenderContext::geometryPartCount
int geometryPartCount() const
Part count of current geometry.
Definition: qgssymbol.h:833
QgsRenderContext
Contains information about the context of a rendering operation.
Definition: qgsrendercontext.h:58
QgsFeatureRenderer::usedAttributes
virtual QSet< QString > usedAttributes(const QgsRenderContext &context) const =0
Returns a list of attributes required by this renderer.
QgsSymbolRenderContext::setOutputUnit
Q_DECL_DEPRECATED void setOutputUnit(QgsUnitTypes::RenderUnit u)
Sets the output unit for the context.
Definition: qgssymbol.h:747
QgsMarkerSymbolLayer
Abstract base class for marker symbol layers.
Definition: qgssymbollayer.h:582
QgsSymbolRenderContext::QgsSymbolRenderContext
QgsSymbolRenderContext(const QgsSymbolRenderContext &rh)=delete
QgsSymbolRenderContext cannot be copied.
QgsSymbol::ScaleMethod
ScaleMethod
Scale method.
Definition: qgssymbol.h:97
QgsSymbolRenderContext::~QgsSymbolRenderContext
~QgsSymbolRenderContext()
QgsSymbol
Abstract base class for all rendered symbols.
Definition: qgssymbol.h:64
QgsSymbol::PreviewFlag
PreviewFlag
Flags for controlling how symbol preview images are generated.
Definition: qgssymbol.h:378
QgsFeatureRenderer::toSld
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
QgsSymbolRenderContext::setFeature
void setFeature(const QgsFeature *f)
Definition: qgssymbol.h:797
QgsLegendPatchShape
Represents a patch shape for use in map legends.
Definition: qgslegendpatchshape.h:31
QgsFeatureRenderer::stopRender
virtual void stopRender(QgsRenderContext &context)
Must be called when a render cycle has finished, to allow the renderer to clean up.
Definition: qgsrenderer.cpp:107
qgssymbollayerreference.h
SIP_TYPEHINT
#define SIP_TYPEHINT(type)
Definition: qgis_sip.h:218
QgsSymbolRenderContext::setRenderHints
void setRenderHints(QgsSymbol::RenderHints hints)
Sets rendering hint flags for the symbol.
Definition: qgssymbol.h:795
SIP_TRANSFERBACK
#define SIP_TRANSFERBACK
Definition: qgis_sip.h:48
SIP_FACTORY
#define SIP_FACTORY
Definition: qgis_sip.h:76
QgsSymbolRenderContext::selected
bool selected() const
Returns true if symbols should be rendered using the selected symbol coloring and style.
Definition: qgssymbol.h:777
QgsSymbolRenderContext
Definition: qgssymbol.h:695
QgsSymbolRenderContext::originalGeometryType
QgsWkbTypes::GeometryType originalGeometryType() const
Returns the geometry type for the original feature geometry being rendered.
Definition: qgssymbol.h:819
SIP_DEPRECATED
#define SIP_DEPRECATED
Definition: qgis_sip.h:106
QgsSymbol::setOpacity
void setOpacity(qreal opacity)
Sets the opacity for the symbol.
Definition: qgssymbol.h:465
SIP_CONVERT_TO_SUBCLASS_CODE
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition: qgis_sip.h:177
QgsSymbol::setClipFeaturesToExtent
void setClipFeaturesToExtent(bool clipFeaturesToExtent)
Sets whether features drawn by the symbol should be clipped to the render context's extent.
Definition: qgssymbol.h:488
QgsSymbol::opacity
qreal opacity() const
Returns the opacity for the symbol.
Definition: qgssymbol.h:458
QgsCsException
Custom exception class for Coordinate Reference System related exceptions.
Definition: qgsexception.h:66
QgsSymbolLayer
Definition: qgssymbollayer.h:53
QgsSymbolRenderContext::renderContext
const QgsRenderContext & renderContext() const
Returns a reference to the context's render context.
Definition: qgssymbol.h:727
SIP_SKIP
#define SIP_SKIP
Definition: qgis_sip.h:126
SIP_THROW
#define SIP_THROW(name)
Definition: qgis_sip.h:189
QgsSymbolRenderContext::fields
QgsFields fields() const
Fields of the layer.
Definition: qgssymbol.h:827
QgsFeatureRenderer::_getPoint
static QPointF _getPoint(QgsRenderContext &context, const QgsPoint &point)
Creates a point in screen coordinates from a wkb string in map coordinates.
Definition: qgsrenderer.cpp:44
QgsMarkerSymbol
A marker symbol type, for rendering Point and MultiPoint geometries.
Definition: qgssymbol.h:931
QgsSymbolRenderContext::setGeometryPartCount
void setGeometryPartCount(int count)
Sets the part count of current geometry.
Definition: qgssymbol.h:839
SIP_TRANSFER
#define SIP_TRANSFER
Definition: qgis_sip.h:36
qgsrendercontext.h
Q_DECLARE_OPERATORS_FOR_FLAGS
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.
QgsLineSymbol
A line symbol type, for rendering LineString and MultiLineString geometries.
Definition: qgssymbol.h:1131
QgsSymbol::Fill
@ Fill
Fill symbol.
Definition: qgssymbol.h:89
QgsMapUnitScale
Struct for storing maximum and minimum scales for measurements in map units.
Definition: qgsmapunitscale.h:38
QgsSymbol::setForceRHR
void setForceRHR(bool force)
Sets whether polygon features drawn by the symbol should be reoriented to follow the standard right-h...
Definition: qgssymbol.h:510
QgsExpressionContextScope
Single scope for storing variables and functions for use within a QgsExpressionContext.
Definition: qgsexpressioncontext.h:112
QgsSymbolRenderContext::renderHints
QgsSymbol::RenderHints renderHints() const
Returns the rendering hint flags for the symbol.
Definition: qgssymbol.h:789
QgsSymbolRenderContext::setOriginalGeometryType
void setOriginalGeometryType(QgsWkbTypes::GeometryType type)
Sets the geometry type for the original feature geometry being rendered.
Definition: qgssymbol.h:809
QgsSymbol::clone
virtual QgsSymbol * clone() const =0
Returns a deep copy of this symbol.
QgsSymbol::renderHints
RenderHints renderHints() const
Returns the rendering hint flags for the symbol.
Definition: qgssymbol.h:477
QgsStringMap
QMap< QString, QString > QgsStringMap
Definition: qgis.h:758
QgsFeatureRenderer
Definition: qgsrenderer.h:103
QgsWkbTypes::GeometryType
GeometryType
The geometry types are used to group QgsWkbTypes::Type in a coarse way.
Definition: qgswkbtypes.h:141
QgsSymbol::clipFeaturesToExtent
bool clipFeaturesToExtent() const
Returns whether features drawn by the symbol will be clipped to the render context's extent.
Definition: qgssymbol.h:499
SIP_FORCE
#define SIP_FORCE
Definition: qgis_sip.h:131
c
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
Definition: porting_processing.dox:1
QgsFeatureRenderer::mType
QString mType
Definition: qgsrenderer.h:520
QgsVectorLayer
Represents a vector layer which manages a vector based data sets.
Definition: qgsvectorlayer.h:387
QgsSymbolLayerList
QList< QgsSymbolLayer * > QgsSymbolLayerList
Definition: qgssymbol.h:53
QgsFillSymbolLayer
Definition: qgssymbollayer.h:1099
QgsSymbol::setRenderHints
void setRenderHints(RenderHints hints)
Sets rendering hint flags for the symbol.
Definition: qgssymbol.h:471
QgsSymbol::FlagIncludeCrosshairsForMarkerSymbols
@ FlagIncludeCrosshairsForMarkerSymbols
Include a crosshairs reference image in the background of marker symbol previews.
Definition: qgssymbol.h:379
QgsSymbolRenderContext::setMapUnitScale
Q_DECL_DEPRECATED void setMapUnitScale(const QgsMapUnitScale &scale)
Definition: qgssymbol.h:757
QgsFeatureRenderer::renderFeature
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.
Definition: qgsrenderer.cpp:119
QgsPaintEffect
Base class for visual effects which can be applied to QPicture drawings.
Definition: qgspainteffect.h:54
QgsFillSymbol
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
Definition: qgssymbol.h:1234
qgsproperty.h
QgsSymbol::Line
@ Line
Line symbol.
Definition: qgssymbol.h:88
QgsFeatureRenderer::renderVertexMarker
void renderVertexMarker(QPointF pt, QgsRenderContext &context)
render editing vertex marker at specified point
Definition: qgsrenderer.cpp:369
QgsWkbTypes::UnknownGeometry
@ UnknownGeometry
Definition: qgswkbtypes.h:145
QgsSymbol::type
SymbolType type() const
Returns the symbol's type.
Definition: qgssymbol.h:122
QgsSymbol::Marker
@ Marker
Marker symbol.
Definition: qgssymbol.h:87
qgsmapunitscale.h
QgsFeatureRenderer::dump
virtual QString dump() const
Returns debug information about this renderer.
Definition: qgsrenderer.cpp:138
QgsFeature
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition: qgsfeature.h:56
QgsSymbolRenderContext::renderContext
QgsRenderContext & renderContext()
Returns a reference to the context's render context.
Definition: qgssymbol.h:721
QgsSymbol::SymbolType
SymbolType
Type of the symbol.
Definition: qgssymbol.h:86
QgsSymbol::symbolLayers
QgsSymbolLayerList symbolLayers()
Returns the list of symbol layers contained in the symbol.
Definition: qgssymbol.h:133
QgsSymbol::ScaleArea
@ ScaleArea
Calculate scale by the area.
Definition: qgssymbol.h:98
QgsFeatureRenderer::startRender
virtual void startRender(QgsRenderContext &context, const QgsFields &fields)
Must be called when a new render cycle is started.
Definition: qgsrenderer.cpp:93
MathUtils::angle
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
SIP_END
#define SIP_END
Definition: qgis_sip.h:194
QgsSymbolRenderContext::geometryPartNum
int geometryPartNum() const
Part number of current geometry.
Definition: qgssymbol.h:845
QgsSymbol::forceRHR
bool forceRHR() const
Returns true if polygon features drawn by the symbol will be reoriented to follow the standard right-...
Definition: qgssymbol.h:521
QgsSymbolRenderContext::mapUnitScale
Q_DECL_DEPRECATED QgsMapUnitScale mapUnitScale() const
Definition: qgssymbol.h:752
QgsSymbol::symbolLayerCount
int symbolLayerCount() const
Returns the total number of symbol layers contained in the symbol.
Definition: qgssymbol.h:183