StelCore.cpp   StelCore.cpp 
skipping to change at line 37 skipping to change at line 37
#include "StelUtils.hpp" #include "StelUtils.hpp"
#include "StelGeodesicGrid.hpp" #include "StelGeodesicGrid.hpp"
#include "StelMovementMgr.hpp" #include "StelMovementMgr.hpp"
#include "StelModuleMgr.hpp" #include "StelModuleMgr.hpp"
#include "StelPainter.hpp" #include "StelPainter.hpp"
#include "StelLocationMgr.hpp" #include "StelLocationMgr.hpp"
#include "StelObserver.hpp" #include "StelObserver.hpp"
#include "StelObjectMgr.hpp" #include "StelObjectMgr.hpp"
#include "Planet.hpp" #include "Planet.hpp"
#include "SolarSystem.hpp" #include "SolarSystem.hpp"
#include "LandscapeMgr.hpp"
#include <QtOpenGL> #include <QtOpenGL>
#include <QSettings> #include <QSettings>
#include <QDebug> #include <QDebug>
#include <QMetaEnum> #include <QMetaEnum>
// Init statics transfo matrices // Init statics transfo matrices
// See vsop87.doc: // See vsop87.doc:
const Mat4d StelCore::matJ2000ToVsop87(Mat4d::xrotation(-23.439280305555555 5556*(M_PI/180)) * Mat4d::zrotation(0.0000275*(M_PI/180))); const Mat4d StelCore::matJ2000ToVsop87(Mat4d::xrotation(-23.439280305555555 5556*(M_PI/180)) * Mat4d::zrotation(0.0000275*(M_PI/180)));
const Mat4d StelCore::matVsop87ToJ2000(matJ2000ToVsop87.transpose()); const Mat4d StelCore::matVsop87ToJ2000(matJ2000ToVsop87.transpose());
skipping to change at line 645 skipping to change at line 646
// Return the observer heliocentric position // Return the observer heliocentric position
Vec3d StelCore::getObserverHeliocentricEclipticPos() const Vec3d StelCore::getObserverHeliocentricEclipticPos() const
{ {
return Vec3d(matAltAzToHeliocentricEcliptic[12], matAltAzToHeliocent ricEcliptic[13], matAltAzToHeliocentricEcliptic[14]); return Vec3d(matAltAzToHeliocentricEcliptic[12], matAltAzToHeliocent ricEcliptic[13], matAltAzToHeliocentricEcliptic[14]);
} }
// Set the location to use by default at startup // Set the location to use by default at startup
void StelCore::setDefaultLocationID(const QString& id) void StelCore::setDefaultLocationID(const QString& id)
{ {
bool ok = false;
StelApp::getInstance().getLocationMgr().locationForSmallString(id, &
ok);
if (!ok)
return;
defaultLocationID = id; defaultLocationID = id;
StelApp::getInstance().getLocationMgr().locationForSmallString(id);
QSettings* conf = StelApp::getInstance().getSettings(); QSettings* conf = StelApp::getInstance().getSettings();
Q_ASSERT(conf); Q_ASSERT(conf);
conf->setValue("init_location/location", id); conf->setValue("init_location/location", id);
} }
void StelCore::returnToDefaultLocation()
{
StelLocationMgr& locationMgr = StelApp::getInstance().getLocationMgr
();
bool ok = false;
StelLocation loc = locationMgr.locationForString(defaultLocationID,
&ok);
if (ok)
moveObserverTo(loc, 0.);
}
void StelCore::returnToHome()
{
// Using returnToDefaultLocation() and getCurrentLocation() introduc
e issue, because for flying
// between planets using SpaceShip and second method give does not e
xist data
StelLocationMgr& locationMgr = StelApp::getInstance().getLocationMgr
();
bool ok = false;
StelLocation loc = locationMgr.locationForString(defaultLocationID,
&ok);
if (ok)
moveObserverTo(loc, 0.);
PlanetP p = GETSTELMODULE(SolarSystem)->searchByEnglishName(loc.plan
etName);
LandscapeMgr* landscapeMgr = GETSTELMODULE(LandscapeMgr);
landscapeMgr->setCurrentLandscapeID(landscapeMgr->getDefaultLandscap
eID());
landscapeMgr->setFlagAtmosphere(p->hasAtmosphere());
landscapeMgr->setFlagFog(p->hasAtmosphere());
GETSTELMODULE(StelObjectMgr)->unSelect();
StelMovementMgr* smmgr = getMovementMgr();
smmgr->setViewDirectionJ2000(altAzToJ2000(smmgr->getInitViewingDirec
tion(), StelCore::RefractionOff));
}
void StelCore::setJDay(double JD) void StelCore::setJDay(double JD)
{ {
JDay=JD; JDay=JD;
} }
double StelCore::getJDay() const double StelCore::getJDay() const
{ {
return JDay; return JDay;
} }
skipping to change at line 716 skipping to change at line 752
// Get the informations on the current location // Get the informations on the current location
const StelLocation& StelCore::getCurrentLocation() const const StelLocation& StelCore::getCurrentLocation() const
{ {
return position->getCurrentLocation(); return position->getCurrentLocation();
} }
// Smoothly move the observer to the given location // Smoothly move the observer to the given location
void StelCore::moveObserverTo(const StelLocation& target, double duration, double durationIfPlanetChange) void StelCore::moveObserverTo(const StelLocation& target, double duration, double durationIfPlanetChange)
{ {
emit(locationChanged(target));
double d = (getCurrentLocation().planetName==target.planetName) ? du ration : durationIfPlanetChange; double d = (getCurrentLocation().planetName==target.planetName) ? du ration : durationIfPlanetChange;
if (d>0.) if (d>0.)
{ {
StelLocation curLoc = getCurrentLocation(); StelLocation curLoc = getCurrentLocation();
if (position->isTraveling()) if (position->isTraveling())
{ {
// Avoid using a temporary location name to create a nother temporary one (otherwise it looks like loc1 -> loc2 -> loc3 etc..) // Avoid using a temporary location name to create a nother temporary one (otherwise it looks like loc1 -> loc2 -> loc3 etc..)
curLoc.name = "."; curLoc.name = ".";
} }
SpaceShipObserver* newObs = new SpaceShipObserver(curLoc, ta rget, d); SpaceShipObserver* newObs = new SpaceShipObserver(curLoc, ta rget, d);
delete position; delete position;
position = newObs; position = newObs;
newObs->update(0); newObs->update(0);
} }
else else
{ {
delete position; delete position;
position = new StelObserver(target); position = new StelObserver(target);
} }
emit(locationChanged(target));
} }
//! Set stellarium time to current real world time //! Set stellarium time to current real world time
void StelCore::setTimeNow() void StelCore::setTimeNow()
{ {
setJDay(StelUtils::getJDFromSystem()); setJDay(StelUtils::getJDFromSystem());
} }
void StelCore::setTodayTime(const QTime& target) void StelCore::setTodayTime(const QTime& target)
{ {
skipping to change at line 821 skipping to change at line 857
addSiderealDays(7.0); addSiderealDays(7.0);
} }
void StelCore::addSiderealMonth() void StelCore::addSiderealMonth()
{ {
addSiderealDays(27.321661); addSiderealDays(27.321661);
} }
void StelCore::addSiderealYear() void StelCore::addSiderealYear()
{ {
addSiderealDays(365.256363004); addSolarDays(365.256363004);
} }
void StelCore::subtractHour() void StelCore::subtractHour()
{ {
addSolarDays(-JD_HOUR); addSolarDays(-JD_HOUR);
} }
void StelCore::subtractDay() void StelCore::subtractDay()
{ {
addSolarDays(-1.0); addSolarDays(-1.0);
skipping to change at line 856 skipping to change at line 892
addSiderealDays(-7.0); addSiderealDays(-7.0);
} }
void StelCore::subtractSiderealMonth() void StelCore::subtractSiderealMonth()
{ {
addSiderealDays(-27.321661); addSiderealDays(-27.321661);
} }
void StelCore::subtractSiderealYear() void StelCore::subtractSiderealYear()
{ {
addSiderealDays(-365.256363004); addSolarDays(-365.256363004);
} }
void StelCore::addSolarDays(double d) void StelCore::addSolarDays(double d)
{ {
setJDay(getJDay() + d); setJDay(getJDay() + d);
} }
void StelCore::addSiderealDays(double d) void StelCore::addSiderealDays(double d)
{ {
const PlanetP& home = position->getHomePlanet(); const PlanetP& home = position->getHomePlanet();
 End of changes. 8 change blocks. 
4 lines changed or deleted 50 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/