28 qreal C_1, C_2, C_3, C_4, C_5, C_6;
31 qreal theta_0, theta_1;
37 void setup(qreal M_0, qreal M_1, qreal C_1, qreal C_2, qreal C_3, qreal C_4,
38 qreal C_5, qreal C_6, qreal Pi, qreal
epsilon, qreal theta_0,
40 const QString&
id,
bool atmosphere =
false )
52 this->theta_0 = theta_0;
53 this->theta_1 = theta_1;
57 this->atmosphere = atmosphere;
64 : d( new PlanetPrivate )
66 d->setup( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
71 : d( new PlanetPrivate )
75 if (
id ==
"mercury" ) {
82 }
else if (
id ==
"venus" ) {
87 (-1.4813688*
DEG2RAD), 6051800.0,
88 name(
id ),
id,
true );
90 }
else if (
id ==
"earth" ) {
95 (360.9856235*
DEG2RAD), 6378000.0,
96 name(
id ),
id,
true );
98 }
else if (
id ==
"mars" ) {
103 (350.89198226*
DEG2RAD), 3397000.0,
104 name(
id ),
id,
true );
106 }
else if (
id ==
"jupiter" ) {
111 (870.5366420*
DEG2RAD), 71492000.0,
112 name(
id ),
id,
true );
114 }
else if (
id ==
"saturn" ) {
119 (810.7939024*
DEG2RAD), 60268000.0,
120 name(
id ),
id,
true );
122 }
else if (
id ==
"uranus" ) {
127 (-501.1600928*
DEG2RAD), 25559000.0,
128 name(
id ),
id,
true );
130 }
else if (
id ==
"neptune" ) {
135 (536.3128492*
DEG2RAD), 24766000.0,
136 name(
id ),
id,
true );
139 }
else if (
id ==
"pluto" ) {
144 (-56.3623195*
DEG2RAD), 1151000.0,
147 }
else if (
id ==
"sun" ) {
149 mDebug() <<
"creating \"sun\" which has invalid orbital elements";
151 d->setup( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 695000000.0,
152 name(
id ),
id,
true );
154 }
else if (
id ==
"moon" ) {
156 mDebug() <<
"creating \"moon\" which has invalid orbital elements";
158 d->setup( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1738000.0,
161 }
else if (
id ==
"sky" ) {
163 mDebug() <<
"creating \"sky\" which has invalid orbital elements";
165 d->setup( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10000000.0,
169 mDebug() <<
"creating planet" <<
id <<
"without enough info";
170 d->setup( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10000000.0,
177 : d( new PlanetPrivate )
339 if (
id ==
"mercury" ) {
341 }
else if (
id ==
"venus" ) {
343 }
else if (
id ==
"earth" ) {
345 }
else if (
id ==
"mars" ) {
347 }
else if (
id ==
"jupiter" ) {
349 }
else if (
id ==
"saturn" ) {
351 }
else if (
id ==
"uranus" ) {
353 }
else if (
id ==
"neptune" ) {
356 }
else if (
id ==
"pluto" ) {
359 }
else if (
id ==
"sun" ) {
361 }
else if (
id ==
"moon" ) {
363 }
else if (
id ==
"sky" ) {
365 }
else if (
id.isEmpty() ) {
366 mDebug() <<
"Warning: empty id";
367 return QObject::tr(
"Unknown Planet",
"a planet without data");
404 return d->atmosphere;
409 d->atmosphere = enabled;
414 return d->atmosphereColor;
419 d->atmosphereColor = color;
QString id() const
The internal, nonlocalized name of the planet.
qreal Pi() const
ecliptic longitude of the perihelion
qreal theta_0() const
for calculating sidereal time
Planet & operator=(const Planet &rhs)
QString tr(const char *sourceText, const char *disambiguation, int n)
static QStringList planetList()
qreal C_1() const
for calculating equation of center
qreal M_0() const
for calculating mean anomaly
bool hasAtmosphere() const
void setTheta_1(qreal theta_1)
void setHasAtmosphere(bool enabled)
static qreal radius(qreal zoom)
Planet()
Constructor to use for a custom planet All of the orbital elements are left empty, so you can fill them in yourself.
qreal radius() const
the radius of the planet, in metres
QColor atmosphereColor() const
void setName(const QString &name)
void setEpsilon(qreal epsilon)
QString name() const
The user visible name of the planet.
qreal epsilon() const
obliquity of the ecliptic plane
void setAtmosphereColor(const QColor &color)
void setRadius(qreal radius)
void setTheta_0(qreal theta_0)
QDebug mDebug()
a function to replace qDebug() in Marble library code
void setId(const QString &id)