Kstars

supernova.h
1/*
2 SPDX-FileCopyrightText: 2016 Jasem Mutlaq <mutlaqja@ikarustech.com>
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 */
33class 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};
The KStars Popup Menu.
Definition kspopupmenu.h:35
Provides all necessary information about an object in the sky: its coordinates, name(s),...
Definition skyobject.h:42
const CachingDms & dec() const
Definition skypoint.h:269
const CachingDms & ra() const
Definition skypoint.h:263
Represents the supernova object.
Definition supernova.h:34
QString getType() const
Definition supernova.h:48
float getRedShift() const
Definition supernova.h:57
QString getDate() const
Definition supernova.h:54
Supernova * clone() const override
Definition supernova.cpp:24
QString getHostGalaxy() const
Definition supernova.h:51
void initPopupMenu(KSPopupMenu *) override
Initialize the popup menut.
Definition supernova.cpp:30
An angle, stored as degrees, but expressible in many ways.
Definition dms.h:38
QDateTime currentDateTime()
qint64 daysTo(const QDateTime &other) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:38:44 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.