Kstars

supernovaecomponent.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 "ksnumbers.h"
12#include "listcomponent.h"
13#include "skyobjects/supernova.h"
14#include "filedownloader.h"
15
16#include <QList>
17#include <QPointer>
18
19/**
20 * @class SupernovaeComponent
21 * @brief This class encapsulates Supernovae.
22 *
23 * @author Jasem Mutlaq, Samikshan Bairagya
24 *
25 * @version 0.2
26 */
27
28class Supernova;
29
31{
33
34 public:
36 virtual ~SupernovaeComponent() override = default;
37
38 bool selected() override;
39 void update(KSNumbers *num = nullptr) override;
40 SkyObject *objectNearest(SkyPoint *p, double &maxrad) override;
41
42 /**
43 * @note This should actually be implemented in a better manner.
44 * Possibly by checking if the host galaxy for the supernova is drawn.
45 */
46 void draw(SkyPainter *skyp) override;
47
48 //virtual void notifyNewSupernovae();
49 /** @note Basically copy pasted from StarComponent::zoomMagnitudeLimit() */
50 static float zoomMagnitudeLimit();
51
52 public slots:
53 /** @short This initiates updating of the data file */
55
56 protected slots:
57 void downloadReady();
58 void downloadError(const QString &errorString);
59
60 private:
61 void loadData();
62 void unzipData();
63 static const QString tnsDataFilename;
64 static const QString tnsDataFilenameZip;
65 static const QString tnsDataUrl;
66 bool m_DataLoaded { false }, m_DataLoading { false };
67 QPointer<FileDownloader> downloadJob;
68};
There are several time-dependent values used in position calculations, that are not specific to an ob...
Definition ksnumbers.h:43
An abstract parent class, to be inherited by SkyComponents that store a QList of SkyObjects.
SkyComposite is a kind of container class for SkyComponent objects.
Provides all necessary information about an object in the sky: its coordinates, name(s),...
Definition skyobject.h:42
Draws things on the sky, without regard to backend.
Definition skypainter.h:40
The sky coordinates of a point in the sky.
Definition skypoint.h:45
Represents the supernova object.
Definition supernova.h:34
This class encapsulates Supernovae.
void slotTriggerDataFileUpdate()
This initiates updating of the data file.
void draw(SkyPainter *skyp) override
SkyObject * objectNearest(SkyPoint *p, double &maxrad) override
Find the SkyObject nearest the given SkyPoint.
static float zoomMagnitudeLimit()
void update(KSNumbers *num=nullptr) override
Update the sky positions of this component.
Q_OBJECTQ_OBJECT
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:19:04 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.