StelMainScriptAPI.cpp   StelMainScriptAPI.cpp 
skipping to change at line 41 skipping to change at line 41
#include "Planet.hpp" #include "Planet.hpp"
#include "SolarSystem.hpp" #include "SolarSystem.hpp"
#include "StarMgr.hpp" #include "StarMgr.hpp"
#include "StelApp.hpp" #include "StelApp.hpp"
#include "StelAudioMgr.hpp" #include "StelAudioMgr.hpp"
#include "StelVideoMgr.hpp" #include "StelVideoMgr.hpp"
#include "StelCore.hpp" #include "StelCore.hpp"
#include "StelFileMgr.hpp" #include "StelFileMgr.hpp"
#include "StelLocation.hpp" #include "StelLocation.hpp"
#include "StelLocationMgr.hpp" #include "StelLocationMgr.hpp"
#include "StelMainGraphicsView.hpp" #include "StelMainView.hpp"
#include "StelModuleMgr.hpp" #include "StelModuleMgr.hpp"
#include "StelMovementMgr.hpp" #include "StelMovementMgr.hpp"
#include "StelObject.hpp" #include "StelObject.hpp"
#include "StelObjectMgr.hpp" #include "StelObjectMgr.hpp"
#include "StelProjector.hpp" #include "StelProjector.hpp"
#include "StelSkyCultureMgr.hpp" #include "StelSkyCultureMgr.hpp"
#include "StelSkyDrawer.hpp" #include "StelSkyDrawer.hpp"
#include "StelSkyLayerMgr.hpp" #include "StelSkyLayerMgr.hpp"
#include "StelUtils.hpp" #include "StelUtils.hpp"
#include "StelGuiBase.hpp" #include "StelGuiBase.hpp"
#include "MilkyWay.hpp" #include "MilkyWay.hpp"
#include <QAction>
#include <QDateTime> #include <QDateTime>
#include <QDebug> #include <QDebug>
#include <QDir> #include <QDir>
#include <QFile> #include <QFile>
#include <QFileInfo> #include <QFileInfo>
#include <QRegExp> #include <QRegExp>
#include <QSet> #include <QSet>
#include <QStringList> #include <QStringList>
#include <QTemporaryFile> #include <QTemporaryFile>
skipping to change at line 98 skipping to change at line 97
connect(this, SIGNAL(requestSeekVideo(const QString&, qint64)), Stel App::getInstance().getStelVideoMgr(), SLOT(seekVideo(const QString&, qint64 ))); connect(this, SIGNAL(requestSeekVideo(const QString&, qint64)), Stel App::getInstance().getStelVideoMgr(), SLOT(seekVideo(const QString&, qint64 )));
connect(this, SIGNAL(requestSetVideoXY(const QString&, float, float) ), StelApp::getInstance().getStelVideoMgr(), SLOT(setVideoXY(const QString& , float, float))); connect(this, SIGNAL(requestSetVideoXY(const QString&, float, float) ), StelApp::getInstance().getStelVideoMgr(), SLOT(setVideoXY(const QString& , float, float)));
connect(this, SIGNAL(requestSetVideoAlpha(const QString&, float)), S telApp::getInstance().getStelVideoMgr(), SLOT(setVideoAlpha(const QString&, float))); connect(this, SIGNAL(requestSetVideoAlpha(const QString&, float)), S telApp::getInstance().getStelVideoMgr(), SLOT(setVideoAlpha(const QString&, float)));
connect(this, SIGNAL(requestResizeVideo(const QString&, float, float )), StelApp::getInstance().getStelVideoMgr(), SLOT(resizeVideo(const QStrin g&, float, float))); connect(this, SIGNAL(requestResizeVideo(const QString&, float, float )), StelApp::getInstance().getStelVideoMgr(), SLOT(resizeVideo(const QStrin g&, float, float)));
connect(this, SIGNAL(requestShowVideo(const QString&, bool)), StelAp p::getInstance().getStelVideoMgr(), SLOT(showVideo(const QString&, bool))); connect(this, SIGNAL(requestShowVideo(const QString&, bool)), StelAp p::getInstance().getStelVideoMgr(), SLOT(showVideo(const QString&, bool)));
connect(this, SIGNAL(requestExit()), this->parent(), SLOT(stopScript ())); connect(this, SIGNAL(requestExit()), this->parent(), SLOT(stopScript ()));
connect(this, SIGNAL(requestSetNightMode(bool)), &StelApp::getInstan ce(), SLOT(setVisionModeNight(bool))); connect(this, SIGNAL(requestSetNightMode(bool)), &StelApp::getInstan ce(), SLOT(setVisionModeNight(bool)));
connect(this, SIGNAL(requestSetProjectionMode(QString)), StelApp::ge tInstance().getCore(), SLOT(setCurrentProjectionTypeKey(QString))); connect(this, SIGNAL(requestSetProjectionMode(QString)), StelApp::ge tInstance().getCore(), SLOT(setCurrentProjectionTypeKey(QString)));
connect(this, SIGNAL(requestSetSkyCulture(QString)), &StelApp::getIn stance().getSkyCultureMgr(), SLOT(setCurrentSkyCultureID(QString))); connect(this, SIGNAL(requestSetSkyCulture(QString)), &StelApp::getIn stance().getSkyCultureMgr(), SLOT(setCurrentSkyCultureID(QString)));
connect(this, SIGNAL(requestSetDiskViewport(bool)), StelMainGraphics View::getInstance().getMainScriptAPIProxy(), SLOT(setDiskViewport(bool))); connect(this, SIGNAL(requestSetDiskViewport(bool)), StelApp::getInst ance().getMainScriptAPIProxy(), SLOT(setDiskViewport(bool)));
connect(this, SIGNAL(requestSetHomePosition()), StelApp::getInstance ().getCore(), SLOT(returnToHome())); connect(this, SIGNAL(requestSetHomePosition()), StelApp::getInstance ().getCore(), SLOT(returnToHome()));
} }
StelMainScriptAPI::~StelMainScriptAPI() StelMainScriptAPI::~StelMainScriptAPI()
{ {
} }
//! Set the current date in Julian Day //! Set the current date in Julian Day
//! @param JD the Julian Date //! @param JD the Julian Date
void StelMainScriptAPI::setJDay(double JD) void StelMainScriptAPI::setJDay(double JD)
skipping to change at line 179 skipping to change at line 178
void StelMainScriptAPI::setDeltaTAlgorithm(QString algorithmName) void StelMainScriptAPI::setDeltaTAlgorithm(QString algorithmName)
{ {
StelApp::getInstance().getCore()->setCurrentDeltaTAlgorithmKey(algor ithmName); StelApp::getInstance().getCore()->setCurrentDeltaTAlgorithmKey(algor ithmName);
} }
//! Set time speed in JDay/sec //! Set time speed in JDay/sec
//! @param ts time speed in JDay/sec //! @param ts time speed in JDay/sec
void StelMainScriptAPI::setTimeRate(double ts) void StelMainScriptAPI::setTimeRate(double ts)
{ {
// 1 second = .00001157407407407407 JDay // 1 second = .00001157407407407407 JDay
StelApp::getInstance().getCore()->setTimeRate(ts * 0.000011574074074 07407 * StelMainGraphicsView::getInstance().getScriptMgr().getScriptRate()) ; StelApp::getInstance().getCore()->setTimeRate(ts * 0.000011574074074 07407 * StelApp::getInstance().getScriptMgr().getScriptRate());
} }
//! Get time speed in JDay/sec //! Get time speed in JDay/sec
//! @return time speed in JDay/sec //! @return time speed in JDay/sec
double StelMainScriptAPI::getTimeRate() const double StelMainScriptAPI::getTimeRate() const
{ {
return StelApp::getInstance().getCore()->getTimeRate() / (0.00001157 407407407407 * StelMainGraphicsView::getInstance().getScriptMgr().getScript Rate()); return StelApp::getInstance().getCore()->getTimeRate() / (0.00001157 407407407407 * StelApp::getInstance().getScriptMgr().getScriptRate());
} }
bool StelMainScriptAPI::isRealTime() bool StelMainScriptAPI::isRealTime()
{ {
return StelApp::getInstance().getCore()->getIsTimeNow(); return StelApp::getInstance().getCore()->getIsTimeNow();
} }
void StelMainScriptAPI::setRealTime() void StelMainScriptAPI::setRealTime()
{ {
setTimeRate(1.0); setTimeRate(1.0);
skipping to change at line 220 skipping to change at line 219
loc.altitude = altitude; loc.altitude = altitude;
if (ssmgr->searchByName(planet)) if (ssmgr->searchByName(planet))
loc.planetName = planet; loc.planetName = planet;
loc.name = name; loc.name = name;
core->moveObserverTo(loc, duration); core->moveObserverTo(loc, duration);
} }
void StelMainScriptAPI::setObserverLocation(const QString id, float duratio n) void StelMainScriptAPI::setObserverLocation(const QString id, float duratio n)
{ {
StelCore* core = StelApp::getInstance().getCore(); StelCore* core = StelApp::getInstance().getCore();
bool ok; StelLocation loc = StelApp::getInstance().getLocationMgr().locationF
StelLocation loc = StelApp::getInstance().getLocationMgr().locationF orString(id);
orSmallString(id, &ok); if (!loc.isValid())
if (!ok)
return; // location find failed return; // location find failed
core->moveObserverTo(loc, duration); core->moveObserverTo(loc, duration);
} }
QString StelMainScriptAPI::getObserverLocation() QString StelMainScriptAPI::getObserverLocation()
{ {
return StelApp::getInstance().getCore()->getCurrentLocation().getID( ); return StelApp::getInstance().getCore()->getCurrentLocation().getID( );
} }
QVariantMap StelMainScriptAPI::getObserverLocationInfo() QVariantMap StelMainScriptAPI::getObserverLocationInfo()
skipping to change at line 253 skipping to change at line 251
// extra data // extra data
map.insert("sidereal-year", planet->getSiderealPeriod()); map.insert("sidereal-year", planet->getSiderealPeriod());
map.insert("sidereal-day", planet->getSiderealDay()*24.); map.insert("sidereal-day", planet->getSiderealDay()*24.);
map.insert("solar-day", planet->getMeanSolarDay()*24.); map.insert("solar-day", planet->getMeanSolarDay()*24.);
return map; return map;
} }
void StelMainScriptAPI::screenshot(const QString& prefix, bool invert, cons t QString& dir) void StelMainScriptAPI::screenshot(const QString& prefix, bool invert, cons t QString& dir)
{ {
bool oldInvertSetting = StelMainGraphicsView::getInstance().getFlagI bool oldInvertSetting = StelMainView::getInstance().getFlagInvertScr
nvertScreenShotColors(); eenShotColors();
StelMainGraphicsView::getInstance().setFlagInvertScreenShotColors(in StelMainView::getInstance().setFlagInvertScreenShotColors(invert);
vert); StelMainView::getInstance().saveScreenShot(prefix, dir);
StelMainGraphicsView::getInstance().saveScreenShot(prefix, dir); StelMainView::getInstance().setFlagInvertScreenShotColors(oldInvertS
StelMainGraphicsView::getInstance().setFlagInvertScreenShotColors(ol etting);
dInvertSetting);
} }
void StelMainScriptAPI::setGuiVisible(bool b) void StelMainScriptAPI::setGuiVisible(bool b)
{ {
StelApp::getInstance().getGui()->setVisible(b); StelApp::getInstance().getGui()->setVisible(b);
} }
void StelMainScriptAPI::setMinFps(float m) void StelMainScriptAPI::setMinFps(float m)
{ {
StelMainGraphicsView::getInstance().setMinFps(m); StelMainView::getInstance().setMinFps(m);
} }
float StelMainScriptAPI::getMinFps() float StelMainScriptAPI::getMinFps()
{ {
return StelMainGraphicsView::getInstance().getMinFps(); return StelMainView::getInstance().getMinFps();
} }
void StelMainScriptAPI::setMaxFps(float m) void StelMainScriptAPI::setMaxFps(float m)
{ {
StelMainGraphicsView::getInstance().setMaxFps(m); StelMainView::getInstance().setMaxFps(m);
} }
float StelMainScriptAPI::getMaxFps() float StelMainScriptAPI::getMaxFps()
{ {
return StelMainGraphicsView::getInstance().getMaxFps(); return StelMainView::getInstance().getMaxFps();
} }
QString StelMainScriptAPI::getMountMode() QString StelMainScriptAPI::getMountMode()
{ {
if (GETSTELMODULE(StelMovementMgr)->getMountMode() == StelMovementMg r::MountEquinoxEquatorial) if (GETSTELMODULE(StelMovementMgr)->getMountMode() == StelMovementMg r::MountEquinoxEquatorial)
return "equatorial"; return "equatorial";
else else
return "azimuthal"; return "azimuthal";
} }
skipping to change at line 485 skipping to change at line 483
minRes, maxBright, visible); minRes, maxBright, visible);
} }
void StelMainScriptAPI::removeSkyImage(const QString& id) void StelMainScriptAPI::removeSkyImage(const QString& id)
{ {
emit(requestRemoveSkyImage(id)); emit(requestRemoveSkyImage(id));
} }
void StelMainScriptAPI::loadSound(const QString& filename, const QString& i d) void StelMainScriptAPI::loadSound(const QString& filename, const QString& i d)
{ {
QString path; QString path = StelFileMgr::findFile("scripts/" + filename);
try if (path.isEmpty())
{
path = StelFileMgr::findFile("scripts/" + filename);
}
catch(std::runtime_error& e)
{ {
qWarning() << "cannot play sound" << QDir::toNativeSeparator s(filename) << ":" << e.what(); qWarning() << "cannot play sound" << QDir::toNativeSeparator s(filename);
return; return;
} }
emit(requestLoadSound(path, id)); emit(requestLoadSound(path, id));
} }
void StelMainScriptAPI::playSound(const QString& id) void StelMainScriptAPI::playSound(const QString& id)
{ {
emit(requestPlaySound(id)); emit(requestPlaySound(id));
} }
skipping to change at line 521 skipping to change at line 515
emit(requestStopSound(id)); emit(requestStopSound(id));
} }
void StelMainScriptAPI::dropSound(const QString& id) void StelMainScriptAPI::dropSound(const QString& id)
{ {
emit(requestDropSound(id)); emit(requestDropSound(id));
} }
void StelMainScriptAPI::loadVideo(const QString& filename, const QString& i d, float x, float y, bool show, float alpha) void StelMainScriptAPI::loadVideo(const QString& filename, const QString& i d, float x, float y, bool show, float alpha)
{ {
QString path; QString path = StelFileMgr::findFile("scripts/" + filename);
try if (path.isEmpty())
{
path = StelFileMgr::findFile("scripts/" + filename);
}
catch(std::runtime_error& e)
{ {
qWarning() << "cannot play video" << QDir::toNativeSeparator s(filename) << ":" << e.what(); qWarning() << "cannot play video" << QDir::toNativeSeparator s(filename);
return; return;
} }
emit(requestLoadVideo(path, id, x, y, show, alpha)); emit(requestLoadVideo(path, id, x, y, show, alpha));
} }
void StelMainScriptAPI::playVideo(const QString& id) void StelMainScriptAPI::playVideo(const QString& id)
{ {
emit(requestPlayVideo(id)); emit(requestPlayVideo(id));
} }
skipping to change at line 582 skipping to change at line 572
emit(requestResizeVideo(id, w, h)); emit(requestResizeVideo(id, w, h));
} }
void StelMainScriptAPI::showVideo(const QString& id, bool show) void StelMainScriptAPI::showVideo(const QString& id, bool show)
{ {
emit(requestShowVideo(id, show)); emit(requestShowVideo(id, show));
} }
int StelMainScriptAPI::getScreenWidth() int StelMainScriptAPI::getScreenWidth()
{ {
return StelMainGraphicsView::getInstance().size().width(); return StelMainView::getInstance().size().width();
} }
int StelMainScriptAPI::getScreenHeight() int StelMainScriptAPI::getScreenHeight()
{ {
return StelMainGraphicsView::getInstance().size().height(); return StelMainView::getInstance().size().height();
} }
double StelMainScriptAPI::getScriptRate() double StelMainScriptAPI::getScriptRate()
{ {
return StelMainGraphicsView::getInstance().getScriptMgr().getScript Rate(); return StelApp::getInstance().getScriptMgr().getScriptRate();
} }
void StelMainScriptAPI::setScriptRate(double r) void StelMainScriptAPI::setScriptRate(double r)
{ {
return StelMainGraphicsView::getInstance().getScriptMgr().setScript Rate(r); return StelApp::getInstance().getScriptMgr().setScriptRate(r);
} }
void StelMainScriptAPI::pauseScript() void StelMainScriptAPI::pauseScript()
{ {
return StelMainGraphicsView::getInstance().getScriptMgr().pauseScrip t(); return StelApp::getInstance().getScriptMgr().pauseScript();
} }
void StelMainScriptAPI::setSelectedObjectInfo(const QString& level) void StelMainScriptAPI::setSelectedObjectInfo(const QString& level)
{ {
if (level == "AllInfo") if (level == "AllInfo")
StelApp::getInstance().getGui()->setInfoTextFilters(StelObje ct::InfoStringGroup(StelObject::AllInfo)); StelApp::getInstance().getGui()->setInfoTextFilters(StelObje ct::InfoStringGroup(StelObject::AllInfo));
else if (level == "ShortInfo") else if (level == "ShortInfo")
StelApp::getInstance().getGui()->setInfoTextFilters(StelObje ct::InfoStringGroup(StelObject::ShortInfo)); StelApp::getInstance().getGui()->setInfoTextFilters(StelObje ct::InfoStringGroup(StelObject::ShortInfo));
else if (level == "None") else if (level == "None")
StelApp::getInstance().getGui()->setInfoTextFilters((StelObj ect::InfoStringGroup)0); StelApp::getInstance().getGui()->setInfoTextFilters((StelObj ect::InfoStringGroup)0);
skipping to change at line 630 skipping to change at line 620
} }
void StelMainScriptAPI::quitStellarium() void StelMainScriptAPI::quitStellarium()
{ {
QCoreApplication::exit(); QCoreApplication::exit();
} }
void StelMainScriptAPI::debug(const QString& s) void StelMainScriptAPI::debug(const QString& s)
{ {
qDebug() << "script: " << s; qDebug() << "script: " << s;
StelMainGraphicsView::getInstance().getScriptMgr().debug(s); StelApp::getInstance().getScriptMgr().debug(s);
} }
double StelMainScriptAPI::jdFromDateString(const QString& dt, const QString & spec) double StelMainScriptAPI::jdFromDateString(const QString& dt, const QString & spec)
{ {
StelCore *core = StelApp::getInstance().getCore(); StelCore *core = StelApp::getInstance().getCore();
if (dt == "now") if (dt == "now")
return StelUtils::getJDFromSystem(); return StelUtils::getJDFromSystem();
bool ok; bool ok;
double jd; double jd;
skipping to change at line 668 skipping to change at line 658
double yearLength = 365.242190419; // duration of Earth's me an tropical year double yearLength = 365.242190419; // duration of Earth's me an tropical year
double monthLength = 27.321582241; // duration of Earth's me an tropical month double monthLength = 27.321582241; // duration of Earth's me an tropical month
if (nowRe.capturedTexts().at(1)=="now") if (nowRe.capturedTexts().at(1)=="now")
jd = StelUtils::getJDFromSystem(); jd = StelUtils::getJDFromSystem();
else else
jd = core->getJDay(); jd = core->getJDay();
if (nowRe.capturedTexts().at(8) == "sidereal") if (nowRe.capturedTexts().at(8) == "sidereal")
{ {
dayLength = core->getLocalSideralDayLength(); dayLength = core->getLocalSiderealDayLength();
yearLength = core->getLocalSideralYearLength(); yearLength = core->getLocalSiderealYearLength();
monthLength = 27.321661; // duration of Earth's side real month monthLength = 27.321661; // duration of Earth's side real month
} }
QString unitString = nowRe.capturedTexts().at(6); QString unitString = nowRe.capturedTexts().at(6);
if (unitString == "seconds" || unitString == "second") if (unitString == "seconds" || unitString == "second")
unit = dayLength / (24*3600.); unit = dayLength / (24*3600.);
else if (unitString == "minutes" || unitString == "minute") else if (unitString == "minutes" || unitString == "minute")
unit = dayLength / (24*60.); unit = dayLength / (24*60.);
else if (unitString == "hours" || unitString == "hour") else if (unitString == "hours" || unitString == "hour")
unit = dayLength / (24.); unit = dayLength / (24.);
skipping to change at line 741 skipping to change at line 731
debug("getObjectData WARNING - object not found: " + name); debug("getObjectData WARNING - object not found: " + name);
map.insert("found", false); map.insert("found", false);
return map; return map;
} }
else else
{ {
map.insert("found", true); map.insert("found", true);
} }
Vec3d pos; Vec3d pos;
double ra, dec, alt, azi, glong, glat; double ra, dec, alt, az, glong, glat;
StelCore* core = StelApp::getInstance().getCore(); StelCore* core = StelApp::getInstance().getCore();
// ra/dec // ra/dec
pos = obj->getEquinoxEquatorialPos(core); pos = obj->getEquinoxEquatorialPos(core);
StelUtils::rectToSphe(&ra, &dec, pos); StelUtils::rectToSphe(&ra, &dec, pos);
map.insert("ra", ra*180./M_PI); map.insert("ra", ra*180./M_PI);
map.insert("dec", dec*180./M_PI); map.insert("dec", dec*180./M_PI);
// ra/dec in J2000 // ra/dec in J2000
pos = obj->getJ2000EquatorialPos(core); pos = obj->getJ2000EquatorialPos(core);
StelUtils::rectToSphe(&ra, &dec, pos); StelUtils::rectToSphe(&ra, &dec, pos);
map.insert("raJ2000", ra*180./M_PI); map.insert("raJ2000", ra*180./M_PI);
map.insert("decJ2000", dec*180./M_PI); map.insert("decJ2000", dec*180./M_PI);
// apparent altitude/azimuth // apparent altitude/azimuth
pos = obj->getAltAzPosApparent(core); pos = obj->getAltAzPosApparent(core);
StelUtils::rectToSphe(&azi, &alt, pos); StelUtils::rectToSphe(&az, &alt, pos);
az = 3.*M_PI - az; // N is zero, E is 90 degrees
if (az > M_PI*2)
az -= M_PI*2;
map.insert("altitude", alt*180./M_PI); map.insert("altitude", alt*180./M_PI);
map.insert("azimuth", azi*180./M_PI); map.insert("azimuth", az*180./M_PI);
// geometric altitude/azimuth // geometric altitude/azimuth
pos = obj->getAltAzPosGeometric(core); pos = obj->getAltAzPosGeometric(core);
StelUtils::rectToSphe(&azi, &alt, pos); StelUtils::rectToSphe(&az, &alt, pos);
az = 3.*M_PI - az; // N is zero, E is 90 degrees
if (az > M_PI*2)
az -= M_PI*2;
map.insert("altitude-geometric", alt*180./M_PI); map.insert("altitude-geometric", alt*180./M_PI);
map.insert("azimuth-geometric", azi*180./M_PI); map.insert("azimuth-geometric", az*180./M_PI);
// galactic long/lat in J2000 // galactic long/lat
pos = obj->getJ2000GalacticPos(core); pos = obj->getGalacticPos(core);
StelUtils::rectToSphe(&glong, &glat, pos); StelUtils::rectToSphe(&glong, &glat, pos);
map.insert("glong", alt*180./M_PI); map.insert("glong", glong*180./M_PI);
map.insert("glat", azi*180./M_PI); map.insert("glat", glat*180./M_PI);
// magnitude // magnitude
map.insert("vmag", obj->getVMagnitude(core, false)); map.insert("vmag", obj->getVMagnitude(core));
map.insert("vmage", obj->getVMagnitude(core, true)); map.insert("vmage", obj->getVMagnitudeWithExtinction(core));
// angular size // angular size
map.insert("size", obj->getAngularSize(core)); map.insert("size", obj->getAngularSize(core));
// localized name // localized name
map.insert("localized-name", obj->getNameI18n()); map.insert("localized-name", obj->getNameI18n());
return map; return map;
} }
skipping to change at line 813 skipping to change at line 811
map.insert("found", false); map.insert("found", false);
return map; return map;
} }
else else
{ {
map.insert("found", true); map.insert("found", true);
} }
// OK, object found. Let's go. // OK, object found. Let's go.
Vec3d pos; Vec3d pos;
double ra, dec, alt, azi, glong, glat; double ra, dec, alt, az, glong, glat;
StelCore* core = StelApp::getInstance().getCore(); StelCore* core = StelApp::getInstance().getCore();
// ra/dec // ra/dec
pos = obj->getEquinoxEquatorialPos(core); pos = obj->getEquinoxEquatorialPos(core);
StelUtils::rectToSphe(&ra, &dec, pos); StelUtils::rectToSphe(&ra, &dec, pos);
map.insert("ra", ra*180./M_PI); map.insert("ra", ra*180./M_PI);
map.insert("dec", dec*180./M_PI); map.insert("dec", dec*180./M_PI);
// ra/dec in J2000 // ra/dec in J2000
pos = obj->getJ2000EquatorialPos(core); pos = obj->getJ2000EquatorialPos(core);
StelUtils::rectToSphe(&ra, &dec, pos); StelUtils::rectToSphe(&ra, &dec, pos);
map.insert("raJ2000", ra*180./M_PI); map.insert("raJ2000", ra*180./M_PI);
map.insert("decJ2000", dec*180./M_PI); map.insert("decJ2000", dec*180./M_PI);
// apparent altitude/azimuth // apparent altitude/azimuth
pos = obj->getAltAzPosApparent(core); pos = obj->getAltAzPosApparent(core);
StelUtils::rectToSphe(&azi, &alt, pos); StelUtils::rectToSphe(&az, &alt, pos);
az = 3.*M_PI - az; // N is zero, E is 90 degrees
if (az > M_PI*2)
az -= M_PI*2;
map.insert("altitude", alt*180./M_PI); map.insert("altitude", alt*180./M_PI);
map.insert("azimuth", azi*180./M_PI); map.insert("azimuth", az*180./M_PI);
// geometric altitude/azimuth // geometric altitude/azimuth
pos = obj->getAltAzPosGeometric(core); pos = obj->getAltAzPosGeometric(core);
StelUtils::rectToSphe(&azi, &alt, pos); StelUtils::rectToSphe(&az, &alt, pos);
az = 3.*M_PI - az; // N is zero, E is 90 degrees
if (az > M_PI*2)
az -= M_PI*2;
map.insert("altitude-geometric", alt*180./M_PI); map.insert("altitude-geometric", alt*180./M_PI);
map.insert("azimuth-geometric", azi*180./M_PI); map.insert("azimuth-geometric", az*180./M_PI);
// galactic long/lat in J2000 // galactic long/lat
pos = obj->getJ2000GalacticPos(core); pos = obj->getGalacticPos(core);
StelUtils::rectToSphe(&glong, &glat, pos); StelUtils::rectToSphe(&glong, &glat, pos);
map.insert("glong", alt*180./M_PI); map.insert("glong", glong*180./M_PI);
map.insert("glat", azi*180./M_PI); map.insert("glat", glat*180./M_PI);
// magnitude // magnitude
map.insert("vmag", obj->getVMagnitude(core, false)); map.insert("vmag", obj->getVMagnitude(core));
map.insert("vmage", obj->getVMagnitude(core, true)); map.insert("vmage", obj->getVMagnitudeWithExtinction(core));
// angular size // angular size
map.insert("size", obj->getAngularSize(core)); map.insert("size", obj->getAngularSize(core));
// english name or designation & localized name // english name or designation & localized name
map.insert("name", obj->getEnglishName()); map.insert("name", obj->getEnglishName());
map.insert("localized-name", obj->getNameI18n()); map.insert("localized-name", obj->getNameI18n());
return map; return map;
} }
 End of changes. 38 change blocks. 
64 lines changed or deleted 69 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/