-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqgsdecorationnortharrow.h
75 lines (58 loc) · 2.33 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
/***************************************************************************
plugin.h
Functions:
-------------------
begin : Jan 21, 2004
copyright : (C) 2004 by Tim Sutton
email : [email protected]
***************************************************************************/
/***************************************************************************
* *
* 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
QgsDecorationNorthArrow( QObject *parent = nullptr );
virtual ~QgsDecorationNorthArrow();
public slots:
//! set 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( QPainter * ) override;
//! try to calculate the direction for the north arrow. Sets the
//! private class rotation variable. If unable to calculate the
//! direction, the function returns false and leaves the rotation
//! variable as is.
bool calculateNorthDirection();
private:
// static const double DEG2RAD;
static const double TOL;
// The amount of rotation for the north arrow
int mRotationInt;
//! enable or disable the automatic setting of the arrow direction
bool mAutomatic;
//! margin values
int mMarginHorizontal;
int mMarginVertical;
friend class QgsDecorationNorthArrowDialog;
};
#endif