Kstars

asteroidscomponent.h
1 /*
2  SPDX-FileCopyrightText: 2005 Thomas Kabelmann <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include "binarylistcomponent.h"
10 #include "ksparser.h"
11 #include "typedef.h"
12 #include "skyobjects/ksasteroid.h"
13 #include "solarsystemlistcomponent.h"
14 #include "filedownloader.h"
15 
16 #include <QList>
17 #include <QPointer>
18 
19 /**
20  * @class AsteroidsComponent
21  * Represents the asteroids on the sky map.
22  *
23  * @author Thomas Kabelmann
24  * @version 0.1
25  */
27  virtual public BinaryListComponent<KSAsteroid, AsteroidsComponent>
28 {
29  Q_OBJECT
30 
32  public:
33  /**
34  * @short Default constructor.
35  *
36  * @p parent pointer to the parent SolarSystemComposite
37  */
39  virtual ~AsteroidsComponent() override = default;
40 
41  void draw(SkyPainter *skyp) override;
42  bool selected() override;
43  SkyObject *objectNearest(SkyPoint *p, double &maxrad) override;
44 
45  void updateDataFile(bool isAutoUpdate = false);
46 
47  QString ans();
48 
49  protected slots:
50  void downloadReady();
51  void downloadError(const QString &errorString);
52 
53  private:
54  void loadDataFromText() override;
55 
56  QPointer<FileDownloader> downloadJob;
57 };
Q_OBJECTQ_OBJECT
provides functionality for loading the component data from Binary
Stores dms coordinates for a point in the sky. for converting between coordinate systems.
Definition: skypoint.h:44
virtual void loadDataFromText()=0
loadDataFromText
A subclass of KSPlanetBase that implements asteroids.
Definition: ksasteroid.h:41
void draw(SkyPainter *skyp) override
Draw the object on the SkyMap skyp a pointer to the SkyPainter to use.
SkyObject * objectNearest(SkyPoint *p, double &maxrad) override
Find the SkyObject nearest the given SkyPoint.
bool selected() override
Draws things on the sky, without regard to backend.
Definition: skypainter.h:37
Information about an object in the sky.
Definition: skyobject.h:41
QObject * parent() const const
AsteroidsComponent(SolarSystemComposite *parent)
Default constructor.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Mon Aug 15 2022 04:04:00 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.