QGIS API Documentation
4.3.0-Master (9dce731a7a1)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
layout
qgslayoutnortharrowhandler.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgslayoutnortharrowhandler.h
3
-------------------
4
begin : April 2020
5
copyright : (C) 2020 by Nyall Dawson
6
email : nyall dot dawson at gmail dot com
7
***************************************************************************/
8
9
/***************************************************************************
10
* *
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
15
* *
16
***************************************************************************/
17
#ifndef QGSLAYOUTNORTHARROWHANDLER_H
18
#define QGSLAYOUTNORTHARROWHANDLER_H
19
20
#include "qgis_core.h"
21
#include "
qgis_sip.h
"
22
23
#include <QObject>
24
#include <QPointer>
25
26
class
QgsLayoutItemMap
;
27
33
class
CORE_EXPORT
QgsLayoutNorthArrowHandler
:
public
QObject
34
{
35
Q_OBJECT
36
public
:
38
enum
NorthMode
39
{
40
GridNorth
= 0,
41
TrueNorth
,
42
};
43
47
QgsLayoutNorthArrowHandler
( QObject *parent
SIP_TRANSFERTHIS
);
48
52
double
arrowRotation
()
const
{
return
mArrowRotation; }
53
59
void
setLinkedMap(
QgsLayoutItemMap
*map );
60
67
QgsLayoutItemMap
*linkedMap()
const
;
68
74
NorthMode
northMode
()
const
{
return
mNorthMode; }
75
81
void
setNorthMode( NorthMode mode );
82
88
double
northOffset
()
const
{
return
mNorthOffset; }
89
95
void
setNorthOffset(
double
offset );
96
97
signals:
99
void
arrowRotationChanged
(
double
newRotation );
100
101
private
:
103
double
mArrowRotation = 0;
104
105
QString mRotationMapUuid;
107
QPointer< QgsLayoutItemMap > mRotationMap;
108
110
NorthMode
mNorthMode =
GridNorth
;
112
double
mNorthOffset = 0.0;
113
114
void
disconnectMap(
QgsLayoutItemMap
*map );
115
116
private
slots:
117
118
void
updateMapRotation();
119
};
120
121
#endif
// QGSLAYOUTNORTHARROWHANDLER_H
QgsLayoutItemMap
Layout graphical items for displaying a map.
Definition
qgslayoutitemmap.h:331
QgsLayoutNorthArrowHandler
An object which handles north-arrow type behavior for layout items.
Definition
qgslayoutnortharrowhandler.h:34
QgsLayoutNorthArrowHandler::northMode
NorthMode northMode() const
Returns the mode used to calculate the arrow rotation.
Definition
qgslayoutnortharrowhandler.h:74
QgsLayoutNorthArrowHandler::arrowRotation
double arrowRotation() const
Returns the rotation to be used for the arrow, in degrees clockwise.
Definition
qgslayoutnortharrowhandler.h:52
QgsLayoutNorthArrowHandler::arrowRotationChanged
void arrowRotationChanged(double newRotation)
Emitted on arrow rotation change.
QgsLayoutNorthArrowHandler::NorthMode
NorthMode
Method for syncing rotation to a map's North direction.
Definition
qgslayoutnortharrowhandler.h:39
QgsLayoutNorthArrowHandler::GridNorth
@ GridNorth
Align to grid north.
Definition
qgslayoutnortharrowhandler.h:40
QgsLayoutNorthArrowHandler::TrueNorth
@ TrueNorth
Align to true north.
Definition
qgslayoutnortharrowhandler.h:41
QgsLayoutNorthArrowHandler::QgsLayoutNorthArrowHandler
QgsLayoutNorthArrowHandler(QObject *parent)
Constructor for QgsLayoutNorthArrowHandler, with the specified parent object.
Definition
qgslayoutnortharrowhandler.cpp:31
QgsLayoutNorthArrowHandler::northOffset
double northOffset() const
Returns the offset added to the arrows's rotation from a map's North.
Definition
qgslayoutnortharrowhandler.h:88
qgis_sip.h
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:52
Generated on
for QGIS API Documentation by
1.17.0