Kstars

wutdialog.cpp
1/*
2 SPDX-FileCopyrightText: 2003 Thomas Kabelmann <tk78@gmx.de>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#include "wutdialog.h"
8
9#include "kstars.h"
10#include "skymap.h"
11#include "dialogs/detaildialog.h"
12#include "dialogs/locationdialog.h"
13#include "dialogs/timedialog.h"
14#include "skyobjects/kssun.h"
15#include "skyobjects/ksmoon.h"
16#include "skycomponents/skymapcomposite.h"
17#include "tools/observinglist.h"
18#include "catalogsdb.h"
19#include "Options.h"
20
21#include <KLocalizedString>
22
23WUTDialogUI::WUTDialogUI(QWidget *p) : QFrame(p)
24{
25 setupUi(this);
26}
27
28WUTDialog::WUTDialog(QWidget *parent, bool _session, GeoLocation *_geo,
30 : QDialog(parent), session(_session), T0(_lt), geo(_geo)
31{
32#ifdef Q_OS_MACOS
34#endif
35 WUT = new WUTDialogUI(this);
36
37 QVBoxLayout *mainLayout = new QVBoxLayout(this);
38
39 mainLayout->addWidget(WUT);
40
41 setWindowTitle(i18nc("@title:window", "What's up Tonight"));
42
44 mainLayout->addWidget(buttonBox);
45 connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
46
47 setModal(false);
48
49 //If the Time is earlier than 6:00 am, assume the user wants the night of the previous date
50 if (T0.time().hour() < 6)
51 T0 = T0.addDays(-1);
52
53 //Now, set time T0 to midnight (of the following day)
54 T0.setTime(QTime(0, 0, 0));
55 T0 = T0.addDays(1);
56 UT0 = geo->LTtoUT(T0);
57
58 //Set the Tomorrow date/time to Noon the following day
59 Tomorrow = T0.addSecs(12 * 3600);
60 TomorrowUT = geo->LTtoUT(Tomorrow);
61
62 //Set the Evening date/time to 6:00 pm
63 Evening = T0.addSecs(-6 * 3600);
64 EveningUT = geo->LTtoUT(Evening);
65
66 QString sGeo = geo->translatedName();
67 if (!geo->translatedProvince().isEmpty())
68 sGeo += ", " + geo->translatedProvince();
69 sGeo += ", " + geo->translatedCountry();
70 WUT->LocationLabel->setText(i18n("at %1", sGeo));
71 WUT->DateLabel->setText(
72 i18n("The night of %1", QLocale().toString(Evening.date(), QLocale::LongFormat)));
73 m_Mag = 10.0;
74 WUT->MagnitudeEdit->setValue(m_Mag);
75 //WUT->MagnitudeEdit->setSliderEnabled( true );
76 WUT->MagnitudeEdit->setSingleStep(0.100);
77 initCategories();
78
79 makeConnections();
80}
81
82void WUTDialog::makeConnections()
83{
84 connect(WUT->DateButton, SIGNAL(clicked()), SLOT(slotChangeDate()));
85 connect(WUT->LocationButton, SIGNAL(clicked()), SLOT(slotChangeLocation()));
86 connect(WUT->CenterButton, SIGNAL(clicked()), SLOT(slotCenter()));
87 connect(WUT->DetailButton, SIGNAL(clicked()), SLOT(slotDetails()));
88 connect(WUT->ObslistButton, SIGNAL(clicked()), SLOT(slotObslist()));
89 connect(WUT->CategoryListWidget, SIGNAL(currentTextChanged(QString)),
90 SLOT(slotLoadList(QString)));
91 connect(WUT->ObjectListWidget, SIGNAL(currentTextChanged(QString)),
92 SLOT(slotDisplayObject(QString)));
93 connect(WUT->EveningMorningBox, SIGNAL(activated(int)),
94 SLOT(slotEveningMorning(int)));
95 connect(WUT->MagnitudeEdit, SIGNAL(valueChanged(double)),
96 SLOT(slotChangeMagnitude()));
97}
98
99void WUTDialog::initCategories()
100{
101 m_Categories << i18n("Planets") << i18n("Stars") << i18n("Nebulae")
102 << i18n("Galaxies") << i18n("Star Clusters") << i18n("Constellations")
103 << i18n("Asteroids") << i18n("Comets");
104
105 foreach (const QString &c, m_Categories)
106 WUT->CategoryListWidget->addItem(c);
107
108 WUT->CategoryListWidget->setCurrentRow(0);
109}
110
112{
113 QString sRise, sSet, sDuration;
114 float Dur;
115 int hDur, mDur;
116 KStarsData *data = KStarsData::Instance();
117 // reset all lists
118 foreach (const QString &c, m_Categories)
119 {
120 if (m_VisibleList.contains(c))
121 visibleObjects(c).clear();
122 else
123 m_VisibleList[c] = QSet<const SkyObject *>();
124
125 m_CategoryInitialized[c] = false;
126 }
127
128 // sun almanac information
129 KSSun *oSun = dynamic_cast<KSSun *>(data->objectNamed(i18n("Sun")));
130
131 Q_ASSERT(oSun);
132
133 sunRiseTomorrow = oSun->riseSetTime(TomorrowUT, geo, true);
134 sunSetToday = oSun->riseSetTime(EveningUT, geo, false);
135 sunRiseToday = oSun->riseSetTime(EveningUT, geo, true);
136
137 //check to see if Sun is circumpolar
138 KSNumbers *num = new KSNumbers(UT0.djd());
139 KSNumbers *oldNum = new KSNumbers(data->ut().djd());
140 CachingDms LST = geo->GSTtoLST(T0.gst());
141
142 oSun->updateCoords(num, true, geo->lat(), &LST, true);
143 if (oSun->checkCircumpolar(geo->lat()))
144 {
145 if (oSun->alt().Degrees() > 0.0)
146 {
147 sRise = i18n("circumpolar");
148 sSet = i18n("circumpolar");
149 sDuration = "00:00";
150 Dur = hDur = mDur = 0;
151 }
152 else
153 {
154 sRise = i18n("does not rise");
155 sSet = i18n("does not rise");
156 sDuration = "24:00";
157 Dur = hDur = 24;
158 mDur = 0;
159 }
160 }
161 else
162 {
163 //Round times to the nearest minute by adding 30 seconds to the time
164 sRise = QLocale().toString(sunRiseTomorrow);
165 sSet = QLocale().toString(sunSetToday);
166
167 Dur = 24.0 + (float)sunRiseTomorrow.hour() +
168 (float)sunRiseTomorrow.minute() / 60.0 +
169 (float)sunRiseTomorrow.second() / 3600.0 - (float)sunSetToday.hour() -
170 (float)sunSetToday.minute() / 60.0 - (float)sunSetToday.second() / 3600.0;
171 hDur = int(Dur);
172 mDur = int(60.0 * (Dur - (float)hDur));
173 QTime tDur(hDur, mDur);
174 //sDuration = QLocale().toString(tDur);
175 // Should always be in 24 hour format
176 sDuration = tDur.toString("hh:mm");
177 }
178
179 WUT->SunSetLabel->setText(
180 i18nc("Sunset at time %1 on date %2", "Sunset: %1 on %2", sSet,
181 QLocale().toString(Evening.date(), QLocale::LongFormat)));
182 WUT->SunRiseLabel->setText(
183 i18nc("Sunrise at time %1 on date %2", "Sunrise: %1 on %2", sRise,
184 QLocale().toString(Tomorrow.date(), QLocale::LongFormat)));
185 if (Dur == 0)
186 WUT->NightDurationLabel->setText(i18n("Night duration: %1", sDuration));
187 else if (Dur > 1)
188 WUT->NightDurationLabel->setText(i18n("Night duration: %1 hours", sDuration));
189 else if (Dur == 1)
190 WUT->NightDurationLabel->setText(i18n("Night duration: %1 hour", sDuration));
191 else if (mDur > 1)
192 WUT->NightDurationLabel->setText(i18n("Night duration: %1 minutes", sDuration));
193 else if (mDur == 1)
194 WUT->NightDurationLabel->setText(i18n("Night duration: %1 minute", sDuration));
195
196 // moon almanac information
197 KSMoon *oMoon = dynamic_cast<KSMoon *>(data->objectNamed(i18n("Moon")));
198 moonRise = oMoon->riseSetTime(UT0, geo, true);
199 moonSet = oMoon->riseSetTime(UT0, geo, false);
200
201 //check to see if Moon is circumpolar
202 oMoon->updateCoords(num, true, geo->lat(), &LST, true);
203 if (oMoon->checkCircumpolar(geo->lat()))
204 {
205 if (oMoon->alt().Degrees() > 0.0)
206 {
207 sRise = i18n("circumpolar");
208 sSet = i18n("circumpolar");
209 }
210 else
211 {
212 sRise = i18n("does not rise");
213 sSet = i18n("does not rise");
214 }
215 }
216 else
217 {
218 //Round times to the nearest minute by adding 30 seconds to the time
219 sRise = QLocale().toString(moonRise.addSecs(30));
220 sSet = QLocale().toString(moonSet.addSecs(30));
221 }
222
223 WUT->MoonRiseLabel->setText(
224 i18n("Moon rises at: %1 on %2", sRise,
225 QLocale().toString(Evening.date(), QLocale::LongFormat)));
226
227 // If the moon rises and sets on the same day, this will be valid [ Unless
228 // the moon sets on the next day after staying on for over 24 hours ]
229
230 if (moonSet > moonRise)
231 WUT->MoonSetLabel->setText(
232 i18n("Moon sets at: %1 on %2", sSet,
233 QLocale().toString(Evening.date(), QLocale::LongFormat)));
234 else
235 WUT->MoonSetLabel->setText(
236 i18n("Moon sets at: %1 on %2", sSet,
237 QLocale().toString(Tomorrow.date(), QLocale::LongFormat)));
238 oMoon->findPhase(nullptr);
239 WUT->MoonIllumLabel->setText(i18nc("%2 is the value, % is the percent sign", "%1 (%2%)", oMoon->phaseName(), int(100.0 * oMoon->illum())));
240
241 //Restore Sun's and Moon's coordinates, and recompute Moon's original Phase
242 oMoon->updateCoords(oldNum, true, geo->lat(), data->lst(), true);
243 oSun->updateCoords(oldNum, true, geo->lat(), data->lst(), true);
244 oMoon->findPhase(nullptr);
245
246 if (WUT->CategoryListWidget->currentItem())
247 slotLoadList(WUT->CategoryListWidget->currentItem()->text());
248
249 delete num;
250 delete oldNum;
251}
252
253QSet<const SkyObject *> &WUTDialog::visibleObjects(const QString &category)
254{
255 return m_VisibleList[category];
256}
257
258const SkyObject * WUTDialog::findVisibleObject(const QString &name)
259{
260 for (const auto &oneList : m_VisibleList)
261 {
262 for (const auto &oneObject : oneList)
263 {
264 if (oneObject->name() == name)
265 return oneObject;
266 }
267 }
268
269 return nullptr;
270}
271
272bool WUTDialog::isCategoryInitialized(const QString &category)
273{
274 return m_CategoryInitialized[category];
275}
276
277QVector<QPair<QString, const SkyObject *>> WUTDialog::load_dso(const QString &category,
278 const std::vector<SkyObject::TYPE> &types)
279{
280 CatalogsDB::DBManager db{ CatalogsDB::dso_db_path() };
282
283 auto &lst = m_CatalogObjects[category];
284 lst.clear();
285
286 for (const auto type : types)
287 {
288 lst.splice(lst.end(), db.get_objects(type, m_Mag));
289 }
290
291 objects.reserve(lst.size());
292 for (const auto &obj : lst)
293 {
294 objects.push_back({ obj.name(), &obj });
295 }
296
297 return objects;
298}
299
300void WUTDialog::slotLoadList(const QString &c)
301{
302 KStarsData *data = KStarsData::Instance();
303 if (!m_VisibleList.contains(c))
304 return;
305
306 WUT->ObjectListWidget->clear();
308
309 const bool isDSO = c == m_Categories[2] || c == m_Categories[3] || c == m_Categories[4];
310
311 if (!isCategoryInitialized(c))
312 {
313 if (c == m_Categories[0]) //Planets
314 {
315 foreach (const QString &name,
316 data->skyComposite()->objectNames(SkyObject::PLANET))
317 {
318 SkyObject *o = data->skyComposite()->findByName(name);
319
320 if (o->mag() <= m_Mag && checkVisibility(o))
321 visibleObjects(c).insert(o);
322 }
323
324 m_CategoryInitialized[c] = true;
325 }
326
327 else if (c == m_Categories[1]) //Stars
328 {
330 starObjects.append(data->skyComposite()->objectLists(SkyObject::STAR));
331 starObjects.append(
332 data->skyComposite()->objectLists(SkyObject::CATALOG_STAR));
333 starObjects.append(load_dso(c, { SkyObject::STAR, SkyObject::CATALOG_STAR }));
334
335 for (const auto &object : starObjects)
336 {
337 const SkyObject *o = object.second;
338
339 if (o->mag() <= m_Mag && checkVisibility(o))
340 {
341 visibleObjects(c).insert(o);
342 }
343 }
344 m_CategoryInitialized[c] = true;
345 }
346
347 else if (c == m_Categories[5]) //Constellations
348 {
349 foreach (SkyObject *o, data->skyComposite()->constellationNames())
350 if (checkVisibility(o))
351 visibleObjects(c).insert(o);
352
353 m_CategoryInitialized[c] = true;
354 }
355
356 else if (c == m_Categories[6]) //Asteroids
357 {
358 foreach (SkyObject *o, data->skyComposite()->asteroids())
359 if (o->mag() <= m_Mag &&
360 o->name() != i18nc("Asteroid name (optional)", "Pluto") &&
362 visibleObjects(c).insert(o);
363
364 m_CategoryInitialized[c] = true;
365 }
366
367 else if (c == m_Categories[7]) //Comets
368 {
369 foreach (SkyObject *o, data->skyComposite()->comets())
370 if (o->mag() <= m_Mag && checkVisibility(o))
371 visibleObjects(c).insert(o);
372
373 m_CategoryInitialized[c] = true;
374 }
375
376 else //all deep-sky objects, need to split clusters, nebulae and galaxies
377 {
378 auto dsos{ load_dso(c,
379 {
380 SkyObject::OPEN_CLUSTER, SkyObject::GLOBULAR_CLUSTER,
381 SkyObject::GASEOUS_NEBULA, SkyObject::PLANETARY_NEBULA,
382 SkyObject::SUPERNOVA_REMNANT, SkyObject::SUPERNOVA,
383 SkyObject::GALAXY
384 }) };
385
386 for (auto &dso : dsos)
387 {
388 const SkyObject *o = dso.second;
389 if (checkVisibility(o) && o->mag() <= m_Mag)
390 {
391 switch (o->type())
392 {
393 case SkyObject::OPEN_CLUSTER: //fall through
394 case SkyObject::GLOBULAR_CLUSTER:
395 visibleObjects(m_Categories[4]).insert(o); //star clusters
396 break;
397 case SkyObject::GASEOUS_NEBULA: //fall through
398 case SkyObject::PLANETARY_NEBULA: //fall through
399 case SkyObject::SUPERNOVA: //fall through
400 case SkyObject::SUPERNOVA_REMNANT:
401 visibleObjects(m_Categories[2]).insert(o); //nebulae
402 break;
403 case SkyObject::GALAXY:
404 visibleObjects(m_Categories[3]).insert(o); //galaxies
405 break;
406 }
407 }
408 }
409
410 m_CategoryInitialized[m_Categories[2]] = true;
411 m_CategoryInitialized[m_Categories[3]] = true;
412 m_CategoryInitialized[m_Categories[4]] = true;
413 }
414 }
415
416 //Now the category has been initialized, we can populate the list widget
417 if (isDSO)
418 {
419 for (const auto &oneObject : visibleObjects(c))
420 WUT->ObjectListWidget->addItem(oneObject->name());
421 }
422 else
423 {
424 for (const auto &oneObject : visibleObjects(c))
425 WUT->ObjectListWidget->addItem(oneObject->longname());
426 }
427
429
430 // highlight first item
431 if (WUT->ObjectListWidget->count())
432 {
433 WUT->ObjectListWidget->setCurrentRow(0);
434 WUT->ObjectListWidget->setFocus();
435 }
436}
437
439{
440 bool visible(false);
441 double minAlt =
442 6.0; //An object is considered 'visible' if it is above horizon during civil twilight.
443
444 // reject objects that never rise
445 if (o->checkCircumpolar(geo->lat()) == true && o->alt().Degrees() <= 0)
446 return false;
447
448 //Initial values for T1, T2 assume all night option of EveningMorningBox
449 KStarsDateTime T1 = Evening;
450 T1.setTime(sunSetToday);
451 KStarsDateTime T2 = Tomorrow;
452 T2.setTime(sunRiseTomorrow);
453
454 //Check Evening/Morning only state:
455 if (EveningFlag == 0) //Evening only
456 {
457 T2 = T0; //midnight
458 }
459 else if (EveningFlag == 1) //Morning only
460 {
461 T1 = T0; //midnight
462 }
463
464 for (KStarsDateTime test = T1; test < T2; test = test.addSecs(3600))
465 {
466 //Need LST of the test time, expressed as a dms object.
467 KStarsDateTime ut = geo->LTtoUT(test);
468 dms LST = geo->GSTtoLST(ut.gst());
469 SkyPoint sp = o->recomputeCoords(ut, geo);
470
471 //check altitude of object at this time.
472 sp.EquatorialToHorizontal(&LST, geo->lat());
473
474 if (sp.alt().Degrees() > minAlt)
475 {
476 visible = true;
477 break;
478 }
479 }
480
481 return visible;
482}
483
484void WUTDialog::slotDisplayObject(const QString &name)
485{
486 QTime tRise, tSet, tTransit;
487 QString sRise, sTransit, sSet;
488
489 sRise = "--:--";
490 sTransit = "--:--";
491 sSet = "--:--";
492 WUT->DetailButton->setEnabled(false);
493
494 SkyObject *o = nullptr;
495 if (name.isEmpty())
496 {
497 //no object selected
498 WUT->ObjectBox->setTitle(i18n("No Object Selected"));
499 o = nullptr;
500 }
501 else
502 {
503 o = KStarsData::Instance()->objectNamed(name);
504
505 if (!o) //should never get here
506 {
507 WUT->ObjectBox->setTitle(i18n("Object Not Found"));
508 }
509 }
510 if (o)
511 {
512 WUT->ObjectBox->setTitle(o->name());
513
514 if (o->checkCircumpolar(geo->lat()))
515 {
516 if (o->alt().Degrees() > 0.0)
517 {
518 sRise = i18n("circumpolar");
519 sSet = i18n("circumpolar");
520 }
521 else
522 {
523 sRise = i18n("does not rise");
524 sSet = i18n("does not rise");
525 }
526 }
527 else
528 {
529 tRise = o->riseSetTime(T0, geo, true);
530 tSet = o->riseSetTime(T0, geo, false);
531
532 sRise = QString("%1:%2").arg(tRise.hour(), 2, 10, QChar('0')).arg(tRise.minute(), 2, 10, QChar('0'));
533 sSet = QString("%1:%2").arg(tSet.hour(), 2, 10, QChar('0')).arg(tSet.minute(), 2, 10, QChar('0'));
534 }
535
536 tTransit = o->transitTime(T0, geo);
537 sTransit = QString("%1:%2").arg(tTransit.hour(), 2, 10, QChar('0')).arg(tTransit.minute(), 2, 10, QChar('0'));
538
539 WUT->DetailButton->setEnabled(true);
540 }
541
542 WUT->ObjectRiseLabel->setText(i18n("Rises at: %1", sRise));
543 WUT->ObjectTransitLabel->setText(i18n("Transits at: %1", sTransit));
544 WUT->ObjectSetLabel->setText(i18n("Sets at: %1", sSet));
545}
546
547void WUTDialog::slotCenter()
548{
549 KStars *kstars = KStars::Instance();
550 SkyObject *o = nullptr;
551 // get selected item
552 if (WUT->ObjectListWidget->currentItem() != nullptr)
553 {
554 o = kstars->data()->objectNamed(WUT->ObjectListWidget->currentItem()->text());
555 }
556 if (o != nullptr)
557 {
558 kstars->map()->setFocusPoint(o);
559 kstars->map()->setFocusObject(o);
560 kstars->map()->setDestination(*kstars->map()->focusPoint());
561 }
562}
563
564void WUTDialog::slotDetails()
565{
566 KStars *kstars = KStars::Instance();
567 SkyObject *o = nullptr;
568 // get selected item
569 if (WUT->ObjectListWidget->currentItem() != nullptr)
570 {
571 o = kstars->data()->objectNamed(WUT->ObjectListWidget->currentItem()->text());
572 }
573 if (o != nullptr)
574 {
576 new DetailDialog(o, kstars->data()->ut(), geo, kstars);
577 detail->exec();
578 delete detail;
579 }
580}
581void WUTDialog::slotObslist()
582{
583 SkyObject *o = nullptr;
584 // get selected item
585 if (WUT->ObjectListWidget->currentItem() != nullptr)
586 {
587 o = KStarsData::Instance()->objectNamed(
588 WUT->ObjectListWidget->currentItem()->text());
589 }
590 if (o != nullptr)
591 {
592 KStarsData::Instance()->observingList()->slotAddObject(o, session);
593 }
594}
595
596void WUTDialog::slotChangeDate()
597{
598 // Set the time T0 to the evening of today. This will make life easier for the user, who most probably
599 // wants to see what's up on the night of some date, rather than the night of the previous day
600 T0.setTime(QTime(18, 0, 0)); // 6 PM
601
602 QPointer<TimeDialog> td = new TimeDialog(T0, KStarsData::Instance()->geo(), this);
603 if (td->exec() == QDialog::Accepted)
604 {
605 T0 = td->selectedDateTime();
606
607 // If the time is set to 12 midnight, set it to 00:00:01, so that we don't have date interpretation problems
608 if (T0.time() == QTime(0, 0, 0))
609 T0.setTime(QTime(0, 0, 1));
610
611 //If the Time is earlier than 6:00 am, assume the user wants the night of the previous date
612 if (T0.time().hour() < 6)
613 T0 = T0.addDays(-1);
614
615 //Now, set time T0 to midnight (of the following day)
616 T0.setTime(QTime(0, 0, 0));
617 T0 = T0.addDays(1);
618 UT0 = geo->LTtoUT(T0);
619
620 //Set the Tomorrow date/time to Noon the following day
621 Tomorrow = T0.addSecs(12 * 3600);
622 TomorrowUT = geo->LTtoUT(Tomorrow);
623
624 //Set the Evening date/time to 6:00 pm
625 Evening = T0.addSecs(-6 * 3600);
626 EveningUT = geo->LTtoUT(Evening);
627
628 WUT->DateLabel->setText(i18n(
629 "The night of %1", QLocale().toString(Evening.date(), QLocale::LongFormat)));
630
631 init();
632 slotLoadList(WUT->CategoryListWidget->currentItem()->text());
633 }
634 delete td;
635}
636
637void WUTDialog::slotChangeLocation()
638{
640 if (ld->exec() == QDialog::Accepted)
641 {
642 GeoLocation *newGeo = ld->selectedCity();
643 if (newGeo)
644 {
645 geo = newGeo;
646 UT0 = geo->LTtoUT(T0);
647 TomorrowUT = geo->LTtoUT(Tomorrow);
648 EveningUT = geo->LTtoUT(Evening);
649
650 WUT->LocationLabel->setText(i18n("at %1", geo->fullName()));
651
652 init();
653 slotLoadList(WUT->CategoryListWidget->currentItem()->text());
654 }
655 }
656 delete ld;
657}
658
659void WUTDialog::slotEveningMorning(int index)
660{
661 if (EveningFlag != index)
662 {
663 EveningFlag = index;
664 init();
665 slotLoadList(WUT->CategoryListWidget->currentItem()->text());
666 }
667}
668
669void WUTDialog::updateMag()
670{
671 m_Mag = WUT->MagnitudeEdit->value();
672 init();
673 slotLoadList(WUT->CategoryListWidget->currentItem()->text());
674}
675
676void WUTDialog::slotChangeMagnitude()
677{
678 if (timer)
679 {
680 timer->stop();
681 }
682 else
683 {
684 timer = new QTimer(this);
685 timer->setSingleShot(true);
686 connect(timer, SIGNAL(timeout()), this, SLOT(updateMag()));
687 }
688 timer->start(500);
689}
690
691void WUTDialog::showEvent(QShowEvent *event)
692{
693 Q_UNUSED(event);
694 QTimer::singleShot(0, this, SLOT(init()));
695};
a dms subclass that caches its sine and cosine values every time the angle is changed.
Definition cachingdms.h:19
Manages the catalog database and provides an interface to provide an interface to query and modify th...
Definition catalogsdb.h:183
DetailDialog is a window showing detailed information for a selected object.
Contains all relevant information for specifying a location on Earth: City Name, State/Province name,...
Definition geolocation.h:28
QString fullName() const
const CachingDms * lat() const
Definition geolocation.h:70
QString translatedCountry() const
QString translatedName() const
QString translatedProvince() const
Provides necessary information about the Moon.
Definition ksmoon.h:26
QString phaseName() const
Definition ksmoon.cpp:288
double illum() const
Definition ksmoon.h:49
void findPhase(const KSSun *Sun=nullptr)
Determine the phase angle of the moon, and assign the appropriate moon image.
Definition ksmoon.cpp:268
There are several time-dependent values used in position calculations, that are not specific to an ob...
Definition ksnumbers.h:43
void updateCoords(const KSNumbers *num, bool includePlanets=true, const CachingDms *lat=nullptr, const CachingDms *LST=nullptr, bool forceRecompute=false) override
Update position of the planet (reimplemented from SkyPoint)
Child class of KSPlanetBase; encapsulates information about the Sun.
Definition kssun.h:24
KStarsData is the backbone of KStars.
Definition kstarsdata.h:74
CachingDms * lst()
Definition kstarsdata.h:226
SkyObject * objectNamed(const QString &name)
Find object by name.
const KStarsDateTime & ut() const
Definition kstarsdata.h:159
SkyMapComposite * skyComposite()
Definition kstarsdata.h:168
Extension of QDateTime for KStars KStarsDateTime can represent the date/time as a Julian Day,...
KStarsDateTime addDays(int nd) const
Modify the Date/Time by adding a number of days.
KStarsDateTime addSecs(double s) const
long double djd() const
void setTime(const QTime &t)
Assign the Time according to a QTime object.
This is the main window for KStars.
Definition kstars.h:89
SkyMap * map() const
Definition kstars.h:139
static KStars * Instance()
Definition kstars.h:121
KStarsData * data() const
Definition kstars.h:133
Dialog for changing the geographic location of the observer.
void slotAddObject(const SkyObject *o=nullptr, bool session=false, bool update=false)
add a new object to list o pointer to the object to add to the list session flag toggle adding the ob...
SkyObject * findByName(const QString &name, bool exact=true) override
Search the children of this SkyMapComposite for a SkyObject whose name matches the argument.
SkyPoint * focusPoint()
retrieve the FocusPoint position.
Definition skymap.h:149
void setDestination(const SkyPoint &f)
sets the destination point of the sky map.
Definition skymap.cpp:993
void setFocusObject(SkyObject *o)
Set the FocusObject pointer to the argument.
Definition skymap.cpp:371
void setFocusPoint(SkyPoint *f)
set the FocusPoint; the position that is to be the next Destination.
Definition skymap.h:204
Provides all necessary information about an object in the sky: its coordinates, name(s),...
Definition skyobject.h:42
virtual QString name(void) const
Definition skyobject.h:146
QTime transitTime(const KStarsDateTime &dt, const GeoLocation *geo) const
The same iteration technique described in riseSetTime() is used here.
QTime riseSetTime(const KStarsDateTime &dt, const GeoLocation *geo, bool rst, bool exact=true) const
Determine the time at which the point will rise or set.
Definition skyobject.cpp:93
int type(void) const
Definition skyobject.h:189
float mag() const
Definition skyobject.h:207
SkyPoint recomputeCoords(const KStarsDateTime &dt, const GeoLocation *geo=nullptr) const
The equatorial coordinates for the object on date dt are computed and returned, but the object's inte...
The sky coordinates of a point in the sky.
Definition skypoint.h:45
bool checkCircumpolar(const dms *gLat) const
Check if this point is circumpolar at the given geographic latitude.
void EquatorialToHorizontal(const CachingDms *LST, const CachingDms *lat)
Determine the (Altitude, Azimuth) coordinates of the SkyPoint from its (RA, Dec) coordinates,...
Definition skypoint.cpp:77
const dms & alt() const
Definition skypoint.h:281
A class for adjusting the Time and Date.
Definition timedialog.h:38
WUTDialog(QWidget *ks, bool session=false, GeoLocation *geo=KStarsData::Instance() ->geo(), KStarsDateTime lt=KStarsData::Instance() ->lt())
Constructor.
Definition wutdialog.cpp:28
void init()
Determine which objects are visible, and store them in an array of lists, classified by object type.
bool checkVisibility(const SkyObject *o)
Check visibility of object o the object to check.
An angle, stored as degrees, but expressible in many ways.
Definition dms.h:38
const double & Degrees() const
Definition dms.h:141
QString i18nc(const char *context, const char *text, const TYPE &arg...)
QString i18n(const char *text, const TYPE &arg...)
char * toString(const EngineQuery &query)
Category category(StandardShortcut id)
void addWidget(QWidget *widget, int stretch, Qt::Alignment alignment)
QDate date() const const
QTime time() const const
void setModal(bool modal)
virtual void reject()
void rejected()
void clear()
bool contains(const Key &key) const const
void append(QList< T > &&value)
QString toString(QDate date, FormatType format) const const
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
QString arg(Args &&... args) const const
bool isEmpty() const const
WaitCursor
QTime addSecs(int s) const const
int hour() const const
int minute() const const
int second() const const
QString toString(QStringView format) const const
void setCursor(const QCursor &)
void setEnabled(bool)
virtual bool event(QEvent *event) override
void setFocus()
void setWindowFlags(Qt::WindowFlags type)
void setWindowTitle(const QString &)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:53:01 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.