22 #include <QFontMetricsF>
51 if ( pm < 1.0e-6)
return 1.0e6;
56 return 25.0 * 60.0 * 10.0 / pm;
60 const QString &n,
const QString &n2,
61 const QString &sptype,
double pmra,
double pmdec,
62 double par,
bool mult,
bool var,
int hd )
64 PM_RA(pmra), PM_Dec(pmdec),
65 Parallax(par), Multiplicity(mult), Variability(var)
67 QByteArray spt = sptype.toAscii();
87 const QString &n,
const QString &n2,
88 const QString &sptype,
double pmra,
double pmdec,
89 double par,
bool mult,
bool var,
int hd )
91 PM_RA(pmra), PM_Dec(pmdec),
92 Parallax(par), Multiplicity(mult), Variability(var)
94 QByteArray spt = sptype.toAscii();
118 Parallax(o.Parallax),
119 Multiplicity(o.Multiplicity),
120 Variability(o.Variability),
123 SpType[0] = o.SpType[0];
124 SpType[1] = o.SpType[1];
136 ra = stardata->
RA / 1000000.0;
137 dec = stardata->
Dec / 100000.0;
146 PM_RA = stardata->
dRA / 10.0;
147 PM_Dec = stardata->
dDec / 10.0;
148 Parallax = stardata->
parallax / 10.0;
149 Multiplicity = stardata->
flags & 0x02;
150 Variability = stardata->
flags & 0x04 ;
184 double ra,
dec, BV_Index;
186 ra = stardata->
RA / 1000000.0;
187 dec = stardata->
Dec / 100000.0;
190 if( stardata->
V == 30000 && stardata->
B != 30000 )
191 setMag( ( stardata->
B - 1600 ) / 1000.0 );
193 setMag( stardata->
V / 1000.0 );
202 if( stardata->
B == 30000 || stardata->
V == 30000 ) {
207 BV_Index = ( stardata->
B - stardata->
V ) / 1000.0;
208 ( BV_Index > 0.0 ) && ( SpType[0] =
'A' );
209 ( BV_Index > 0.325 ) && ( SpType[0] =
'F' );
210 ( BV_Index > 0.575 ) && ( SpType[0] =
'G' );
211 ( BV_Index > 0.975 ) && ( SpType[0] =
'K' );
212 ( BV_Index > 1.6 ) && ( SpType[0] =
'M' );
215 PM_RA = stardata->
dRA / 100.0;
216 PM_Dec = stardata->
dDec / 100.0;
221 B = stardata->
B / 1000.0;
222 V = stardata->
V / 1000.0;
240 void StarObject::initPopupMenu(
KSPopupMenu *pmenu ) {
256 double newRA, newDec;
296 ( pm < 0 ) && ( pm = -pm );
298 double dst = pm * M_PI / ( 180.0 * 3600.0 );
302 lat1.setRadians( asin(
dec0().sin() * cos( dst ) +
303 dec0().cos() * sin( dst ) * cos( dir0 ) ) );
304 dtheta.setRadians( atan2( sin( dir0 ) * sin( dst ) *
dec0().cos(),
305 cos( dst ) -
dec0().sin() * lat1.sin() ) );
341 return QString( QByteArray(SpType, 2) );
350 if(!
name2().isEmpty())
357 QString code =
name2().left(3);
358 QString letter = code;
361 if ( code ==
"alp" ) gchar ? letter = QString( QChar(alpha + 0) ) : letter = i18n(
"alpha");
362 if ( code ==
"bet" ) gchar ? letter = QString( QChar(alpha + 1) ) : letter = i18n(
"beta");
363 if ( code ==
"gam" ) gchar ? letter = QString( QChar(alpha + 2) ) : letter = i18n(
"gamma");
364 if ( code ==
"del" ) gchar ? letter = QString( QChar(alpha + 3) ) : letter = i18n(
"delta");
365 if ( code ==
"eps" ) gchar ? letter = QString( QChar(alpha + 4) ) : letter = i18n(
"epsilon");
366 if ( code ==
"zet" ) gchar ? letter = QString( QChar(alpha + 5) ) : letter = i18n(
"zeta");
367 if ( code ==
"eta" ) gchar ? letter = QString( QChar(alpha + 6) ) : letter = i18n(
"eta");
368 if ( code ==
"the" ) gchar ? letter = QString( QChar(alpha + 7) ) : letter = i18n(
"theta");
369 if ( code ==
"iot" ) gchar ? letter = QString( QChar(alpha + 8) ) : letter = i18n(
"iota");
370 if ( code ==
"kap" ) gchar ? letter = QString( QChar(alpha + 9) ) : letter = i18n(
"kappa");
371 if ( code ==
"lam" ) gchar ? letter = QString( QChar(alpha +10) ) : letter = i18n(
"lambda");
372 if ( code ==
"mu " ) gchar ? letter = QString( QChar(alpha +11) ) : letter = i18n(
"mu");
373 if ( code ==
"nu " ) gchar ? letter = QString( QChar(alpha +12) ) : letter = i18n(
"nu");
374 if ( code ==
"xi " ) gchar ? letter = QString( QChar(alpha +13) ) : letter = i18n(
"xi");
375 if ( code ==
"omi" ) gchar ? letter = QString( QChar(alpha +14) ) : letter = i18n(
"omicron");
376 if ( code ==
"pi " ) gchar ? letter = QString( QChar(alpha +15) ) : letter = i18n(
"pi");
377 if ( code ==
"rho" ) gchar ? letter = QString( QChar(alpha +16) ) : letter = i18n(
"rho");
380 if ( code ==
"sig" ) gchar ? letter = QString( QChar(alpha +18) ) : letter = i18n(
"sigma");
381 if ( code ==
"tau" ) gchar ? letter = QString( QChar(alpha +19) ) : letter = i18n(
"tau");
382 if ( code ==
"ups" ) gchar ? letter = QString( QChar(alpha +20) ) : letter = i18n(
"upsilon");
383 if ( code ==
"phi" ) gchar ? letter = QString( QChar(alpha +21) ) : letter = i18n(
"phi");
384 if ( code ==
"chi" ) gchar ? letter = QString( QChar(alpha +22) ) : letter = i18n(
"chi");
385 if ( code ==
"psi" ) gchar ? letter = QString( QChar(alpha +23) ) : letter = i18n(
"psi");
386 if ( code ==
"ome" ) gchar ? letter = QString( QChar(alpha +24) ) : letter = i18n(
"omega");
388 if (
name2().length() &&
name2().mid(3,1) !=
" " )
389 letter +=
'[' +
name2().mid(3,1) +
']';
395 QString code =
name2().mid(4,3);
396 if ( code ==
"And" )
return QString(
"Andromedae");
397 if ( code ==
"Ant" )
return QString(
"Antliae");
398 if ( code ==
"Aps" )
return QString(
"Apodis");
399 if ( code ==
"Aqr" )
return QString(
"Aquarii");
400 if ( code ==
"Aql" )
return QString(
"Aquilae");
401 if ( code ==
"Ara" )
return QString(
"Arae");
402 if ( code ==
"Ari" )
return QString(
"Arietis");
403 if ( code ==
"Aur" )
return QString(
"Aurigae");
404 if ( code ==
"Boo" )
return QString(
"Bootis");
405 if ( code ==
"Cae" )
return QString(
"Caeli");
406 if ( code ==
"Cam" )
return QString(
"Camelopardalis");
407 if ( code ==
"Cnc" )
return QString(
"Cancri");
408 if ( code ==
"CVn" )
return QString(
"Canum Venaticorum");
409 if ( code ==
"CMa" )
return QString(
"Canis Majoris");
410 if ( code ==
"CMi" )
return QString(
"Canis Minoris");
411 if ( code ==
"Cap" )
return QString(
"Capricorni");
412 if ( code ==
"Car" )
return QString(
"Carinae");
413 if ( code ==
"Cas" )
return QString(
"Cassiopeiae");
414 if ( code ==
"Cen" )
return QString(
"Centauri");
415 if ( code ==
"Cep" )
return QString(
"Cephei");
416 if ( code ==
"Cet" )
return QString(
"Ceti");
417 if ( code ==
"Cha" )
return QString(
"Chamaeleontis");
418 if ( code ==
"Cir" )
return QString(
"Circini");
419 if ( code ==
"Col" )
return QString(
"Columbae");
420 if ( code ==
"Com" )
return QString(
"Comae Berenices");
421 if ( code ==
"CrA" )
return QString(
"Coronae Austrinae");
422 if ( code ==
"CrB" )
return QString(
"Coronae Borealis");
423 if ( code ==
"Crv" )
return QString(
"Corvi");
424 if ( code ==
"Crt" )
return QString(
"Crateris");
425 if ( code ==
"Cru" )
return QString(
"Crucis");
426 if ( code ==
"Cyg" )
return QString(
"Cygni");
427 if ( code ==
"Del" )
return QString(
"Delphini");
428 if ( code ==
"Dor" )
return QString(
"Doradus");
429 if ( code ==
"Dra" )
return QString(
"Draconis");
430 if ( code ==
"Equ" )
return QString(
"Equulei");
431 if ( code ==
"Eri" )
return QString(
"Eridani");
432 if ( code ==
"For" )
return QString(
"Fornacis");
433 if ( code ==
"Gem" )
return QString(
"Geminorum");
434 if ( code ==
"Gru" )
return QString(
"Gruis");
435 if ( code ==
"Her" )
return QString(
"Herculis");
436 if ( code ==
"Hor" )
return QString(
"Horologii");
437 if ( code ==
"Hya" )
return QString(
"Hydrae");
438 if ( code ==
"Hyi" )
return QString(
"Hydri");
439 if ( code ==
"Ind" )
return QString(
"Indi");
440 if ( code ==
"Lac" )
return QString(
"Lacertae");
441 if ( code ==
"Leo" )
return QString(
"Leonis");
442 if ( code ==
"LMi" )
return QString(
"Leonis Minoris");
443 if ( code ==
"Lep" )
return QString(
"Leporis");
444 if ( code ==
"Lib" )
return QString(
"Librae");
445 if ( code ==
"Lup" )
return QString(
"Lupi");
446 if ( code ==
"Lyn" )
return QString(
"Lyncis");
447 if ( code ==
"Lyr" )
return QString(
"Lyrae");
448 if ( code ==
"Men" )
return QString(
"Mensae");
449 if ( code ==
"Mic" )
return QString(
"Microscopii");
450 if ( code ==
"Mon" )
return QString(
"Monocerotis");
451 if ( code ==
"Mus" )
return QString(
"Muscae");
452 if ( code ==
"Nor" )
return QString(
"Normae");
453 if ( code ==
"Oct" )
return QString(
"Octantis");
454 if ( code ==
"Oph" )
return QString(
"Ophiuchi");
455 if ( code ==
"Ori" )
return QString(
"Orionis");
456 if ( code ==
"Pav" )
return QString(
"Pavonis");
457 if ( code ==
"Peg" )
return QString(
"Pegasi");
458 if ( code ==
"Per" )
return QString(
"Persei");
459 if ( code ==
"Phe" )
return QString(
"Phoenicis");
460 if ( code ==
"Pic" )
return QString(
"Pictoris");
461 if ( code ==
"Psc" )
return QString(
"Piscium");
462 if ( code ==
"PsA" )
return QString(
"Piscis Austrini");
463 if ( code ==
"Pup" )
return QString(
"Puppis");
464 if ( code ==
"Pyx" )
return QString(
"Pyxidis");
465 if ( code ==
"Ret" )
return QString(
"Reticuli");
466 if ( code ==
"Sge" )
return QString(
"Sagittae");
467 if ( code ==
"Sgr" )
return QString(
"Sagittarii");
468 if ( code ==
"Sco" )
return QString(
"Scorpii");
469 if ( code ==
"Scl" )
return QString(
"Sculptoris");
470 if ( code ==
"Sct" )
return QString(
"Scuti");
471 if ( code ==
"Ser" )
return QString(
"Serpentis");
472 if ( code ==
"Sex" )
return QString(
"Sextantis");
473 if ( code ==
"Tau" )
return QString(
"Tauri");
474 if ( code ==
"Tel" )
return QString(
"Telescopii");
475 if ( code ==
"Tri" )
return QString(
"Trianguli");
476 if ( code ==
"TrA" )
return QString(
"Trianguli Australis");
477 if ( code ==
"Tuc" )
return QString(
"Tucanae");
478 if ( code ==
"UMa" )
return QString(
"Ursae Majoris");
479 if ( code ==
"UMi" )
return QString(
"Ursae Minoris");
480 if ( code ==
"Vel" )
return QString(
"Velorum");
481 if ( code ==
"Vir" )
return QString(
"Virginis");
482 if ( code ==
"Vol" )
return QString(
"Volantis");
483 if ( code ==
"Vul" )
return QString(
"Vulpeculae");
499 else if ( !
gname().trimmed().isEmpty() )
500 sName =
gname(
true );
503 return KGlobal::locale()->formatNumber(
mag(), 1 );
508 return sName +
' ' + KGlobal::locale()->formatNumber(
mag(), 1 );
510 return KGlobal::locale()->formatNumber(
mag(), 1 );
532 Q_ASSERT(
"Magnitude is expected to fit into 10bits" && m>=0 && m<(1<<10));
533 Q_ASSERT(
"RA should fit into 24bits" && ra>=0 && ra <(1<<24));
534 Q_ASSERT(
"Dec should fit into 24bits" && dec>=0 && dec<(1<<24));
Structure that holds star data for really faint stars.
bool checkBendLight()
Check if this sky point is close enough to the sun for gravitational lensing to be significant...
Structure that holds star data.
void JITupdate()
added for JIT updates from both StarComponent and ConstellationLines
KStarsData is the backbone of KStars.
static double reindexInterval(double pm)
returns the reindex interval (in centuries!) for the given magnitude of proper motion (in milliarcsec...
double pmMagnitudeSquared()
returns the square of the magnitude of the proper motion correction in (milliarcsec/year)^2 ...
QString translatedName() const
QString sptype(void) const
Returns entire spectral type string.
static bool alwaysRecomputeCoordinates()
Get Always recompute coordinates.
long double getJD() const
static KStarsData * Instance()
const double & Degrees() const
void setLongName(const QString &longname=QString())
Set the object's long name.
virtual void updateCoords(KSNumbers *num, bool includePlanets=true, const dms *lat=0, const dms *LST=0, bool forceRecompute=false)
Determine the current coordinates (RA, Dec) from the catalog coordinates (RA0, Dec0), accounting for both precession and nutation.
virtual void updateCoords(KSNumbers *num, bool includePlanets=true, const dms *lat=0, const dms *LST=0, bool forceRecompute=false)
Determine the current coordinates (RA, Dec) from the catalog coordinates (RA0, Dec0), accounting for both precession and nutation.
static const UID UID_STAR
Kind of UID.
virtual double labelOffset() const
void setNames(QString name, QString name2)
Sets the name, genetive name, and long name.
unsigned int updateNumID()
static bool useRelativistic()
Get Apply relativistic corrections due to the bending of light in sun's gravitational field...
QString greekLetter(bool useGreekChars=true) const
Returns the greek letter portion of the star's genetive name.
virtual UID getUID() const
Return UID for object.
void getIndexCoords(KSNumbers *num, double *ra, double *dec)
QString constell(void) const
qint64 UID
Type for Unique object IDenticator.
void setName2(const QString &name2=QString())
Set the object's secondary name.
An angle, stored as degrees, but expressible in many ways.
void setType(int t)
Set the object's type identifier to the argument.
char spchar() const
Returns just the first character of the spectral type string.
void EquatorialToHorizontal(const dms *LST, const dms *lat)
Determine the (Altitude, Azimuth) coordinates of the SkyPoint from its (RA, Dec) coordinates, given the local sidereal time and the observer's latitude.
QString name2(void) const
void setMag(float m)
Set the object's sorting magnitude.
double pmMagnitude()
returns the magnitude of the proper motion correction in milliarcsec/year
There are several time-dependent values used in position calculations, that are not specific to an ob...
void setRA0(dms r)
Sets RA0, the catalog Right Ascension.
void init(const starData *stardata)
Initializes a StarObject to given data.
static double zoomFactor()
Get Zoom Factor, in pixels per radian.
virtual QString labelString() const
StarObject(dms r=dms(0.0), dms d=dms(0.0), float m=0.0, const QString &n=QString(), const QString &n2=QString(), const QString &sptype="--", double pmra=0.0, double pmdec=0.0, double par=0.0, bool mult=false, bool var=false, int hd=0)
Constructor.
void setRA(dms r)
Sets RA, the current Right Ascension.
virtual StarObject * clone() const
Create copy of object.
void setDec(dms d)
Sets Dec, the current Declination.
void setDec0(dms d)
Sets Dec0, the catalog Declination.
void setName(const QString &name)
Set the object's primary name.
long double lastPrecessJD
virtual QString name(void) const
If star is unnamed return "star" otherwise return the name.
static bool showStarNames()
Get Label star names in the sky map?
QString gname(bool useGreekChars=true) const
Returns the genetive name of the star.
This is a subclass of SkyObject.
Provides all necessary information about an object in the sky: its coordinates, name(s), type, magnitude, and QStringLists of URLs for images and webpages regarding the object.
double julianMillenia() const
QString nameLabel(bool drawName, bool drawMag) const
static bool showStarMagnitudes()
Get Label star magnitudes in the sky map?