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

kstars

  • sources
  • kde-4.12
  • kdeedu
  • kstars
  • kstars
geolocation.h
Go to the documentation of this file.
1 /***************************************************************************
2  geolocation.h - K Desktop Planetarium
3  -------------------
4  begin : Sun Feb 11 2001
5  copyright : (C) 2001-2005 by Jason Harris
6  email : jharris@30doradus.org
7  copyright : (C) 2003-2005 by Pablo de Vicente
8  email : p.devicente@wanadoo.es
9  ***************************************************************************/
10 
11 /***************************************************************************
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * *
18  ***************************************************************************/
19 
20 #ifndef GEOLOCATION_H_
21 #define GEOLOCATION_H_
22 
23 #include <klocale.h>
24 
25 #include "dms.h"
26 #include "timezonerule.h"
27 #include "kstarsdatetime.h"
28 
39 class GeoLocation {
40 public:
52  GeoLocation(dms lng, dms lat,
53  const QString &name="Nowhere",
54  const QString &province="Nowhere",
55  const QString &country="Nowhere",
56  double TZ=0, TimeZoneRule *TZrule=NULL, int iEllips=4, double hght=-10 );
57 
69  GeoLocation(double x, double y, double z,
70  const QString &name="Nowhere",
71  const QString &province="Nowhere",
72  const QString &country="Nowhere",
73  double TZ=0, TimeZoneRule *TZrule=NULL, int iEllips=4 );
74 
76  const dms* lng() const { return &Longitude; }
77 
79  const dms* lat() const { return &Latitude; }
80 
82  double height() const { return Height; }
83 
85  double xPos() const { return PosCartX; }
86 
88  double yPos() const { return PosCartY; }
89 
91  double zPos() const { return PosCartZ; }
92 
94  int ellipsoid() const { return indexEllipsoid; }
95 
97  QString name() const { return Name; }
98 
100  QString translatedName() const;
101 
103  QString province() const { return Province; }
104 
106  QString translatedProvince() const;
107 
109  QString country() const { return Country; }
110 
112  QString translatedCountry() const;
113 
115  QString fullName() const;
116 
118  double TZ0() const { return TimeZone; }
119 
121  double TZ() const { if( TZrule ) return TimeZone + TZrule->deltaTZ(); return TimeZone; }
122 
124  TimeZoneRule* tzrule() { return TZrule; }
125 
128  void setLong( dms l ) {
129  Longitude = l;
130  geodToCart();
131  }
132 
136  void setLat( dms l ) {
137  Latitude = l;
138  geodToCart();
139  }
140 
144  void setHeight( double hg ) {
145  Height = hg;
146  geodToCart();
147  }
148 
152  void setXPos( double x ) {
153  PosCartX = x;
154  cartToGeod();
155  }
159  void setYPos( double y ) {
160  PosCartY = y;
161  cartToGeod();
162  }
166  void setZPos( double z ) {
167  PosCartZ = z;
168  cartToGeod();
169  }
170 
175  void changeEllipsoid( int i );
176 
180  void setName( const QString &n ) { Name = n; }
181 
185  void setProvince( const QString &n ) { Province = n; }
186 
190  void setCountry( const QString &n ) { Country = n; }
191 
204  void cartToGeod();
205 
218  void geodToCart();
219 
228  void setEllipsoid( int i );
229 
230  dms GSTtoLST( const dms &gst ) const { return dms( gst.Degrees() + Longitude.Degrees() ); }
231  dms LSTtoGST( const dms &lst ) const { return dms( lst.Degrees() - Longitude.Degrees() ); }
232 
233  KStarsDateTime UTtoLT( const KStarsDateTime &ut ) const { return ut.addSecs( int( 3600.*TZ() ) ); }
234  KStarsDateTime LTtoUT( const KStarsDateTime &lt ) const { return lt.addSecs( int( -3600.*TZ() ) ); }
235 
236 
246  void TopocentricVelocity(double vtopo[], dms gt);
247 
251  double LMST( double jd );
252 
253 private:
254  dms Longitude, Latitude;
255  QString Name, Province, Country;
256  TimeZoneRule *TZrule;
257  double TimeZone, Height;
258  double axis, flattening;
259  long double PosCartX, PosCartY, PosCartZ;
260  int indexEllipsoid;
261 };
262 
263 #endif
GeoLocation::xPos
double xPos() const
Definition: geolocation.h:85
GeoLocation::ellipsoid
int ellipsoid() const
Definition: geolocation.h:94
GeoLocation::setYPos
void setYPos(double y)
Set Y.
Definition: geolocation.h:159
GeoLocation::setXPos
void setXPos(double x)
Set X.
Definition: geolocation.h:152
TimeZoneRule::deltaTZ
double deltaTZ() const
Definition: timezonerule.h:88
GeoLocation::translatedName
QString translatedName() const
Definition: geolocation.cpp:78
GeoLocation::TopocentricVelocity
void TopocentricVelocity(double vtopo[], dms gt)
Computes the velocity in km/s of an observer on the surface of the Earth referred to a system whose o...
Definition: geolocation.cpp:139
GeoLocation::setCountry
void setCountry(const QString &n)
Set Country name according to argument.
Definition: geolocation.h:190
GeoLocation::zPos
double zPos() const
Definition: geolocation.h:91
GeoLocation::setZPos
void setZPos(double z)
Set Z.
Definition: geolocation.h:166
dms::Degrees
const double & Degrees() const
Definition: dms.h:98
GeoLocation::lng
const dms * lng() const
Definition: geolocation.h:76
GeoLocation::LTtoUT
KStarsDateTime LTtoUT(const KStarsDateTime &lt) const
Definition: geolocation.h:234
GeoLocation::changeEllipsoid
void changeEllipsoid(int i)
Update Latitude, Longitude and Height according to new ellipsoid.
Definition: geolocation.cpp:73
GeoLocation::tzrule
TimeZoneRule * tzrule()
Definition: geolocation.h:124
TimeZoneRule
This class provides the information needed to determine whether Daylight Savings Time (DST; a...
Definition: timezonerule.h:56
GeoLocation::setName
void setName(const QString &n)
Set City name according to argument.
Definition: geolocation.h:180
GeoLocation::setLat
void setLat(dms l)
Set latitude according to dms argument.
Definition: geolocation.h:136
GeoLocation::LMST
double LMST(double jd)
Local Mean Sidereal Time.
Definition: geolocation.cpp:157
GeoLocation::geodToCart
void geodToCart()
Converts from longitude, latitude and height on a standard geoid of the Earth to cartesian coordinate...
Definition: geolocation.cpp:124
dms.h
GeoLocation::setLong
void setLong(dms l)
Set longitude according to dms argument.
Definition: geolocation.h:128
GeoLocation::GeoLocation
GeoLocation(dms lng, dms lat, const QString &name="Nowhere", const QString &province="Nowhere", const QString &country="Nowhere", double TZ=0, TimeZoneRule *TZrule=NULL, int iEllips=4, double hght=-10)
Constructor using dms objects to specify longitude and latitude.
Definition: geolocation.cpp:24
GeoLocation::translatedProvince
QString translatedProvince() const
Definition: geolocation.cpp:88
GeoLocation::height
double height() const
Definition: geolocation.h:82
timezonerule.h
GeoLocation
Contains all relevant information for specifying a location on Earth: City Name, State/Province name...
Definition: geolocation.h:39
GeoLocation::GSTtoLST
dms GSTtoLST(const dms &gst) const
Definition: geolocation.h:230
GeoLocation::yPos
double yPos() const
Definition: geolocation.h:88
KStarsDateTime::addSecs
KStarsDateTime addSecs(double s) const
Definition: kstarsdatetime.cpp:127
KStarsDateTime
Extension of KDateTime for KStars KStarsDateTime can represent the date/time as a Julian Day...
Definition: kstarsdatetime.h:45
dms
An angle, stored as degrees, but expressible in many ways.
Definition: dms.h:42
GeoLocation::province
QString province() const
Definition: geolocation.h:103
GeoLocation::setHeight
void setHeight(double hg)
Set elevation above sea level.
Definition: geolocation.h:144
GeoLocation::name
QString name() const
Definition: geolocation.h:97
GeoLocation::lat
const dms * lat() const
Definition: geolocation.h:79
GeoLocation::TZ0
double TZ0() const
Definition: geolocation.h:118
GeoLocation::setEllipsoid
void setEllipsoid(int i)
The geoid is an elliposid which fits the shape of the Earth.
Definition: geolocation.cpp:64
GeoLocation::cartToGeod
void cartToGeod()
Converts from cartesian coordinates in meters to longitude, latitude and height on a standard geoid f...
Definition: geolocation.cpp:96
GeoLocation::TZ
double TZ() const
Definition: geolocation.h:121
GeoLocation::fullName
QString fullName() const
Definition: geolocation.cpp:56
kstarsdatetime.h
GeoLocation::UTtoLT
KStarsDateTime UTtoLT(const KStarsDateTime &ut) const
Definition: geolocation.h:233
GeoLocation::LSTtoGST
dms LSTtoGST(const dms &lst) const
Definition: geolocation.h:231
GeoLocation::setProvince
void setProvince(const QString &n)
Set Province name according to argument.
Definition: geolocation.h:185
GeoLocation::translatedCountry
QString translatedCountry() const
Definition: geolocation.cpp:92
GeoLocation::country
QString country() const
Definition: geolocation.h:109
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:19 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kstars

Skip menu "kstars"
  • 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