1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2013 Mayank Madan <maddiemadan@gmail.com>
4 // SPDX-FileCopyrightText: Sanjiban Bairagya <sanjiban22393@gmail.com>
5 //
6 
7 #include "GeoDataScale.h"
8 #include "GeoDataTypes.h"
9 
10 namespace Marble {
11 
12 class GeoDataScalePrivate
13 {
14 public:
15     double m_x;
16 
17     double m_y;
18 
19     double m_z;
20 
21     GeoDataScalePrivate();
22 };
23 
GeoDataScalePrivate()24 GeoDataScalePrivate::GeoDataScalePrivate() :
25     m_x(1), m_y(1), m_z(1)
26 {
27     // nothing to do
28 }
29 
GeoDataScale()30 GeoDataScale::GeoDataScale() : d( new GeoDataScalePrivate )
31 {
32     // nothing to do
33 }
34 
GeoDataScale(const Marble::GeoDataScale & other)35 GeoDataScale::GeoDataScale( const Marble::GeoDataScale &other ) :
36     GeoDataObject( other ), d( new GeoDataScalePrivate( *other.d ) )
37 {
38     // nothing to do
39 }
40 
operator =(const GeoDataScale & other)41 GeoDataScale &GeoDataScale::operator=( const GeoDataScale &other )
42 {
43     GeoDataObject::operator=( other );
44     *d = *other.d;
45     return *this;
46 }
47 
48 
operator ==(const GeoDataScale & other) const49 bool GeoDataScale::operator==( const GeoDataScale &other ) const
50 {
51     return equals(other) &&
52            d->m_x == other.d->m_x &&
53            d->m_y == other.d->m_y &&
54            d->m_z == other.d->m_z;
55 }
56 
operator !=(const GeoDataScale & other) const57 bool GeoDataScale::operator!=( const GeoDataScale &other ) const
58 {
59     return !this->operator==( other );
60 }
61 
~GeoDataScale()62 GeoDataScale::~GeoDataScale()
63 {
64     delete d;
65 }
66 
nodeType() const67 const char *GeoDataScale::nodeType() const
68 {
69     return GeoDataTypes::GeoDataScaleType;
70 }
71 
x() const72 double GeoDataScale::x() const
73 {
74     return d->m_x;
75 }
76 
setX(double x)77 void GeoDataScale::setX( double x )
78 {
79     d->m_x = x;
80 }
81 
y() const82 double GeoDataScale::y() const
83 {
84     return d->m_y;
85 }
86 
setY(double y)87 void GeoDataScale::setY( double y )
88 {
89     d->m_y = y;
90 }
91 
z() const92 double GeoDataScale::z() const
93 {
94     return d->m_z;
95 }
96 
setZ(double z)97 void GeoDataScale::setZ( double z )
98 {
99     d->m_z = z;
100 }
101 
102 }
103