• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

kstars

  • sources
  • kde-4.12
  • kdeedu
  • kstars
  • kstars
  • skyobjects
starobject.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  starobject.cpp - K Desktop Planetarium
3  -------------------
4  begin : Tue Sep 18 2001
5  copyright : (C) 2001 by Jason Harris
6  email : kstars@30doradus.org
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #include "starobject.h"
19 
20 #include <QColor>
21 #include <QPainter>
22 #include <QFontMetricsF>
23 #include <QPixmap>
24 #include <kdebug.h>
25 
26 #include "kspopupmenu.h"
27 #include "ksnumbers.h"
28 #include "kstarsdata.h"
29 #include "Options.h"
30 #include "skymap.h"
31 
32 // DEBUG EDIT. Uncomment for testing Proper Motion
33 //#include "skycomponents/skymesh.h"
34 // END DEBUG
35 
36 #include "skycomponents/skylabeler.h"
37 
38 // DEBUG EDIT. Uncomment for testing Proper Motion
39 // You will also need to uncomment all related blocks
40 // from this file, starobject.h and also the trixel-boundaries
41 // block from lines 253 - 257 of skymapcomposite.cpp
42 //QVector<SkyPoint *> StarObject::Trail;
43 // END DEBUG
44 
45 #include <cmath>
46 
47 //----- Static Methods -----
48 //
49 double StarObject::reindexInterval( double pm )
50 {
51  if ( pm < 1.0e-6) return 1.0e6;
52 
53  // arcminutes * sec/min * milliarcsec/sec centuries/year
54  // / [milliarcsec/year] = centuries
55 
56  return 25.0 * 60.0 * 10.0 / pm;
57 }
58 
59 StarObject::StarObject( dms r, dms d, float m,
60  const QString &n, const QString &n2,
61  const QString &sptype, double pmra, double pmdec,
62  double par, bool mult, bool var, int hd )
63  : SkyObject (SkyObject::STAR, r, d, m, n, n2, QString()),
64  PM_RA(pmra), PM_Dec(pmdec),
65  Parallax(par), Multiplicity(mult), Variability(var)
66 {
67  QByteArray spt = sptype.toAscii();
68  SpType[0] = spt[0];
69  SpType[1] = spt[1];
70  QString lname;
71  if ( hasName() ) {
72  lname = n;
73  if ( hasName2() ) lname += " (" + gname() + ')';
74  } else if ( hasName2() ) {
75  lname = gname();
76  //If genetive name exists, but no primary name, set primary name = genetive name.
77  setName( gname() );
78  }
79 
80  HD = hd;
81 
82  setLongName(lname);
83  updateID = updateNumID = 0;
84 }
85 
86 StarObject::StarObject( double r, double d, float m,
87  const QString &n, const QString &n2,
88  const QString &sptype, double pmra, double pmdec,
89  double par, bool mult, bool var, int hd )
90  : SkyObject (SkyObject::STAR, r, d, m, n, n2, QString()),
91  PM_RA(pmra), PM_Dec(pmdec),
92  Parallax(par), Multiplicity(mult), Variability(var)
93 {
94  QByteArray spt = sptype.toAscii();
95  SpType[0] = spt[0];
96  SpType[1] = spt[1];
97 
98  QString lname;
99  if ( hasName() ) {
100  lname = n;
101  if ( hasName2() )lname += " (" + gname() + ')';
102  } else if ( hasName2() ) {
103  lname = gname();
104  //If genetive name exists, but no primary name, set primary name = genetive name.
105  setName( gname() );
106  }
107 
108  HD = hd;
109 
110  setLongName(lname);
111  updateID = updateNumID = 0;
112 }
113 
114 StarObject::StarObject( const StarObject &o ) :
115  SkyObject (o),
116  PM_RA(o.PM_RA),
117  PM_Dec(o.PM_Dec),
118  Parallax(o.Parallax),
119  Multiplicity(o.Multiplicity),
120  Variability(o.Variability),
121  HD(o.HD)
122 {
123  SpType[0] = o.SpType[0];
124  SpType[1] = o.SpType[1];
125  updateID = updateNumID = 0;
126 }
127 
128 StarObject* StarObject::clone() const
129 {
130  return new StarObject(*this);
131 }
132 
133 void StarObject::init( const starData *stardata )
134 {
135  double ra, dec;
136  ra = stardata->RA / 1000000.0;
137  dec = stardata->Dec / 100000.0;
138  setType( SkyObject::STAR );
139  setMag( stardata->mag / 100.0 );
140  setRA0( ra );
141  setDec0( dec );
142  setRA( ra );
143  setDec( dec );
144  SpType[0] = stardata->spec_type[0];
145  SpType[1] = stardata->spec_type[1];
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 ;
151  updateID = updateNumID = 0;
152  HD = stardata->HD;
153  B = V = 99.9;
154 
155  // DEBUG Edit. For testing proper motion. Uncomment all related blocks to test.
156  // WARNING: You can debug only ONE STAR AT A TIME, because
157  // the StarObject::Trail is static. It has to be
158  // static, because otherwise, we can run into segfaults
159  // due to the memcpy() that we do to create stars
160  /*
161  testStar = false;
162  if( stardata->HD == 103095 && Trail.size() == 0 ) {
163  // Populate Trail with various positions
164  kDebug() << "TEST STAR FOUND!";
165  testStar = true;
166  KSNumbers num( J2000 ); // Some estimate, doesn't matter.
167  long double jy;
168  for( jy = -10000.0; jy <= 10000.0; jy += 500.0 ) {
169  num.updateValues( J2000 + jy * 365.238 );
170  double ra, dec;
171  getIndexCoords( &num, &ra, &dec );
172  Trail.append( new SkyPoint( ra / 15.0, dec ) );
173  }
174  kDebug() << "Populated the star's trail with " << Trail.size() << " entries.";
175  }
176  */
177  // END DEBUG.
178 
179 
180 }
181 
182 void StarObject::init( const deepStarData *stardata )
183 {
184  double ra, dec, BV_Index;
185 
186  ra = stardata->RA / 1000000.0;
187  dec = stardata->Dec / 100000.0;
188  setType( SkyObject::STAR );
189 
190  if( stardata->V == 30000 && stardata->B != 30000 )
191  setMag( ( stardata->B - 1600 ) / 1000.0 ); // FIXME: Is it okay to make up stuff like this?
192  else
193  setMag( stardata->V / 1000.0 );
194 
195  setRA0( ra );
196  setDec0( dec );
197  setRA( ra );
198  setDec( dec );
199 
200  SpType[1] = '?';
201  SpType[0] = 'B';
202  if( stardata->B == 30000 || stardata->V == 30000 ) {
203  BV_Index = -100;
204  SpType[0] = '?';
205  }
206  else {
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' );
213  }
214 
215  PM_RA = stardata->dRA / 100.0;
216  PM_Dec = stardata->dDec / 100.0;
217  Parallax = 0.0;
218  Multiplicity = 0;
219  Variability = 0;
220  updateID = updateNumID = 0;
221  B = stardata->B / 1000.0;
222  V = stardata->V / 1000.0;
223 }
224 
225 void StarObject::setNames( QString name, QString name2 ) {
226  QString lname;
227 
228  setName( name );
229 
230  setName2( name2 );
231 
232  if ( hasName() ) {
233  lname = name;
234  if ( hasName2() ) lname += " (" + gname() + ')';
235  } else if ( hasName2() )
236  lname = gname();
237  setLongName(lname);
238 }
239 
240 void StarObject::initPopupMenu( KSPopupMenu *pmenu ) {
241  pmenu->createStarMenu( this );
242 }
243 
244 void StarObject::updateCoords( KSNumbers *num, bool , const dms*, const dms*, bool ) {
245  //Correct for proper motion of stars. Determine RA and Dec offsets.
246  //Proper motion is given im milliarcsec per year by the pmRA() and pmDec() functions.
247  //That is numerically identical to the number of arcsec per millenium, so multiply by
248  //KSNumbers::julianMillenia() to find the offsets in arcsec.
249 
250  // Correction: The method below computes the proper motion before the
251  // precession. If we precessed first then the direction of the proper
252  // motion correction would depend on how far we've precessed. -jbb
253  double saveRA = ra0().Hours();
254  double saveDec = dec0().Degrees();
255 
256  double newRA, newDec;
257 
258  getIndexCoords( num, &newRA, &newDec );
259  newRA /= 15.0; // getIndexCoords returns in Degrees, while we want the RA in Hours
260  setRA0( newRA );
261  setDec0( newDec );
262 
263  SkyPoint::updateCoords( num );
264  setRA0( saveRA );
265  setDec0( saveDec );
266 }
267 
268 void StarObject::getIndexCoords( KSNumbers *num, double *ra, double *dec )
269 {
270  static double pmms;
271 
272  // Old, Incorrect Proper motion Computation. We retain this in a
273  // comment because we might want to use it to come up with a
274  // linear approximation that's faster.
275  // double dra = pmRA() * num->julianMillenia() / ( cos( dec0().radians() ) * 3600.0 );
276  // double ddec = pmDec() * num->julianMillenia() / 3600.0;
277 
278  // Proper Motion Correction should be implemented as motion along a great
279  // circle passing through the given (ra0, dec0) in a direction of
280  // atan2( pmRA(), pmDec() ) to an angular distance given by the Magnitude of
281  // PM times the number of Julian millenia since J2000.0
282 
283  pmms = pmMagnitudeSquared();
284 
285  if( isnan( pmms ) || pmms * num->julianMillenia() * num->julianMillenia() < 1. ) {
286  // Ignore corrections
287  *ra = ra0().Degrees();
288  *dec = dec0().Degrees();
289  return;
290  }
291 
292  double pm = pmMagnitude() * num->julianMillenia(); // Proper Motion in arcseconds
293 
294  double dir0 = ( pm > 0 ) ? atan2( pmRA(), pmDec() ) : atan2( -pmRA(), -pmDec() ); // Bearing, in radian
295 
296  ( pm < 0 ) && ( pm = -pm );
297 
298  double dst = pm * M_PI / ( 180.0 * 3600.0 );
299  // double phi = M_PI / 2.0 - dec0().radians();
300 
301  dms lat1, dtheta;
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() ) );
306 
307  // Using dms instead, to ensure that the numbers are in the right range.
308  dms finalRA( ra0().Degrees() + dtheta.Degrees() );
309 
310  *ra = finalRA.Degrees();
311  *dec = lat1.Degrees();
312 
313  // *ra = ra0().Degrees() + dra;
314  // *dec = dec0().Degrees() + ddec;
315 }
316 
317 void StarObject::JITupdate()
318 {
319  static KStarsData *data = KStarsData::Instance();
320 
321  if ( updateNumID != data->updateNumID() ) {
322  // TODO: This can be optimized and reorganized further in a better manner.
323  // Maybe we should do this only for stars, since this is really a slow step only for stars
324  Q_ASSERT( std::isfinite( lastPrecessJD ) );
325  if( ( lastPrecessJD - data->updateNum()->getJD() ) >= 0.0005 // TODO: Make this 0.0005 a constant / define it
326  || ( lastPrecessJD - data->updateNum()->getJD() ) <= -0.0005
327  || Options::alwaysRecomputeCoordinates()
328  || ( Options::useRelativistic() && checkBendLight() ) ) {
329 
330  // Short circuit right here, if recomputing coordinates is not required. NOTE: POTENTIALLY DANGEROUS
331  updateCoords( data->updateNum() );
332  }
333 
334  updateNumID = data->updateNumID();
335  }
336  EquatorialToHorizontal( data->lst(), data->geo()->lat() );
337  updateID = data->updateID();
338 }
339 
340 QString StarObject::sptype( void ) const {
341  return QString( QByteArray(SpType, 2) );
342 }
343 
344 char StarObject::spchar() const
345 {
346  return SpType[0];
347 }
348 
349 QString StarObject::gname( bool useGreekChars ) const {
350  if(!name2().isEmpty())
351  return greekLetter( useGreekChars ) + ' ' + constell();
352  else
353  return QString();
354 }
355 
356 QString StarObject::greekLetter( bool gchar ) const {
357  QString code = name2().left(3);
358  QString letter = code; //in case genitive name is *not* a Greek letter
359  int alpha = 0x03B1;
360 
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");
378  //there are two unicode symbols for sigma;
379  //skip the first one, the second is more widely used
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");
387 
388  if ( name2().length() && name2().mid(3,1) != " " )
389  letter += '[' + name2().mid(3,1) + ']';
390 
391  return letter;
392 }
393 
394 QString StarObject::constell() const { // FIXME: Move this somewhere else, make this static, and give it a better name. Mostly for code cleanliness. Also, try to put it in a DB.
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");
484 
485  return QString();
486 }
487 
488 // The two routines below seem overly complicated but at least they are doing
489 // the right thing now. Please resist the temptation to simplify them unless
490 // you are prepared to ensure there is no ugly label overlap for all 8 cases
491 // they deal with ( drawName x DrawMag x star-has-name). -jbb
492 
493 QString StarObject::nameLabel( bool drawName, bool drawMag ) const
494 {
495  QString sName;
496  if ( drawName ) {
497  if ( translatedName() != i18n("star") && ! translatedName().isEmpty() )
498  sName = translatedName();
499  else if ( ! gname().trimmed().isEmpty() )
500  sName = gname( true );
501  else {
502  if ( drawMag )
503  return KGlobal::locale()->formatNumber( mag(), 1 );
504  }
505  if ( ! drawMag )
506  return sName;
507  else
508  return sName + ' ' + KGlobal::locale()->formatNumber( mag(), 1 );
509  }
510  return KGlobal::locale()->formatNumber( mag(), 1 );
511 }
512 
513 //If this works, we can maybe get rid of customLabel() and nameLabel()??
514 QString StarObject::labelString() const {
515  return nameLabel( Options::showStarNames(), Options::showStarMagnitudes() );
516 }
517 
518 double StarObject::labelOffset() const {
519  return (6. + 0.5*( 5.0 - mag() ) + 0.01*( Options::zoomFactor()/500. ) );
520 }
521 
522 SkyObject::UID StarObject::getUID() const
523 {
524  // mag takes 10 bit
525  SkyObject::UID m = mag()*10;
526  if( m < 0 ) m = 0;
527 
528  // Both RA & dec fits in 24-bits
529  SkyObject::UID ra = ra0().Degrees() * 36000;
530  SkyObject::UID dec = (ra0().Degrees()+91) * 36000;
531 
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));
535 
536  return (SkyObject::UID_STAR << 60) | (m << 48) | (ra << 24) | dec;
537 }
starData::mag
qint16 mag
Definition: stardata.h:35
deepStarData
Structure that holds star data for really faint stars.
Definition: deepstardata.h:28
SkyPoint::checkBendLight
bool checkBendLight()
Check if this sky point is close enough to the sun for gravitational lensing to be significant...
Definition: skypoint.cpp:258
SkyPoint::ra
const dms & ra() const
Definition: skypoint.h:171
starData
Structure that holds star data.
Definition: stardata.h:28
SkyPoint::dec0
const dms & dec0() const
Definition: skypoint.h:168
StarObject::JITupdate
void JITupdate()
added for JIT updates from both StarComponent and ConstellationLines
Definition: starobject.cpp:317
KStarsData
KStarsData is the backbone of KStars.
Definition: kstarsdata.h:66
starData::RA
qint32 RA
Definition: stardata.h:29
StarObject::reindexInterval
static double reindexInterval(double pm)
returns the reindex interval (in centuries!) for the given magnitude of proper motion (in milliarcsec...
Definition: starobject.cpp:49
KSPopupMenu
The KStars Popup Menu.
Definition: kspopupmenu.h:43
KStarsData::updateID
unsigned int updateID()
Definition: kstarsdata.h:224
StarObject::pmMagnitudeSquared
double pmMagnitudeSquared()
returns the square of the magnitude of the proper motion correction in (milliarcsec/year)^2 ...
Definition: starobject.h:190
SkyObject::translatedName
QString translatedName() const
Definition: skyobject.h:129
deepStarData::dDec
qint16 dDec
Definition: deepstardata.h:32
StarObject::sptype
QString sptype(void) const
Returns entire spectral type string.
Definition: starobject.cpp:340
Options::alwaysRecomputeCoordinates
static bool alwaysRecomputeCoordinates()
Get Always recompute coordinates.
Definition: Options.h:4407
KSNumbers::getJD
long double getJD() const
Definition: ksnumbers.h:123
deepStarData::RA
qint32 RA
Definition: deepstardata.h:29
starData::dRA
qint32 dRA
Definition: stardata.h:31
KStarsData::lst
dms * lst()
Definition: kstarsdata.h:161
KStarsData::Instance
static KStarsData * Instance()
Definition: kstarsdata.h:92
dms::Degrees
const double & Degrees() const
Definition: dms.h:98
SkyObject::setLongName
void setLongName(const QString &longname=QString())
Set the object's long name.
Definition: skyobject.cpp:92
SkyPoint::updateCoords
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.
Definition: skypoint.cpp:317
StarObject::updateCoords
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.
Definition: starobject.cpp:244
SkyObject::UID_STAR
static const UID UID_STAR
Kind of UID.
Definition: skyobject.h:56
KStarsData::geo
GeoLocation * geo()
Definition: kstarsdata.h:164
StarObject::labelOffset
virtual double labelOffset() const
Definition: starobject.cpp:518
StarObject::setNames
void setNames(QString name, QString name2)
Sets the name, genetive name, and long name.
Definition: starobject.cpp:225
KStarsData::updateNumID
unsigned int updateNumID()
Definition: kstarsdata.h:225
Options::useRelativistic
static bool useRelativistic()
Get Apply relativistic corrections due to the bending of light in sun's gravitational field...
Definition: Options.h:2481
StarObject::greekLetter
QString greekLetter(bool useGreekChars=true) const
Returns the greek letter portion of the star's genetive name.
Definition: starobject.cpp:356
SkyPoint::ra0
const dms & ra0() const
Definition: skypoint.h:165
StarObject::getUID
virtual UID getUID() const
Return UID for object.
Definition: starobject.cpp:522
StarObject::getIndexCoords
void getIndexCoords(KSNumbers *num, double *ra, double *dec)
Definition: starobject.cpp:268
deepStarData::Dec
qint32 Dec
Definition: deepstardata.h:30
KStarsData::updateNum
KSNumbers * updateNum()
Definition: kstarsdata.h:226
kspopupmenu.h
StarObject::updateID
quint64 updateID
Definition: starobject.h:265
starData::Dec
qint32 Dec
Definition: stardata.h:30
StarObject::updateNumID
quint64 updateNumID
Definition: starobject.h:266
deepStarData::V
qint16 V
Definition: deepstardata.h:34
skymap.h
StarObject::constell
QString constell(void) const
Definition: starobject.cpp:394
SkyObject::UID
qint64 UID
Type for Unique object IDenticator.
Definition: skyobject.h:53
starData::dDec
qint32 dDec
Definition: stardata.h:32
ksnumbers.h
SkyObject::setName2
void setName2(const QString &name2=QString())
Set the object's secondary name.
Definition: skyobject.h:423
KSPopupMenu::createStarMenu
void createStarMenu(StarObject *star)
Create a popup menu for a star.
Definition: kspopupmenu.cpp:170
dms
An angle, stored as degrees, but expressible in many ways.
Definition: dms.h:42
SkyObject::setType
void setType(int t)
Set the object's type identifier to the argument.
Definition: skyobject.h:171
SkyPoint::dec
const dms & dec() const
Definition: skypoint.h:174
dms::Hours
double Hours() const
Definition: dms.h:125
StarObject::spchar
char spchar() const
Returns just the first character of the spectral type string.
Definition: starobject.cpp:344
SkyPoint::EquatorialToHorizontal
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.
Definition: skypoint.cpp:55
Options.h
SkyObject::name2
QString name2(void) const
Definition: skyobject.h:132
SkyObject::setMag
void setMag(float m)
Set the object's sorting magnitude.
Definition: skyobject.h:409
SkyObject::mag
float mag(void) const
Definition: skyobject.h:182
StarObject::pmMagnitude
double pmMagnitude()
returns the magnitude of the proper motion correction in milliarcsec/year
Definition: starobject.h:180
KSNumbers
There are several time-dependent values used in position calculations, that are not specific to an ob...
Definition: ksnumbers.h:43
GeoLocation::lat
const dms * lat() const
Definition: geolocation.h:79
SkyPoint::setRA0
void setRA0(dms r)
Sets RA0, the catalog Right Ascension.
Definition: skypoint.h:97
deepStarData::dRA
qint16 dRA
Definition: deepstardata.h:31
NaN::d
const double d
Definition: nan.h:35
StarObject::pmDec
double pmDec() const
Definition: starobject.h:207
StarObject::init
void init(const starData *stardata)
Initializes a StarObject to given data.
Definition: starobject.cpp:133
Options::zoomFactor
static double zoomFactor()
Get Zoom Factor, in pixels per radian.
Definition: Options.h:2531
StarObject::labelString
virtual QString labelString() const
Definition: starobject.cpp:514
starobject.h
StarObject::hasName
bool hasName() const
Definition: starobject.h:128
StarObject::StarObject
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.
Definition: starobject.cpp:59
deepStarData::B
qint16 B
Definition: deepstardata.h:33
SkyObject::hasName2
bool hasName2() const
Definition: skyobject.h:270
starData::HD
qint32 HD
Definition: stardata.h:34
SkyPoint::setRA
void setRA(dms r)
Sets RA, the current Right Ascension.
Definition: skypoint.h:119
StarObject::pmRA
double pmRA() const
Definition: starobject.h:204
StarObject::clone
virtual StarObject * clone() const
Create copy of object.
Definition: starobject.cpp:128
SkyPoint::setDec
void setDec(dms d)
Sets Dec, the current Declination.
Definition: skypoint.h:130
kstarsdata.h
SkyPoint::setDec0
void setDec0(dms d)
Sets Dec0, the catalog Declination.
Definition: skypoint.h:108
SkyObject::setName
void setName(const QString &name)
Set the object's primary name.
Definition: skyobject.h:419
skylabeler.h
SkyPoint::lastPrecessJD
long double lastPrecessJD
Definition: skypoint.h:505
starData::flags
char flags
Definition: stardata.h:38
StarObject::name
virtual QString name(void) const
If star is unnamed return "star" otherwise return the name.
Definition: starobject.h:131
Options::showStarNames
static bool showStarNames()
Get Label star names in the sky map?
Definition: Options.h:2215
starData::parallax
qint32 parallax
Definition: stardata.h:33
StarObject::gname
QString gname(bool useGreekChars=true) const
Returns the genetive name of the star.
Definition: starobject.cpp:349
StarObject
This is a subclass of SkyObject.
Definition: starobject.h:41
SkyObject::STAR
Definition: skyobject.h:108
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.
Definition: skyobject.h:46
KSNumbers::julianMillenia
double julianMillenia() const
Definition: ksnumbers.h:96
StarObject::nameLabel
QString nameLabel(bool drawName, bool drawMag) const
Definition: starobject.cpp:493
starData::spec_type
char spec_type[2]
Definition: stardata.h:37
Options::showStarMagnitudes
static bool showStarMagnitudes()
Get Label star magnitudes in the sky map?
Definition: Options.h:2196
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:21 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kstars

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

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal