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
14class QDateTime;
15class QStringList;
16class QColor;
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
28 /** Constructor to use for a custom planet
29 * All of the orbital elements are left empty, so you can fill them in yourself.
30 */
31 Planet();
32
33 /**
34 * @deprecated Please use PlanetFactory::construct(id) instead.
35 */
36 MARBLE_DEPRECATED explicit Planet(const QString& id);
37
38 ///Copy Constructor
39 Planet( const Planet& other );
40 ///Destructor
41 ~Planet();
42
43 /* Getter functions */
44 /// for calculating mean anomaly
45 qreal M_0() const;
46 qreal M_1() const;
47
48 /// for calculating equation of center
49 qreal C_1() const;
50 qreal C_2() const;
51 qreal C_3() const;
52 qreal C_4() const;
53 qreal C_5() const;
54 qreal C_6() const;
55
56 /// ecliptic longitude of the perihelion
57 qreal Pi() const;
58
59 /// obliquity of the ecliptic plane
60 qreal epsilon() const;
61
62 /// for calculating sidereal time
63 qreal theta_0() const;
64 qreal theta_1() const;
65
66 /// the radius of the planet, in metres
67 qreal radius() const;
68
69 /// the twilight zone of the planet, in radians
70 qreal twilightZone() const;
71
72 /** The user visible name of the planet */
73 QString name() const;
74 /** The internal, nonlocalized name of the planet */
75 QString id() const;
76
77 /**
78 * Fills the longitude and latitude with the planet's sun position.
79 *
80 * @param lon the longitude of the sun, in radian
81 * @param lat the latitude of the sun, in radian
82 * @param dateTime the time for which the sun position is to be calculated
83 */
84 void sunPosition(qreal &lon, qreal &lat, const QDateTime &dateTime) const;
85
86 /* Setter functions */
87 void setM_0( qreal M_0 );
88 void setM_1( qreal M_1 );
89
90 void setC_1( qreal C_1 );
91 void setC_2( qreal C_2 );
92 void setC_3( qreal C_3 );
93 void setC_4( qreal C_4 );
94 void setC_5( qreal C_5 );
95 void setC_6( qreal C_6 );
96
97 void setPi( qreal Pi );
98
99 void setEpsilon( qreal epsilon );
100
101 void setTheta_0( qreal theta_0 );
102 void setTheta_1( qreal theta_1 );
103
104 void setRadius( qreal radius );
105
106 void setTwilightZone(qreal twilightZone);
107
108 void setName( const QString& name );
109 void setId( const QString& id );
110
111 Planet& operator=( const Planet& rhs );
112
113 /**
114 * @deprecated Please use PlanetFactory::localizedName(id) instead.
115 */
116 MARBLE_DEPRECATED static QString name(const QString& id);
117 /**
118 * @deprecated Please use PlanetFactory::planetList() instead.
119 */
120 MARBLE_DEPRECATED static QStringList planetList();
121
122 bool hasAtmosphere() const;
123 void setHasAtmosphere( bool enabled );
124
125 QColor atmosphereColor() const;
126 void setAtmosphereColor( const QColor& color );
127
128private:
129 PlanetPrivate * const d;
130};
131
132
133
134} //namespace Marble
135
136
137#endif
QString name(StandardShortcut 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 Tue Mar 26 2024 11:18:17 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.