28 qreal C_1, C_2, C_3, C_4, C_5, C_6;
31 qreal theta_0, theta_1;
35 QColor atmosphereColor;
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,
39 qreal theta_1, qreal radius,
const QString& name,
40 const QString&
id,
bool atmosphere =
false )
52 this->theta_0 = theta_0;
53 this->theta_1 = theta_1;
54 this->radius = radius;
57 this->atmosphere = atmosphere;
64 : d( new PlanetPrivate )
66 d->setup( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
67 QObject::tr(
"Unknown Planet",
"a planet without data"), QString(
"unknown") );
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,
171 name( QString() ), QString(
"unknown") );
177 : d( new PlanetPrivate )
339 if (
id ==
"mercury" ) {
340 return QObject::tr(
"Mercury",
"the planet");
341 }
else if (
id ==
"venus" ) {
342 return QObject::tr(
"Venus",
"the planet");
343 }
else if (
id ==
"earth" ) {
344 return QObject::tr(
"Earth",
"the planet");
345 }
else if (
id ==
"mars" ) {
346 return QObject::tr(
"Mars",
"the planet");
347 }
else if (
id ==
"jupiter" ) {
348 return QObject::tr(
"Jupiter",
"the planet");
349 }
else if (
id ==
"saturn" ) {
350 return QObject::tr(
"Saturn",
"the planet");
351 }
else if (
id ==
"uranus" ) {
352 return QObject::tr(
"Uranus",
"the planet");
353 }
else if (
id ==
"neptune" ) {
354 return QObject::tr(
"Neptune",
"the planet");
356 }
else if (
id ==
"pluto" ) {
357 return QObject::tr(
"Pluto",
"the planet");
359 }
else if (
id ==
"sun" ) {
360 return QObject::tr(
"Sun",
"the earth's star");
361 }
else if (
id ==
"moon" ) {
362 return QObject::tr(
"Moon",
"the earth's moon");
363 }
else if (
id ==
"sky" ) {
364 return QObject::tr(
"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)
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)
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)