/
qgslinesymbollayerv2.h
154 lines (95 loc) · 4.06 KB
/
qgslinesymbollayerv2.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
#ifndef QGSLINESYMBOLLAYERV2_H
#define QGSLINESYMBOLLAYERV2_H
#include "qgssymbollayerv2.h"
#include <QPen>
#define DEFAULT_SIMPLELINE_COLOR QColor(0,0,0)
#define DEFAULT_SIMPLELINE_WIDTH DEFAULT_LINE_WIDTH
#define DEFAULT_SIMPLELINE_PENSTYLE Qt::SolidLine
#define DEFAULT_SIMPLELINE_JOINSTYLE Qt::BevelJoin
#define DEFAULT_SIMPLELINE_CAPSTYLE Qt::SquareCap
class CORE_EXPORT QgsSimpleLineSymbolLayerV2 : public QgsLineSymbolLayerV2
{
public:
QgsSimpleLineSymbolLayerV2( QColor color = DEFAULT_SIMPLELINE_COLOR,
double width = DEFAULT_SIMPLELINE_WIDTH,
Qt::PenStyle penStyle = DEFAULT_SIMPLELINE_PENSTYLE );
// static stuff
static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsStringMap() );
// implemented from base classes
QString layerType() const;
void startRender( QgsSymbolV2RenderContext& context );
void stopRender( QgsSymbolV2RenderContext& context );
void renderPolyline( const QPolygonF& points, QgsSymbolV2RenderContext& context );
QgsStringMap properties() const;
QgsSymbolLayerV2* clone() const;
// new stuff
Qt::PenStyle penStyle() const { return mPenStyle; }
void setPenStyle( Qt::PenStyle style ) { mPenStyle = style; }
Qt::PenJoinStyle penJoinStyle() const { return mPenJoinStyle; }
void setPenJoinStyle( Qt::PenJoinStyle style ) { mPenJoinStyle = style; }
Qt::PenCapStyle penCapStyle() const { return mPenCapStyle; }
void setPenCapStyle( Qt::PenCapStyle style ) { mPenCapStyle = style; }
double offset() const { return mOffset; }
void setOffset( double offset ) { mOffset = offset; }
protected:
Qt::PenStyle mPenStyle;
Qt::PenJoinStyle mPenJoinStyle;
Qt::PenCapStyle mPenCapStyle;
QPen mPen;
double mOffset;
};
/////////
#define DEFAULT_MARKERLINE_ROTATE true
#define DEFAULT_MARKERLINE_INTERVAL 3
class CORE_EXPORT QgsMarkerLineSymbolLayerV2 : public QgsLineSymbolLayerV2
{
public:
QgsMarkerLineSymbolLayerV2( bool rotateMarker = DEFAULT_MARKERLINE_ROTATE,
double interval = DEFAULT_MARKERLINE_INTERVAL );
~QgsMarkerLineSymbolLayerV2();
// static stuff
static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsStringMap() );
// implemented from base classes
QString layerType() const;
void startRender( QgsSymbolV2RenderContext& context );
void stopRender( QgsSymbolV2RenderContext& context );
void renderPolyline( const QPolygonF& points, QgsSymbolV2RenderContext& context );
QgsStringMap properties() const;
QgsSymbolLayerV2* clone() const;
void setColor( QColor color );
QgsSymbolV2* subSymbol();
bool setSubSymbol( QgsSymbolV2* symbol );
// new stuff
bool rotateMarker() const { return mRotateMarker; }
void setRotateMarker( bool rotate ) { mRotateMarker = rotate; }
double interval() const { return mInterval; }
void setInterval( double interval ) { mInterval = interval; }
double offset() const { return mOffset; }
void setOffset( double offset ) { mOffset = offset; }
protected:
void renderPolylineNoOffset( const QPolygonF& points, QgsSymbolV2RenderContext& context );
bool mRotateMarker;
double mInterval;
QgsMarkerSymbolV2* mMarker;
double mOffset;
};
/////////
#define DEFAULT_LINEDECORATION_COLOR QColor(0,0,0)
class CORE_EXPORT QgsLineDecorationSymbolLayerV2 : public QgsLineSymbolLayerV2
{
public:
QgsLineDecorationSymbolLayerV2( QColor color = DEFAULT_LINEDECORATION_COLOR );
~QgsLineDecorationSymbolLayerV2();
// static stuff
static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsStringMap() );
// implemented from base classes
QString layerType() const;
void startRender( QgsSymbolV2RenderContext& context );
void stopRender( QgsSymbolV2RenderContext& context );
void renderPolyline( const QPolygonF& points, QgsSymbolV2RenderContext& context );
QgsStringMap properties() const;
QgsSymbolLayerV2* clone() const;
protected:
QPen mPen;
};
#endif