StelObject.cpp   StelObject.cpp 
skipping to change at line 30 skipping to change at line 30
#include "StelObject.hpp" #include "StelObject.hpp"
#include "StelApp.hpp" #include "StelApp.hpp"
#include "StelCore.hpp" #include "StelCore.hpp"
#include "StelProjector.hpp" #include "StelProjector.hpp"
#include "StelUtils.hpp" #include "StelUtils.hpp"
#include "StelTranslator.hpp" #include "StelTranslator.hpp"
#include "StelSkyDrawer.hpp" #include "StelSkyDrawer.hpp"
#include "RefractionExtinction.hpp" #include "RefractionExtinction.hpp"
#include "StelLocation.hpp" #include "StelLocation.hpp"
#include "SolarSystem.hpp" #include "SolarSystem.hpp"
#include "StelModuleMgr.hpp"
#include "StelGui.hpp"
#include <QRegExp> #include <QRegExp>
#include <QDebug> #include <QDebug>
#include <QSettings> #include <QSettings>
Vec3d StelObject::getEquinoxEquatorialPos(const StelCore* core) const Vec3d StelObject::getEquinoxEquatorialPos(const StelCore* core) const
{ {
return core->j2000ToEquinoxEqu(getJ2000EquatorialPos(core)); return core->j2000ToEquinoxEqu(getJ2000EquatorialPos(core));
} }
skipping to change at line 112 skipping to change at line 110
// 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::getPositionInfoString(const StelCore *core, const InfoS tringGroup& flags) const
{ {
bool withAtmosphere = core->getSkyDrawer()->getFlagHasAtmosphere(); bool withAtmosphere = core->getSkyDrawer()->getFlagHasAtmosphere();
bool withDecimalDegree = dynamic_cast<StelGui*>(StelApp::getInstance ().getGui())->getFlagShowDecimalDegrees(); bool withDecimalDegree = StelApp::getInstance().getFlagShowDecimalDe grees();;
double currentEpoch = core->getCurrentEpoch(); double currentEpoch = core->getCurrentEpoch();
QString cepoch = qc_("on date", "coordinates for current epoch"); QString cepoch = qc_("on date", "coordinates for current epoch");
if (currentEpoch>0 && currentEpoch<9000.) if (currentEpoch>0 && currentEpoch<9000.)
{ {
// OK, we can show epoch in format YYYY.F // OK, we can show epoch in format YYYY.F
cepoch = QString("J%1").arg(QString::number(currentEpoch, 'f ', 1)); cepoch = QString("J%1").arg(QString::number(currentEpoch, 'f ', 1));
} }
QString res; QString res;
if (flags&RaDecJ2000) if (flags&RaDecJ2000)
{ {
skipping to change at line 143 skipping to change at line 141
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 gStr(dec_equ)) + "<br>"; res += q_("RA/Dec") + QString(" (%1): %2/%3").arg(ce poch, StelUtils::radToDecDegStr(ra_equ,5,false,true), StelUtils::radToDecDe gStr(dec_equ)) + "<br>";
else else
res += q_("RA/Dec") + QString(" (%1): %2/%3").arg(ce poch, StelUtils::radToHmsStr(ra_equ,true), StelUtils::radToDmsStr(dec_equ,t rue)) + "<br>"; res += q_("RA/Dec") + QString(" (%1): %2/%3").arg(ce poch, StelUtils::radToHmsStr(ra_equ,true), StelUtils::radToDmsStr(dec_equ,t rue)) + "<br>";
} }
if (flags&HourAngle) if (flags&HourAngle)
{ {
double dec_sidereal, ra_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) if (withAtmosphere)
{ {
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;
res += q_("Hour angle/DE: %1/%2").arg(StelUtils::rad if (withDecimalDegree)
ToHmsStr(ra_sidereal,true), StelUtils::radToDmsStr(dec_sidereal,true)) + " {
" + q_("(apparent)") + "<br>"; ha_sidereal = ra_sidereal*12/M_PI;
if (ha_sidereal>24.)
ha_sidereal -= 24.;
hadec = QString("%1h").arg(ha_sidereal, 0, '
f', 5);
res += q_("Hour angle/DE: %1/%2").arg(hadec,
StelUtils::radToDecDegStr(dec_sidereal)) + " " + q_("(apparent)") + "<br>"
;
}
else
res += q_("Hour angle/DE: %1/%2").arg(StelUt
ils::radToHmsStr(ra_sidereal,true), StelUtils::radToDmsStr(dec_sidereal,tru
e)) + " " + q_("(apparent)") + "<br>";
} }
else else
{ {
res += q_("Hour angle/DE: %1/%2").arg(StelUtils::rad if (withDecimalDegree)
ToHmsStr(ra_sidereal,true), StelUtils::radToDmsStr(dec_sidereal,true)) + " {
" + "<br>"; ha_sidereal = ra_sidereal*12/M_PI;
if (ha_sidereal>24.)
ha_sidereal -= 24.;
hadec = QString("%1h").arg(ha_sidereal, 0, '
f', 5);
res += q_("Hour angle/DE: %1/%2").arg(hadec,
StelUtils::radToDecDegStr(dec_sidereal)) + " " + "<br>";
}
else
res += q_("Hour angle/DE: %1/%2").arg(StelUt
ils::radToHmsStr(ra_sidereal,true), StelUtils::radToDmsStr(dec_sidereal,tru
e)) + " " + "<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));
az = 3.*M_PI - az; // N is zero, E is 90 degrees az = 3.*M_PI - az; // N is zero, E is 90 degrees
if (az > M_PI*2) if (az > M_PI*2)
skipping to change at line 186 skipping to change at line 203
} }
else else
{ {
if (withDecimalDegree) if (withDecimalDegree)
res += q_("Az/Alt: %1/%2").arg(StelUtils::ra dToDecDegStr(az), StelUtils::radToDecDegStr(alt)) + " " + "<br>"; res += q_("Az/Alt: %1/%2").arg(StelUtils::ra dToDecDegStr(az), StelUtils::radToDecDegStr(alt)) + " " + "<br>";
else else
res += q_("Az/Alt: %1/%2").arg(StelUtils::ra dToDmsStr(az,true), StelUtils::radToDmsStr(alt,true)) + " " + "<br>"; res += q_("Az/Alt: %1/%2").arg(StelUtils::ra dToDmsStr(az,true), StelUtils::radToDmsStr(alt,true)) + " " + "<br>";
} }
} }
if ((flags&EclipticCoord) && (core->getCurrentLocation().planetName= ="Earth")) if (flags&EclipticCoord)
{ {
static SolarSystem *ssystem=GETSTELMODULE(SolarSystem); double ecl = core->getCurrentPlanet()->getRotObliquity(24515
double ecl= ssystem->getEarth()->getRotObliquity(2451545.0); 45.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::ctRadec2Ecl(ra_equ, dec_equ, ecl, &lambda, &beta) ; StelUtils::equToEcl(ra_equ, dec_equ, ecl, &lambda, &beta);
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(" (J%1): %2/%3").arg(QString::number(2000.f, 'f', 1), StelUtils::radToDecDeg Str(lambda), StelUtils::radToDecDegStr(beta)) + "<br>"; res += q_("Ecliptic longitude/latitude") + QString(" (J%1): %2/%3").arg(QString::number(2000.f, 'f', 1), StelUtils::radToDecDeg Str(lambda), StelUtils::radToDecDegStr(beta)) + "<br>";
else else
res += q_("Ecliptic longitude/latitude") + QString(" (J%1): %2/%3").arg(QString::number(2000.f, 'f', 1), StelUtils::radToDmsStr (lambda, true), StelUtils::radToDmsStr(beta, true)) + "<br>"; res += q_("Ecliptic longitude/latitude") + QString(" (J%1): %2/%3").arg(QString::number(2000.f, 'f', 1), StelUtils::radToDmsStr (lambda, true), StelUtils::radToDmsStr(beta, true)) + "<br>";
ecl= ssystem->getEarth()->getRotObliquity(core->getJDay()); ecl = core->getCurrentPlanet()->getRotObliquity(core->getJDa y());
StelUtils::rectToSphe(&ra_equ,&dec_equ,getEquinoxEquatorialP os(core)); StelUtils::rectToSphe(&ra_equ,&dec_equ,getEquinoxEquatorialP os(core));
StelUtils::ctRadec2Ecl(ra_equ, dec_equ, ecl, &lambda, &beta) ; StelUtils::equToEcl(ra_equ, dec_equ, ecl, &lambda, &beta);
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(" (%1): %2/%3").arg(cepoch, StelUtils::radToDecDegStr(lambda), StelUtils::ra dToDecDegStr(beta)) + "<br>"; res += q_("Ecliptic longitude/latitude") + QString(" (%1): %2/%3").arg(cepoch, StelUtils::radToDecDegStr(lambda), StelUtils::ra dToDecDegStr(beta)) + "<br>";
else else
res += q_("Ecliptic longitude/latitude") + QString(" (%1): %2/%3").arg(cepoch, StelUtils::radToDmsStr(lambda, true), StelUtils: :radToDmsStr(beta, true)) + "<br>"; res += q_("Ecliptic longitude/latitude") + QString(" (%1): %2/%3").arg(cepoch, StelUtils::radToDmsStr(lambda, true), StelUtils: :radToDmsStr(beta, true)) + "<br>";
} }
if (flags&GalacticCoord) if (flags&GalacticCoord)
{ {
double glong, glat; double glong, glat;
 End of changes. 10 change blocks. 
16 lines changed or deleted 38 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/