• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

marble

  • sources
  • kde-4.14
  • kdeedu
  • marble
  • src
  • lib
  • marble
  • geodata
  • data
GeoDataLocation.cpp
Go to the documentation of this file.
1 //
2 // This file is part of the Marble Virtual Globe.
3 //
4 // This program is free software licensed under the GNU LGPL. You can
5 // find a copy of this license in LICENSE.txt in the top directory of
6 // the source code.
7 //
8 // Copyright 2013 Sanjiban Bairagya <sanjiban22393@gmail.com>
9 //
10 
11 #include "GeoDataLocation.h"
12 #include "GeoDataTypes.h"
13 #include "GeoDataCoordinates.h"
14 
15 namespace Marble {
16 
17 class GeoDataLocationPrivate
18 {
19 public:
20 
21  GeoDataCoordinates m_coordinates;
22 
23  GeoDataLocationPrivate();
24 };
25 
26 GeoDataLocationPrivate::GeoDataLocationPrivate() :
27  m_coordinates()
28 {
29  // nothing to do
30 }
31 
32 GeoDataLocation::GeoDataLocation() : d( new GeoDataLocationPrivate )
33 {
34  // nothing to do
35 }
36 
37 GeoDataLocation::GeoDataLocation( const Marble::GeoDataLocation &other ) :
38  GeoDataObject( other ), d( new GeoDataLocationPrivate( *other.d ) )
39 {
40  // nothing to do
41 }
42 
43 GeoDataLocation &GeoDataLocation::operator=( const GeoDataLocation &other )
44 {
45  GeoDataObject::operator=( other );
46  *d = *other.d;
47  return *this;
48 }
49 
50 
51 bool GeoDataLocation::operator==( const GeoDataLocation &other ) const
52 {
53  return equals(other) &&
54  d->m_coordinates == other.d->m_coordinates;
55 }
56 
57 bool GeoDataLocation::operator!=( const GeoDataLocation &other ) const
58 {
59  return !this->operator==( other );
60 }
61 
62 GeoDataLocation::~GeoDataLocation()
63 {
64  delete d;
65 }
66 
67 const char *GeoDataLocation::nodeType() const
68 {
69  return GeoDataTypes::GeoDataLocationType;
70 }
71 
72 qreal GeoDataLocation::altitude() const
73 {
74  return d->m_coordinates.altitude();
75 }
76 
77 void GeoDataLocation::setAltitude(qreal altitude)
78 {
79 
80  d->m_coordinates.setAltitude(altitude);
81 }
82 
83 qreal GeoDataLocation::latitude(GeoDataCoordinates::Unit unit) const
84 {
85  return d->m_coordinates.latitude(unit);
86 }
87 
88 void GeoDataLocation::setLatitude(qreal latitude, GeoDataCoordinates::Unit unit)
89 {
90  d->m_coordinates.setLatitude(latitude, unit);
91 }
92 
93 qreal GeoDataLocation::longitude( GeoDataCoordinates::Unit unit ) const
94 {
95  return d->m_coordinates.longitude(unit);
96 }
97 
98 void GeoDataLocation::setLongitude(qreal longitude, GeoDataCoordinates::Unit unit)
99 {
100  d->m_coordinates.setLongitude(longitude, unit);
101 }
102 
103 
104 }
Marble::GeoDataCoordinates::Unit
Unit
enum used constructor to specify the units used
Definition: GeoDataCoordinates.h:64
GeoDataCoordinates.h
Marble::GeoDataLocation::nodeType
virtual const char * nodeType() const
Provides type information for downcasting a GeoNode.
Definition: GeoDataLocation.cpp:67
Marble::GeoDataLocation::altitude
qreal altitude() const
Returns the distance to earth's surface in meters, interpreted according to altitudeMode.
Definition: GeoDataLocation.cpp:72
Marble::GeoDataLocation::~GeoDataLocation
~GeoDataLocation()
Definition: GeoDataLocation.cpp:62
Marble::GeoDataObject
A base class for all geodata objects.
Definition: GeoDataObject.h:48
Marble::GeoDataObject::equals
virtual bool equals(const GeoDataObject &other) const
Compares the value of id and targetId of the two objects.
Definition: GeoDataObject.cpp:126
Marble::GeoDataLocation::longitude
qreal longitude(GeoDataCoordinates::Unit) const
Definition: GeoDataLocation.cpp:93
Marble::GeoDataLocation::setLatitude
void setLatitude(qreal latitude, GeoDataCoordinates::Unit unit)
Definition: GeoDataLocation.cpp:88
Marble::GeoDataLocation::setAltitude
void setAltitude(qreal altitude)
Definition: GeoDataLocation.cpp:77
Marble::GeoDataLocation::d
GeoDataLocationPrivate *const d
Definition: GeoDataLocation.h:54
GeoDataLocation.h
Marble::GeoDataTypes::GeoDataLocationType
const char * GeoDataLocationType
Definition: GeoDataTypes.cpp:56
Marble::GeoDataLocation::latitude
qreal latitude(GeoDataCoordinates::Unit) const
Definition: GeoDataLocation.cpp:83
Marble::GeoDataLocation::operator=
GeoDataLocation & operator=(const GeoDataLocation &other)
Definition: GeoDataLocation.cpp:43
Marble::GeoDataLocation::operator==
bool operator==(const GeoDataLocation &other) const
Definition: GeoDataLocation.cpp:51
Marble::GeoDataLocation
Definition: GeoDataLocation.h:23
Marble::GeoDataObject::operator=
GeoDataObject & operator=(const GeoDataObject &)
Definition: GeoDataObject.cpp:54
Marble::GeoDataLocation::operator!=
bool operator!=(const GeoDataLocation &other) const
Definition: GeoDataLocation.cpp:57
GeoDataTypes.h
Marble::GeoDataLocation::GeoDataLocation
GeoDataLocation()
Definition: GeoDataLocation.cpp:32
Marble::GeoDataLocation::setLongitude
void setLongitude(qreal longitude, GeoDataCoordinates::Unit unit)
Definition: GeoDataLocation.cpp:98
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:39 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

marble

Skip menu "marble"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal