QGIS API Documentation  3.21.0-Master (5b68dc587e)
qgsmarkersymbol.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsmarkersymbol.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 QGSMARKERSYMBOL_H
17 #define QGSMARKERSYMBOL_H
18 
19 #include "qgis_core.h"
20 #include "qgssymbol.h"
21 
23 
30 class CORE_EXPORT QgsMarkerSymbol : public QgsSymbol
31 {
32  public:
33 
38  static QgsMarkerSymbol *createSimple( const QVariantMap &properties ) SIP_FACTORY;
39 
46 
53  void setAngle( double symbolAngle );
54 
62  double angle() const;
63 
69  void setDataDefinedAngle( const QgsProperty &property );
70 
78  QgsProperty dataDefinedAngle() const;
79 
87  void setLineAngle( double lineAngle );
88 
97  void setSize( double size );
98 
111  double size() const;
112 
126  double size( const QgsRenderContext &context ) const;
127 
136  void setSizeUnit( QgsUnitTypes::RenderUnit unit );
137 
146  QgsUnitTypes::RenderUnit sizeUnit() const;
147 
156  void setSizeMapUnitScale( const QgsMapUnitScale &scale );
157 
167  QgsMapUnitScale sizeMapUnitScale() const;
168 
174  void setDataDefinedSize( const QgsProperty &property );
175 
183  QgsProperty dataDefinedSize() const;
184 
190  void setScaleMethod( Qgis::ScaleMethod scaleMethod );
191 
196  Qgis::ScaleMethod scaleMethod();
197 
210  void renderPoint( QPointF point, const QgsFeature *f, QgsRenderContext &context, int layer = -1, bool selected = false );
211 
223  QRectF bounds( QPointF point, QgsRenderContext &context, const QgsFeature &feature = QgsFeature() ) const;
224 
225  QgsMarkerSymbol *clone() const override SIP_FACTORY;
226 
227  private:
228 
229  void renderPointUsingLayer( QgsMarkerSymbolLayer *layer, QPointF point, QgsSymbolRenderContext &context );
230 
231 };
232 
233 
234 #endif // QGSMARKERSYMBOL_H
235 
ScaleMethod
Scale methods.
Definition: qgis.h:183
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Definition: qgsfeature.h:56
Struct for storing maximum and minimum scales for measurements in map units.
Abstract base class for marker symbol layers.
A marker symbol type, for rendering Point and MultiPoint geometries.
A store for object properties.
Definition: qgsproperty.h:232
Contains information about the context of a rendering operation.
Abstract base class for all rendered symbols.
Definition: qgssymbol.h:38
virtual QgsSymbol * clone() const =0
Returns a deep copy of this symbol.
RenderUnit
Rendering size units.
Definition: qgsunittypes.h:168
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
#define SIP_TRANSFER
Definition: qgis_sip.h:36
#define SIP_FACTORY
Definition: qgis_sip.h:76
QList< QgsSymbolLayer * > QgsSymbolLayerList
Definition: qgssymbol.h:27