Kstars

supernovaecomponent.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 "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 
28 class Supernova;
29 
31 {
32  Q_OBJECT
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  bool m_DataLoaded { false }, m_DataLoading { false };
63  QPointer<FileDownloader> downloadJob;
64 };
Q_OBJECTQ_OBJECT
void update(KSNumbers *num=nullptr) override
Update the sky positions of this component.
Stores dms coordinates for a point in the sky. for converting between coordinate systems.
Definition: skypoint.h:44
SkyObject * objectNearest(SkyPoint *p, double &maxrad) override
Find the SkyObject nearest the given SkyPoint.
Store several time-dependent astronomical quantities.
Definition: ksnumbers.h:42
void draw(SkyPainter *skyp) override
Draws things on the sky, without regard to backend.
Definition: skypainter.h:37
void slotTriggerDataFileUpdate()
This initiates updating of the data file.
This class encapsulates Supernovae.
static float zoomMagnitudeLimit()
Information about an object in the sky.
Definition: skyobject.h:41
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Aug 11 2022 04:00:06 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.