Marble

Planet.h
1// SPDX-FileCopyrightText: 2009 Henry de Valence <hdevalence@gmail.com>
2// SPDX-FileCopyrightText: 2009 David Roberts <dvdr18@gmail.com>
3// SPDX-FileCopyrightText: 2012 Mohammed Nafees <nafees.technocool@gmail.com>
4// SPDX-License-Identifier: LGPL-2.1-or-later
5//
6
7#ifndef MARBLE_PLANET_H
8#define MARBLE_PLANET_H
9
10#include "marble_export.h"
11
12#include <QtGlobal>
13
14#include <QColor>
15#include <QDateTime>
16#include <QStringList>
17
18namespace Marble
19{
20
21class PlanetPrivate;
22
23class MARBLE_EXPORT Planet
24{
25 // Not a QObject because we don't need sigs/slots
26public:
27 /** Constructor to use for a custom planet
28 * All of the orbital elements are left empty, so you can fill them in yourself.
29 */
30 Planet();
31
32 /**
33 * @deprecated Please use PlanetFactory::construct(id) instead.
34 */
35 MARBLE_DEPRECATED explicit Planet(const QString &id);
36
37 /// Copy Constructor
38 Planet(const Planet &other);
39 /// Destructor
40 ~Planet();
41
42 /* Getter functions */
43 /// for calculating mean anomaly
44 qreal M_0() const;
45 qreal M_1() const;
46
47 /// for calculating equation of center
48 qreal C_1() const;
49 qreal C_2() const;
50 qreal C_3() const;
51 qreal C_4() const;
52 qreal C_5() const;
53 qreal C_6() const;
54
55 /// ecliptic longitude of the perihelion
56 qreal Pi() const;
57
58 /// obliquity of the ecliptic plane
59 qreal epsilon() const;
60
61 /// for calculating sidereal time
62 qreal theta_0() const;
63 qreal theta_1() const;
64
65 /// the radius of the planet, in metres
66 qreal radius() const;
67
68 /// the twilight zone of the planet, in radians
69 qreal twilightZone() const;
70
71 /** The user visible name of the planet */
72 QString name() const;
73 /** The internal, nonlocalized name of the planet */
74 QString id() const;
75
76 /**
77 * Fills the longitude and latitude with the planet's sun position.
78 *
79 * @param lon the longitude of the sun, in radian
80 * @param lat the latitude of the sun, in radian
81 * @param dateTime the time for which the sun position is to be calculated
82 */
83 void sunPosition(qreal &lon, qreal &lat, const QDateTime &dateTime) const;
84
85 /* Setter functions */
86 void setM_0(qreal M_0);
87 void setM_1(qreal M_1);
88
89 void setC_1(qreal C_1);
90 void setC_2(qreal C_2);
91 void setC_3(qreal C_3);
92 void setC_4(qreal C_4);
93 void setC_5(qreal C_5);
94 void setC_6(qreal C_6);
95
96 void setPi(qreal Pi);
97
98 void setEpsilon(qreal epsilon);
99
100 void setTheta_0(qreal theta_0);
101 void setTheta_1(qreal theta_1);
102
103 void setRadius(qreal radius);
104
105 void setTwilightZone(qreal twilightZone);
106
107 void setName(const QString &name);
108 void setId(const QString &id);
109
110 Planet &operator=(const Planet &rhs);
111
112 /**
113 * @deprecated Please use PlanetFactory::localizedName(id) instead.
114 */
115 MARBLE_DEPRECATED static QString name(const QString &id);
116 /**
117 * @deprecated Please use PlanetFactory::planetList() instead.
118 */
119 MARBLE_DEPRECATED static QStringList planetList();
120
121 bool hasAtmosphere() const;
122 void setHasAtmosphere(bool enabled);
123
124 QColor atmosphereColor() const;
125 void setAtmosphereColor(const QColor &color);
126
127private:
128 PlanetPrivate *const d;
129};
130
131} // namespace Marble
132
133#endif
QString name(StandardAction id)
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 11 2024 12:14:14 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.