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

kstars

skyobject.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           skyobject.h  -  K Desktop Planetarium
00003                              -------------------
00004     begin                : Sun Feb 11 2001
00005     copyright            : (C) 2001 by Jason Harris
00006     email                : jharris@30doradus.org
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef SKYOBJECT_H
00019 #define SKYOBJECT_H
00020 
00021 #include <qstring.h>
00022 #include <qstringlist.h>
00023 
00024 #include <klocale.h>
00025 
00026 #include "skypoint.h"
00027 #include "dms.h"
00028 #include "kspopupmenu.h"
00029 
00039 class QPoint;
00040 class GeoLocation;
00041 class KStarsDateTime;
00042 
00043 class SkyObject : public SkyPoint {
00044 public:
00054     SkyObject( int t=TYPE_UNKNOWN, dms r=dms(0.0), dms d=dms(0.0),
00055                         float m=0.0, QString n="", QString n2="", QString lname="" );
00067     SkyObject( int t, double r, double d, float m=0.0,
00068                         QString n="", QString n2="", QString lname="" );
00069 
00073     SkyObject( SkyObject &o );
00074 
00078     ~SkyObject();
00079 
00083     enum TYPE { STAR=0, CATALOG_STAR=1, PLANET=2, OPEN_CLUSTER=3, GLOBULAR_CLUSTER=4,
00084         GASEOUS_NEBULA=5, PLANETARY_NEBULA=6, SUPERNOVA_REMNANT=7, GALAXY=8, COMET=9,
00085         ASTEROID=10, CONSTELLATION=11, TYPE_UNKNOWN };
00086 
00089     virtual QString name( void ) const { return hasName() ? *Name : unnamedString;}
00090 
00093     QString translatedName() const { return i18n( name().utf8() );}
00094 
00098     void setName( const QString &name );
00099 
00102     QString name2( void ) const { return hasName2() ? *Name2 : emptyString; }
00103 
00106     QString translatedName2() const { return i18n( name2().utf8() );}
00107 
00111     void setName2( const QString &name2="" );
00112 
00115     virtual QString longname( void ) const { return hasLongName() ? *LongName : unnamedObjectString; }
00116 
00119     QString translatedLongName() const { return i18n( longname().utf8() );}
00120 
00124     void setLongName( const QString &longname="" );
00125 
00129     int type( void ) const { return (int)Type; }
00130 
00135     void setType( int t ) { Type = (unsigned char)t; }
00136 
00139     QString typeName( void ) const;
00140 
00143     float mag( void ) const { return Magnitude; }
00144 
00148     void setMag( float m ) { Magnitude = m; }
00149 
00153     virtual double pa() const { return 0.0; }
00154 
00157     bool isSolarSystem() { return ( type() == 2 || type() == 9 || type() == 10 ); }
00158 
00164     virtual void showPopupMenu( KSPopupMenu *pmenu, QPoint pos ) { pmenu->createEmptyMenu( this ); pmenu->popup( pos ); }
00165 
00177     QTime riseSetTime( const KStarsDateTime &dt, const GeoLocation *geo, bool rst );
00178 
00185     QTime riseSetTimeUT( const KStarsDateTime &dt, const GeoLocation *geo, bool rst);
00186 
00193     dms riseSetTimeLST( const KStarsDateTime &dt, const GeoLocation *geo, bool rst);
00194 
00202     dms riseSetTimeAz( const KStarsDateTime &dt, const GeoLocation *geo, bool rst);
00203 
00209     QTime transitTime( const KStarsDateTime &dt, const GeoLocation *geo );
00210 
00215     QTime transitTimeUT( const KStarsDateTime &dt, const GeoLocation *geo );
00216 
00221     dms transitAltitude( const KStarsDateTime &dt, const GeoLocation *geo );
00222 
00227     bool checkCircumpolar( const dms *gLng );
00228 
00235     SkyPoint recomputeCoords( const KStarsDateTime &dt, const GeoLocation *geo=0 );
00236 
00237     const bool hasName() const { return Name != 0; }
00238     
00239     const bool hasName2() const { return Name2 != 0; }
00240     
00241     const bool hasLongName() const { return LongName != 0; }
00242     
00245     QString messageFromTitle( const QString &imageTitle );
00246 
00249     void saveUserLog( const QString &newLog );
00250 
00251     QStringList ImageList, ImageTitle;
00252     QStringList InfoList, InfoTitle;
00253     QString userLog;
00254 
00255 private:
00256 
00269     QTime auxRiseSetTimeUT( const KStarsDateTime &dt, const GeoLocation *geo,
00270                 const dms *righta, const dms *decl, bool riseT);
00271 
00282     dms auxRiseSetTimeLST( const dms *gLt, const dms *rga, const dms *decl, bool rst );
00283 
00292     double approxHourAngle( const dms *h, const dms *gLat, const dms *d );
00293 
00307     dms elevationCorrection(void);
00308 
00309     unsigned char Type;
00310     float Magnitude;
00311 
00312 protected:
00313 
00314     QString *Name, *Name2, *LongName;
00315 
00316     // store often used name strings in static variables
00317     static QString emptyString;
00318     static QString unnamedString;
00319     static QString unnamedObjectString;
00320     static QString starString;
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