Marble

GeoDataOrientation.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2013 Sanjiban Bairagya <sanjiban22393@gmail.com>
4//
5
6#include "GeoDataOrientation.h"
7#include "GeoDataTypes.h"
8
9namespace Marble
10{
11
12class GeoDataOrientationPrivate
13{
14public:
15 double m_heading;
16
17 double m_tilt;
18
19 double m_roll;
20
21 GeoDataOrientationPrivate();
22};
23
24GeoDataOrientationPrivate::GeoDataOrientationPrivate()
25 : m_heading(0)
26 , m_tilt(0)
27 , m_roll(0)
28{
29 // nothing to do
30}
31
32GeoDataOrientation::GeoDataOrientation()
33 : d(new GeoDataOrientationPrivate)
34{
35 // nothing to do
36}
37
38GeoDataOrientation::GeoDataOrientation(const Marble::GeoDataOrientation &other)
39 : GeoDataObject(other)
40 , d(new GeoDataOrientationPrivate(*other.d))
41{
42 // nothing to do
43}
44
45GeoDataOrientation &GeoDataOrientation::operator=(const GeoDataOrientation &other)
46{
47 GeoDataObject::operator=(other);
48 *d = *other.d;
49 return *this;
50}
51
52bool GeoDataOrientation::operator==(const GeoDataOrientation &other) const
53{
54 return equals(other) && d->m_heading == other.d->m_heading && d->m_roll == other.d->m_roll && d->m_tilt == other.d->m_tilt;
55}
56
57bool GeoDataOrientation::operator!=(const GeoDataOrientation &other) const
58{
59 return !this->operator==(other);
60}
61
62GeoDataOrientation::~GeoDataOrientation()
63{
64 delete d;
65}
66
67const char *GeoDataOrientation::nodeType() const
68{
69 return GeoDataTypes::GeoDataOrientationType;
70}
71
72double GeoDataOrientation::heading() const
73{
74 return d->m_heading;
75}
76
77void GeoDataOrientation::setHeading(double heading)
78{
79 d->m_heading = heading;
80}
81
82double GeoDataOrientation::tilt() const
83{
84 return d->m_tilt;
85}
86
87void GeoDataOrientation::setTilt(double tilt)
88{
89 d->m_tilt = tilt;
90}
91
92double GeoDataOrientation::roll() const
93{
94 return d->m_roll;
95}
96
97void GeoDataOrientation::setRoll(double roll)
98{
99 d->m_roll = roll;
100}
101
102}
QAction * roll(const QObject *recvr, const char *slot, QObject *parent)
KIOCORE_EXPORT bool operator==(const UDSEntry &entry, const UDSEntry &other)
bool equals(const QVariant &lhs, const QVariant &rhs)
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:37:03 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.