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
11class GeoDataLocationPrivate
12{
13public:
14
15 GeoDataCoordinates m_coordinates;
16
17 GeoDataLocationPrivate();
18};
19
20GeoDataLocationPrivate::GeoDataLocationPrivate() :
21 m_coordinates()
22{
23 // nothing to do
24}
25
26GeoDataLocation::GeoDataLocation() : d( new GeoDataLocationPrivate )
27{
28 // nothing to do
29}
30
31GeoDataLocation::GeoDataLocation( const Marble::GeoDataLocation &other ) :
32 GeoDataObject( other ), d( new GeoDataLocationPrivate( *other.d ) )
33{
34 // nothing to do
35}
36
37GeoDataLocation &GeoDataLocation::operator=( const GeoDataLocation &other )
38{
39 GeoDataObject::operator=( other );
40 *d = *other.d;
41 return *this;
42}
43
44
45bool GeoDataLocation::operator==( const GeoDataLocation &other ) const
46{
47 return equals(other) &&
48 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
74 d->m_coordinates.setAltitude(altitude);
75}
76
77qreal GeoDataLocation::latitude(GeoDataCoordinates::Unit unit) const
78{
79 return d->m_coordinates.latitude(unit);
80}
81
82void GeoDataLocation::setLatitude(qreal latitude, GeoDataCoordinates::Unit unit)
83{
84 d->m_coordinates.setLatitude(latitude, unit);
85}
86
87qreal GeoDataLocation::longitude( GeoDataCoordinates::Unit unit ) const
88{
89 return d->m_coordinates.longitude(unit);
90}
91
92void GeoDataLocation::setLongitude(qreal longitude, GeoDataCoordinates::Unit unit)
93{
94 d->m_coordinates.setLongitude(longitude, unit);
95}
96
97
98}
bool equals(const QVariant &lhs, const QVariant &rhs)
Binds a QML item to a specific geodetic location in screen coordinates.
bool operator==(const QGraphicsApiFilter &reference, const QGraphicsApiFilter &sample)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:18:17 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.