-
-
Notifications
You must be signed in to change notification settings - Fork 3k
/
qgsdecorationnortharrow.h
82 lines (64 loc) · 2.48 KB
/
qgsdecorationnortharrow.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
/***************************************************************************
plugin.h
Functions:
-------------------
begin : Jan 21, 2004
copyright : (C) 2004 by Tim Sutton
email : tim@linfiniti.com
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSNORTHARROWPLUGIN
#define QGSNORTHARROWPLUGIN
#include "qgsdecorationitem.h"
#include <QStringList>
#include "qgis_app.h"
class QAction;
class QToolBar;
class QPainter;
class APP_EXPORT QgsDecorationNorthArrow: public QgsDecorationItem
{
Q_OBJECT
public:
/**
* Constructor for QgsDecorationNorthArrow, with the specified \a parent object.
*/
QgsDecorationNorthArrow( QObject *parent = nullptr );
public slots:
//! Sets values on the gui when a project is read or the gui first loaded
void projectRead() override;
//! Save values to the project
void saveToProject() override;
//! Show the dialog box
void run() override;
//! Draw some arbitrary text to the screen
void render( const QgsMapSettings &mapSettings, QgsRenderContext &context ) override;
//! Returns the north arrow SVG path
QString svgPath();
private:
// static const double DEG2RAD;
static const double TOL;
//! The north arrow fill color
QColor mColor;
//! The north arrow outline color
QColor mOutlineColor;
//! The north arrow size in millimeter
double mSize = 16.0;
//! Custom north arrow svg path
QString mSvgPath;
// The amount of rotation for the north arrow
int mRotationInt = 0;
//! enable or disable the automatic setting of the arrow direction
bool mAutomatic = true;
//! margin values
int mMarginHorizontal = 0;
int mMarginVertical = 0;
friend class QgsDecorationNorthArrowDialog;
};
#endif