QGIS API Documentation  3.14.0-Pi (9f7028fd23)
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 
380  QImage bigSymbolPreviewImage( QgsExpressionContext *expressionContext = nullptr );
381 
385  QString dump() const;
386 
392  virtual QgsSymbol *clone() const = 0 SIP_FACTORY;
393 
397  void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const;
398 
407  QgsUnitTypes::RenderUnit outputUnit() const;
408 
417  void setOutputUnit( QgsUnitTypes::RenderUnit unit );
418 
428  QgsMapUnitScale mapUnitScale() const;
429 
438  void setMapUnitScale( const QgsMapUnitScale &scale );
439 
445  qreal opacity() const { return mOpacity; }
446 
452  void setOpacity( qreal opacity ) { mOpacity = opacity; }
453 
458  void setRenderHints( RenderHints hints ) { mRenderHints = hints; }
459 
464  RenderHints renderHints() const { return mRenderHints; }
465 
475  void setClipFeaturesToExtent( bool clipFeaturesToExtent ) { mClipFeaturesToExtent = clipFeaturesToExtent; }
476 
486  bool clipFeaturesToExtent() const { return mClipFeaturesToExtent; }
487 
497  void setForceRHR( bool force ) { mForceRHR = force; }
498 
508  bool forceRHR() const { return mForceRHR; }
509 
515  QSet<QString> usedAttributes( const QgsRenderContext &context ) const;
516 
521  bool hasDataDefinedProperties() const;
522 
527  Q_DECL_DEPRECATED void setLayer( const QgsVectorLayer *layer ) SIP_DEPRECATED;
528 
532  Q_DECL_DEPRECATED const QgsVectorLayer *layer() const SIP_DEPRECATED;
533 
538  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 );
539 
545  QgsSymbolRenderContext *symbolRenderContext();
546 
547  protected:
548  QgsSymbol( SymbolType type, const QgsSymbolLayerList &layers SIP_TRANSFER ); // can't be instantiated
549 
553  static inline QPointF _getPoint( QgsRenderContext &context, const QgsPoint &point )
554  {
555  QPointF pt;
556  if ( context.coordinateTransform().isValid() )
557  {
558  double x = point.x();
559  double y = point.y();
560  double z = 0.0;
561  context.coordinateTransform().transformInPlace( x, y, z );
562  pt = QPointF( x, y );
563 
564  }
565  else
566  pt = point.toQPointF();
567 
568  context.mapToPixel().transformInPlace( pt.rx(), pt.ry() );
569  return pt;
570  }
571 
575  static QPolygonF _getLineString( QgsRenderContext &context, const QgsCurve &curve, bool clipToExtent = true );
576 
583  static QPolygonF _getPolygonRing( QgsRenderContext &context, const QgsCurve &curve, bool clipToExtent, bool isExteriorRing = false, bool correctRingOrientation = false );
584 
592  static void _getPolygon( QPolygonF &pts, QVector<QPolygonF> &holes, QgsRenderContext &context, const QgsPolygon &polygon, bool clipToExtent = true, bool correctRingOrientation = false );
593 
598  QgsSymbolLayerList cloneLayers() const SIP_FACTORY;
599 
609  void renderUsingLayer( QgsSymbolLayer *layer, QgsSymbolRenderContext &context );
610 
615  void renderVertexMarker( QPointF pt, QgsRenderContext &context, int currentVertexMarkerType, double currentVertexMarkerSize );
616 
619 
621  qreal mOpacity = 1.0;
622 
623  RenderHints mRenderHints;
624  bool mClipFeaturesToExtent = true;
625  bool mForceRHR = false;
626 
627  Q_DECL_DEPRECATED const QgsVectorLayer *mLayer = nullptr; //current vectorlayer
628 
629  private:
630 #ifdef SIP_RUN
631  QgsSymbol( const QgsSymbol & );
632 #endif
633 
638  bool mStarted = false;
639 
641  std::unique_ptr< QgsSymbolRenderContext > mSymbolRenderContext;
642 
654  void startFeatureRender( const QgsFeature &feature, QgsRenderContext &context, int layer = -1 );
655 
667  void stopFeatureRender( const QgsFeature &feature, QgsRenderContext &context, int layer = -1 );
668 
669  Q_DISABLE_COPY( QgsSymbol )
670 
671 };
672 
673 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsSymbol::RenderHints )
674 
675 
681 class CORE_EXPORT QgsSymbolRenderContext
682 {
683  public:
684 
685  //TODO QGIS 4.0 - remove mapUnitScale and renderunit
686 
698  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() );
699 
701 
703  QgsSymbolRenderContext( const QgsSymbolRenderContext &rh ) = delete;
704 
708  QgsRenderContext &renderContext() { return mRenderContext; }
709 
714  const QgsRenderContext &renderContext() const { return mRenderContext; } SIP_SKIP
715 
722  void setOriginalValueVariable( const QVariant &value );
723 
728  Q_DECL_DEPRECATED QgsUnitTypes::RenderUnit outputUnit() const SIP_DEPRECATED { return mOutputUnit; }
729 
734  Q_DECL_DEPRECATED void setOutputUnit( QgsUnitTypes::RenderUnit u ) SIP_DEPRECATED { mOutputUnit = u; }
735 
739  Q_DECL_DEPRECATED QgsMapUnitScale mapUnitScale() const SIP_DEPRECATED { return mMapUnitScale; }
740 
744  Q_DECL_DEPRECATED void setMapUnitScale( const QgsMapUnitScale &scale ) SIP_DEPRECATED { mMapUnitScale = scale; }
745 
751  qreal opacity() const { return mOpacity; }
752 
758  void setOpacity( qreal opacity ) { mOpacity = opacity; }
759 
764  bool selected() const { return mSelected; }
765 
770  void setSelected( bool selected ) { mSelected = selected; }
771 
776  QgsSymbol::RenderHints renderHints() const { return mRenderHints; }
777 
782  void setRenderHints( QgsSymbol::RenderHints hints ) { mRenderHints = hints; }
783 
784  void setFeature( const QgsFeature *f ) { mFeature = f; }
785 
789  const QgsFeature *feature() const { return mFeature; }
790 
796  void setOriginalGeometryType( QgsWkbTypes::GeometryType type ) { mOriginalGeometryType = type; }
797 
806  QgsWkbTypes::GeometryType originalGeometryType() const { return mOriginalGeometryType; }
807 
814  QgsFields fields() const { return mFields; }
815 
820  int geometryPartCount() const { return mGeometryPartCount; }
821 
826  void setGeometryPartCount( int count ) { mGeometryPartCount = count; }
827 
832  int geometryPartNum() const { return mGeometryPartNum; }
833 
838  void setGeometryPartNum( int num ) { mGeometryPartNum = num; }
839 
843  Q_DECL_DEPRECATED double outputLineWidth( double width ) const SIP_DEPRECATED;
844 
848  Q_DECL_DEPRECATED double outputPixelSize( double size ) const SIP_DEPRECATED;
849 
850  // workaround for sip 4.7. Don't use assignment - will fail with assertion error
851  QgsSymbolRenderContext &operator=( const QgsSymbolRenderContext & );
852 
858  QgsExpressionContextScope *expressionContextScope();
859 
867  void setExpressionContextScope( QgsExpressionContextScope *contextScope SIP_TRANSFER );
868 
875  const QgsLegendPatchShape *patchShape() const;
876 
883  void setPatchShape( const QgsLegendPatchShape &shape );
884 
885  private:
886 
887 #ifdef SIP_RUN
889 #endif
890 
891  QgsRenderContext &mRenderContext;
892  std::unique_ptr< QgsExpressionContextScope > mExpressionContextScope;
893  QgsUnitTypes::RenderUnit mOutputUnit;
894  QgsMapUnitScale mMapUnitScale;
895  qreal mOpacity = 1.0;
896  bool mSelected;
897  QgsSymbol::RenderHints mRenderHints;
898  const QgsFeature *mFeature; //current feature
899  QgsFields mFields;
900  int mGeometryPartCount;
901  int mGeometryPartNum;
903  std::unique_ptr< QgsLegendPatchShape > mPatchShape;
904 };
905 
906 
907 
909 
910 
917 class CORE_EXPORT QgsMarkerSymbol : public QgsSymbol
918 {
919  public:
920 
925  static QgsMarkerSymbol *createSimple( const QgsStringMap &properties ) SIP_FACTORY;
926 
933 
940  void setAngle( double symbolAngle );
941 
949  double angle() const;
950 
956  void setDataDefinedAngle( const QgsProperty &property );
957 
965  QgsProperty dataDefinedAngle() const;
966 
974  void setLineAngle( double lineAngle );
975 
984  void setSize( double size );
985 
998  double size() const;
999 
1013  double size( const QgsRenderContext &context ) const;
1014 
1023  void setSizeUnit( QgsUnitTypes::RenderUnit unit );
1024 
1033  QgsUnitTypes::RenderUnit sizeUnit() const;
1034 
1043  void setSizeMapUnitScale( const QgsMapUnitScale &scale );
1044 
1054  QgsMapUnitScale sizeMapUnitScale() const;
1055 
1061  void setDataDefinedSize( const QgsProperty &property );
1062 
1070  QgsProperty dataDefinedSize() const;
1071 
1072  void setScaleMethod( QgsSymbol::ScaleMethod scaleMethod );
1073  ScaleMethod scaleMethod();
1074 
1087  void renderPoint( QPointF point, const QgsFeature *f, QgsRenderContext &context, int layer = -1, bool selected = false );
1088 
1100  QRectF bounds( QPointF point, QgsRenderContext &context, const QgsFeature &feature = QgsFeature() ) const;
1101 
1102  QgsMarkerSymbol *clone() const override SIP_FACTORY;
1103 
1104  private:
1105 
1106  void renderPointUsingLayer( QgsMarkerSymbolLayer *layer, QPointF point, QgsSymbolRenderContext &context );
1107 
1108 };
1109 
1110 
1117 class CORE_EXPORT QgsLineSymbol : public QgsSymbol
1118 {
1119  public:
1120 
1125  static QgsLineSymbol *createSimple( const QgsStringMap &properties ) SIP_FACTORY;
1126 
1133 
1140  void setWidth( double width );
1141 
1152  double width() const;
1153 
1165  double width( const QgsRenderContext &context ) const;
1166 
1172  void setDataDefinedWidth( const QgsProperty &property );
1173 
1181  QgsProperty dataDefinedWidth() const;
1182 
1195  void renderPolyline( const QPolygonF &points, const QgsFeature *f, QgsRenderContext &context, int layer = -1, bool selected = false );
1196 
1197  QgsLineSymbol *clone() const override SIP_FACTORY;
1198 
1199  private:
1200 
1201  void renderPolylineUsingLayer( QgsLineSymbolLayer *layer, const QPolygonF &points, QgsSymbolRenderContext &context );
1202 
1203 };
1204 
1205 
1212 class CORE_EXPORT QgsFillSymbol : public QgsSymbol
1213 {
1214  public:
1215 
1220  static QgsFillSymbol *createSimple( const QgsStringMap &properties ) SIP_FACTORY;
1221 
1228  void setAngle( double angle );
1229 
1245  void renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings, const QgsFeature *f, QgsRenderContext &context, int layer = -1, bool selected = false );
1246 
1247  QgsFillSymbol *clone() const override SIP_FACTORY;
1248 
1249  private:
1250 
1251  void renderPolygonUsingLayer( QgsSymbolLayer *layer, const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context );
1253  QRectF polygonBounds( const QPolygonF &points, const QVector<QPolygonF> *rings ) const;
1255  QVector<QPolygonF> *translateRings( const QVector<QPolygonF> *rings, double dx, double dy ) const;
1256 };
1257 
1258 #endif
1259 
QgsCurve
Abstract base class for curved geometry type.
Definition: qgscurve.h:35
QgsLineSymbolLayer
Definition: qgssymbollayer.h:894
QgsExpressionContext
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Definition: qgsexpressioncontext.h:369
qgsfields.h
QgsSymbolRenderContext::setOpacity
void setOpacity(qreal opacity)
Sets the opacity for the symbol.
Definition: qgssymbol.h:758
QgsProperty
A store for object properties.
Definition: qgsproperty.h:231
QgsUnitTypes::RenderUnit
RenderUnit
Rendering size units.
Definition: qgsunittypes.h:166
QgsPolygon
Polygon geometry type.
Definition: qgspolygon.h:33
QgsPoint
Point geometry type, with support for z-dimension and m-values.
Definition: qgspoint.h:37
QgsSymbolRenderContext::outputUnit
Q_DECL_DEPRECATED QgsUnitTypes::RenderUnit outputUnit() const
Returns the output unit for the context.
Definition: qgssymbol.h:728
QgsSymbolRenderContext::feature
const QgsFeature * feature() const
Returns the current feature being rendered.
Definition: qgssymbol.h:789
QgsFields
Definition: qgsfields.h:44
QgsSymbolRenderContext::setSelected
void setSelected(bool selected)
Sets whether symbols should be rendered using the selected symbol coloring and style.
Definition: qgssymbol.h:770
QgsSymbol::RenderHint
RenderHint
Flags controlling behavior of symbols during rendering.
Definition: qgssymbol.h:104
QgsSymbolRenderContext::setGeometryPartNum
void setGeometryPartNum(int num)
Sets the part number of current geometry.
Definition: qgssymbol.h:838
QgsSymbolRenderContext::opacity
qreal opacity() const
Returns the opacity for the symbol.
Definition: qgssymbol.h:751
QgsFeatureRenderer::type
QString type() const
Definition: qgsrenderer.h:141
qgis.h
QgsSymbolRenderContext::geometryPartCount
int geometryPartCount() const
Part count of current geometry.
Definition: qgssymbol.h:820
QgsRenderContext
Definition: qgsrendercontext.h:57
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:734
QgsMarkerSymbolLayer
Abstract base class for marker symbol layers.
Definition: qgssymbollayer.h:575
QgsSymbol::ScaleMethod
ScaleMethod
Scale method.
Definition: qgssymbol.h:96
QgsSymbol
Definition: qgssymbol.h:63
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:784
QgsLegendPatchShape
Definition: qgslegendpatchshape.h:30
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:213
QgsSymbolRenderContext::setRenderHints
void setRenderHints(QgsSymbol::RenderHints hints)
Sets rendering hint flags for the symbol.
Definition: qgssymbol.h:782
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:764
QgsSymbolRenderContext
Definition: qgssymbol.h:681
QgsSymbolRenderContext::originalGeometryType
QgsWkbTypes::GeometryType originalGeometryType() const
Returns the geometry type for the original feature geometry being rendered.
Definition: qgssymbol.h:806
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:452
SIP_CONVERT_TO_SUBCLASS_CODE
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition: qgis_sip.h:172
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:475
QgsSymbol::opacity
qreal opacity() const
Returns the opacity for the symbol.
Definition: qgssymbol.h:445
QgsCsException
Definition: qgsexception.h:65
QgsSymbolLayer
Definition: qgssymbollayer.h:52
QgsSymbolRenderContext::renderContext
const QgsRenderContext & renderContext() const
Returns a reference to the context's render context.
Definition: qgssymbol.h:714
SIP_SKIP
#define SIP_SKIP
Definition: qgis_sip.h:126
SIP_THROW
#define SIP_THROW(name)
Definition: qgis_sip.h:184
QgsSymbolRenderContext::fields
QgsFields fields() const
Fields of the layer.
Definition: qgssymbol.h:814
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
Definition: qgssymbol.h:917
QgsFeatureRenderer::clone
virtual QgsFeatureRenderer * clone() const =0
Create a deep copy of this renderer.
QgsSymbolRenderContext::setGeometryPartCount
void setGeometryPartCount(int count)
Sets the part count of current geometry.
Definition: qgssymbol.h:826
SIP_TRANSFER
#define SIP_TRANSFER
Definition: qgis_sip.h:36
qgsrendercontext.h
QgsLineSymbol
Definition: qgssymbol.h:1117
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:37
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:497
QgsExpressionContextScope
Single scope for storing variables and functions for use within a QgsExpressionContext....
Definition: qgsexpressioncontext.h:111
QgsSymbolRenderContext::renderHints
QgsSymbol::RenderHints renderHints() const
Returns the rendering hint flags for the symbol.
Definition: qgssymbol.h:776
QgsSymbolRenderContext::setOriginalGeometryType
void setOriginalGeometryType(QgsWkbTypes::GeometryType type)
Sets the geometry type for the original feature geometry being rendered.
Definition: qgssymbol.h:796
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:464
QgsStringMap
QMap< QString, QString > QgsStringMap
Definition: qgis.h:714
QgsFeatureRenderer
Definition: qgsrenderer.h:102
QgsWkbTypes::GeometryType
GeometryType
The geometry types are used to group QgsWkbTypes::Type in a coarse way.
Definition: qgswkbtypes.h:139
QgsSymbol::clipFeaturesToExtent
bool clipFeaturesToExtent() const
Returns whether features drawn by the symbol will be clipped to the render context's extent.
Definition: qgssymbol.h:486
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
Definition: qgsvectorlayer.h:385
QgsSymbolLayerList
QList< QgsSymbolLayer * > QgsSymbolLayerList
Definition: qgssymbol.h:53
QgsFillSymbolLayer
Definition: qgssymbollayer.h:1092
QgsSymbol::setRenderHints
void setRenderHints(RenderHints hints)
Sets rendering hint flags for the symbol.
Definition: qgssymbol.h:458
QgsSymbolRenderContext::setMapUnitScale
Q_DECL_DEPRECATED void setMapUnitScale(const QgsMapUnitScale &scale)
Definition: qgssymbol.h:744
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:53
QgsFillSymbol
Definition: qgssymbol.h:1212
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:144
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
Definition: qgsfeature.h:55
QgsSymbolRenderContext::renderContext
QgsRenderContext & renderContext()
Returns a reference to the context's render context.
Definition: qgssymbol.h:708
QgsSymbol::SymbolType
SymbolType
Type of the symbol.
Definition: qgssymbol.h:85
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:189
QgsSymbolRenderContext::geometryPartNum
int geometryPartNum() const
Part number of current geometry.
Definition: qgssymbol.h:832
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:508
QgsSymbolRenderContext::mapUnitScale
Q_DECL_DEPRECATED QgsMapUnitScale mapUnitScale() const
Definition: qgssymbol.h:739
QgsSymbol::symbolLayerCount
int symbolLayerCount() const
Returns the total number of symbol layers contained in the symbol.
Definition: qgssymbol.h:183