StelObject.cpp   StelObject.cpp 
skipping to change at line 37 skipping to change at line 37
#include "RefractionExtinction.hpp" #include "RefractionExtinction.hpp"
#include "StelLocation.hpp" #include "StelLocation.hpp"
#include "SolarSystem.hpp" #include "SolarSystem.hpp"
#include "StelModuleMgr.hpp" #include "StelModuleMgr.hpp"
#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>();
Vec3d StelObject::getEquinoxEquatorialPos(const StelCore* core) const Vec3d StelObject::getEquinoxEquatorialPos(const StelCore* core) const
{ {
return core->j2000ToEquinoxEqu(getJ2000EquatorialPos(core)); return core->j2000ToEquinoxEqu(getJ2000EquatorialPos(core));
} }
// 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);
} }
skipping to change at line 109 skipping to change at line 111
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 = StelApp::getInstance().getFlagShowDecimalDe grees(); bool withDecimalDegree = StelApp::getInstance().getFlagShowDecimalDe grees();
bool useOldAzimuth = StelApp::getInstance().getFlagOldAzimuthUsage() ; bool useSouthAzimuth = StelApp::getInstance().getFlagSouthAzimuthUsa ge();
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;
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)
skipping to change at line 177 skipping to change at line 179
res += q_("Hour angle/DE: %1/%2").arg(StelUt ils::radToHmsStr(ra_sidereal,true), StelUtils::radToDmsStr(dec_sidereal,tru e)) + " " + "<br>"; 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));
float direction = 3.; // N is zero, E is 90 degrees float direction = 3.; // N is zero, E is 90 degrees
if (useOldAzimuth) 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 )") + "<br>"; res += q_("Az/Alt: %1/%2").arg(StelUtils::ra dToDecDegStr(az), StelUtils::radToDecDegStr(alt_app)) + " " + q_("(apparent )") + "<br>";
else else
res += q_("Az/Alt: %1/%2").arg(StelUtils::ra dToDmsStr(az,true), StelUtils::radToDmsStr(alt_app,true)) + " " + q_("(appa rent)") + "<br>"; res += q_("Az/Alt: %1/%2").arg(StelUtils::ra dToDmsStr(az,true), StelUtils::radToDmsStr(alt_app,true)) + " " + q_("(appa rent)") + "<br>";
skipping to change at line 251 skipping to change at line 253
res += q_("Galactic longitude/latitude: %1/%2").arg( StelUtils::radToDecDegStr(glong), StelUtils::radToDecDegStr(glat)) + "<br>" ; res += q_("Galactic longitude/latitude: %1/%2").arg( StelUtils::radToDecDegStr(glong), StelUtils::radToDecDegStr(glat)) + "<br>" ;
else else
res += q_("Galactic longitude/latitude: %1/%2").arg( StelUtils::radToDmsStr(glong,true), StelUtils::radToDmsStr(glat,true)) + "< br>"; res += q_("Galactic longitude/latitude: %1/%2").arg( StelUtils::radToDmsStr(glong,true), StelUtils::radToDmsStr(glat,true)) + "< br>";
} }
if ((flags&Extra) && core->getCurrentPlanet()->getEnglishName()=="Ea rth") if ((flags&Extra) && core->getCurrentPlanet()->getEnglishName()=="Ea rth")
{ {
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.;
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.);
if (sidereal < 0.) sidereal+=24.;
res += q_("Apparent Sidereal Time: %1").arg(StelUtil s::hoursToHmsStr(sidereal)) + "<br>"; res += q_("Apparent Sidereal Time: %1").arg(StelUtil s::hoursToHmsStr(sidereal)) + "<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
{ {
skipping to change at line 277 skipping to change at line 281
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");
} }
else 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( ));
} }
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>"));
 End of changes. 6 change blocks. 
3 lines changed or deleted 7 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/