File indexing completed on 2025-01-05 03:58:41
0001 // SPDX-FileCopyrightText: 2009 Henry de Valence <hdevalence@gmail.com> 0002 // SPDX-FileCopyrightText: 2009 David Roberts <dvdr18@gmail.com> 0003 // SPDX-FileCopyrightText: 2012 Mohammed Nafees <nafees.technocool@gmail.com> 0004 // SPDX-License-Identifier: LGPL-2.1-or-later 0005 // 0006 0007 #ifndef MARBLE_PLANET_H 0008 #define MARBLE_PLANET_H 0009 0010 #include "digikam_export.h" 0011 0012 #include <QtGlobal> 0013 0014 #include <QDateTime> 0015 #include <QStringList> 0016 #include <QColor> 0017 0018 namespace Marble 0019 { 0020 0021 class PlanetPrivate; 0022 0023 class DIGIKAM_EXPORT Planet 0024 { 0025 //Not a QObject because we don't need sigs/slots 0026 public: 0027 0028 /** Constructor to use for a custom planet 0029 * All of the orbital elements are left empty, so you can fill them in yourself. 0030 */ 0031 Planet(); 0032 0033 /** 0034 * @deprecated Please use PlanetFactory::construct(id) instead. 0035 */ 0036 explicit Planet(const QString& id); 0037 0038 ///Copy Constructor 0039 Planet( const Planet& other ); 0040 ///Destructor 0041 ~Planet(); 0042 0043 /* Getter functions */ 0044 /// for calculating mean anomaly 0045 qreal M_0() const; 0046 qreal M_1() const; 0047 0048 /// for calculating equation of center 0049 qreal C_1() const; 0050 qreal C_2() const; 0051 qreal C_3() const; 0052 qreal C_4() const; 0053 qreal C_5() const; 0054 qreal C_6() const; 0055 0056 /// ecliptic longitude of the perihelion 0057 qreal Pi() const; 0058 0059 /// obliquity of the ecliptic plane 0060 qreal epsilon() const; 0061 0062 /// for calculating sidereal time 0063 qreal theta_0() const; 0064 qreal theta_1() const; 0065 0066 /// the radius of the planet, in metres 0067 qreal radius() const; 0068 0069 /// the twilight zone of the planet, in radians 0070 qreal twilightZone() const; 0071 0072 /** The user visible name of the planet */ 0073 QString name() const; 0074 /** The internal, nonlocalized name of the planet */ 0075 QString id() const; 0076 0077 /** 0078 * Fills the longitude and latitude with the planet's sun position. 0079 * 0080 * @param lon the longitude of the sun, in radian 0081 * @param lat the latitude of the sun, in radian 0082 * @param dateTime the time for which the sun position is to be calculated 0083 */ 0084 void sunPosition(qreal &lon, qreal &lat, const QDateTime &dateTime) const; 0085 0086 /* Setter functions */ 0087 void setM_0( qreal M_0 ); 0088 void setM_1( qreal M_1 ); 0089 0090 void setC_1( qreal C_1 ); 0091 void setC_2( qreal C_2 ); 0092 void setC_3( qreal C_3 ); 0093 void setC_4( qreal C_4 ); 0094 void setC_5( qreal C_5 ); 0095 void setC_6( qreal C_6 ); 0096 0097 void setPi( qreal Pi ); 0098 0099 void setEpsilon( qreal epsilon ); 0100 0101 void setTheta_0( qreal theta_0 ); 0102 void setTheta_1( qreal theta_1 ); 0103 0104 void setRadius( qreal radius ); 0105 0106 void setTwilightZone(qreal twilightZone); 0107 0108 void setName( const QString& name ); 0109 void setId( const QString& id ); 0110 0111 Planet& operator=( const Planet& rhs ); 0112 0113 /** 0114 * @deprecated Please use PlanetFactory::localizedName(id) instead. 0115 */ 0116 static QString name(const QString& id); 0117 /** 0118 * @deprecated Please use PlanetFactory::planetList() instead. 0119 */ 0120 static QStringList planetList(); 0121 0122 bool hasAtmosphere() const; 0123 void setHasAtmosphere( bool enabled ); 0124 0125 QColor atmosphereColor() const; 0126 void setAtmosphereColor( const QColor& color ); 0127 0128 private: 0129 PlanetPrivate * const d; 0130 }; 0131 0132 0133 0134 } //namespace Marble 0135 0136 0137 #endif