Marble

GeoDataLocation.cpp
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2013 Sanjiban Bairagya <[email protected]>
4 //
5 
6 #include "GeoDataLocation.h"
7 #include "GeoDataTypes.h"
8 
9 namespace Marble {
10 
11 class GeoDataLocationPrivate
12 {
13 public:
14 
15  GeoDataCoordinates m_coordinates;
16 
17  GeoDataLocationPrivate();
18 };
19 
20 GeoDataLocationPrivate::GeoDataLocationPrivate() :
21  m_coordinates()
22 {
23  // nothing to do
24 }
25 
26 GeoDataLocation::GeoDataLocation() : d( new GeoDataLocationPrivate )
27 {
28  // nothing to do
29 }
30 
31 GeoDataLocation::GeoDataLocation( const Marble::GeoDataLocation &other ) :
32  GeoDataObject( other ), d( new GeoDataLocationPrivate( *other.d ) )
33 {
34  // nothing to do
35 }
36 
37 GeoDataLocation &GeoDataLocation::operator=( const GeoDataLocation &other )
38 {
39  GeoDataObject::operator=( other );
40  *d = *other.d;
41  return *this;
42 }
43 
44 
45 bool GeoDataLocation::operator==( const GeoDataLocation &other ) const
46 {
47  return equals(other) &&
48  d->m_coordinates == other.d->m_coordinates;
49 }
50 
51 bool GeoDataLocation::operator!=( const GeoDataLocation &other ) const
52 {
53  return !this->operator==( other );
54 }
55 
56 GeoDataLocation::~GeoDataLocation()
57 {
58  delete d;
59 }
60 
61 const char *GeoDataLocation::nodeType() const
62 {
63  return GeoDataTypes::GeoDataLocationType;
64 }
65 
66 qreal GeoDataLocation::altitude() const
67 {
68  return d->m_coordinates.altitude();
69 }
70 
71 void GeoDataLocation::setAltitude(qreal altitude)
72 {
73 
74  d->m_coordinates.setAltitude(altitude);
75 }
76 
77 qreal GeoDataLocation::latitude(GeoDataCoordinates::Unit unit) const
78 {
79  return d->m_coordinates.latitude(unit);
80 }
81 
82 void GeoDataLocation::setLatitude(qreal latitude, GeoDataCoordinates::Unit unit)
83 {
84  d->m_coordinates.setLatitude(latitude, unit);
85 }
86 
87 qreal GeoDataLocation::longitude( GeoDataCoordinates::Unit unit ) const
88 {
89  return d->m_coordinates.longitude(unit);
90 }
91 
92 void GeoDataLocation::setLongitude(qreal longitude, GeoDataCoordinates::Unit unit)
93 {
94  d->m_coordinates.setLongitude(longitude, unit);
95 }
96 
97 
98 }
bool operator==(const Qt3DRender::QGraphicsApiFilter &reference, const Qt3DRender::QGraphicsApiFilter &sample)
Binds a QML item to a specific geodetic location in screen coordinates.
Unit
enum used constructor to specify the units used
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Oct 2 2023 03:52:08 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.