• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

kstars

geolocation.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           geolocation.h  -  K Desktop Planetarium
00003                              -------------------
00004     begin                : Sun Feb 11 2001
00005     copyright            : (C) 2001-2005 by Jason Harris
00006     email                : jharris@30doradus.org
00007     copyright            : (C) 2003-2005 by Pablo de Vicente
00008     email                : p.devicente@wanadoo.es
00009  ***************************************************************************/
00010 
00011 /***************************************************************************
00012  *                                                                         *
00013  *   This program is free software; you can redistribute it and/or modify  *
00014  *   it under the terms of the GNU General Public License as published by  *
00015  *   the Free Software Foundation; either version 2 of the License, or     *
00016  *   (at your option) any later version.                                   *
00017  *                                                                         *
00018  ***************************************************************************/
00019 
00020 #ifndef GEOLOCATION_H
00021 #define GEOLOCATION_H
00022 
00023 #include <klocale.h>
00024 
00025 #include "dms.h"
00026 #include "timezonerule.h"
00027 #include "kstarsdatetime.h"
00028 
00039 class GeoLocation {
00040 public: 
00044     GeoLocation();
00045 
00049     GeoLocation( const GeoLocation &g );
00050 
00054     GeoLocation( GeoLocation *g );
00055 
00067     GeoLocation( dms lng, dms lat, QString name="Nowhere", QString province="Nowhere", QString country="Nowhere", double TZ=0, TimeZoneRule *TZrule=NULL, int iEllips=4, double hght=-10 );
00068 
00080     GeoLocation( double lng, double lat, QString name="Nowhere", QString province="Nowhere", QString country="Nowhere", double TZ=0, TimeZoneRule *TZrule=NULL, int iEllips=4, double hght=-10 );
00081 
00093     GeoLocation( double x, double y, double z, QString name="Nowhere", QString province="Nowhere", QString country="Nowhere", double TZ=0, TimeZoneRule *TZrule=NULL, int iEllips=4 );
00094 
00095 
00098     ~GeoLocation() {}
00099 
00102     const dms* lng() const { return &Longitude; }
00105     const dms* lat() const { return &Latitude; }
00108     double height() const { return Height; }
00111     double xPos() const { return PosCartX; }
00114     double yPos() const { return PosCartY; }
00117     double zPos() const { return PosCartZ; }
00120     int ellipsoid() const { return indexEllipsoid; }
00121 
00124     QString name() const { return Name; }
00127     QString translatedName() const { return i18n("City name (optional, probably does not need a translation)", Name.utf8().data()); }
00130     QString province() const { return Province; }
00133     QString translatedProvince() const { return i18n("Region/state name (optional, rarely needs a translation)", Province.utf8().data()); }
00136     QString country() const { return Country; }
00139     QString translatedCountry() const { return i18n("Country name (optional, but should be translated)", Country.utf8().data()); }
00140 
00143     QString fullName() const;
00144 
00147     double TZ0() const { return TimeZone; }
00148 
00151     double TZ() const { return TimeZone + TZrule->deltaTZ(); }
00152 
00155     TimeZoneRule* tzrule() const { return TZrule; }
00156 
00160     void setLong( dms l ) { 
00161         Longitude = l; 
00162         geodToCart();
00163     }
00168     void setLong( double l ) { 
00169         Longitude.setD( l ); 
00170         geodToCart();
00171     }
00172 
00176     void setLat( dms l ) { 
00177         Latitude  = l; 
00178         geodToCart();
00179     }
00180     
00185     void setLat( double l ) { 
00186         Latitude.setD( l ); 
00187         geodToCart();
00188     }
00189 
00193     void setHeight( double hg ) { 
00194         Height  = hg; 
00195         geodToCart();
00196     }
00197 
00201     void setXPos( double x ) { 
00202         PosCartX  = x; 
00203         cartToGeod();
00204     }
00208     void setYPos( double y ) { 
00209         PosCartY  = y; 
00210         cartToGeod();
00211     }
00215     void setZPos( double z ) { 
00216         PosCartZ  = z; 
00217         cartToGeod();
00218     }
00219     
00224     void changeEllipsoid( int i );
00225     
00229     void setName( const QString &n ) { Name = n; }
00230 
00234     void setProvince( const QString &n ) { Province = n; }
00235 
00239     void setCountry( const QString &n ) { Country = n; }
00240 
00244     void setTZ( double tz ) { TimeZone = tz; }
00245 
00249     void setTZrule( TimeZoneRule *tzr ) { TZrule = tzr; }
00250 
00255     void reset( GeoLocation *g );
00256 
00269     void cartToGeod(void);
00270 
00283     void geodToCart (void);
00284 
00293     void setEllipsoid( int i );
00294 
00295     dms GSTtoLST( const dms &gst ) const { return dms( gst.Degrees() + Longitude.Degrees() ); }
00296     dms LSTtoGST( const dms &lst ) const { return dms( lst.Degrees() - Longitude.Degrees() ); }
00297 
00298     KStarsDateTime UTtoLT( const KStarsDateTime &ut ) const { return ut.addSecs( int( 3600.*TZ() ) ); }
00299     KStarsDateTime LTtoUT( const KStarsDateTime &lt ) const { return lt.addSecs( int( -3600.*TZ() ) ); }
00300 
00301 
00302     /* Computes the velocity in km/s of an observer on the surface of the Earth 
00303      * referred to a system whose origin is the center of the Earth. The X and 
00304      * Y axis are contained in the equator and the X axis is towards the nodes
00305      * line. The Z axis is along the poles.
00306      *
00307      * @param vtopo[] Topocentric velocity. The resultant velocity is available 
00308      *        in this array.
00309      * @param gt. Greenwich sideral time for which we want to compute the topocentric velocity.
00310      */
00311     void TopocentricVelocity(double vtopo[], dms gt);
00312 
00313 private:
00314     dms Longitude, Latitude;
00315     QString Name, Province, Country;
00316     TimeZoneRule *TZrule;
00317     double TimeZone, Height;
00318     double axis, flattening;
00319     long double PosCartX, PosCartY, PosCartZ;
00320     int indexEllipsoid;
00321 };
00322 
00323 #endif

kstars

Skip menu "kstars"
  • Main Page
  • Modules
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • keduca
  • kstars
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal