QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
qgslinesymbol.h
Go to the documentation of this file.
1/***************************************************************************
2 qgslinesymbol.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 QGSLINESYMBOL_H
17#define QGSLINESYMBOL_H
18
19#include "qgis.h"
20#include "qgis_core.h"
21#include "qgssymbol.h"
22
29class CORE_EXPORT QgsLineSymbol : public QgsSymbol
30{
31 public:
32
37 static std::unique_ptr< QgsLineSymbol > createSimple( const QVariantMap &properties );
38
45
52 void setWidth( double width ) const;
53
59 void setWidthUnit( Qgis::RenderUnit unit ) const;
60
71 double width() const;
72
84 double width( const QgsRenderContext &context ) const;
85
90 void setDataDefinedWidth( const QgsProperty &property ) const;
91
99
112 void renderPolyline( const QPolygonF &points, const QgsFeature *f, QgsRenderContext &context, int layer = -1, bool selected = false );
113
114 QgsLineSymbol *clone() const override SIP_FACTORY;
115
116 private:
117
118 void renderPolylineUsingLayer( QgsLineSymbolLayer *layer, const QPolygonF &points, QgsSymbolRenderContext &context );
119
120};
121
122
123#endif // QGSLINESYMBOL_H
124
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
Abstract base class for line symbol layers.
void setWidthUnit(Qgis::RenderUnit unit) const
Sets the width units for the whole symbol (including all symbol layers).
void setDataDefinedWidth(const QgsProperty &property) const
Set data defined width for whole symbol (including all symbol layers).
void setWidth(double width) const
Sets the width for the whole line symbol.
void renderPolyline(const QPolygonF &points, const QgsFeature *f, QgsRenderContext &context, int layer=-1, bool selected=false)
Renders the symbol along the line joining points, using the given render context.
static std::unique_ptr< QgsLineSymbol > createSimple(const QVariantMap &properties)
Create a line symbol with one symbol layer: SimpleLine with specified properties.
double width() const
Returns the estimated width for the whole symbol, which is the maximum width of all marker symbol lay...
QgsLineSymbol(const QgsSymbolLayerList &layers=QgsSymbolLayerList())
Constructor for QgsLineSymbol, with the specified list of initial symbol layers.
QgsProperty dataDefinedWidth() const
Returns data defined width for 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