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

kstars

starobject.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           starobject.h  -  K Desktop Planetarium
00003                              -------------------
00004     begin                : Tue Sep 18 2001
00005     copyright            : (C) 2001 by Thomas Kabelmann
00006     email                : tk78@gmx.de
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 STAROBJECT_H
00019 #define STAROBJECT_H
00020 
00021 #include <qpoint.h>
00022 
00023 #include "skyobject.h"
00024 
00025 class QPainter;
00026 class QString;
00027 class KSPopupMenu;
00028 
00039 class StarObject : public SkyObject {
00040     public:
00041 
00045         StarObject(StarObject & o);
00046 
00062     StarObject( dms r=dms(0.0), dms d=dms(0.0), float m=0.0, QString n="",
00063                 QString n2="", QString sptype="--", double pmra=0.0, double pmdec=0.0,
00064                 double par=0.0, bool mult=false, bool var=false );
00080     StarObject( double r, double d, float m=0.0, QString n="",
00081                 QString n2="", QString sptype="--", double pmra=0.0, double pmdec=0.0,
00082                 double par=0.0, bool mult=false, bool var=false );
00083 
00087     ~StarObject() {}
00088 
00092     virtual QString name( void ) const { return hasName() ? *Name : starString;}
00093 
00097     virtual QString longname( void ) const { return hasLongName() ? *LongName : starString; }
00103     QChar color( void ) const { return SpType.at(0); }
00104 
00109     QString sptype( void ) const;
00110 
00115     QString gname( bool useGreekChars=true ) const;
00116 
00122     QString greekLetter( bool useGreekChars=true ) const;
00123 
00126     QString constell( void ) const;
00127 
00136     virtual void updateCoords( KSNumbers *num, bool includePlanets=true, const dms *lat=0, const dms *LST=0 );
00137 
00143     void setProperMotion( double pmra, double pmdec ) { PM_RA = pmra; PM_Dec = pmdec; }
00144 
00147     double pmRA() const { return PM_RA; }
00148 
00151     double pmDec() const { return PM_Dec; }
00152 
00155     void setParallax( double plx ) { Parallax = plx; }
00156 
00159     double parallax() const { return Parallax; }
00160 
00163     double distance() const { return 1000./parallax(); }
00164 
00168     void setMultiple( bool m ) { Multiplicity = m; }
00169 
00172     bool isMultiple() const { return Multiplicity; }
00173 
00177     void setVariable( bool v ) { Variability = v; }
00178 
00181     bool isVariable() const { return Variability; }
00182 
00183 //Not using VRange, VPeriod currently (to save memory)
00185 //  *@param r the range of brightness, in magnitudes
00186 //  */
00187 //  void setVRange( double r ) { VRange = r; }
00188 //
00190 //  */
00191 //  double vrange() const { return VRange; }
00192 //
00194 //  */
00195 //  void setVPeriod( double p ) { VPeriod = p; }
00196 //
00198 //  */
00199 //  double vperiod() const { return VPeriod; }
00200 
00201     void draw( QPainter &psky, QPixmap *sky, QPixmap *starpix, int x, int y, bool drawMultiple=true, double scale=1.0 );
00202 
00203     //overloaded from SkyObject
00204     void drawLabel( QPainter &psky, int x, int y, double zoom, bool drawName, bool drawMag, double scale );
00205 
00211     virtual void showPopupMenu( KSPopupMenu *pmenu, QPoint pos ) { pmenu->createStarMenu( this ); pmenu->popup( pos ); }
00212 
00213 private:
00214     QString SpType;
00215 
00216     double PM_RA, PM_Dec, Parallax;  //, VRange, VPeriod;
00217     bool Multiplicity, Variability;
00218 };
00219 
00220 #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