Marble

GeoDataLocation.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2013 Sanjiban Bairagya <sanjiban22393@gmail.com>
4//
5
6#include "GeoDataLocation.h"
7#include "GeoDataTypes.h"
8
9namespace Marble
10{
11
12class GeoDataLocationPrivate
13{
14public:
15 GeoDataCoordinates m_coordinates;
16
17 GeoDataLocationPrivate();
18};
19
20GeoDataLocationPrivate::GeoDataLocationPrivate()
21 : m_coordinates()
22{
23 // nothing to do
24}
25
26GeoDataLocation::GeoDataLocation()
27 : d(new GeoDataLocationPrivate)
28{
29 // nothing to do
30}
31
32GeoDataLocation::GeoDataLocation(const Marble::GeoDataLocation &other)
33 : GeoDataObject(other)
34 , d(new GeoDataLocationPrivate(*other.d))
35{
36 // nothing to do
37}
38
39GeoDataLocation &GeoDataLocation::operator=(const GeoDataLocation &other)
40{
41 GeoDataObject::operator=(other);
42 *d = *other.d;
43 return *this;
44}
45
46bool GeoDataLocation::operator==(const GeoDataLocation &other) const
47{
48 return equals(other) && d->m_coordinates == other.d->m_coordinates;
49}
50
51bool GeoDataLocation::operator!=(const GeoDataLocation &other) const
52{
53 return !this->operator==(other);
54}
55
56GeoDataLocation::~GeoDataLocation()
57{
58 delete d;
59}
60
61const char *GeoDataLocation::nodeType() const
62{
63 return GeoDataTypes::GeoDataLocationType;
64}
65
66qreal GeoDataLocation::altitude() const
67{
68 return d->m_coordinates.altitude();
69}
70
71void GeoDataLocation::setAltitude(qreal altitude)
72{
73 d->m_coordinates.setAltitude(altitude);
74}
75
76qreal GeoDataLocation::latitude(GeoDataCoordinates::Unit unit) const
77{
78 return d->m_coordinates.latitude(unit);
79}
80
81void GeoDataLocation::setLatitude(qreal latitude, GeoDataCoordinates::Unit unit)
82{
83 d->m_coordinates.setLatitude(latitude, unit);
84}
85
86qreal GeoDataLocation::longitude(GeoDataCoordinates::Unit unit) const
87{
88 return d->m_coordinates.longitude(unit);
89}
90
91void GeoDataLocation::setLongitude(qreal longitude, GeoDataCoordinates::Unit unit)
92{
93 d->m_coordinates.setLongitude(longitude, unit);
94}
95
96}
bool equals(const QVariant &lhs, const QVariant &rhs)
bool operator==(const StyleDelim &l, const StyleDelim &r)
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 Sat Dec 21 2024 17:04:14 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.