QGIS API Documentation 3.99.0-Master (21b3aa880ba)
Loading...
Searching...
No Matches
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
30class CORE_EXPORT QgsMarkerSymbol : public QgsSymbol
31{
32 public:
33
38 static std::unique_ptr< QgsMarkerSymbol > createSimple( const QVariantMap &properties );
39
46
53 void setAngle( double symbolAngle ) const;
54
61 double angle() const;
62
67 void setDataDefinedAngle( const QgsProperty &property );
68
76
83 void setLineAngle( double lineAngle ) const;
84
93 void setSize( double size ) const;
94
107 double size() const;
108
122 double size( const QgsRenderContext &context ) const;
123
131 void setSizeUnit( Qgis::RenderUnit unit ) const;
132
141
149 void setSizeMapUnitScale( const QgsMapUnitScale &scale ) const;
150
160
165 void setDataDefinedSize( const QgsProperty &property ) const;
166
174
181
187
200 void renderPoint( QPointF point, const QgsFeature *f, QgsRenderContext &context, int layer = -1, bool selected = false );
201
212 QRectF bounds( QPointF point, QgsRenderContext &context, const QgsFeature &feature = QgsFeature() ) const;
213
214 QgsMarkerSymbol *clone() const override SIP_FACTORY;
215
216 private:
217
218 void renderPointUsingLayer( QgsMarkerSymbolLayer *layer, QPointF point, QgsSymbolRenderContext &context );
219
220};
221
222
223#endif // QGSMARKERSYMBOL_H
ScaleMethod
Scale methods.
Definition qgis.h:624
RenderUnit
Rendering size units.
Definition qgis.h:5183
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Definition qgsfeature.h:58
Struct for storing maximum and minimum scales for measurements in map units.
Abstract base class for marker symbol layers.
void setScaleMethod(Qgis::ScaleMethod scaleMethod) const
Sets the method to use for scaling the marker's size.
void setAngle(double symbolAngle) const
Sets the angle for the whole symbol.
void setSize(double size) const
Sets the size for the whole symbol.
QgsProperty dataDefinedAngle() const
Returns data defined angle for whole symbol (including all symbol layers).
static std::unique_ptr< QgsMarkerSymbol > createSimple(const QVariantMap &properties)
Create a marker symbol with one symbol layer: SimpleMarker with specified properties.
QgsMarkerSymbol(const QgsSymbolLayerList &layers=QgsSymbolLayerList())
Constructor for QgsMarkerSymbol, with the specified list of initial symbol layers.
double size() const
Returns the estimated size for the whole symbol, which is the maximum size of all marker symbol layer...
double angle() const
Returns the marker angle for the whole symbol.
QgsMapUnitScale sizeMapUnitScale() const
Returns the size map unit scale for the whole symbol.
void setLineAngle(double lineAngle) const
Sets the line angle modification for the symbol's angle.
QgsProperty dataDefinedSize() const
Returns data defined size for whole symbol (including all symbol layers).
void setDataDefinedSize(const QgsProperty &property) const
Set data defined size for whole symbol (including all symbol layers).
void setSizeMapUnitScale(const QgsMapUnitScale &scale) const
Sets the size map unit scale for the whole symbol (including all symbol layers).
Qgis::ScaleMethod scaleMethod() const
Returns the method to use for scaling the marker's size.
void renderPoint(QPointF point, const QgsFeature *f, QgsRenderContext &context, int layer=-1, bool selected=false)
Renders the symbol at the specified point, using the given render context.
Qgis::RenderUnit sizeUnit() const
Returns the size units for the whole symbol (including all symbol layers).
void setDataDefinedAngle(const QgsProperty &property)
Set data defined angle for whole symbol (including all symbol layers).
QRectF bounds(QPointF point, QgsRenderContext &context, const QgsFeature &feature=QgsFeature()) const
Returns the approximate bounding box of the marker symbol, which includes the bounding box of all sym...
void setSizeUnit(Qgis::RenderUnit unit) const
Sets the size units for the whole symbol (including all symbol layers).
A store for object properties.
Contains information about the context of a rendering operation.
Encapsulates the context in which a symbol is being rendered.
virtual QgsSymbol * clone() const =0
Returns a deep copy of this symbol.
Q_DECL_DEPRECATED const QgsVectorLayer * layer() const
QgsSymbol(Qgis::SymbolType type, const QgsSymbolLayerList &layers)
Constructor for a QgsSymbol of the specified type.
#define SIP_TRANSFER
Definition qgis_sip.h:36
#define SIP_FACTORY
Definition qgis_sip.h:84
QList< QgsSymbolLayer * > QgsSymbolLayerList
Definition qgssymbol.h:30