StelObject.cpp   StelObject.cpp 
skipping to change at line 153 skipping to change at line 153
Vec3d altAzPos = getAltAzPosGeometric(core); Vec3d altAzPos = getAltAzPosGeometric(core);
altAzPos.normalize(); altAzPos.normalize();
float vMag = getVMagnitude(core); float vMag = getVMagnitude(core);
// without the test, planets flicker stupidly in fullsky atmosphere- less view. // without the test, planets flicker stupidly in fullsky atmosphere- less view.
if (core->getSkyDrawer()->getFlagHasAtmosphere()) if (core->getSkyDrawer()->getFlagHasAtmosphere())
core->getSkyDrawer()->getExtinction().forward(altAzPos, &vMa g); core->getSkyDrawer()->getExtinction().forward(altAzPos, &vMa g);
return vMag; return vMag;
} }
// Format the positional info string contain J2000/of date/altaz/hour angle positions for the object // Format the positional info string contain J2000/of date/altaz/hour angle positions for the object
QString StelObject::getPositionInfoString(const StelCore *core, const InfoS tringGroup& flags) const QString StelObject::getCommonInfoString(const StelCore *core, const InfoStr ingGroup& flags) const
{ {
StelApp& app = StelApp::getInstance();
bool withAtmosphere = core->getSkyDrawer()->getFlagHasAtmosphere(); bool withAtmosphere = core->getSkyDrawer()->getFlagHasAtmosphere();
bool withDecimalDegree = StelApp::getInstance().getFlagShowDecimalDe bool withDecimalDegree = app.getFlagShowDecimalDegrees();
grees(); bool useSouthAzimuth = app.getFlagSouthAzimuthUsage();
bool useSouthAzimuth = StelApp::getInstance().getFlagSouthAzimuthUsa bool withTables = app.getFlagUseFormattingOutput();
ge(); bool withDesignations = app.getFlagUseCCSDesignation();
double az_app, alt_app; double az_app, alt_app;
StelUtils::rectToSphe(&az_app,&alt_app,getAltAzPosApparent(core)); StelUtils::rectToSphe(&az_app,&alt_app,getAltAzPosApparent(core));
Q_UNUSED(az_app); Q_UNUSED(az_app);
QString cepoch = qc_("on date", "coordinates for current epoch"); QString cepoch = qc_("on date", "coordinates for current epoch");
QString res; QString res;
QString currentPlanet = core->getCurrentPlanet()->getEnglishName(); QString currentPlanet = core->getCurrentPlanet()->getEnglishName();
QString firstCoordinate, secondCoordinate, apparent = " ";
if (withAtmosphere)
apparent += q_("(apparent)");
if (withTables)
res += "<table style='margin:0em 0em 0em -0.125em;border-spa
cing:0px;border:0px;'>";
// TRANSLATORS: Right ascension/Declination
QString RADec = qc_("RA/Dec", "celestial coordinate system");
if (withDesignations)
RADec = QString("%1/%2").arg(QChar(0x03B1), QChar(0x03B4));
if (flags&RaDecJ2000) if (flags&RaDecJ2000)
{ {
double dec_j2000, ra_j2000; double dec_j2000, ra_j2000;
StelUtils::rectToSphe(&ra_j2000,&dec_j2000,getJ2000Equatoria lPos(core)); StelUtils::rectToSphe(&ra_j2000,&dec_j2000,getJ2000Equatoria lPos(core));
if (withDecimalDegree) if (withDecimalDegree)
res += q_("RA/Dec") + QString(" (J2000.0): %1/%2").a {
rg(StelUtils::radToDecDegStr(ra_j2000,5,false,true), StelUtils::radToDecDeg firstCoordinate = StelUtils::radToDecDegStr(ra_j200
Str(dec_j2000)) + "<br>"; 0,5,false,true);
secondCoordinate = StelUtils::radToDecDegStr(dec_j20
00);
}
else
{
firstCoordinate = StelUtils::radToHmsStr(ra_j2000,t
rue);
secondCoordinate = StelUtils::radToDmsStr(dec_j2000,
true);
}
if (withTables)
res += QString("<tr><td>%1 (J2000.0):</td><td style=
'text-align:right;'>%2/</td><td style='text-align:right;'>%3</td><td></td><
/tr>").arg(RADec, firstCoordinate, secondCoordinate);
else else
res += q_("RA/Dec") + QString(" (J2000.0): %1/%2").a rg(StelUtils::radToHmsStr(ra_j2000,true), StelUtils::radToDmsStr(dec_j2000, true)) + "<br>"; res += QString("%1 (J2000.0): %2/%3").arg(RADec, fir stCoordinate, secondCoordinate) + "<br>";
} }
if (flags&RaDecOfDate) if (flags&RaDecOfDate)
{ {
double dec_equ, ra_equ; double dec_equ, ra_equ;
StelUtils::rectToSphe(&ra_equ,&dec_equ,getEquinoxEquatorialP os(core)); StelUtils::rectToSphe(&ra_equ,&dec_equ,getEquinoxEquatorialP os(core));
if (withDecimalDegree) if (withDecimalDegree)
res += q_("RA/Dec") + QString(" (%1): %2/%3").arg(ce {
poch, StelUtils::radToDecDegStr(ra_equ,5,false,true), StelUtils::radToDecDe firstCoordinate = StelUtils::radToDecDegStr(ra_equ,
gStr(dec_equ)) + "<br>"; 5,false,true);
secondCoordinate = StelUtils::radToDecDegStr(dec_equ
);
}
else else
res += q_("RA/Dec") + QString(" (%1): %2/%3").arg(ce {
poch, StelUtils::radToHmsStr(ra_equ,true), StelUtils::radToDmsStr(dec_equ,t firstCoordinate = StelUtils::radToHmsStr(ra_equ,tru
rue)) + "<br>"; e);
secondCoordinate = StelUtils::radToDmsStr(dec_equ,tr
ue);
}
if (withTables)
res += QString("<tr><td>%1 (%4):</td><td style='text
-align:right;'>%2/</td><td style='text-align:right;'>%3</td><td></td></tr>"
).arg(RADec, firstCoordinate, secondCoordinate, cepoch);
else
res += QString("%1 (%4): %2/%3").arg(RADec, firstCoo
rdinate, secondCoordinate, cepoch) + "<br>";
} }
if (flags&HourAngle) if (flags&HourAngle)
{ {
double dec_sidereal, ra_sidereal, ha_sidereal; double dec_sidereal, ra_sidereal, ha_sidereal;
QString hadec;
StelUtils::rectToSphe(&ra_sidereal,&dec_sidereal,getSidereal PosGeometric(core)); StelUtils::rectToSphe(&ra_sidereal,&dec_sidereal,getSidereal PosGeometric(core));
ra_sidereal = 2.*M_PI-ra_sidereal; ra_sidereal = 2.*M_PI-ra_sidereal;
if (withAtmosphere && (alt_app>-3.0*M_PI/180.0)) // Don't sh ow refracted values much below horizon where model is meaningless. if (withAtmosphere && (alt_app>-3.0*M_PI/180.0)) // Don't sh ow refracted values much below horizon where model is meaningless.
{ {
StelUtils::rectToSphe(&ra_sidereal,&dec_sidereal,get SiderealPosApparent(core)); StelUtils::rectToSphe(&ra_sidereal,&dec_sidereal,get SiderealPosApparent(core));
ra_sidereal = 2.*M_PI-ra_sidereal; ra_sidereal = 2.*M_PI-ra_sidereal;
if (withDecimalDegree) if (withDecimalDegree)
{ {
ha_sidereal = ra_sidereal*12/M_PI; ha_sidereal = ra_sidereal*12/M_PI;
if (ha_sidereal>24.) if (ha_sidereal>24.)
ha_sidereal -= 24.; ha_sidereal -= 24.;
hadec = QString("%1h").arg(ha_sidereal, 0, ' firstCoordinate = QString("%1h").arg(ha_sid
f', 5); ereal, 0, 'f', 5);
res += q_("Hour angle/DE: %1/%2").arg(hadec, secondCoordinate = StelUtils::radToDecDegStr
StelUtils::radToDecDegStr(dec_sidereal)) + " " + q_("(apparent)") + "<br>" (dec_sidereal);
;
} }
else else
res += q_("Hour angle/DE: %1/%2").arg(StelUt {
ils::radToHmsStr(ra_sidereal,true), StelUtils::radToDmsStr(dec_sidereal,tru firstCoordinate = StelUtils::radToHmsStr(ra
e)) + " " + q_("(apparent)") + "<br>"; _sidereal,true);
secondCoordinate = StelUtils::radToDmsStr(de
c_sidereal,true);
}
} }
else else
{ {
if (withDecimalDegree) if (withDecimalDegree)
{ {
ha_sidereal = ra_sidereal*12/M_PI; ha_sidereal = ra_sidereal*12/M_PI;
if (ha_sidereal>24.) if (ha_sidereal>24.)
ha_sidereal -= 24.; ha_sidereal -= 24.;
hadec = QString("%1h").arg(ha_sidereal, 0, ' firstCoordinate = QString("%1h").arg(ha_sid
f', 5); ereal, 0, 'f', 5);
res += q_("Hour angle/DE: %1/%2").arg(hadec, secondCoordinate = StelUtils::radToDecDegStr
StelUtils::radToDecDegStr(dec_sidereal)) + " " + "<br>"; (dec_sidereal);
} }
else else
res += q_("Hour angle/DE: %1/%2").arg(StelUt {
ils::radToHmsStr(ra_sidereal,true), StelUtils::radToDmsStr(dec_sidereal,tru firstCoordinate = StelUtils::radToHmsStr(ra
e)) + " " + "<br>"; _sidereal,true);
secondCoordinate = StelUtils::radToDmsStr(de
c_sidereal,true);
}
} }
// TRANSLATORS: Hour angle/Declination
QString HADec = qc_("HA/Dec", "celestial coordinate system")
;
if (withDesignations)
HADec = QString("h/%1").arg(QChar(0x03B4));
if (withTables)
res += QString("<tr><td>%1:</td><td style='text-alig
n:right;'>%2/</td><td style='text-align:right;'>%3</td><td>%4</td></tr>").a
rg(HADec, firstCoordinate, secondCoordinate, apparent);
else
res += QString("%1: %2/%3 %4").arg(HADec, firstCoord
inate, secondCoordinate, apparent) + "<br>";
} }
if (flags&AltAzi) if (flags&AltAzi)
{ {
// calculate alt az // calculate alt az
double az,alt; double az,alt;
StelUtils::rectToSphe(&az,&alt,getAltAzPosGeometric(core)); StelUtils::rectToSphe(&az,&alt,getAltAzPosGeometric(core));
float direction = 3.; // N is zero, E is 90 degrees float direction = 3.; // N is zero, E is 90 degrees
if (useSouthAzimuth) if (useSouthAzimuth)
direction = 2.; direction = 2.;
az = direction*M_PI - az; az = direction*M_PI - az;
if (az > M_PI*2) if (az > M_PI*2)
az -= M_PI*2; az -= M_PI*2;
if (withAtmosphere && (alt_app>-3.0*M_PI/180.0)) // Don't sh ow refracted altitude much below horizon where model is meaningless. if (withAtmosphere && (alt_app>-3.0*M_PI/180.0)) // Don't sh ow refracted altitude much below horizon where model is meaningless.
{ {
if (withDecimalDegree) if (withDecimalDegree)
res += q_("Az/Alt: %1/%2").arg(StelUtils::ra {
dToDecDegStr(az), StelUtils::radToDecDegStr(alt_app)) + " " + q_("(apparent firstCoordinate = StelUtils::radToDecDegStr
)") + "<br>"; (az);
secondCoordinate = StelUtils::radToDecDegStr
(alt_app);
}
else else
res += q_("Az/Alt: %1/%2").arg(StelUtils::ra {
dToDmsStr(az,true), StelUtils::radToDmsStr(alt_app,true)) + " " + q_("(appa firstCoordinate = StelUtils::radToDmsStr(az
rent)") + "<br>"; ,true);
secondCoordinate = StelUtils::radToDmsStr(al
t_app,true);
}
} }
else else
{ {
if (withDecimalDegree) if (withDecimalDegree)
res += q_("Az/Alt: %1/%2").arg(StelUtils::ra {
dToDecDegStr(az), StelUtils::radToDecDegStr(alt)) + " " + "<br>"; firstCoordinate = StelUtils::radToDecDegStr
(az);
secondCoordinate = StelUtils::radToDecDegStr
(alt);
}
else else
res += q_("Az/Alt: %1/%2").arg(StelUtils::ra {
dToDmsStr(az,true), StelUtils::radToDmsStr(alt,true)) + " " + "<br>"; firstCoordinate = StelUtils::radToDmsStr(az
,true);
secondCoordinate = StelUtils::radToDmsStr(al
t,true);
}
}
// TRANSLATORS: Azimuth/Altitude
QString AzAlt = qc_("Az./Alt.", "celestial coordinate system
");
if (withDesignations)
AzAlt = "A/a";
if (withTables)
res += QString("<tr><td>%1:</td><td style='text-alig
n:right;'>%2/</td><td style='text-align:right;'>%3</td><td>%4</td></tr>").a
rg(AzAlt, firstCoordinate, secondCoordinate, apparent);
else
res += QString("%1: %2/%3 %4").arg(AzAlt, firstCoord
inate, secondCoordinate, apparent) + "<br>";
}
if (flags&GalacticCoord)
{
double glong, glat;
StelUtils::rectToSphe(&glong, &glat, getGalacticPos(core));
if (withDecimalDegree)
{
firstCoordinate = StelUtils::radToDecDegStr(glong);
secondCoordinate = StelUtils::radToDecDegStr(glat);
} }
else
{
firstCoordinate = StelUtils::radToDmsStr(glong,true
);
secondCoordinate = StelUtils::radToDmsStr(glat,true)
;
}
// TRANSLATORS: Galactic longitude/latitude
QString GalLongLat = qc_("Gal. long./lat.", "celestial coord
inate system");
if (withDesignations)
GalLongLat = "l/b";
if (withTables)
res += QString("<tr><td>%1:</td><td style='text-alig
n:right;'>%2/</td><td style='text-align:right;'>%3</td><td></td></tr>").arg
(GalLongLat, firstCoordinate, secondCoordinate);
else
res += QString("%1: %2/%3").arg(GalLongLat, firstCoo
rdinate, secondCoordinate) + "<br>";
}
if (flags&SupergalacticCoord)
{
double sglong, sglat;
StelUtils::rectToSphe(&sglong, &sglat, getSupergalacticPos(c
ore));
if (withDecimalDegree)
{
firstCoordinate = StelUtils::radToDecDegStr(sglong)
;
secondCoordinate = StelUtils::radToDecDegStr(sglat);
}
else
{
firstCoordinate = StelUtils::radToDmsStr(sglong,tru
e);
secondCoordinate = StelUtils::radToDmsStr(sglat,true
);
}
// TRANSLATORS: Supergalactic longitude/latitude
QString SGalLongLat = qc_("Supergal. long./lat.", "celestial
coordinate system");
if (withDesignations)
SGalLongLat = "SGL/SGB";
if (withTables)
res += QString("<tr><td>%1:</td><td style='text-alig
n:right;'>%2/</td><td style='text-align:right;'>%3</td><td></td></tr>").arg
(SGalLongLat, firstCoordinate, secondCoordinate);
else
res += QString("%1: %2/%3").arg(SGalLongLat, firstCo
ordinate, secondCoordinate) + "<br>";
} }
// N.B. Ecliptical coordinates are particularly earth-bound. // N.B. Ecliptical coordinates are particularly earth-bound.
// It may be OK to have terrestrial ecliptical coordinates of J2000. 0 (standard epoch) because those are in practice linked with VSOP XY plane, // It may be OK to have terrestrial ecliptical coordinates of J2000. 0 (standard epoch) because those are in practice linked with VSOP XY plane,
// and because the ecliptical grid of J2000 is also shown for observ ers on other planets. // and because the ecliptical grid of J2000 is also shown for observ ers on other planets.
// The formulation here has never computed the true position of any observer planet's orbital plane except for Earth, // The formulation here has never computed the true position of any observer planet's orbital plane except for Earth,
// or ever displayed the coordinates in the observer planet's equiva lent to Earth's ecliptical coordinates. // or ever displayed the coordinates in the observer planet's equiva lent to Earth's ecliptical coordinates.
// As quick test you can observe if in any "Ecliptic coordinate" as seen from e.g. Mars or Jupiter the Sun was ever close to beta=0 (except if crossing the node...). // As quick test you can observe if in any "Ecliptic coordinate" as seen from e.g. Mars or Jupiter the Sun was ever close to beta=0 (except if crossing the node...).
// TRANSLATORS: Ecliptic longitude/latitude
QString EqlLongLat = qc_("Ecl. long./lat.", "celestial coordinate sy
stem");
if (withDesignations)
EqlLongLat = QString("%1/%2").arg(QChar(0x03BB), QChar(0x03B
2));
if (flags&EclipticCoordJ2000) if (flags&EclipticCoordJ2000)
{ {
double eclJ2000=GETSTELMODULE(SolarSystem)->getEarth()->getR otObliquity(2451545.0); double eclJ2000=GETSTELMODULE(SolarSystem)->getEarth()->getR otObliquity(2451545.0);
double ra_equ, dec_equ, lambda, beta; double ra_equ, dec_equ, lambda, beta;
StelUtils::rectToSphe(&ra_equ,&dec_equ,getJ2000EquatorialPos (core)); StelUtils::rectToSphe(&ra_equ,&dec_equ,getJ2000EquatorialPos (core));
StelUtils::equToEcl(ra_equ, dec_equ, eclJ2000, &lambda, &bet a); StelUtils::equToEcl(ra_equ, dec_equ, eclJ2000, &lambda, &bet a);
if (lambda<0) lambda+=2.0*M_PI; if (lambda<0) lambda+=2.0*M_PI;
if (withDecimalDegree) if (withDecimalDegree)
res += q_("Ecliptic longitude/latitude") + QString(" {
(J2000.0): %1/%2").arg(StelUtils::radToDecDegStr(lambda), StelUtils::radTo firstCoordinate = StelUtils::radToDecDegStr(lambda)
DecDegStr(beta)) + "<br>"; ;
secondCoordinate = StelUtils::radToDecDegStr(beta);
}
else else
res += q_("Ecliptic longitude/latitude") + QString(" {
(J2000.0): %1/%2").arg(StelUtils::radToDmsStr(lambda, true), StelUtils::ra firstCoordinate = StelUtils::radToDmsStr(lambda, tr
dToDmsStr(beta, true)) + "<br>"; ue);
secondCoordinate = StelUtils::radToDmsStr(beta, true
);
}
if (withTables)
res += QString("<tr><td>%1 (J2000.0):</td><td style=
'text-align:right;'>%2/</td><td style='text-align:right;'>%3</td><td></td><
/tr>").arg(EqlLongLat, firstCoordinate, secondCoordinate);
else
res += QString("%1 (J2000.0): %2/%3").arg(EqlLongLat
, firstCoordinate, secondCoordinate) + "<br>";
} }
if ((flags&EclipticCoordOfDate) && (QString("Earth Sun").contains(cu rrentPlanet))) if ((flags&EclipticCoordOfDate) && (QString("Earth Sun").contains(cu rrentPlanet)))
{ {
double jde=core->getJDE(); double jde=core->getJDE();
double eclJDE = GETSTELMODULE(SolarSystem)->getEarth()->getR otObliquity(jde); double eclJDE = GETSTELMODULE(SolarSystem)->getEarth()->getR otObliquity(jde);
if (StelApp::getInstance().getCore()->getUseNutation()) if (StelApp::getInstance().getCore()->getUseNutation())
{ {
double deltaEps, deltaPsi; double deltaEps, deltaPsi;
getNutationAngles(jde, &deltaPsi, &deltaEps); getNutationAngles(jde, &deltaPsi, &deltaEps);
eclJDE+=deltaEps; eclJDE+=deltaEps;
} }
double ra_equ, dec_equ, lambdaJDE, betaJDE; double ra_equ, dec_equ, lambdaJDE, betaJDE;
StelUtils::rectToSphe(&ra_equ,&dec_equ,getEquinoxEquatorialP os(core)); StelUtils::rectToSphe(&ra_equ,&dec_equ,getEquinoxEquatorialP os(core));
StelUtils::equToEcl(ra_equ, dec_equ, eclJDE, &lambdaJDE, &be taJDE); StelUtils::equToEcl(ra_equ, dec_equ, eclJDE, &lambdaJDE, &be taJDE);
if (lambdaJDE<0) lambdaJDE+=2.0*M_PI; if (lambdaJDE<0) lambdaJDE+=2.0*M_PI;
if (withDecimalDegree) if (withDecimalDegree)
res += q_("Ecliptic longitude/latitude") + QString(" {
(%1): %2/%3").arg(cepoch, StelUtils::radToDecDegStr(lambdaJDE), StelUtils: firstCoordinate = StelUtils::radToDecDegStr(lambdaJ
:radToDecDegStr(betaJDE)) + "<br>"; DE);
secondCoordinate = StelUtils::radToDecDegStr(betaJDE
);
}
else else
res += q_("Ecliptic longitude/latitude") + QString(" {
(%1): %2/%3").arg(cepoch, StelUtils::radToDmsStr(lambdaJDE, true), StelUti firstCoordinate = StelUtils::radToDmsStr(lambdaJDE,
ls::radToDmsStr(betaJDE, true)) + "<br>"; true);
// GZ Only for now: display epsilon_A, angle between Earth's secondCoordinate = StelUtils::radToDmsStr(betaJDE, t
Axis and ecl. of date. rue);
if (withDecimalDegree) }
res += q_("Ecliptic obliquity") + QString(" (%1): %2
").arg(cepoch, StelUtils::radToDecDegStr(eclJDE)) + "<br>"; if (withTables)
res += QString("<tr><td>%1 (%4):</td><td style='text
-align:right;'>%2/</td><td style='text-align:right;'>%3</td><td></td></tr>"
).arg(EqlLongLat, firstCoordinate, secondCoordinate, cepoch) + "</table>";
else else
res += q_("Ecliptic obliquity") + QString(" (%1): %2 res += QString("%1 (%4): %2/%3").arg(EqlLongLat, fir
").arg(cepoch, StelUtils::radToDmsStr(eclJDE, true)) + "<br>"; stCoordinate, secondCoordinate, cepoch) + "<br>";
}
if (flags&GalacticCoord) // GZ Only for now: display epsilon_A, angle between Earth's
{ Axis and ecl. of date.
double glong, glat;
StelUtils::rectToSphe(&glong, &glat, getGalacticPos(core));
if (withDecimalDegree) if (withDecimalDegree)
res += q_("Galactic longitude/latitude: %1/%2").arg( StelUtils::radToDecDegStr(glong), StelUtils::radToDecDegStr(glat)) + "<br>" ; firstCoordinate = StelUtils::radToDecDegStr(eclJDE);
else else
res += q_("Galactic longitude/latitude: %1/%2").arg( firstCoordinate = StelUtils::radToDmsStr(eclJDE, tru
StelUtils::radToDmsStr(glong,true), StelUtils::radToDmsStr(glat,true)) + "< e);
br>";
}
if (flags&SupergalacticCoord) QString eqlObl = q_("Ecliptic obliquity");
{ if (withTables)
double sglong, sglat; {
StelUtils::rectToSphe(&sglong, &sglat, getSupergalacticPos(c res += "<table style='margin:0em 0em 0em -0.125em;bo
ore)); rder-spacing:0px;border:0px;'>";
if (withDecimalDegree) res += QString("<tr><td>%1 (%4):</td><td>%2</td></tr
res += q_("Supergalactic longitude/latitude: %1/%2") >").arg(eqlObl, firstCoordinate, cepoch);
.arg(StelUtils::radToDecDegStr(sglong), StelUtils::radToDecDegStr(sglat)) + }
"<br>";
else else
res += q_("Supergalactic longitude/latitude: %1/%2") .arg(StelUtils::radToDmsStr(sglong,true), StelUtils::radToDmsStr(sglat,true )) + "<br>"; res += QString("%1 (%3): %2").arg(eqlObl, firstCoord inate, cepoch) + "<br>";
} }
if (flags&IAUConstellation) if (withTables)
{ res += "</table>";
QString constel=core->getIAUConstellation(getEquinoxEquatori
alPos(core));
res += q_("IAU Constellation: %1").arg(constel) + "<br>";
}
if ((flags&SiderealTime) && (currentPlanet=="Earth")) if ((flags&SiderealTime) && (currentPlanet=="Earth"))
{ {
double longitude=core->getCurrentLocation().longitude; double longitude=core->getCurrentLocation().longitude;
double sidereal=(get_mean_sidereal_time(core->getJD(), core- >getJDE()) + longitude) / 15.; double sidereal=(get_mean_sidereal_time(core->getJD(), core- >getJDE()) + longitude) / 15.;
sidereal=fmod(sidereal, 24.); sidereal=fmod(sidereal, 24.);
if (sidereal < 0.) sidereal+=24.; if (sidereal < 0.) sidereal+=24.;
res += q_("Mean Sidereal Time: %1").arg(StelUtils::hoursToHm QString STc = q_("Mean Sidereal Time");
sStr(sidereal)) + "<br>"; QString STd = StelUtils::hoursToHmsStr(sidereal);
if (withTables)
{
res += "<table style='margin:0em 0em 0em -0.125em;bo
rder-spacing:0px;border:0px;'>";
res += QString("<tr><td>%1:</td><td style='text-alig
n:right;'>%2</td></tr>").arg(STc, STd);
}
else
res += QString("%1: %2").arg(STc, STd) + "<br>";
if (core->getUseNutation()) if (core->getUseNutation())
{ {
sidereal=(get_apparent_sidereal_time(core->getJD(), core->getJDE()) + longitude) / 15.; sidereal=(get_apparent_sidereal_time(core->getJD(), core->getJDE()) + longitude) / 15.;
sidereal=fmod(sidereal, 24.); sidereal=fmod(sidereal, 24.);
if (sidereal < 0.) sidereal+=24.; if (sidereal < 0.) sidereal+=24.;
res += q_("Apparent Sidereal Time: %1").arg(StelUtil STc = q_("Apparent Sidereal Time");
s::hoursToHmsStr(sidereal)) + "<br>"; STd = StelUtils::hoursToHmsStr(sidereal);
if (withTables)
res += QString("<tr><td>%1:</td><td style='t
ext-align:right;'>%2</td></tr>").arg(STc, STd);
else
res += QString("%1: %2").arg(STc, STd) + "<b
r>";
} }
if (withTables)
res += "</table>";
}
if (flags&IAUConstellation)
{
QString constel=core->getIAUConstellation(getEquinoxEquatori
alPos(core));
res += QString("%1: %2").arg(q_("IAU Constellation"), conste
l) + "<br>";
} }
return res; return res;
} }
// Apply post processing on the info string // Apply post processing on the info string
void StelObject::postProcessInfoString(QString& str, const InfoStringGroup& flags) const void StelObject::postProcessInfoString(QString& str, const InfoStringGroup& flags) const
{ {
// hack for avoiding an empty line before table
str.replace(QRegExp("<br(\\s*/)?><table"), "<table");
// chomp trailing line breaks // chomp trailing line breaks
str.replace(QRegExp("<br(\\s*/)?>\\s*$"), ""); str.replace(QRegExp("<br(\\s*/)?>\\s*$"), "");
if (flags&PlainText) if (flags&PlainText)
{ {
str.replace("<b>", ""); str.replace("<b>", "");
str.replace("</b>", ""); str.replace("</b>", "");
str.replace("<h2>", ""); str.replace("<h2>", "");
str.replace("</h2>", "\n"); str.replace("</h2>", "\n");
str.replace(QRegExp("<br(\\s*/)?>"), "\n"); str.replace(QRegExp("<br(\\s*/)?>"), "\n");
str.replace("<tr>", "");
str.replace(QRegExp("<td(\\w*)?>"), "");
str.replace("<td>", "");
str.replace("</tr>", "\n");
str.replace(QRegExp("<table(\\w*)?>"), "");
str.replace("</table>", "");
} }
else if(!(flags&NoFont)) else if(!(flags&NoFont))
{ {
Vec3f color = getInfoColor(); Vec3f color = getInfoColor();
StelCore* core = StelApp::getInstance().getCore(); StelCore* core = StelApp::getInstance().getCore();
if (core->isBrightDaylight() && core->getSkyDrawer()->getFla gHasAtmosphere()==true && !StelApp::getInstance().getVisionModeNight()) if (core->isBrightDaylight() && core->getSkyDrawer()->getFla gHasAtmosphere()==true && !StelApp::getInstance().getVisionModeNight())
{ {
// make info text more readable when atmosphere enab led at daylight. // make info text more readable when atmosphere enab led at daylight.
color = StelUtils::strToVec3f(StelApp::getInstance() .getSettings()->value("color/daylight_text_color", "0.0,0.0,0.0").toString( )); color = StelUtils::strToVec3f(StelApp::getInstance() .getSettings()->value("color/daylight_text_color", "0.0,0.0,0.0").toString( ));
} }
 End of changes. 37 change blocks. 
90 lines changed or deleted 297 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/