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

marble

  • sources
  • kde-4.12
  • kdeedu
  • marble
  • src
  • plugins
  • declarative
Coordinate.h
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 2011 Dennis Nienhüser <earthwings@gentoo.org>
9 //
10 
11 #ifndef MARBLE_DECLARATIVE_COORDINATE_H
12 #define MARBLE_DECLARATIVE_COORDINATE_H
13 
14 #include "GeoDataCoordinates.h"
15 #include <QObject>
16 
17 #if QT_VERSION < 0x050000
18  #include <QtDeclarative>
19 #else
20  #include <QtQml/qqml.h>
21 #endif
22 
28 class Coordinate : public QObject
29 {
30  Q_OBJECT
31 
32  Q_PROPERTY( qreal longitude READ longitude WRITE setLongitude NOTIFY longitudeChanged )
33  Q_PROPERTY( qreal latitude READ latitude WRITE setLatitude NOTIFY latitudeChanged )
34  Q_PROPERTY( qreal altitude READ altitude WRITE setAltitude NOTIFY altitudeChanged )
35 
36 public:
38  explicit Coordinate( qreal lon = 0.0, qreal lat = 0.0, qreal altitude = 0.0, QObject *parent = 0 );
39 
41  qreal longitude() const;
42 
44  void setLongitude( qreal lon );
45 
47  qreal latitude() const;
48 
50  void setLatitude( qreal lat );
51 
53  qreal altitude() const;
54 
56  void setAltitude( qreal alt );
57 
59  Marble::GeoDataCoordinates coordinates() const;
60 
62  void setCoordinates( const Marble::GeoDataCoordinates &coordinates );
63 
65  Q_INVOKABLE qreal distance( qreal longitude, qreal latitude ) const;
66 
68  Q_INVOKABLE qreal bearing( qreal longitude, qreal latitude ) const;
69 
70  bool operator == ( const Coordinate &other ) const;
71 
72  bool operator != ( const Coordinate &other ) const;
73 
74 Q_SIGNALS:
75  void longitudeChanged();
76  void latitudeChanged();
77  void altitudeChanged();
78 
79 private:
80  Marble::GeoDataCoordinates m_coordinate;
81 };
82 
83 QML_DECLARE_TYPE( Coordinate )
84 
85 #endif // MARBLE_DECLARATIVE_COORDINATE_H
GeoDataCoordinates.h
Coordinate::longitude
qreal longitude() const
Provides access to the longitude (degree) of the coordinate.
QObject
Coordinate
Represents a coordinate with the properties of a name and coordinates.
Definition: Coordinate.h:28
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:70
Coordinate::longitudeChanged
void longitudeChanged()
Coordinate::setCoordinates
void setCoordinates(const Marble::GeoDataCoordinates &coordinates)
Change all coordinates at once.
Definition: Coordinate.cpp:65
Coordinate::altitudeChanged
void altitudeChanged()
Coordinate::coordinates
Marble::GeoDataCoordinates coordinates() const
Change the altitude of the coordinate.
Definition: Coordinate.cpp:60
Coordinate::setLatitude
void setLatitude(qreal lat)
Change the latitude of the coordinate.
Definition: Coordinate.cpp:43
Coordinate::setAltitude
void setAltitude(qreal alt)
Change the altitude of the coordinate.
Definition: Coordinate.cpp:54
Coordinate::setLongitude
void setLongitude(qreal lon)
Change the longitude of the coordinate.
Definition: Coordinate.cpp:32
Coordinate::bearing
Q_INVOKABLE qreal bearing(qreal longitude, qreal latitude) const
Bearing (in degree) to the given coordinate.
Definition: Coordinate.cpp:77
Coordinate::latitude
qreal latitude() const
Provides access to the latitude (degree) of the coordinate.
Coordinate::latitudeChanged
void latitudeChanged()
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:38:49 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
  • kstars
  • libkdeedu
  •   keduvocdocument
  • 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