1 /*
2     SPDX-FileCopyrightText: 2005 Thomas Kabelmann <thomas.kabelmann@gmx.de>
3 
4     SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include "planetmoonscomponent.h"
10 #include "skycomposite.h"
11 
12 class AsteroidsComponent;
13 class CometsComponent;
14 class KSMoon;
15 class KSPlanet;
16 class KSSun;
17 //class JupiterMoonsComponent;
18 class SkyLabeler;
19 class KSEarthShadow;
20 /**
21  * @class SolarSystemComposite
22  * The solar system composite manages all planets, asteroids and comets.
23  * As every sub component of solar system needs the earth , the composite
24  * is managing this object by itself.
25  *
26  * @author Thomas Kabelmann
27  * @version 0.1
28  */
29 
30 class SolarSystemComposite : public SkyComposite
31 {
32   public:
33     explicit SolarSystemComposite(SkyComposite *parent);
34     ~SolarSystemComposite() override;
35 
36     // Use this instead of `findByName`
earth()37     KSPlanet *earth() { return m_Earth; }
sun()38     KSSun *sun() { return m_Sun; }
moon()39     KSMoon *moon() { return m_Moon; }
earthShadow()40     KSEarthShadow *earthShadow() { return m_EarthShadow; }
41 
42     const QList<SkyObject *> &asteroids() const;
43     const QList<SkyObject *> &comets() const;
44     const QList<SkyObject *> &planetObjects() const;
45     const QList<SkyObject *> &moons() const;
46 
47     bool selected() override;
48 
49     void update(KSNumbers *num) override;
50 
51     void updateSolarSystemBodies(KSNumbers *num) override;
52 
53     void updateMoons(KSNumbers *num) override;
54 
55     void drawTrails(SkyPainter *skyp) override;
56 
57     CometsComponent *cometsComponent();
58 
59     AsteroidsComponent *asteroidsComponent();
60 
61     QList<PlanetMoonsComponent *> planetMoonsComponent() const;
62 
63     const QList<SolarSystemSingleComponent *> &planets() const;
64 
65   private:
66     KSPlanet *m_Earth { nullptr };
67     KSSun *m_Sun { nullptr };
68     KSMoon *m_Moon { nullptr };
69     KSEarthShadow *m_EarthShadow { nullptr };
70 
71     //    PlanetMoonsComponent *m_JupiterMoons;
72     AsteroidsComponent *m_AsteroidsComponent;
73     CometsComponent *m_CometsComponent;
74     QList<SolarSystemSingleComponent *> m_planets;
75     QList<SkyObject *> m_planetObjects;
76     QList<SkyObject *> m_moons;
77 };
78