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 
9 namespace Marble {
10 
11 class GeoDataOrientationPrivate
12 {
13 public:
14     double m_heading;
15 
16     double m_tilt;
17 
18     double m_roll;
19 
20     GeoDataOrientationPrivate();
21 };
22 
GeoDataOrientationPrivate()23 GeoDataOrientationPrivate::GeoDataOrientationPrivate() :
24     m_heading(0), m_tilt(0), m_roll(0)
25 {
26     // nothing to do
27 }
28 
GeoDataOrientation()29 GeoDataOrientation::GeoDataOrientation() : d( new GeoDataOrientationPrivate )
30 {
31     // nothing to do
32 }
33 
GeoDataOrientation(const Marble::GeoDataOrientation & other)34 GeoDataOrientation::GeoDataOrientation( const Marble::GeoDataOrientation &other ) :
35     GeoDataObject( other ), d( new GeoDataOrientationPrivate( *other.d ) )
36 {
37     // nothing to do
38 }
39 
operator =(const GeoDataOrientation & other)40 GeoDataOrientation &GeoDataOrientation::operator=( const GeoDataOrientation &other )
41 {
42     GeoDataObject::operator=( other );
43     *d = *other.d;
44     return *this;
45 }
46 
47 
operator ==(const GeoDataOrientation & other) const48 bool GeoDataOrientation::operator==( const GeoDataOrientation &other ) const
49 {
50     return equals(other) &&
51            d->m_heading == other.d->m_heading &&
52            d->m_roll == other.d->m_roll &&
53            d->m_tilt == other.d->m_tilt;
54 }
55 
operator !=(const GeoDataOrientation & other) const56 bool GeoDataOrientation::operator!=( const GeoDataOrientation &other ) const
57 {
58     return !this->operator==( other );
59 }
60 
~GeoDataOrientation()61 GeoDataOrientation::~GeoDataOrientation()
62 {
63     delete d;
64 }
65 
nodeType() const66 const char *GeoDataOrientation::nodeType() const
67 {
68     return GeoDataTypes::GeoDataOrientationType;
69 }
70 
heading() const71 double GeoDataOrientation::heading() const
72 {
73     return d->m_heading;
74 }
75 
setHeading(double heading)76 void GeoDataOrientation::setHeading( double heading )
77 {
78     d->m_heading = heading;
79 }
80 
tilt() const81 double GeoDataOrientation::tilt() const
82 {
83     return d->m_tilt;
84 }
85 
setTilt(double tilt)86 void GeoDataOrientation::setTilt( double tilt )
87 {
88     d->m_tilt = tilt;
89 }
90 
roll() const91 double GeoDataOrientation::roll() const
92 {
93     return d->m_roll;
94 }
95 
setRoll(double roll)96 void GeoDataOrientation::setRoll( double roll )
97 {
98     d->m_roll = roll;
99 }
100 
101 }
102