• Skip to content
  • Skip to link menu
Brand

API Documentation

  1. KDE API Reference
  2. Marble
  • KDE Home
  • Contact Us

Quick Links

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

Class Picker

About

Marble framework, a library for maps, virtual globes and world atlases

Maintainers
Torsten Rahn,
Dennis Nienhüser
Supported platforms
Android, Linux, MacOSX, Windows
Community
IRC: #marble on Freenode
Mailing list: marble-devel
Use with CMake
find_package(Marble)
target_link_libraries(yourapp Marble)
Use with QMake
QT += Marble 
Clone
git clone git://anongit.kde.org/marble.git
Browse source
Marble on cgit.kde.org

Marble

  • kde
  • kdeedu
  • marble
  • src
  • lib
  • marble
  • declarative
Coordinate.h
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 2011 Dennis Nienhüser <[email protected]>
9 //
10 
11 #ifndef MARBLE_DECLARATIVE_COORDINATE_H
12 #define MARBLE_DECLARATIVE_COORDINATE_H
13 
14 #include "GeoDataCoordinates.h"
15 #include <QObject>
16 #include <QtQml>
17 
23 class Coordinate : public QObject
24 {
25  Q_OBJECT
26 
27  Q_PROPERTY( qreal longitude READ longitude WRITE setLongitude NOTIFY longitudeChanged )
28  Q_PROPERTY( qreal latitude READ latitude WRITE setLatitude NOTIFY latitudeChanged )
29  Q_PROPERTY( qreal altitude READ altitude WRITE setAltitude NOTIFY altitudeChanged )
30 
31 public:
33  explicit Coordinate( qreal lon = 0.0, qreal lat = 0.0, qreal altitude = 0.0, QObject *parent = nullptr );
34  explicit Coordinate( const Marble::GeoDataCoordinates & coordinates );
35 
37  qreal longitude() const;
38 
40  void setLongitude( qreal lon );
41 
43  qreal latitude() const;
44 
46  void setLatitude( qreal lat );
47 
49  qreal altitude() const;
50 
52  void setAltitude( qreal alt );
53 
55  Marble::GeoDataCoordinates coordinates() const;
56 
58  void setCoordinates( const Marble::GeoDataCoordinates &coordinates );
59 
61  Q_INVOKABLE qreal distance( qreal longitude, qreal latitude ) const;
62 
64  Q_INVOKABLE qreal bearing( qreal longitude, qreal latitude ) const;
65 
66  bool operator == ( const Coordinate &other ) const;
67 
68  bool operator != ( const Coordinate &other ) const;
69 
70 Q_SIGNALS:
71  void longitudeChanged();
72  void latitudeChanged();
73  void altitudeChanged();
74 
75 private:
76  Marble::GeoDataCoordinates m_coordinate;
77 };
78 
79 QML_DECLARE_TYPE( Coordinate )
80 
81 #endif // MARBLE_DECLARATIVE_COORDINATE_H
Marble::GeoDataCoordinates
A 3d point representation.
Definition: GeoDataCoordinates.h:45
Coordinate::Coordinate
Coordinate(qreal lon=0.0, qreal lat=0.0, qreal altitude=0.0, QObject *parent=nullptr)
Constructor.
Definition: Coordinate.cpp:19
Coordinate::longitude
qreal longitude() const
Provides access to the longitude (degree) of the coordinate.
Coordinate
Represents a coordinate with the properties of a name and coordinates.
Definition: Coordinate.h:23
Coordinate::altitude
qreal altitude() const
Provides access to the altitude (meters) of the coordinate.
Coordinate::distance
Q_INVOKABLE qreal distance(qreal longitude, qreal latitude) const
Distance (in meter) to the given coordinate.
Definition: Coordinate.cpp:75
QObject
Coordinate::setCoordinates
void setCoordinates(const Marble::GeoDataCoordinates &coordinates)
Change all coordinates at once.
Definition: Coordinate.cpp:70
Coordinate::coordinates
Marble::GeoDataCoordinates coordinates() const
Change the altitude of the coordinate.
Definition: Coordinate.cpp:65
Coordinate::setLatitude
void setLatitude(qreal lat)
Change the latitude of the coordinate.
Definition: Coordinate.cpp:48
Coordinate::setAltitude
void setAltitude(qreal alt)
Change the altitude of the coordinate.
Definition: Coordinate.cpp:59
Coordinate::setLongitude
void setLongitude(qreal lon)
Change the longitude of the coordinate.
Definition: Coordinate.cpp:37
QObject::parent
QObject * parent() const
Coordinate::bearing
Q_INVOKABLE qreal bearing(qreal longitude, qreal latitude) const
Bearing (in degree) to the given coordinate.
Definition: Coordinate.cpp:82
Coordinate::latitude
qreal latitude() const
Provides access to the latitude (degree) of the coordinate.
This file is part of the KDE documentation.
Documentation copyright © 1996-2019 The KDE developers.
Generated on Mon Dec 9 2019 02:05:44 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

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