Kstars

solarsystemcomposite.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 "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 
31 {
32  public:
34  ~SolarSystemComposite() override;
35 
36  // Use this instead of `findByName`
37  KSPlanet *earth() { return m_Earth; }
38  KSSun *sun() { return m_Sun; }
39  KSMoon *moon() { return m_Moon; }
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;
75  QList<SkyObject *> m_planetObjects;
76  QList<SkyObject *> m_moons;
77 };
void drawTrails(SkyPainter *skyp) override
Draw trails for objects.
void update(KSNumbers *num) override
Delegate update-position requests to all sub components.
Provides necessary information about the Moon. A subclass of SkyObject that provides information need...
Definition: ksmoon.h:25
SkyComposite * parent()
Definition: skycomponent.h:137
A class that manages the calculation of the earths shadow (in moon distance) as a 'virtual' skyobject...
Definition: ksearthshadow.h:27
Provides necessary information about the Sun.
Definition: kssun.h:23
Store several time-dependent astronomical quantities.
Definition: ksnumbers.h:42
Draws things on the sky, without regard to backend.
Definition: skypainter.h:37
Provides necessary information about objects in the solar system.
Definition: ksplanet.h:32
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Tue Aug 9 2022 04:06:07 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.