StelObject.cpp   StelObject.cpp 
skipping to change at line 41 skipping to change at line 41
#include "planetsephems/sidereal_time.h" #include "planetsephems/sidereal_time.h"
#include <QRegExp> #include <QRegExp>
#include <QDebug> #include <QDebug>
#include <QSettings> #include <QSettings>
int StelObject::stelObjectPMetaTypeID = qRegisterMetaType<StelObjectP>(); int StelObject::stelObjectPMetaTypeID = qRegisterMetaType<StelObjectP>();
Vec3d StelObject::getEquinoxEquatorialPos(const StelCore* core) const Vec3d StelObject::getEquinoxEquatorialPos(const StelCore* core) const
{ {
return core->j2000ToEquinoxEqu(getJ2000EquatorialPos(core)); return core->j2000ToEquinoxEqu(getJ2000EquatorialPos(core), StelCore
::RefractionOff);
}
Vec3d StelObject::getEquinoxEquatorialPosApparent(const StelCore* core) con
st
{
return core->j2000ToEquinoxEqu(getJ2000EquatorialPos(core), StelCore
::RefractionOn);
}
Vec3d StelObject::getEquinoxEquatorialPosAuto(const StelCore* core) const
{
return core->j2000ToEquinoxEqu(getJ2000EquatorialPos(core), StelCore
::RefractionAuto);
} }
// Get observer local sidereal coordinate // Get observer local sidereal coordinate
Vec3d StelObject::getSiderealPosGeometric(const StelCore* core) const Vec3d StelObject::getSiderealPosGeometric(const StelCore* core) const
{ {
return Mat4d::zrotation(-core->getLocalSiderealTime())* getEquinoxEq uatorialPos(core); return Mat4d::zrotation(-core->getLocalSiderealTime())* getEquinoxEq uatorialPos(core);
} }
// Get observer local sidereal coordinates, deflected by refraction // Get observer local sidereal coordinates, deflected by refraction
Vec3d StelObject::getSiderealPosApparent(const StelCore* core) const Vec3d StelObject::getSiderealPosApparent(const StelCore* core) const
skipping to change at line 72 skipping to change at line 82
// Get observer-centered alt/az position // Get observer-centered alt/az position
Vec3d StelObject::getAltAzPosApparent(const StelCore* core) const Vec3d StelObject::getAltAzPosApparent(const StelCore* core) const
{ {
return core->j2000ToAltAz(getJ2000EquatorialPos(core), StelCore::Ref ractionOn); return core->j2000ToAltAz(getJ2000EquatorialPos(core), StelCore::Ref ractionOn);
} }
// Get observer-centered alt/az position // Get observer-centered alt/az position
Vec3d StelObject::getAltAzPosAuto(const StelCore* core) const Vec3d StelObject::getAltAzPosAuto(const StelCore* core) const
{ {
return core->j2000ToAltAz(getJ2000EquatorialPos(core)); return core->j2000ToAltAz(getJ2000EquatorialPos(core), StelCore::Ref ractionAuto);
} }
// Get observer-centered galactic position // Get observer-centered galactic position
Vec3d StelObject::getGalacticPos(const StelCore *core) const Vec3d StelObject::getGalacticPos(const StelCore *core) const
{ {
return core->j2000ToGalactic(getJ2000EquatorialPos(core)); return core->j2000ToGalactic(getJ2000EquatorialPos(core));
} }
// Get observer-centered supergalactic position // Get observer-centered supergalactic position
Vec3d StelObject::getSupergalacticPos(const StelCore *core) const Vec3d StelObject::getSupergalacticPos(const StelCore *core) const
skipping to change at line 216 skipping to change at line 226
// 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...).
if (flags&EclipticCoordJ2000) if (flags&EclipticCoordJ2000)
{ {
double ecl=GETSTELMODULE(SolarSystem)->getEarth()->getRotObl iquity(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, ecl, &lambda, &beta); 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 DecDegStr(beta)) + "<br>"; res += q_("Ecliptic longitude/latitude") + QString(" (J2000.0): %1/%2").arg(StelUtils::radToDecDegStr(lambda), StelUtils::radTo DecDegStr(beta)) + "<br>";
else else
res += q_("Ecliptic longitude/latitude") + QString(" (J2000.0): %1/%2").arg(StelUtils::radToDmsStr(lambda, true), StelUtils::ra dToDmsStr(beta, true)) + "<br>"; res += q_("Ecliptic longitude/latitude") + QString(" (J2000.0): %1/%2").arg(StelUtils::radToDmsStr(lambda, true), StelUtils::ra dToDmsStr(beta, true)) + "<br>";
} }
if ((flags&EclipticCoordOfDate) && (QString("Earth Sun").contains(cu rrentPlanet))) if ((flags&EclipticCoordOfDate) && (QString("Earth Sun").contains(cu rrentPlanet)))
{ {
skipping to change at line 273 skipping to change at line 283
else else
res += q_("Supergalactic longitude/latitude: %1/%2") .arg(StelUtils::radToDmsStr(sglong,true), StelUtils::radToDmsStr(sglat,true )) + "<br>"; res += q_("Supergalactic longitude/latitude: %1/%2") .arg(StelUtils::radToDmsStr(sglong,true), StelUtils::radToDmsStr(sglat,true )) + "<br>";
} }
if (flags&IAUConstellation) if (flags&IAUConstellation)
{ {
QString constel=core->getIAUConstellation(getJ2000Equatorial Pos(core)); QString constel=core->getIAUConstellation(getJ2000Equatorial Pos(core));
res += q_("IAU Constellation: %1").arg(constel) + "<br>"; res += q_("IAU Constellation: %1").arg(constel) + "<br>";
} }
if ((flags&Extra) && (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 sStr(sidereal)) + "<br>"; res += q_("Mean Sidereal Time: %1").arg(StelUtils::hoursToHm sStr(sidereal)) + "<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.);
skipping to change at line 319 skipping to change at line 329
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( ));
} }
str.prepend(QString("<font color=%1>").arg(StelUtils::vec3fT oHtmlColor(color))); str.prepend(QString("<font color=%1>").arg(StelUtils::vec3fT oHtmlColor(color)));
str.append(QString("</font>")); str.append(QString("</font>"));
} }
} }
QVariantMap StelObject::getInfoMap(const StelCore *core) const
{
QVariantMap map;
Vec3d pos;
double ra, dec, alt, az, glong, glat;
bool useOldAzimuth = StelApp::getInstance().getFlagSouthAzimuthUsage
();
map.insert("type", getType());
// ra/dec
pos = getEquinoxEquatorialPos(core);
StelUtils::rectToSphe(&ra, &dec, pos);
map.insert("ra", ra*180./M_PI);
map.insert("dec", dec*180./M_PI);
// ra/dec in J2000
pos = getJ2000EquatorialPos(core);
StelUtils::rectToSphe(&ra, &dec, pos);
map.insert("raJ2000", ra*180./M_PI);
map.insert("decJ2000", dec*180./M_PI);
// apparent altitude/azimuth
pos = getAltAzPosApparent(core);
StelUtils::rectToSphe(&az, &alt, pos);
float direction = 3.; // N is zero, E is 90 degrees
if (useOldAzimuth)
direction = 2.;
az = direction*M_PI - az;
if (az > M_PI*2)
az -= M_PI*2;
map.insert("altitude", alt*180./M_PI);
map.insert("azimuth", az*180./M_PI);
// geometric altitude/azimuth
pos = getAltAzPosGeometric(core);
StelUtils::rectToSphe(&az, &alt, pos);
az = direction*M_PI - az;
if (az > M_PI*2)
az -= M_PI*2;
map.insert("altitude-geometric", alt*180./M_PI);
map.insert("azimuth-geometric", az*180./M_PI);
// galactic long/lat
pos = getGalacticPos(core);
StelUtils::rectToSphe(&glong, &glat, pos);
map.insert("glong", glong*180./M_PI);
map.insert("glat", glat*180./M_PI);
// supergalactic long/lat
pos = getSupergalacticPos(core);
StelUtils::rectToSphe(&glong, &glat, pos);
map.insert("sglong", glong*180./M_PI);
map.insert("sglat", glat*180./M_PI);
SolarSystem* ssmgr = GETSTELMODULE(SolarSystem);
double ra_equ, dec_equ, lambda, beta;
// J2000
double eclJ2000 = ssmgr->getEarth()->getRotObliquity(2451545.0);
double ecl = ssmgr->getEarth()->getRotObliquity(core->getJDE());
// ecliptic longitude/latitude (J2000 frame)
StelUtils::rectToSphe(&ra_equ,&dec_equ, getJ2000EquatorialPos(core))
;
StelUtils::equToEcl(ra_equ, dec_equ, eclJ2000, &lambda, &beta);
if (lambda<0) lambda+=2.0*M_PI;
map.insert("elongJ2000", lambda*180./M_PI);
map.insert("elatJ2000", beta*180./M_PI);
if (QString("Earth Sun").contains(core->getCurrentLocation().planetN
ame))
{
// ecliptic longitude/latitude
StelUtils::rectToSphe(&ra_equ,&dec_equ, getEquinoxEquatorial
Pos(core));
StelUtils::equToEcl(ra_equ, dec_equ, ecl, &lambda, &beta);
if (lambda<0) lambda+=2.0*M_PI;
map.insert("elong", lambda*180./M_PI);
map.insert("elat", beta*180./M_PI);
}
// magnitude
map.insert("vmag", getVMagnitude(core));
map.insert("vmage", getVMagnitudeWithExtinction(core));
// angular size
double angularSize = 2.*getAngularSize(core)*M_PI/180.;
bool sign;
double deg;
StelUtils::radToDecDeg(angularSize, sign, deg);
if (!sign)
deg *= -1;
map.insert("size", angularSize);
map.insert("size-dd", deg);
map.insert("size-deg", StelUtils::radToDecDegStr(angularSize, 5));
map.insert("size-dms", StelUtils::radToDmsStr(angularSize, true));
// english name or designation & localized name
map.insert("name", getEnglishName());
map.insert("localized-name", getNameI18n());
return map;
}
 End of changes. 6 change blocks. 
5 lines changed or deleted 19 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/