Kstars

satellitescomponent.h
1 /*
2  SPDX-FileCopyrightText: 2009 Jerome SONRIER <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include "satellitegroup.h"
10 #include "skycomponent.h"
11 
12 #include <QList>
13 
14 class QPointF;
15 class Satellite;
16 
17 /**
18  * @class SatellitesComponent
19  * Represents artificial satellites on the sky map.
20  * @author Jérôme SONRIER
21  * @version 1.0
22  */
24 {
25  public:
26  /**
27  * @short Constructor
28  * @param parent pointer to the parent SkyComposite
29  */
30  explicit SatellitesComponent(SkyComposite *parent = nullptr);
31 
32  /**
33  * @short Destructor
34  */
35  ~SatellitesComponent() override;
36 
37  /**
38  * @return true if satellites must be draw.
39  */
40  bool selected() override;
41 
42  /**
43  * Draw all satellites.
44  * @param skyp SkyPainter to use
45  */
46  void draw(SkyPainter *skyp) override;
47 
48  /**
49  * Update satellites position.
50  * @param num
51  */
52  void update(KSNumbers *num) override;
53 
54  /**
55  * Download new TLE files
56  */
57  void updateTLEs();
58 
59  /**
60  * @return The list of all groups
61  */
63 
64  /**
65  * Search a satellite by name.
66  * @param name The name of the satellite
67  * @return Satellite that was find or 0
68  */
70 
71  /**
72  * Draw label of a satellite.
73  * @param sat The satellite
74  * @param pos The position of the satellite
75  */
76  void drawLabel(Satellite *sat, const QPointF &pos);
77 
78  /**
79  * Search the nearest satellite from point p
80  * @param p
81  * @param maxrad
82  */
83  SkyObject *objectNearest(SkyPoint *p, double &maxrad) override;
84 
85  /**
86  * Return object given name
87  * @param name object name
88  * @p exact If true, it will return an exact match, otherwise it can return
89  * a partial match.
90  * @return object if found, otherwise nullptr
91  */
92  SkyObject *findByName(const QString &name, bool exact = true) override;
93 
94  void loadData();
95 
96  protected:
97  void drawTrails(SkyPainter *skyp) override;
98 
99  private:
100  QList<SatelliteGroup *> m_groups; // List of all groups
102 };
void update(KSNumbers *num) override
Update satellites position.
void drawTrails(SkyPainter *skyp) override
Draw trails for objects.
~SatellitesComponent() override
Destructor.
Stores dms coordinates for a point in the sky. for converting between coordinate systems.
Definition: skypoint.h:44
SkyComposite * parent()
Definition: skycomponent.h:137
SatellitesComponent(SkyComposite *parent=nullptr)
Constructor.
Store several time-dependent astronomical quantities.
Definition: ksnumbers.h:42
Satellite * findSatellite(QString name)
Search a satellite by name.
Draws things on the sky, without regard to backend.
Definition: skypainter.h:37
QList< SatelliteGroup * > groups()
void draw(SkyPainter *skyp) override
Draw all satellites.
void drawLabel(Satellite *sat, const QPointF &pos)
Draw label of a satellite.
void updateTLEs()
Download new TLE files.
SkyObject * objectNearest(SkyPoint *p, double &maxrad) override
Search the nearest satellite from point p.
SkyObject * findByName(const QString &name, bool exact=true) override
Return object given name.
Information about an object in the sky.
Definition: skyobject.h:41
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sat Aug 13 2022 04:01:58 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.