StelMainScriptAPI.cpp   StelMainScriptAPI.cpp 
skipping to change at line 24 skipping to change at line 24
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA.
*/ */
#include "StelMainScriptAPI.hpp" #include "StelMainScriptAPI.hpp"
#include "StelMainScriptAPIProxy.hpp" #include "StelMainScriptAPIProxy.hpp"
#include "StelScriptMgr.hpp" #include "StelScriptMgr.hpp"
#include "StelLocaleMgr.hpp"
#include "ConstellationMgr.hpp" #include "ConstellationMgr.hpp"
#include "GridLinesMgr.hpp" #include "GridLinesMgr.hpp"
#include "LandscapeMgr.hpp" #include "LandscapeMgr.hpp"
#include "MeteorMgr.hpp" #include "MeteorMgr.hpp"
#include "NebulaMgr.hpp" #include "NebulaMgr.hpp"
#include "Planet.hpp" #include "Planet.hpp"
#include "SolarSystem.hpp" #include "SolarSystem.hpp"
#include "StarMgr.hpp" #include "StarMgr.hpp"
#include "StelApp.hpp" #include "StelApp.hpp"
skipping to change at line 89 skipping to change at line 90
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)), StelMainGraphics View::getInstance().getMainScriptAPIProxy(), SLOT(setDiskViewport(bool)));
} }
StelMainScriptAPI::~StelMainScriptAPI() StelMainScriptAPI::~StelMainScriptAPI()
{ {
} }
ScriptSleeper& StelMainScriptAPI::getScriptSleeper(void)
{
return scriptSleeper;
}
//! 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)
{ {
StelApp::getInstance().getCore()->getNavigator()->setJDay(JD); StelApp::getInstance().getCore()->getNavigator()->setJDay(JD);
} }
//! Get the current date in Julian Day //! Get the current date in Julian Day
//! @return the Julian Date //! @return the Julian Date
double StelMainScriptAPI::getJDay(void) const double StelMainScriptAPI::getJDay() const
{ {
return StelApp::getInstance().getCore()->getNavigator()->getJDay(); return StelApp::getInstance().getCore()->getNavigator()->getJDay();
} }
void StelMainScriptAPI::setDate(const QString& dt, const QString& spec) void StelMainScriptAPI::setDate(const QString& dt, const QString& spec)
{ {
StelApp::getInstance().getCore()->getNavigator()->setJDay(jdFromDate String(dt, spec)); StelApp::getInstance().getCore()->getNavigator()->setJDay(jdFromDate String(dt, spec));
} }
QString StelMainScriptAPI::getDate(const QString& spec) QString StelMainScriptAPI::getDate(const QString& spec)
{ {
return StelUtils::jdToIsoString(getJDay()); if (spec=="utc")
return StelUtils::julianDayToISO8601String(getJDay());
else
return StelUtils::julianDayToISO8601String(getJDay()+StelUti
ls::getGMTShiftFromQT(getJDay())/24);
} }
//! 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()->getNavigator()->setTimeRate(ts * 0 .00001157407407407407 * scriptSleeper.getRate()); StelApp::getInstance().getCore()->getNavigator()->setTimeRate(ts * 0 .00001157407407407407 * StelMainGraphicsView::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(void) const double StelMainScriptAPI::getTimeRate() const
{ {
return StelApp::getInstance().getCore()->getNavigator()->getTimeRate () / (0.00001157407407407407 * scriptSleeper.getRate()); return StelApp::getInstance().getCore()->getNavigator()->getTimeRate () / (0.00001157407407407407 * StelMainGraphicsView::getInstance().getScrip tMgr().getScriptRate());
} }
bool StelMainScriptAPI::isRealTime() bool StelMainScriptAPI::isRealTime()
{ {
return StelApp::getInstance().getCore()->getNavigator()->getIsTimeNo w(); return StelApp::getInstance().getCore()->getNavigator()->getIsTimeNo w();
} }
void StelMainScriptAPI::setRealTime() void StelMainScriptAPI::setRealTime()
{ {
setTimeRate(1.0); setTimeRate(1.0);
StelApp::getInstance().getCore()->getNavigator()->setTimeNow(); StelApp::getInstance().getCore()->getNavigator()->setTimeNow();
} }
void StelMainScriptAPI::wait(double t)
{
scriptSleeper.sleep(t*1000);
}
void StelMainScriptAPI::waitFor(const QString& dt, const QString& spec)
{
double JD = jdFromDateString(dt, spec);
StelNavigator* nav = StelApp::getInstance().getCore()->getNavigator(
);
Q_ASSERT(nav);
double timeSpeed = nav->getTimeRate();
if (timeSpeed == 0.)
{
qWarning() << "waitFor called with no time passing - would b
e infinite. not waiting!";
return;
}
else if (timeSpeed > 0)
{
while(nav->getJDay() < JD)
scriptSleeper.sleep(200);
}
else
{
while(nav->getJDay() > JD)
scriptSleeper.sleep(200);
}
}
void StelMainScriptAPI::setObserverLocation(double longitude, double latitu de, double altitude, double duration, const QString& name, const QString& p lanet) void StelMainScriptAPI::setObserverLocation(double longitude, double latitu de, double altitude, double duration, const QString& name, const QString& p lanet)
{ {
StelNavigator* nav = StelApp::getInstance().getCore()->getNavigator( ); StelNavigator* nav = StelApp::getInstance().getCore()->getNavigator( );
Q_ASSERT(nav); Q_ASSERT(nav);
SolarSystem* ssmgr = GETSTELMODULE(SolarSystem); SolarSystem* ssmgr = GETSTELMODULE(SolarSystem);
Q_ASSERT(ssmgr); Q_ASSERT(ssmgr);
StelLocation loc = nav->getCurrentLocation(); StelLocation loc = nav->getCurrentLocation();
if (longitude < 180 || longitude > 180) loc.longitude = longitude;
loc.longitude = longitude; loc.latitude = latitude;
if (latitude < 180 || latitude > 180) if (altitude > -1000)
loc.latitude = latitude;
if (altitude < -1000)
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;
nav->moveObserverTo(loc, duration); nav->moveObserverTo(loc, duration);
} }
void StelMainScriptAPI::setObserverLocation(const QString id, double durati on) void StelMainScriptAPI::setObserverLocation(const QString id, float duratio n)
{ {
StelNavigator* nav = StelApp::getInstance().getCore()->getNavigator( ); StelNavigator* nav = StelApp::getInstance().getCore()->getNavigator( );
Q_ASSERT(nav); Q_ASSERT(nav);
StelLocation loc = StelApp::getInstance().getLocationMgr().locationF orSmallString(id); StelLocation loc = StelApp::getInstance().getLocationMgr().locationF orSmallString(id);
// How best to test to see if the lookup of the name was a success? // How best to test to see if the lookup of the name was a success?
// On failure, it returns Paris, but maybe we _want_ Paris. // On failure, it returns Paris, but maybe we _want_ Paris.
// Ugly. -MNG // Ugly. -MNG
if (id!="Paris, France" && (loc.name=="Paris" && loc.country=="Franc e")) if (id!="Paris, France" && (loc.name=="Paris" && loc.country=="Franc e"))
return; // location find fail return; // location find fail
skipping to change at line 282 skipping to change at line 249
QString StelMainScriptAPI::getProjectionMode() QString StelMainScriptAPI::getProjectionMode()
{ {
return StelApp::getInstance().getCore()->getCurrentProjectionTypeKey (); return StelApp::getInstance().getCore()->getCurrentProjectionTypeKey ();
} }
void StelMainScriptAPI::setProjectionMode(const QString& id) void StelMainScriptAPI::setProjectionMode(const QString& id)
{ {
emit(requestSetProjectionMode(id)); emit(requestSetProjectionMode(id));
} }
QStringList StelMainScriptAPI::getAllSkyCultureIDs(void) QStringList StelMainScriptAPI::getAllSkyCultureIDs()
{ {
return StelApp::getInstance().getSkyCultureMgr().getSkyCultureListID s(); return StelApp::getInstance().getSkyCultureMgr().getSkyCultureListID s();
} }
QString StelMainScriptAPI::getSkyCulture() QString StelMainScriptAPI::getSkyCulture()
{ {
return StelApp::getInstance().getSkyCultureMgr().getCurrentSkyCultur eID(); return StelApp::getInstance().getSkyCultureMgr().getCurrentSkyCultur eID();
} }
void StelMainScriptAPI::setSkyCulture(const QString& id) void StelMainScriptAPI::setSkyCulture(const QString& id)
{ {
emit(requestSetSkyCulture(id)); emit(requestSetSkyCulture(id));
} }
bool StelMainScriptAPI::getFlagGravityLabels() bool StelMainScriptAPI::getFlagGravityLabels()
{ {
return StelApp::getInstance().getCore()->getProjection(Mat4d())->get FlagGravityLabels(); return StelApp::getInstance().getCore()->getProjection(StelCore::Fra meJ2000)->getFlagGravityLabels();
} }
void StelMainScriptAPI::setFlagGravityLabels(bool b) void StelMainScriptAPI::setFlagGravityLabels(bool b)
{ {
StelApp::getInstance().getCore()->setFlagGravityLabels(b); StelApp::getInstance().getCore()->setFlagGravityLabels(b);
} }
bool StelMainScriptAPI::getDiskViewport() bool StelMainScriptAPI::getDiskViewport()
{ {
return StelApp::getInstance().getCore()->getProjection(Mat4d())->get MaskType() == StelProjector::MaskDisk; return StelApp::getInstance().getCore()->getProjection(StelCore::Fra meJ2000)->getMaskType() == StelProjector::MaskDisk;
} }
void StelMainScriptAPI::setDiskViewport(bool b) void StelMainScriptAPI::setDiskViewport(bool b)
{ {
emit(requestSetDiskViewport(b)); emit(requestSetDiskViewport(b));
} }
void StelMainScriptAPI::loadSkyImage(const QString& id, const QString& file name, void StelMainScriptAPI::loadSkyImage(const QString& id, const QString& file name,
double ra0, double dec0, double ra0, double dec0,
double ra1, double dec1, double ra1, double dec1,
skipping to change at line 347 skipping to change at line 314
StelUtils::getDecAngle(ra1) *180./M_PI, Ste lUtils::getDecAngle(dec1)*180./M_PI, StelUtils::getDecAngle(ra1) *180./M_PI, Ste lUtils::getDecAngle(dec1)*180./M_PI,
StelUtils::getDecAngle(ra2) *180./M_PI, Ste lUtils::getDecAngle(dec2)*180./M_PI, StelUtils::getDecAngle(ra2) *180./M_PI, Ste lUtils::getDecAngle(dec2)*180./M_PI,
StelUtils::getDecAngle(ra3) *180./M_PI, Ste lUtils::getDecAngle(dec3)*180./M_PI, StelUtils::getDecAngle(ra3) *180./M_PI, Ste lUtils::getDecAngle(dec3)*180./M_PI,
minRes, maxBright, visible); minRes, maxBright, visible);
} }
void StelMainScriptAPI::loadSkyImage(const QString& id, const QString& file name, void StelMainScriptAPI::loadSkyImage(const QString& id, const QString& file name,
dou ble ra, double dec, double angSize, double rotation, dou ble ra, double dec, double angSize, double rotation,
dou ble minRes, double maxBright, bool visible) dou ble minRes, double maxBright, bool visible)
{ {
Vec3d XYZ; Vec3f XYZ;
const double RADIUS_NEB = 1.; static const float RADIUS_NEB = 1.;
StelUtils::spheToRect(ra*M_PI/180., dec*M_PI/180., XYZ); StelUtils::spheToRect(ra*M_PI/180., dec*M_PI/180., XYZ);
XYZ*=RADIUS_NEB; XYZ*=RADIUS_NEB;
double texSize = RADIUS_NEB * sin(angSize/2/60*M_PI/180); float texSize = RADIUS_NEB * sin(angSize/2/60*M_PI/180);
Mat4f matPrecomp = Mat4f::translation(XYZ) * Mat4f matPrecomp = Mat4f::translation(XYZ) *
Mat4f::zrotation(ra*M_PI/180.) * Mat4f::zrotation(ra*M_PI/180.) *
Mat4f::yrotation(-dec*M_PI/180.) * Mat4f::yrotation(-dec*M_PI/180.) *
Mat4f::xrotation(rotation*M_PI/18 0.); Mat4f::xrotation(rotation*M_PI/18 0.);
Vec3d corners[4]; Vec3f corners[4];
corners[0] = matPrecomp * Vec3d(0.,-texSize,-texSize); corners[0] = matPrecomp * Vec3f(0.f,-texSize,-texSize);
corners[1] = matPrecomp * Vec3d(0., texSize,-texSize); corners[1] = matPrecomp * Vec3f(0.f, texSize,-texSize);
corners[2] = matPrecomp * Vec3d(0.,-texSize, texSize); corners[2] = matPrecomp * Vec3f(0.f,-texSize, texSize);
corners[3] = matPrecomp * Vec3d(0., texSize, texSize); corners[3] = matPrecomp * Vec3f(0.f, texSize, texSize);
// convert back to ra/dec (radians) // convert back to ra/dec (radians)
Vec3d cornersRaDec[4]; Vec3f cornersRaDec[4];
for(int i=0; i<4; i++) for(int i=0; i<4; i++)
StelUtils::rectToSphe(&cornersRaDec[i][0], &cornersRaDec[i][ 1], corners[i]); StelUtils::rectToSphe(&cornersRaDec[i][0], &cornersRaDec[i][ 1], corners[i]);
loadSkyImage(id, filename, loadSkyImage(id, filename,
cornersRaDec[0][0]*180./M_PI, cornersRaDec[ 0][1]*180./M_PI, cornersRaDec[0][0]*180./M_PI, cornersRaDec[ 0][1]*180./M_PI,
cornersRaDec[1][0]*180./M_PI, cornersRaDec[ 1][1]*180./M_PI, cornersRaDec[1][0]*180./M_PI, cornersRaDec[ 1][1]*180./M_PI,
cornersRaDec[3][0]*180./M_PI, cornersRaDec[ 3][1]*180./M_PI, cornersRaDec[3][0]*180./M_PI, cornersRaDec[ 3][1]*180./M_PI,
cornersRaDec[2][0]*180./M_PI, cornersRaDec[ 2][1]*180./M_PI, cornersRaDec[2][0]*180./M_PI, cornersRaDec[ 2][1]*180./M_PI,
minRes, maxBright, visible); minRes, maxBright, visible);
} }
skipping to change at line 426 skipping to change at line 393
void StelMainScriptAPI::stopSound(const QString& id) void StelMainScriptAPI::stopSound(const QString& id)
{ {
emit(requestStopSound(id)); emit(requestStopSound(id));
} }
void StelMainScriptAPI::dropSound(const QString& id) void StelMainScriptAPI::dropSound(const QString& id)
{ {
emit(requestDropSound(id)); emit(requestDropSound(id));
} }
int StelMainScriptAPI::getScreenWidth(void) int StelMainScriptAPI::getScreenWidth()
{ {
return StelMainGraphicsView::getInstance().size().width(); return StelMainGraphicsView::getInstance().size().width();
} }
int StelMainScriptAPI::getScreenHeight(void) int StelMainScriptAPI::getScreenHeight()
{ {
return StelMainGraphicsView::getInstance().size().height(); return StelMainGraphicsView::getInstance().size().height();
} }
double StelMainScriptAPI::getScriptRate(void) double StelMainScriptAPI::getScriptRate()
{ {
return scriptSleeper.getRate(); return StelMainGraphicsView::getInstance().getScriptMgr().getScript Rate();
} }
void StelMainScriptAPI::setScriptRate(double r) void StelMainScriptAPI::setScriptRate(double r)
{ {
return scriptSleeper.setRate(r); return StelMainGraphicsView::getInstance().getScriptMgr().setScript Rate(r);
} }
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);
else else
qWarning() << "setSelectedObjectInfo unknown level string \" " << level << "\""; qWarning() << "setSelectedObjectInfo unknown level string \" " << level << "\"";
} }
void StelMainScriptAPI::exit(void) void StelMainScriptAPI::exit()
{ {
emit(requestExit()); emit(requestExit());
} }
void StelMainScriptAPI::quitStellarium(void) 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); StelMainGraphicsView::getInstance().getScriptMgr().debug(s);
} }
double StelMainScriptAPI::jdFromDateString(const QString& dt, const QString & spec) double StelMainScriptAPI::jdFromDateString(const QString& dt, const QString & spec)
{ {
QDateTime qdt;
double JD;
// 2008-03-24T13:21:01
QRegExp isoRe("^\\d{4}[:\\-]\\d\\d[:\\-]\\d\\dT\\d?\\d:\\d\\d:\\d\\d
$");
QRegExp nowRe("^(now)?(\\s*([+\\-])\\s*(\\d+(\\.\\d+)?)\\s*(second|s
econds|minute|minutes|hour|hours|day|days|week|weeks))(\\s+(sidereal)?)?");
if (dt == "now") if (dt == "now")
return StelUtils::getJDFromSystem(); return StelUtils::getJDFromSystem();
else if (isoRe.exactMatch(dt))
{
qdt = QDateTime::fromString(dt, Qt::ISODate);
if (spec=="local") bool ok;
JD = StelUtils::qDateTimeToJd(qdt.toUTC()); double jd;
else if (spec=="local")
JD = StelUtils::qDateTimeToJd(qdt); {
jd = StelApp::getInstance().getLocaleMgr().getJdFromISO8601T
return JD; imeLocal(dt, &ok);
} }
else if (nowRe.exactMatch(dt)) else
{
jd = StelUtils::getJulianDayFromISO8601String(dt, &ok);
}
if (ok)
return jd;
QRegExp nowRe("^(now)?(\\s*([+\\-])\\s*(\\d+(\\.\\d+)?)\\s*(second|s
econds|minute|minutes|hour|hours|day|days|week|weeks))(\\s+(sidereal)?)?");
if (nowRe.exactMatch(dt))
{ {
double delta; double delta;
double unit; double unit;
double dayLength = 1.0; double dayLength = 1.0;
if (nowRe.capturedTexts().at(1)=="now") if (nowRe.capturedTexts().at(1)=="now")
JD = StelUtils::getJDFromSystem(); jd = StelUtils::getJDFromSystem();
else else
JD = StelApp::getInstance().getCore()->getNavigator( )->getJDay(); jd = StelApp::getInstance().getCore()->getNavigator( )->getJDay();
if (nowRe.capturedTexts().at(8) == "sidereal") if (nowRe.capturedTexts().at(8) == "sidereal")
dayLength = StelApp::getInstance().getCore()->getNav igator()->getLocalSideralDayLength(); dayLength = StelApp::getInstance().getCore()->getNav igator()->getLocalSideralDayLength();
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")
skipping to change at line 530 skipping to change at line 494
unit = dayLength * 7.; unit = dayLength * 7.;
else else
{ {
qWarning() << "StelMainScriptAPI::setDate - unknown time unit:" << nowRe.capturedTexts().at(4); qWarning() << "StelMainScriptAPI::setDate - unknown time unit:" << nowRe.capturedTexts().at(4);
unit = 0; unit = 0;
} }
delta = nowRe.capturedTexts().at(4).toDouble(); delta = nowRe.capturedTexts().at(4).toDouble();
if (nowRe.capturedTexts().at(3) == "+") if (nowRe.capturedTexts().at(3) == "+")
JD += (unit * delta); jd += (unit * delta);
else if (nowRe.capturedTexts().at(3) == "-") else if (nowRe.capturedTexts().at(3) == "-")
JD -= (unit * delta); jd -= (unit * delta);
return jd;
return JD;
}
else
{
qWarning() << "StelMainScriptAPI::jdFromDateString error - d
ate string" << dt << "not recognised, returning \"now\"";
return StelUtils::getJDFromSystem();
} }
qWarning() << "StelMainScriptAPI::jdFromDateString error: date strin
g" << dt << "not recognised, returning \"now\"";
return StelUtils::getJDFromSystem();
} }
void StelMainScriptAPI::selectObjectByName(const QString& name, bool pointe r) void StelMainScriptAPI::selectObjectByName(const QString& name, bool pointe r)
{ {
StelObjectMgr* omgr = GETSTELMODULE(StelObjectMgr); StelObjectMgr* omgr = GETSTELMODULE(StelObjectMgr);
omgr->setFlagSelectedObjectPointer(pointer); omgr->setFlagSelectedObjectPointer(pointer);
if (name=="") if (name=="")
omgr->unSelect(); omgr->unSelect();
else else
omgr->findAndSelect(name); omgr->findAndSelect(name);
skipping to change at line 798 skipping to change at line 759
GETSTELMODULE(StelObjectMgr)->unSelect(); GETSTELMODULE(StelObjectMgr)->unSelect();
Vec3d aimJ2000, aimEquofDate; Vec3d aimJ2000, aimEquofDate;
double dRa = StelUtils::getDecAngle(ra); double dRa = StelUtils::getDecAngle(ra);
double dDec = StelUtils::getDecAngle(dec); double dDec = StelUtils::getDecAngle(dec);
StelUtils::spheToRect(dRa,dDec,aimJ2000); StelUtils::spheToRect(dRa,dDec,aimJ2000);
aimEquofDate = StelApp::getInstance().getCore()->getNavigator()->j20 00ToEquinoxEqu(aimJ2000); aimEquofDate = StelApp::getInstance().getCore()->getNavigator()->j20 00ToEquinoxEqu(aimJ2000);
mvmgr->moveToJ2000(aimEquofDate, duration); mvmgr->moveToJ2000(aimEquofDate, duration);
} }
QString StelMainScriptAPI::getAppLanguage()
{
return StelApp::getInstance().getLocaleMgr().getAppLanguage();
}
void StelMainScriptAPI::setAppLanguage(QString langCode)
{
StelApp::getInstance().getLocaleMgr().setAppLanguage(langCode);
}
QString StelMainScriptAPI::getSkyLanguage()
{
return StelApp::getInstance().getLocaleMgr().getSkyLanguage();
}
void StelMainScriptAPI::setSkyLanguage(QString langCode)
{
StelApp::getInstance().getLocaleMgr().setSkyLanguage(langCode);
}
 End of changes. 35 change blocks. 
98 lines changed or deleted 58 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/