• 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
  • skycomponents
deepskycomponent.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  deepskycomponent.cpp - K Desktop Planetarium
3  -------------------
4  begin : 2005/15/08
5  copyright : (C) 2005 by Thomas Kabelmann
6  email : thomas.kabelmann@gmx.de
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 "deepskycomponent.h"
19 
20 #include <QDir>
21 #include <QFile>
22 
23 #include <klocale.h>
24 #include <kstandarddirs.h>
25 
26 #include "skyobjects/deepskyobject.h"
27 #include "dms.h"
28 #include "ksfilereader.h"
29 #include "kstarsdata.h"
30 #include "skymap.h"
31 #include "skylabel.h"
32 #include "skylabeler.h"
33 #include "Options.h"
34 #include "skymesh.h"
35 #include "skypainter.h"
36 #include "projections/projector.h"
37 
38 
39 DeepSkyComponent::DeepSkyComponent( SkyComposite *parent ) :
40  SkyComponent(parent)
41 {
42  m_skyMesh = SkyMesh::Instance();
43  // Add labels
44  for( int i = 0; i <= MAX_LINENUMBER_MAG; i++ )
45  m_labelList[ i ] = new LabelList;
46  loadData();
47 }
48 
49 DeepSkyComponent::~DeepSkyComponent()
50 {
51  clear();
52 }
53 
54 bool DeepSkyComponent::selected()
55 {
56  return Options::showDeepSky();
57 }
58 
59 void DeepSkyComponent::update( KSNumbers* )
60 {}
61 
62 void DeepSkyComponent::loadData()
63 {
64 
65  KStarsData* data = KStarsData::Instance();
66  //Check whether we need to concatenate a split NGC/IC catalog
67  //(i.e., if user has downloaded the Steinicke catalog)
68  mergeSplitFiles();
69 
70  QList< QPair<QString,KSParser::DataTypes> > sequence;
71  QList<int> widths;
72  sequence.append(qMakePair(QString("Flag"), KSParser::D_QSTRING));
73  widths.append(1);
74 
75  sequence.append(qMakePair(QString("ID"), KSParser::D_INT));
76  widths.append(4);
77 
78  sequence.append(qMakePair(QString("suffix"), KSParser::D_QSTRING));
79  widths.append(1);
80 
81  sequence.append(qMakePair(QString("RA_H"), KSParser::D_INT));
82  widths.append(2);
83 
84  sequence.append(qMakePair(QString("RA_M"),KSParser::D_INT));
85  widths.append(2);
86 
87  sequence.append(qMakePair(QString("RA_S"),KSParser::D_FLOAT));
88  widths.append(4);
89 
90  sequence.append(qMakePair(QString("D_Sign"),KSParser::D_QSTRING));
91  widths.append(2);
92 
93  sequence.append(qMakePair(QString("Dec_d"),KSParser::D_INT));
94  widths.append(2);
95 
96  sequence.append(qMakePair(QString("Dec_m"),KSParser::D_INT));
97  widths.append(2);
98 
99  sequence.append(qMakePair(QString("Dec_s"),KSParser::D_INT));
100  widths.append(2);
101 
102  sequence.append(qMakePair(QString("BMag"),KSParser::D_QSTRING));
103  widths.append(6);
104 
105  sequence.append(qMakePair(QString("type"),KSParser::D_INT));
106  widths.append(2);
107 
108  sequence.append(qMakePair(QString("a"),KSParser::D_FLOAT));
109  widths.append(6);
110 
111  sequence.append(qMakePair(QString("b"),KSParser::D_FLOAT));
112  widths.append(6);
113 
114  sequence.append(qMakePair(QString("pa"),KSParser::D_QSTRING));
115  widths.append(4);
116 
117  sequence.append(qMakePair(QString("PGC"),KSParser::D_INT));
118  widths.append(7);
119 
120  sequence.append(qMakePair(QString("other cat"),KSParser::D_QSTRING));
121  widths.append(4);
122 
123  sequence.append(qMakePair(QString("other1"),KSParser::D_QSTRING));
124  widths.append(6);
125 
126  sequence.append(qMakePair(QString("other2"),KSParser::D_QSTRING));
127  widths.append(6);
128 
129  sequence.append(qMakePair(QString("Messr"),KSParser::D_QSTRING));
130  widths.append(2);
131 
132  sequence.append(qMakePair(QString("MessrNum"),KSParser::D_INT));
133  widths.append(4);
134 
135  sequence.append(qMakePair(QString("Longname"),KSParser::D_QSTRING));
136  //No width to be appended for last sequence object
137 
138  QString file_name = KStandardDirs::locate( "appdata",
139  QString("ngcic.dat") );
140  KSParser deep_sky_parser(file_name, '#', sequence, widths);
141 
142  deep_sky_parser.SetProgress( i18n("Loading NGC/IC objects"), 13444, 10 );
143  kDebug() << "Loading NGC/IC objects";
144 
145  QHash<QString,QVariant> row_content;
146  while (deep_sky_parser.HasNextRow()) {
147  row_content = deep_sky_parser.ReadNextRow();
148 
149  QString iflag;
150  QString cat;
151  iflag = row_content["Flag"].toString().mid( 0, 1 ); //check for NGC/IC catalog flag
152  /*
153  Q_ASSERT(iflag == "I" || iflag == "N" || iflag == " ");
154  // (spacetime): ^ Why an assert? Change in implementation of ksparser
155  // might result in crash for no reason.
156  // n.b. We also allow non-NGC/IC objects which have a blank iflag
157  */
158 
159  float mag(1000.0);
160  int type, ingc, imess(-1), pa;
161  int pgc, ugc;
162  QString con, ss, name, name2, longname;
163  QString cat2;
164 
165  // Designation
166  if ( iflag == "I" ) cat = "IC";
167  else if ( iflag == "N" ) cat = "NGC";
168 
169  ingc = row_content["ID"].toInt(); // NGC/IC catalog number
170  if ( ingc==0 ) cat.clear(); //object is not in NGC or IC catalogs
171 
172  QString suffix = row_content["suffix"].toString(); // multipliticity suffixes, eg: the 'A' in NGC 4945A
173 
174  Q_ASSERT( suffix.isEmpty() || ( suffix.at( 0 ) >= QChar( 'A' ) && suffix.at( 0 ) <= QChar( 'Z' ) ) || (suffix.at( 0 ) >= QChar( 'a' ) && suffix.at( 0 ) <= QChar( 'z' ) ) );
175 
176  //coordinates
177  int rah = row_content["RA_H"].toInt();
178  int ram = row_content["RA_M"].toInt();
179  float ras = row_content["RA_S"].toFloat();
180  QString sgn = row_content["D_Sign"].toString();
181  int dd = row_content["Dec_d"].toInt();
182  int dm = row_content["Dec_m"].toInt();
183  int ds = row_content["Dec_s"].toInt();
184 
185  if ( !( (0.0 <= rah && rah < 24.0) ||
186  (0.0 <= ram && ram < 60.0) ||
187  (0.0 <= ras && ras < 60.0) ||
188  (0.0 <= dd && dd <= 90.0) ||
189  (0.0 <= dm && dm < 60.0) ||
190  (0.0 <= ds && ds < 60.0) ) ) {
191  kDebug() << "Bad coordinates while processing NGC/IC object: " << cat << ingc;
192  kDebug() << "RA H:M:S = " << rah << ":" << ram << ":" << ras << "; Dec D:M:S = " << dd << ":" << dm << ":" << ds;
193  Q_ASSERT( false );
194  }
195 
196  //Ignore lines with no coordinate values if not debugging
197  if (rah==0 && ram==0 && ras==0)
198  continue;
199 
200  //B magnitude
201  ss = row_content["BMag"].toString();
202  if (ss == "") { mag = 99.9f; } else { mag = ss.toFloat(); }
203 
204  //object type
205  type = row_content["type"].toInt();
206 
207  //major and minor axes
208  float a = row_content["a"].toFloat();
209  float b = row_content["b"].toFloat();
210 
211  //position angle. The catalog PA is zero when the Major axis
212  //is horizontal. But we want the angle measured from North, so
213  //we set PA = 90 - pa.
214  ss = row_content["pa"].toString();
215  if (ss == "" ) { pa = 90; } else { pa = 90 - ss.toInt(); }
216 
217  //PGC number
218  pgc = row_content["PGC"].toInt();
219 
220  //UGC number
221  if (row_content["other cat"].toString().trimmed() == "UGC") {
222  ugc = row_content["other1"].toString().toInt();
223  } else {
224  ugc = 0;
225  }
226 
227  //Messier number
228  if ( row_content["Messr"].toString().trimmed() == "M" ) {
229  cat2 = cat;
230  if ( ingc == 0 ) cat2.clear();
231  cat = 'M';
232  imess = row_content["MessrNum"].toInt();
233  }
234 
235  longname = row_content["Longname"].toString();
236 
237  dms r;
238  r.setH( rah, ram, int(ras) );
239  dms d( dd, dm, ds );
240 
241  if ( sgn == "-" ) { d.setD( -1.0*d.Degrees() ); }
242 
243  bool hasName = true;
244  QString snum;
245  if (cat=="IC" || cat=="NGC") {
246  snum.setNum(ingc);
247  name = cat + ' ' + ( ( suffix.isEmpty() ) ? snum : ( snum + suffix ) );
248  } else if (cat == "M") {
249  snum.setNum( imess );
250  name = cat + ' ' + snum; // Note: Messier has no suffixes
251  if (cat2 == "NGC" || cat2 == "IC") {
252  snum.setNum( ingc );
253  name2 = cat2 + ' ' + ( ( suffix.isEmpty() ) ? snum : ( snum + suffix ) );
254  } else {
255  name2.clear();
256  }
257  }
258  else {
259  if (!longname.isEmpty()) name = longname;
260  else {
261  hasName = false;
262  name = i18n( "Unnamed Object" );
263  }
264  }
265 
266  // create new deepskyobject
267  DeepSkyObject *o = 0;
268  if ( type==0 ) type = 1; //Make sure we use CATALOG_STAR, not STAR
269  o = new DeepSkyObject( type, r, d, mag, name, name2, longname, cat, a, b, pa, pgc, ugc );
270  o->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
271 
272  // Add the name(s) to the nameHash for fast lookup -jbb
273  if ( hasName) {
274  nameHash[ name.toLower() ] = o;
275  if ( ! longname.isEmpty() ) nameHash[ longname.toLower() ] = o;
276  if ( ! name2.isEmpty() ) nameHash[ name2.toLower() ] = o;
277  }
278 
279  Trixel trixel = m_skyMesh->index(o);
280 
281  //Assign object to general DeepSkyObjects list,
282  //and a secondary list based on its catalog.
283  m_DeepSkyList.append( o );
284  appendIndex( o, &m_DeepSkyIndex, trixel );
285 
286  if ( o->isCatalogM()) {
287  m_MessierList.append( o );
288  appendIndex( o, &m_MessierIndex, trixel );
289  }
290  else if (o->isCatalogNGC() ) {
291  m_NGCList.append( o );
292  appendIndex( o, &m_NGCIndex, trixel );
293  }
294  else if ( o->isCatalogIC() ) {
295  m_ICList.append( o );
296  appendIndex( o, &m_ICIndex, trixel );
297  }
298  else {
299  m_OtherList.append( o );
300  appendIndex( o, &m_OtherIndex, trixel );
301  }
302 
303  //Add name to the list of object names
304  if ( ! name.isEmpty() )
305  objectNames(type).append( name );
306 
307  //Add long name to the list of object names
308  if ( ! longname.isEmpty() && longname != name )
309  objectNames(type).append( longname );
310 
311  deep_sky_parser.ShowProgress();
312  }
313 }
314 
315 void DeepSkyComponent::mergeSplitFiles() {
316  //If user has downloaded the Steinicke NGC/IC catalog, then it is
317  //split into multiple files. Concatenate these into a single file.
318  QString firstFile = KStandardDirs::locateLocal("appdata", "ngcic01.dat");
319  if ( ! QFile::exists( firstFile ) ) return;
320  QDir localDir = QFileInfo( firstFile ).absoluteDir();
321  QStringList catFiles = localDir.entryList( QStringList( "ngcic??.dat" ) );
322 
323  kDebug() << "Merging split NGC/IC files" << endl;
324 
325  QString buffer;
326  foreach ( const QString &fname, catFiles ) {
327  QFile f( localDir.absoluteFilePath(fname) );
328  if ( f.open( QIODevice::ReadOnly ) ) {
329  QTextStream stream( &f );
330  buffer += stream.readAll();
331 
332  f.close();
333  } else {
334  kDebug() << QString("Error: Could not open %1 for reading").arg(fname) << endl;
335  }
336  }
337 
338  QFile fout( localDir.absoluteFilePath( "ngcic.dat" ) );
339  if ( fout.open( QIODevice::WriteOnly ) ) {
340  QTextStream oStream( &fout );
341  oStream << buffer;
342  fout.close();
343 
344  //Remove the split-files
345  foreach ( const QString &fname, catFiles ) {
346  QString fullname = localDir.absoluteFilePath(fname);
347  //DEBUG
348  kDebug() << "Removing " << fullname << " ..." << endl;
349  QFile::remove( fullname );
350  }
351  }
352 }
353 
354 void DeepSkyComponent::appendIndex( DeepSkyObject *o, DeepSkyIndex* dsIndex, Trixel trixel )
355 {
356  if ( ! dsIndex->contains( trixel ) ) {
357  dsIndex->insert(trixel, new DeepSkyList() );
358  }
359  dsIndex->value( trixel )->append( o );
360 }
361 
362 
363 void DeepSkyComponent::draw( SkyPainter *skyp )
364 {
365  if ( ! selected() ) return;
366 
367  bool drawFlag;
368 
369  drawFlag = Options::showMessier() &&
370  ! ( Options::hideOnSlew() && Options::hideMessier() && SkyMap::IsSlewing() );
371 
372  drawDeepSkyCatalog( skyp, drawFlag, &m_MessierIndex, "MessColor", Options::showMessierImages() );
373 
374  drawFlag = Options::showNGC() &&
375  ! ( Options::hideOnSlew() && Options::hideNGC() && SkyMap::IsSlewing() );
376 
377  drawDeepSkyCatalog( skyp, drawFlag, &m_NGCIndex, "NGCColor" );
378 
379  drawFlag = Options::showIC() &&
380  ! ( Options::hideOnSlew() && Options::hideIC() && SkyMap::IsSlewing() );
381 
382  drawDeepSkyCatalog( skyp, drawFlag, &m_ICIndex, "ICColor" );
383 
384  drawFlag = Options::showOther() &&
385  ! ( Options::hideOnSlew() && Options::hideOther() && SkyMap::IsSlewing() );
386 
387  drawDeepSkyCatalog( skyp, drawFlag, &m_OtherIndex, "NGCColor" );
388 }
389 
390 void DeepSkyComponent::drawDeepSkyCatalog( SkyPainter *skyp, bool drawObject,
391  DeepSkyIndex* dsIndex, const QString& colorString, bool drawImage)
392 {
393  if ( ! ( drawObject || drawImage ) ) return;
394 
395  SkyMap *map = SkyMap::Instance();
396  const Projector *proj = map->projector();
397  KStarsData *data = KStarsData::Instance();
398 
399  UpdateID updateID = data->updateID();
400  UpdateID updateNumID = data->updateNumID();
401 
402  skyp->setPen( data->colorScheme()->colorNamed( colorString ) );
403  skyp->setBrush( Qt::NoBrush );
404 
405  m_hideLabels = ( map->isSlewing() && Options::hideOnSlew() ) ||
406  ! ( Options::showDeepSkyMagnitudes() || Options::showDeepSkyNames() );
407 
408 
409  double maglim = Options::magLimitDrawDeepSky();
410 
411  //adjust maglimit for ZoomLevel
412  double lgmin = log10(MINZOOM);
413  double lgmax = log10(MAXZOOM);
414  double lgz = log10(Options::zoomFactor());
415  if ( lgz <= 0.75 * lgmax )
416  maglim -= (Options::magLimitDrawDeepSky() - Options::magLimitDrawDeepSkyZoomOut() )*(0.75*lgmax - lgz)/(0.75*lgmax - lgmin);
417  m_zoomMagLimit = maglim;
418 
419  double labelMagLim = Options::deepSkyLabelDensity();
420  labelMagLim += ( Options::magLimitDrawDeepSky() - labelMagLim ) * ( lgz - lgmin) / (lgmax - lgmin );
421  if ( labelMagLim > Options::magLimitDrawDeepSky() ) labelMagLim = Options::magLimitDrawDeepSky();
422 
423 
424  //DrawID drawID = m_skyMesh->drawID();
425  MeshIterator region( m_skyMesh, DRAW_BUF );
426 
427  while ( region.hasNext() ) {
428 
429  Trixel trixel = region.next();
430  DeepSkyList* dsList = dsIndex->value( trixel );
431  if ( dsList == 0 ) continue;
432  for (int j = 0; j < dsList->size(); j++ ) {
433  DeepSkyObject *obj = dsList->at( j );
434 
435  //if ( obj->drawID == drawID ) continue; // only draw each line once
436  //obj->drawID = drawID;
437 
438  if ( obj->updateID != updateID ) {
439  obj->updateID = updateID;
440  if ( obj->updateNumID != updateNumID) {
441  obj->updateCoords( data->updateNum() );
442  }
443  obj->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
444  }
445 
446  float mag = obj->mag();
447  float size = obj->a() * dms::PI * Options::zoomFactor() / 10800.0;
448 
449  //only draw objects if flags set, it's bigger than 1 pixel (unless
450  //zoom > 2000.), and it's brighter than maglim (unless mag is
451  //undefined (=99.9)
452  if ( (size > 1.0 || Options::zoomFactor() > 2000.) &&
453  ( mag < (float)maglim || obj->isCatalogIC() ) )
454  {
455 
456  bool drawn = skyp->drawDeepSkyObject(obj, drawImage);
457  if ( drawn && !( m_hideLabels || mag > labelMagLim ) )
458  addLabel( proj->toScreen(obj), obj );
459  //FIXME: find a better way to do above
460  }
461  }
462  }
463 }
464 
465 void DeepSkyComponent::addLabel( const QPointF& p, DeepSkyObject *obj )
466 {
467  int idx = int( obj->mag() * 10.0 );
468  if ( idx < 0 ) idx = 0;
469  if ( idx > MAX_LINENUMBER_MAG ) idx = MAX_LINENUMBER_MAG;
470  m_labelList[ idx ]->append( SkyLabel( p, obj ) );
471 }
472 
473 void DeepSkyComponent::drawLabels()
474 {
475  if ( m_hideLabels ) return;
476 
477  SkyLabeler *labeler = SkyLabeler::Instance();
478  labeler->setPen( QColor( KStarsData::Instance()->colorScheme()->colorNamed( "DSNameColor" ) ) );
479 
480  int max = int( m_zoomMagLimit * 10.0 );
481  if ( max < 0 ) max = 0;
482  if ( max > MAX_LINENUMBER_MAG ) max = MAX_LINENUMBER_MAG;
483 
484  for ( int i = 0; i <= max; i++ ) {
485  LabelList* list = m_labelList[ i ];
486  for ( int j = 0; j < list->size(); j++ ) {
487  labeler->drawNameLabel(list->at(j).obj, list->at(j).o);
488  }
489  list->clear();
490  }
491 
492 }
493 
494 
495 SkyObject* DeepSkyComponent::findByName( const QString &name ) {
496 
497  return nameHash[ name.toLower() ];
498 }
499 
500 void DeepSkyComponent::objectsInArea( QList<SkyObject*>& list, const SkyRegion& region )
501 {
502  for( SkyRegion::const_iterator it = region.constBegin(); it != region.constEnd(); ++it )
503  {
504  Trixel trixel = it.key();
505  if( m_DeepSkyIndex.contains( trixel ) )
506  {
507  DeepSkyList* dsoList = m_DeepSkyIndex.value(trixel);
508  for( DeepSkyList::iterator dsit = dsoList->begin(); dsit != dsoList->end(); ++dsit )
509  list.append( *dsit );
510  }
511  }
512 }
513 
514 
515 //we multiply each catalog's smallest angular distance by the
516 //following factors before selecting the final nearest object:
517 // IC catalog = 0.8
518 // NGC catalog = 0.5
519 // "other" catalog = 0.4
520 // Messier object = 0.25
521 SkyObject* DeepSkyComponent::objectNearest( SkyPoint *p, double &maxrad ) {
522 
523  if ( ! selected() ) return 0;
524 
525  SkyObject *oTry = 0;
526  SkyObject *oBest = 0;
527  double rTry = maxrad;
528  double rBest = maxrad;
529  double r;
530  DeepSkyList* dsList;
531  SkyObject* obj;
532 
533  MeshIterator region( m_skyMesh, OBJ_NEAREST_BUF );
534  while ( region.hasNext() ) {
535  dsList = m_ICIndex[ region.next() ];
536  if ( ! dsList ) continue;
537  for (int i=0; i < dsList->size(); ++i) {
538  obj = dsList->at( i );
539  r = obj->angularDistanceTo( p ).Degrees();
540  if ( r < rTry ) {
541  rTry = r;
542  oTry = obj;
543  }
544  }
545  }
546 
547  rTry *= 0.8;
548  if ( rTry < rBest ) {
549  rBest = rTry;
550  oBest = oTry;
551  }
552 
553  rTry = maxrad;
554  region.reset();
555  while ( region.hasNext() ) {
556  dsList = m_NGCIndex[ region.next() ];
557  if ( ! dsList ) continue;
558  for (int i=0; i < dsList->size(); ++i) {
559  obj = dsList->at( i );
560  r = obj->angularDistanceTo( p ).Degrees();
561  if ( r < rTry ) {
562  rTry = r;
563  oTry = obj;
564  }
565  }
566  }
567 
568  rTry *= 0.6;
569  if ( rTry < rBest ) {
570  rBest = rTry;
571  oBest = oTry;
572  }
573 
574  rTry = maxrad;
575 
576  region.reset();
577  while ( region.hasNext() ) {
578  dsList = m_OtherIndex[ region.next() ];
579  if ( ! dsList ) continue;
580  for (int i=0; i < dsList->size(); ++i) {
581  obj = dsList->at( i );
582  r = obj->angularDistanceTo( p ).Degrees();
583  if ( r < rTry ) {
584  rTry = r;
585  oTry = obj;
586  }
587  }
588  }
589 
590  rTry *= 0.6;
591  if ( rTry < rBest ) {
592  rBest = rTry;
593  oBest = oTry;
594  }
595 
596  rTry = maxrad;
597 
598  region.reset();
599  while ( region.hasNext() ) {
600  dsList = m_MessierIndex[ region.next() ];
601  if ( ! dsList ) continue;
602  for (int i=0; i < dsList->size(); ++i) {
603  obj = dsList->at( i );
604  r = obj->angularDistanceTo( p ).Degrees();
605  if ( r < rTry ) {
606  rTry = r;
607  oTry = obj;
608  }
609  }
610  }
611 
612  // -jbb: this is the template of the non-indexed way
613  //
614  //foreach ( SkyObject *o, m_MessierList ) {
615  // r = o->angularDistanceTo( p ).Degrees();
616  // if ( r < rTry ) {
617  // rTry = r;
618  // oTry = o;
619  // }
620  //}
621 
622  rTry *= 0.5;
623  if ( rTry < rBest ) {
624  rBest = rTry;
625  oBest = oTry;
626  }
627 
628  maxrad = rBest;
629  return oBest;
630 }
631 
632 void DeepSkyComponent::clearList(QList<DeepSkyObject*>& list) {
633  while( !list.isEmpty() ) {
634  SkyObject *o = list.takeFirst();
635  removeFromNames( o );
636  delete o;
637  }
638 }
639 
640 void DeepSkyComponent::clear() {
641  clearList( m_MessierList );
642  clearList( m_NGCList );
643  clearList( m_ICList );
644  clearList( m_OtherList );
645 }
SkyPainter::setBrush
virtual void setBrush(const QBrush &brush)=0
Set the brush of the painter.
KStarsData
KStarsData is the backbone of KStars.
Definition: kstarsdata.h:66
DeepSkyObject::isCatalogIC
bool isCatalogIC() const
Definition: deepskyobject.h:179
Options::hideNGC
static bool hideNGC()
Get Hide NGC objects while moving?
Definition: Options.h:1265
Options::deepSkyLabelDensity
static double deepSkyLabelDensity()
Get Relative density for deep-sky object name labels and/or magnitudes.
Definition: Options.h:2683
KStarsData::updateID
unsigned int updateID()
Definition: kstarsdata.h:224
SkyRegion
QHash< Trixel, bool > SkyRegion
Definition: skycomponents/typedef.h:47
KSParser
Generic class for text file parsers used in KStars.
Definition: ksparser.h:49
KStarsData::colorScheme
ColorScheme * colorScheme()
Definition: kstarsdata.h:149
deepskyobject.h
DeepSkyList
QVector< DeepSkyObject * > DeepSkyList
Definition: deepskycomponent.h:43
MAX_LINENUMBER_MAG
#define MAX_LINENUMBER_MAG
Definition: deepskycomponent.h:41
DeepSkyComponent::selected
bool selected()
Definition: deepskycomponent.cpp:54
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
DeepSkyComponent::clear
void clear()
Definition: deepskycomponent.cpp:640
UpdateID
quint32 UpdateID
Definition: skycomponents/typedef.h:41
SkyComponent
SkyComponent represents an object on the sky map.
Definition: skycomponent.h:44
ColorScheme::colorNamed
QColor colorNamed(const QString &name) const
Retrieve a color by name.
Definition: colorscheme.cpp:97
skypainter.h
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
KStarsData::geo
GeoLocation * geo()
Definition: kstarsdata.h:164
skylabel.h
KStarsData::updateNumID
unsigned int updateNumID()
Definition: kstarsdata.h:225
Options::hideOnSlew
static bool hideOnSlew()
Get Hide objects while moving?
Definition: Options.h:1094
DeepSkyIndex
QHash< int, DeepSkyList * > DeepSkyIndex
Definition: deepskycomponent.h:44
DeepSkyComponent::draw
virtual void draw(SkyPainter *skyp)
Draw the object on the SkyMap skyp a pointer to the SkyPainter to use.
Definition: deepskycomponent.cpp:363
DeepSkyComponent::findByName
virtual SkyObject * findByName(const QString &name)
Search the children of this SkyComponent for a SkyObject whose name matches the argument name the nam...
Definition: deepskycomponent.cpp:495
DeepSkyComponent::objectNearest
virtual SkyObject * objectNearest(SkyPoint *p, double &maxrad)
Find the SkyObject nearest the given SkyPoint.
Definition: deepskycomponent.cpp:521
MAXZOOM
#define MAXZOOM
Definition: kstarsdata.h:39
dms.h
NaN::f
const float f
Definition: nan.h:36
SkyLabeler::Instance
static SkyLabeler * Instance()
Definition: skylabeler.cpp:49
KStarsData::updateNum
KSNumbers * updateNum()
Definition: kstarsdata.h:226
DeepSkyObject::isCatalogNGC
bool isCatalogNGC() const
Definition: deepskyobject.h:174
SkyPoint
The sky coordinates of a point in the sky.
Definition: skypoint.h:50
Projector
This class serves as an interface to handle projections.
Definition: projector.h:49
Projector::toScreen
QPointF toScreen(const SkyPoint *o, bool oRefract=true, bool *onVisibleHemisphere=0) const
This is exactly the same as toScreenVec but it returns a QPointF.
Definition: projector.cpp:93
DeepSkyObject::a
float a() const
Definition: deepskyobject.h:132
deepskycomponent.h
KSParser::D_FLOAT
Definition: ksparser.h:70
MINZOOM
#define MINZOOM
Definition: kstarsdata.h:38
DeepSkyComponent::update
virtual void update(KSNumbers *num=0)
Update the sky positions of this component.
Definition: deepskycomponent.cpp:59
SkyComponent::removeFromNames
void removeFromNames(const SkyObject *obj)
Definition: skycomponent.cpp:58
Options::magLimitDrawDeepSkyZoomOut
static double magLimitDrawDeepSkyZoomOut()
Get Faint limit for deep-sky objects when zoomed out.
Definition: Options.h:2607
SkyMap::isSlewing
bool isSlewing() const
Definition: skymap.cpp:1133
skymap.h
Options::hideIC
static bool hideIC()
Get Hide IC objects while moving?
Definition: Options.h:1227
Options::showDeepSky
static bool showDeepSky()
Get Draw "deep sky" objects in the sky map?
Definition: Options.h:1626
Options::magLimitDrawDeepSky
static double magLimitDrawDeepSky()
Get Faint limit for deep-sky objects.
Definition: Options.h:2588
Options::showDeepSkyMagnitudes
static bool showDeepSkyMagnitudes()
Get Label deep-sky object magnitudes in the sky map?
Definition: Options.h:2234
dms
An angle, stored as degrees, but expressible in many ways.
Definition: dms.h:42
SkyMesh::Instance
static SkyMesh * Instance()
Definition: skymesh.cpp:48
SkyComposite
SkyComposite is a kind of container class for SkyComponent objects.
Definition: skycomposite.h:43
KSParser::D_INT
Definition: ksparser.h:69
SkyLabel
Definition: skylabel.h:28
DeepSkyObject::updateNumID
quint64 updateNumID
Definition: deepskyobject.h:192
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
DRAW_BUF
Definition: skymesh.h:52
SkyPainter::setPen
virtual void setPen(const QPen &pen)=0
Set the pen of the painter.
Trixel
unsigned int Trixel
Definition: htmesh/typedef.h:4
MeshIterator
Definition: MeshIterator.h:22
Options.h
MeshIterator::hasNext
bool hasNext() const
Definition: MeshIterator.h:29
SkyObject::mag
float mag(void) const
Definition: skyobject.h:182
DeepSkyObject
Provides all necessary information about a deep-sky object: data inherited from SkyObject (coordinate...
Definition: deepskyobject.h:43
QTextStream
KSNumbers
There are several time-dependent values used in position calculations, that are not specific to an ob...
Definition: ksnumbers.h:43
DeepSkyObject::isCatalogM
bool isCatalogM() const
Definition: deepskyobject.h:169
Options::showMessierImages
static bool showMessierImages()
Get Draw Messier object images in the sky map?
Definition: Options.h:1854
OBJ_NEAREST_BUF
Definition: skymesh.h:54
GeoLocation::lat
const dms * lat() const
Definition: geolocation.h:79
ksfilereader.h
NaN::d
const double d
Definition: nan.h:35
PI
#define PI
Definition: satellite.cpp:43
Options::zoomFactor
static double zoomFactor()
Get Zoom Factor, in pixels per radian.
Definition: Options.h:2531
SkyMap::IsSlewing
static bool IsSlewing()
Definition: skymap.h:91
Options::showNGC
static bool showNGC()
Get Draw NGC objects in the sky map?
Definition: Options.h:1816
SkyMap
This is the canvas on which the sky is painted.
Definition: skymap.h:72
projector.h
SkyMap::Instance
static SkyMap * Instance()
Definition: skymap.cpp:141
SkyLabeler::setPen
void setPen(const QPen &pen)
sets the pen used for drawing labels on the sky.
Definition: skylabeler.cpp:173
MeshIterator::reset
void reset() const
Definition: MeshIterator.h:42
SkyLabeler::drawNameLabel
bool drawNameLabel(SkyObject *obj, const QPointF &_p)
Tries to draw a label for an object.
Definition: skylabeler.cpp:151
Options::hideOther
static bool hideOther()
Get Hide extra objects while moving?
Definition: Options.h:1284
MeshIterator::next
Trixel next() const
Definition: MeshIterator.h:33
DeepSkyObject::updateID
quint64 updateID
Definition: deepskyobject.h:191
kstarsdata.h
skylabeler.h
skymesh.h
DeepSkyComponent::objectsInArea
virtual void objectsInArea(QList< SkyObject * > &list, const SkyRegion &region)
Searches the region(s) and appends the SkyObjects found to the list of sky objects.
Definition: deepskycomponent.cpp:500
SkyLabeler
The purpose of this class is to prevent labels from overlapping.
Definition: skylabeler.h:112
DeepSkyComponent::~DeepSkyComponent
~DeepSkyComponent()
Definition: deepskycomponent.cpp:49
SkyComponent::objectNames
QHash< int, QStringList > & objectNames()
Definition: skycomponent.h:127
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
SkyMesh::index
Trixel index(const SkyPoint *p)
Definition: skymesh.cpp:93
SkyMap::projector
const Projector * projector() const
Get the current projector.
Definition: skymap.h:264
SkyPainter
Draws things on the sky, without regard to backend.
Definition: skypainter.h:47
KSParser::D_QSTRING
Definition: ksparser.h:68
Options::showDeepSkyNames
static bool showDeepSkyNames()
Get Label deep-sky objects in the sky map?
Definition: Options.h:2253
SkyPoint::angularDistanceTo
dms angularDistanceTo(const SkyPoint *sp, double *const positionAngle=0) const
Computes the angular distance between two SkyObjects.
Definition: skypoint.cpp:608
DeepSkyComponent::drawLabels
void drawLabels()
Definition: deepskycomponent.cpp:473
Options::showIC
static bool showIC()
Get Draw IC objects in the sky map?
Definition: Options.h:1797
DeepSkyComponent::DeepSkyComponent
DeepSkyComponent(SkyComposite *)
Definition: deepskycomponent.cpp:39
SkyPainter::drawDeepSkyObject
virtual bool drawDeepSkyObject(DeepSkyObject *obj, bool drawImage=false)=0
Draw a deep sky object.
QList
Options::showOther
static bool showOther()
Get Draw extra deep-sky objects in the sky map?
Definition: Options.h:1873
Options::hideMessier
static bool hideMessier()
Get Hide Messier objects while moving?
Definition: Options.h:1246
Options::showMessier
static bool showMessier()
Get Draw Messier objects in the sky map?
Definition: Options.h:1835
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:19 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