• 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
  • lib
  • marble
  • geodata
  • data
GeoDataCoordinates.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 2006-2007 Torsten Rahn <tackat@kde.org>
9 // Copyright 2007-2008 Inge Wallin <ingwa@kde.org>
10 // Copyright 2008 Patrick Spendrin <ps_ml@gmx.de>
11 //
12 
13 
14 #ifndef MARBLE_GEODATACOORDINATES_H
15 #define MARBLE_GEODATACOORDINATES_H
16 
17 #include <QCoreApplication>
18 #include <QMetaType>
19 #include <QVector>
20 #include <QString>
21 
22 #include <cmath>
23 
24 /* M_PI is a #define that may or may not be handled in <cmath> */
25 #ifndef M_PI
26 #define M_PI 3.14159265358979323846264338327950288419717
27 #endif
28 
29 #include "geodata_export.h"
30 #include "MarbleGlobal.h"
31 
32 namespace Marble
33 {
34 
35 const qreal TWOPI = 2 * M_PI;
36 
37 class GeoDataCoordinatesPrivate;
38 class Quaternion;
39 
52 class GEODATA_EXPORT GeoDataCoordinates
53 {
54  Q_DECLARE_TR_FUNCTIONS(GeoDataCoordinates)
55 
56  public:
64  enum Unit{
65  Radian,
66  Degree
67  };
68 
79  enum Notation{
80  Decimal,
81  DMS,
82  DM,
83  UTM,
84  Astro
85  };
86 
96  enum BearingType {
97  InitialBearing,
98  FinalBearing
99  };
100 
101  // Type definitions
102  typedef QVector<GeoDataCoordinates> Vector;
103  typedef QVector<GeoDataCoordinates*> PtrVector;
104 
105  GeoDataCoordinates( const GeoDataCoordinates& other );
106 
113  GeoDataCoordinates();
114 
124  GeoDataCoordinates( qreal lon, qreal lat, qreal alt = 0,
125  GeoDataCoordinates::Unit unit = GeoDataCoordinates::Radian,
126  int detail = 0 );
127 
128  virtual ~GeoDataCoordinates();
129 
137  bool isValid() const;
138 
147  void set( qreal lon, qreal lat, qreal alt = 0,
148  GeoDataCoordinates::Unit unit = GeoDataCoordinates::Radian );
149 
158  void geoCoordinates( qreal& lon, qreal& lat,
159  GeoDataCoordinates::Unit unit = GeoDataCoordinates::Radian )
160  const;
161 
171  void geoCoordinates( qreal& lon, qreal& lat, qreal& alt,
172  GeoDataCoordinates::Unit unit = GeoDataCoordinates::Radian )
173  const;
174 
181  void setLongitude( qreal lon,
182  GeoDataCoordinates::Unit unit = GeoDataCoordinates::Radian );
183 
191  qreal longitude( GeoDataCoordinates::Unit unit = GeoDataCoordinates::Radian )
192  const;
193 
201  qreal latitude( GeoDataCoordinates::Unit unit = GeoDataCoordinates::Radian )
202  const;
203 
210  void setLatitude( qreal lat,
211  GeoDataCoordinates::Unit unit = GeoDataCoordinates::Radian );
212 
216  qreal altitude() const;
221  void setAltitude( const qreal altitude );
222 
227  int detail() const;
228 
233  void setDetail( const int det );
234 
243  qreal bearing( const GeoDataCoordinates &other, Unit unit = Radian, BearingType type = InitialBearing ) const;
244 
248  const Quaternion &quaternion() const;
249 
255  bool isPole( Pole = AnyPole ) const;
256 
260  static GeoDataCoordinates::Notation defaultNotation();
261 
266  static void setDefaultNotation( GeoDataCoordinates::Notation notation );
267 
272  static qreal normalizeLon( qreal lon,
273  GeoDataCoordinates::Unit = GeoDataCoordinates::Radian );
274 
279  static qreal normalizeLat( qreal lat,
280  GeoDataCoordinates::Unit = GeoDataCoordinates::Radian );
281 
295  static void normalizeLonLat( qreal &lon, qreal &lat,
296  GeoDataCoordinates::Unit = GeoDataCoordinates::Radian );
297 
303  static GeoDataCoordinates fromString( const QString &string, bool& successful );
304 
309  QString toString() const;
310 
323  QString toString( GeoDataCoordinates::Notation notation, int precision = -1 ) const;
324 
325  static QString lonToString( qreal lon, GeoDataCoordinates::Notation notation,
326  GeoDataCoordinates::Unit unit = Radian,
327  int precision = -1,
328  char format = 'f' );
333  QString lonToString() const;
334 
335  static QString latToString( qreal lat, GeoDataCoordinates::Notation notation,
336  GeoDataCoordinates::Unit unit = Radian,
337  int precision = -1,
338  char format = 'f' );
343  QString latToString() const;
344 
345  virtual bool operator==( const GeoDataCoordinates& ) const;
346  virtual bool operator !=( const GeoDataCoordinates& ) const;
347  GeoDataCoordinates& operator=( const GeoDataCoordinates &other );
348 
350  virtual void pack( QDataStream& stream ) const;
352  virtual void unpack( QDataStream& stream );
353 
354  virtual void detach();
355  protected:
356  GeoDataCoordinatesPrivate* d;
357 
358  private:
359  static GeoDataCoordinates::Notation s_notation;
360  static const GeoDataCoordinates null;
361 };
362 
363 }
364 
365 Q_DECLARE_METATYPE( Marble::GeoDataCoordinates )
366 
367 #endif
Marble::GeoDataCoordinates::Unit
Unit
enum used constructor to specify the units used
Definition: GeoDataCoordinates.h:64
Marble::GeoDataCoordinates::Vector
QVector< GeoDataCoordinates > Vector
Definition: GeoDataCoordinates.h:102
Marble::AnyPole
Any pole.
Definition: MarbleGlobal.h:152
Marble::GeoDataCoordinates
A 3d point representation.
Definition: GeoDataCoordinates.h:52
Marble::GeoDataCoordinates::UTM
Definition: GeoDataCoordinates.h:83
Marble::GeoDataCoordinates::Radian
Definition: GeoDataCoordinates.h:65
Marble::GeoDataCoordinates::d
GeoDataCoordinatesPrivate * d
Definition: GeoDataCoordinates.h:356
Marble::GeoDataCoordinatesPrivate
Definition: GeoDataCoordinates_p.h:20
Marble::GeoDataCoordinates::Decimal
"Decimal" notation (base-10)
Definition: GeoDataCoordinates.h:80
Marble::operator==
bool operator==(const DownloadPolicyKey &lhs, const DownloadPolicyKey &rhs)
Definition: DownloadPolicy.h:49
Marble::GeoDataCoordinates::InitialBearing
Definition: GeoDataCoordinates.h:97
Marble::GeoDataCoordinates::BearingType
BearingType
The BearingType enum specifies where to measure the bearing along great circle arcs.
Definition: GeoDataCoordinates.h:96
Marble::operator!=
bool operator!=(GeoDataLatLonBox const &lhs, GeoDataLatLonBox const &rhs)
Definition: GeoDataLatLonBox.cpp:59
MarbleGlobal.h
Marble::TWOPI
const qreal TWOPI
Definition: GeoDataCoordinates.h:35
Marble::GeoDataCoordinates::Notation
Notation
enum used to specify the notation / numerical system
Definition: GeoDataCoordinates.h:79
Marble::GeoDataCoordinates::PtrVector
QVector< GeoDataCoordinates * > PtrVector
Definition: GeoDataCoordinates.h:103
Marble::Quaternion
Definition: Quaternion.h:43
M_PI
#define M_PI
Definition: GeoDataCoordinates.h:26
GEODATA_EXPORT
#define GEODATA_EXPORT
Definition: geodata_export.h:22
geodata_export.h
Marble::Pole
Pole
Definition: MarbleGlobal.h:151
Marble::GeoDataCoordinates::DMS
"Sexagesimal DMS" notation (base-60)
Definition: GeoDataCoordinates.h:81
Marble::GeoDataCoordinates::DM
"Sexagesimal DM" notation (base-60)
Definition: GeoDataCoordinates.h:82
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