kstars
starobject.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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
00185
00186
00187
00188
00190
00191
00192
00194
00195
00196
00198
00199
00200
00201 void draw( QPainter &psky, QPixmap *sky, QPixmap *starpix, int x, int y, bool drawMultiple=true, double scale=1.0 );
00202
00203
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;
00217 bool Multiplicity, Variability;
00218 };
00219
00220 #endif