Kstars

supernova.h
1 /*
2  SPDX-FileCopyrightText: 2016 Jasem Mutlaq <[email protected]>
3 
4  Based on Samikshan Bairagya GSoC work.
5 
6  SPDX-License-Identifier: GPL-2.0-or-later
7 */
8 
9 #pragma once
10 
11 #include "skyobject.h"
12 
13 /**
14  * @class Supernova
15  * Represents the supernova object. It is a subclass of the SkyObject class.
16  * This class has the information for different supernovae.
17  *
18  * N.B. This was modified to use the Open Supernova Project
19  *
20  * @note The Data File Contains the following parameters
21  * @li sName Designation
22  * @li RA Right Ascension
23  * @li Dec Declination
24  * @li type Supernova Type
25  * @li hostGalaxy Host Galaxy for the supernova
26  * @li date Discovery date yyyy/mm/dd
27  * @li sRedShift Redshift
28  * @li sMag Maximum Apparent magnitude
29  *
30  * @author Samikshan Bairagya
31  * @author Jasem Mutlaq
32  */
33 class Supernova : public SkyObject
34 {
35  public:
36  explicit Supernova(const QString &sName, dms ra, dms dec, const QString &type = QString(),
37  const QString &hostGalaxy = QString(), const QString &date = QString(), float sRedShift = 0.0,
38  float sMag = 99.9, const QDateTime& discoveryDate=QDateTime::currentDateTime());
39  /**
40  * @return a clone of this object
41  * @note See SkyObject::clone()
42  */
43  Supernova *clone() const override;
44 
45  ~Supernova() override = default;
46 
47  /** @return the type of the supernova */
48  inline QString getType() const { return type; }
49 
50  /** @return the host galaxy of the supernova */
51  inline QString getHostGalaxy() const { return hostGalaxy; }
52 
53  /** @return the date the supernova was observed */
54  inline QString getDate() const { return date; }
55 
56  /** @return the date the supernova was observed */
57  inline float getRedShift() const { return redShift; }
58 
59  inline float getAgeDays() { return discoveryDate.daysTo(QDateTime::currentDateTime());}
60 
61  QString url();
62 
63  void initPopupMenu(KSPopupMenu *) override;
64 
65  private:
66  QString type, hostGalaxy, date;
67  QDateTime discoveryDate;
68  float redShift { 0 };
69 };
QString getDate() const
Definition: supernova.h:54
QString getType() const
Definition: supernova.h:48
QDateTime currentDateTime()
QString getHostGalaxy() const
Definition: supernova.h:51
float getRedShift() const
Definition: supernova.h:57
const CachingDms & dec() const
Definition: skypoint.h:269
void initPopupMenu(KSPopupMenu *) override
Initialize the popup menut.
Definition: supernova.cpp:30
Supernova * clone() const override
Definition: supernova.cpp:24
An angle, stored as degrees, but expressible in many ways.
Definition: dms.h:37
qint64 daysTo(const QDateTime &other) const const
const CachingDms & ra() const
Definition: skypoint.h:263
Information about an object in the sky.
Definition: skyobject.h:41
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Fri Sep 22 2023 03:57:59 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.