LandscapeMgr.cpp   LandscapeMgr.cpp 
skipping to change at line 36 skipping to change at line 36
#include "Atmosphere.hpp" #include "Atmosphere.hpp"
#include "StelApp.hpp" #include "StelApp.hpp"
#include "SolarSystem.hpp" #include "SolarSystem.hpp"
#include "StelCore.hpp" #include "StelCore.hpp"
#include "StelLocaleMgr.hpp" #include "StelLocaleMgr.hpp"
#include "StelFontMgr.hpp" #include "StelFontMgr.hpp"
#include "StelModuleMgr.hpp" #include "StelModuleMgr.hpp"
#include "StelFileMgr.hpp" #include "StelFileMgr.hpp"
#include "Planet.hpp" #include "Planet.hpp"
#include "StelIniParser.hpp" #include "StelIniParser.hpp"
#include "SFont.hpp" #include "StelFont.hpp"
#include "SkyDrawer.hpp" #include "StelSkyDrawer.hpp"
#include "StelStyle.hpp" #include "StelStyle.hpp"
#include "StelPainter.hpp"
// Class which manages the cardinal points displaying // Class which manages the cardinal points displaying
class Cardinals class Cardinals
{ {
public: public:
Cardinals(float _radius = 1.); Cardinals(float _radius = 1.);
virtual ~Cardinals(); virtual ~Cardinals();
void draw(const Projector* prj, double latitude, bool gravityON = fa void draw(const StelCore* core, double latitude, bool gravityON = fa
lse) const; lse) const;
void setColor(const Vec3f& c) {color = c;} void setColor(const Vec3f& c) {color = c;}
Vec3f get_color() {return color;} Vec3f get_color() {return color;}
void updateI18n(); void updateI18n();
void update(double deltaTime) {fader.update((int)(deltaTime*1000));} void update(double deltaTime) {fader.update((int)(deltaTime*1000));}
void set_fade_duration(float duration) {fader.setDuration((int)(dura tion*1000.f));} void set_fade_duration(float duration) {fader.setDuration((int)(dura tion*1000.f));}
void setFlagShow(bool b){fader = b;} void setFlagShow(bool b){fader = b;}
bool getFlagShow(void) const {return fader;} bool getFlagShow(void) const {return fader;}
private: private:
float radius; float radius;
double fontSize; double fontSize;
SFont& font; StelFont& font;
Vec3f color; Vec3f color;
QString sNorth, sSouth, sEast, sWest; QString sNorth, sSouth, sEast, sWest;
LinearFader fader; LinearFader fader;
}; };
Cardinals::Cardinals(float _radius) : radius(_radius), fontSize(30), Cardinals::Cardinals(float _radius) : radius(_radius), fontSize(30),
font(StelApp::getInstance().getFontManager().getStandardFont(StelApp::getIn stance().getLocaleMgr().getAppLanguage(), fontSize)), color(0.6,0.2,0.2) font(StelApp::getInstance().getFontManager().getStandardFont(StelApp::getIn stance().getLocaleMgr().getAppLanguage(), fontSize)), color(0.6,0.2,0.2)
{ {
// Default labels - if sky locale specified, loaded later // Default labels - if sky locale specified, loaded later
// Improvement for gettext translation // Improvement for gettext translation
skipping to change at line 80 skipping to change at line 81
sEast = "E"; sEast = "E";
sWest = "W"; sWest = "W";
} }
Cardinals::~Cardinals() Cardinals::~Cardinals()
{ {
} }
// Draw the cardinals points : N S E W // Draw the cardinals points : N S E W
// handles special cases at poles // handles special cases at poles
void Cardinals::draw(const Projector* prj, double latitude, bool gravityON) const void Cardinals::draw(const StelCore* core, double latitude, bool gravityON) const
{ {
const StelProjectorP prj = core->getProjection(StelCore::FrameAltAz)
;
StelPainter sPainter(prj);
if (!fader.getInterstate()) return; if (!fader.getInterstate()) return;
// direction text // direction text
QString d[4]; QString d[4];
d[0] = sNorth; d[0] = sNorth;
d[1] = sSouth; d[1] = sSouth;
d[2] = sEast; d[2] = sEast;
d[3] = sWest; d[3] = sWest;
skipping to change at line 105 skipping to change at line 109
glColor4f(color[0],color[1],color[2],fader.getInterstate()); glColor4f(color[0],color[1],color[2],fader.getInterstate());
glEnable(GL_BLEND); glEnable(GL_BLEND);
glEnable(GL_TEXTURE_2D); glEnable(GL_TEXTURE_2D);
// Normal transparency mode // Normal transparency mode
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
Vec3f pos; Vec3f pos;
Vec3d xy; Vec3d xy;
prj->setCurrentFrame(Projector::FrameLocal);
float shift = font.getStrLen(sNorth)/2; float shift = font.getStrLen(sNorth)/2;
// N for North // N for North
pos.set(-1.f, 0.f, 0.f); pos.set(-1.f, 0.f, 0.f);
if (prj->project(pos,xy)) prj->drawText(&font, xy[0], xy[1], d[0], 0 ., -shift, -shift); if (prj->project(pos,xy)) sPainter.drawText(&font, xy[0], xy[1], d[0 ], 0., -shift, -shift);
// S for South // S for South
pos.set(1.f, 0.f, 0.f); pos.set(1.f, 0.f, 0.f);
if (prj->project(pos,xy)) prj->drawText(&font, xy[0], xy[1], d[1], 0 ., -shift, -shift); if (prj->project(pos,xy)) sPainter.drawText(&font, xy[0], xy[1], d[1 ], 0., -shift, -shift);
// E for East // E for East
pos.set(0.f, 1.f, 0.f); pos.set(0.f, 1.f, 0.f);
if (prj->project(pos,xy)) prj->drawText(&font, xy[0], xy[1], d[2], 0 ., -shift, -shift); if (prj->project(pos,xy)) sPainter.drawText(&font, xy[0], xy[1], d[2 ], 0., -shift, -shift);
// W for West // W for West
pos.set(0.f, -1.f, 0.f); pos.set(0.f, -1.f, 0.f);
if (prj->project(pos,xy)) prj->drawText(&font, xy[0], xy[1], d[3], 0 ., -shift, -shift); if (prj->project(pos,xy)) sPainter.drawText(&font, xy[0], xy[1], d[3 ], 0., -shift, -shift);
} }
// Translate cardinal labels with gettext to current sky language and updat e font for the language // Translate cardinal labels with gettext to current sky language and updat e font for the language
void Cardinals::updateI18n() void Cardinals::updateI18n()
{ {
Translator& trans = StelApp::getInstance().getLocaleMgr().getSkyTran slator(); StelTranslator& trans = StelApp::getInstance().getLocaleMgr().getSky Translator();
sNorth = trans.qtranslate("N"); sNorth = trans.qtranslate("N");
sSouth = trans.qtranslate("S"); sSouth = trans.qtranslate("S");
sEast = trans.qtranslate("E"); sEast = trans.qtranslate("E");
sWest = trans.qtranslate("W"); sWest = trans.qtranslate("W");
font = StelApp::getInstance().getFontManager().getStandardFont(trans .getTrueLocaleName(), fontSize); font = StelApp::getInstance().getFontManager().getStandardFont(trans .getTrueLocaleName(), fontSize);
} }
LandscapeMgr::LandscapeMgr() : atmosphere(NULL), cardinalsPoints(NULL), lan dscape(NULL), flagLandscapeSetsLocation(false) LandscapeMgr::LandscapeMgr() : atmosphere(NULL), cardinalsPoints(NULL), lan dscape(NULL), flagLandscapeSetsLocation(false)
{ {
setObjectName("LandscapeMgr"); setObjectName("LandscapeMgr");
skipping to change at line 172 skipping to change at line 174
void LandscapeMgr::update(double deltaTime) void LandscapeMgr::update(double deltaTime)
{ {
atmosphere->update(deltaTime); atmosphere->update(deltaTime);
landscape->update(deltaTime); landscape->update(deltaTime);
cardinalsPoints->update(deltaTime); cardinalsPoints->update(deltaTime);
// Compute the atmosphere color and intensity // Compute the atmosphere color and intensity
// Compute the sun position in local coordinate // Compute the sun position in local coordinate
SolarSystem* ssystem = (SolarSystem*)StelApp::getInstance().getModul eMgr().getModule("SolarSystem"); SolarSystem* ssystem = (SolarSystem*)StelApp::getInstance().getModul eMgr().getModule("SolarSystem");
Navigator* nav = StelApp::getInstance().getCore()->getNavigation(); StelNavigator* nav = StelApp::getInstance().getCore()->getNavigator(
Projector* prj = StelApp::getInstance().getCore()->getProjection(); );
ToneReproducer* eye = StelApp::getInstance().getCore()->getToneRepro
ducer();
Vec3d sunPos = ssystem->getSun()->getAltAzPos(nav); Vec3d sunPos = ssystem->getSun()->getAltAzPos(nav);
// Compute the moon position in local coordinate // Compute the moon position in local coordinate
Vec3d moonPos = ssystem->getMoon()->getAltAzPos(nav); Vec3d moonPos = ssystem->getMoon()->getAltAzPos(nav);
atmosphere->computeColor(nav->getJDay(), sunPos, moonPos, atmosphere->computeColor(nav->getJDay(), sunPos, moonPos,
ssystem->getMoon()->getPhase(ssystem->getE ssystem->getMoon()->getPhase(ssystem->getEarth()->getHelioce
arth()->getHeliocentricEclipticPos()), ntricEclipticPos()),
eye, prj, nav->getCurrentLocation().latitu StelApp::getInstance().getCore(), nav->getCurrentLocation().
de, nav->getCurrentLocation().altitude, latitude, nav->getCurrentLocation().altitude,
15.f, 40.f); // Temperature = 15c, relati 15.f, 40.f); // Temperature = 15c, relative humidity = 40
ve humidity = 40% %
StelApp::getInstance().getCore()->getSkyDrawer()->reportLuminanceInF ov(3.75+atmosphere->getAverageLuminance()*3.5, true); StelApp::getInstance().getCore()->getSkyDrawer()->reportLuminanceInF ov(3.75+atmosphere->getAverageLuminance()*3.5, true);
// Compute the ground luminance based on every planets around // Compute the ground luminance based on every planets around
// float groundLuminance = 0; // float groundLuminance = 0;
// const vector<Planet*>& allPlanets = ssystem->getAllPlanets(); // const vector<Planet*>& allPlanets = ssystem->getAllPlanets();
// for (vector<Planet*>::const_iterator i=allPlanets.begin();i!=allPlan ets.end();++i) // for (vector<Planet*>::const_iterator i=allPlanets.begin();i!=allPlan ets.end();++i)
// { // {
// Vec3d pos = (*i)->getAltAzPos(nav); // Vec3d pos = (*i)->getAltAzPos(nav);
// pos.normalize(); // pos.normalize();
skipping to change at line 237 skipping to change at line 237
// otherwise we just use the sun position calculation above // otherwise we just use the sun position calculation above
landscapeBrightness *= (atmosphere->getRealDisplayIntensityF actor()+0.1); landscapeBrightness *= (atmosphere->getRealDisplayIntensityF actor()+0.1);
} }
// TODO: should calculate dimming with solar eclipse even without at mosphere on // TODO: should calculate dimming with solar eclipse even without at mosphere on
landscape->setBrightness(landscapeBrightness+0.05); landscape->setBrightness(landscapeBrightness+0.05);
} }
void LandscapeMgr::draw(StelCore* core) void LandscapeMgr::draw(StelCore* core)
{ {
Navigator* nav = core->getNavigation();
Projector* prj = core->getProjection();
ToneReproducer* eye = core->getToneReproducer();
// Draw the atmosphere // Draw the atmosphere
atmosphere->draw(core); atmosphere->draw(core);
// Draw the landscape // Draw the landscape
landscape->draw(eye, prj, nav); landscape->draw(core);
// Draw the cardinal points // Draw the cardinal points
cardinalsPoints->draw(prj, StelApp::getInstance().getCore()->getNavi gation()->getCurrentLocation().latitude); cardinalsPoints->draw(core, StelApp::getInstance().getCore()->getNav igator()->getCurrentLocation().latitude);
} }
void LandscapeMgr::init() void LandscapeMgr::init()
{ {
QSettings* conf = StelApp::getInstance().getSettings(); QSettings* conf = StelApp::getInstance().getSettings();
assert(conf); Q_ASSERT(conf);
atmosphere = new Atmosphere(); atmosphere = new Atmosphere();
landscape = new LandscapeOldStyle(); landscape = new LandscapeOldStyle();
defaultLandscapeID = conf->value("init_location/landscape_name").toS tring(); defaultLandscapeID = conf->value("init_location/landscape_name").toS tring();
setCurrentLandscapeID(defaultLandscapeID); setCurrentLandscapeID(defaultLandscapeID, true);
setFlagLandscape(conf->value("landscape/flag_landscape", conf->value ("landscape/flag_ground", true).toBool()).toBool()); setFlagLandscape(conf->value("landscape/flag_landscape", conf->value ("landscape/flag_ground", true).toBool()).toBool());
setFlagFog(conf->value("landscape/flag_fog",true).toBool()); setFlagFog(conf->value("landscape/flag_fog",true).toBool());
setFlagAtmosphere(conf->value("landscape/flag_atmosphere").toBool()) ; setFlagAtmosphere(conf->value("landscape/flag_atmosphere").toBool()) ;
setAtmosphereFadeDuration(conf->value("landscape/atmosphere_fade_dur ation",1.5).toDouble()); setAtmosphereFadeDuration(conf->value("landscape/atmosphere_fade_dur ation",1.5).toDouble());
setAtmosphereLightPollutionLuminance(conf->value("viewing/light_poll ution_luminance",0.0).toDouble()); setAtmosphereLightPollutionLuminance(conf->value("viewing/light_poll ution_luminance",0.0).toDouble());
cardinalsPoints = new Cardinals(); cardinalsPoints = new Cardinals();
cardinalsPoints->setFlagShow(conf->value("viewing/flag_cardinal_poin ts",true).toBool()); cardinalsPoints->setFlagShow(conf->value("viewing/flag_cardinal_poin ts",true).toBool());
setFlagLandscapeSetsLocation(conf->value("landscape/flag_landscape_s ets_location",false).toBool()); setFlagLandscapeSetsLocation(conf->value("landscape/flag_landscape_s ets_location",false).toBool());
bool ok =true; bool ok =true;
setAtmosphereBortleLightPollution(conf->value("stars/init_bortle_sca le",3).toInt(&ok)); setAtmosphereBortleLightPollution(conf->value("stars/init_bortle_sca le",3).toInt(&ok));
if (!ok) if (!ok)
{ {
conf->setValue("stars/init_bortle_scale",3); conf->setValue("stars/init_bortle_scale",3);
setAtmosphereBortleLightPollution(3); setAtmosphereBortleLightPollution(3);
ok = true; ok = true;
} }
connect(this, SIGNAL(requestSetCurrentLandscapeID(const QString&)),
this, SLOT(doSetCurrentLandscapeID(const QString&)));
connect(this, SIGNAL(requestSetCurrentLandscapeName(const QString&))
, this, SLOT(doSetCurrentLandscapeName(const QString&)));
} }
void LandscapeMgr::setStelStyle(const StelStyle& style) void LandscapeMgr::setStelStyle(const StelStyle& style)
{ {
// Load colors from config file // Load colors from config file
QSettings* conf = StelApp::getInstance().getSettings(); QSettings* conf = StelApp::getInstance().getSettings();
QString section = style.confSectionName; QString section = style.confSectionName;
QString defaultColor = conf->value(section+"/default_color").toStrin g(); QString defaultColor = conf->value(section+"/default_color").toStrin g();
setColorCardinalPoints(StelUtils::strToVec3f(conf->value(section+"/c ardinal_color", defaultColor).toString())); setColorCardinalPoints(StelUtils::strToVec3f(conf->value(section+"/c ardinal_color", defaultColor).toString()));
} }
bool LandscapeMgr::setCurrentLandscapeName(const QString& newLandscapeName) bool LandscapeMgr::setCurrentLandscapeID(const QString& id, bool inThread)
{ {
if (newLandscapeName.isEmpty()) if (inThread)
return 0; return doSetCurrentLandscapeID(id);
QMap<QString,QString> nameToDirMap = getNameToDirMap();
if (nameToDirMap.find(newLandscapeName)!=nameToDirMap.end())
{
return setCurrentLandscapeID(nameToDirMap[newLandscapeName])
;
}
else else
{ {
qWarning() << "Can't find a landscape with name=" << newLand emit(requestSetCurrentLandscapeID(id));
scapeName << endl; return true;
return false;
} }
} }
bool LandscapeMgr::setCurrentLandscapeID(const QString& newLandscapeID) bool LandscapeMgr::setCurrentLandscapeName(const QString& name, bool inThre ad)
{ {
if (newLandscapeID.isEmpty()) QMap<QString,QString> nameToDirMap = getNameToDirMap();
return 0; if (nameToDirMap.find(name)!=nameToDirMap.end())
// we want to lookup the landscape ID (dir) from the name.
StelFileMgr& fileMan = StelApp::getInstance().getFileMgr();
Landscape* newLandscape = NULL;
try
{ {
newLandscape = createFromFile(fileMan.findFile("landscapes/" if (inThread)
+ newLandscapeID + "/landscape.ini"), newLandscapeID); return setCurrentLandscapeID(nameToDirMap[name], tru
e);
else
{
emit(requestSetCurrentLandscapeName(name));
return true;
}
} }
catch (std::runtime_error& e) else
{ {
qWarning() << "ERROR while loading landscape " << "landscape qWarning() << "Can't find a landscape with name=" << name <<
s/" + newLandscapeID + "/landscape.ini" << ", (" << e.what() << ")" << endl endl;
;
}
if (!newLandscape)
return false; return false;
if (landscape)
{
// Copy display parameters from previous landscape to new on
e
newLandscape->setFlagShow(landscape->getFlagShow());
newLandscape->setFlagShowFog(landscape->getFlagShowFog());
delete landscape;
landscape = newLandscape;
} }
currentLandscapeID = newLandscapeID;
if (getFlagLandscapeSetsLocation())
{
StelApp::getInstance().getCore()->getNavigation()->moveObser
verTo(landscape->getLocation());
}
return true;
} }
// Change the default landscape to the landscape with the ID specified. // Change the default landscape to the landscape with the ID specified.
bool LandscapeMgr::setDefaultLandscapeID(const QString& id) bool LandscapeMgr::setDefaultLandscapeID(const QString& id)
{ {
if (id.isEmpty()) if (id.isEmpty())
return false; return false;
defaultLandscapeID = id; defaultLandscapeID = id;
QSettings* conf = StelApp::getInstance().getSettings(); QSettings* conf = StelApp::getInstance().getSettings();
conf->setValue("init_location/landscape_name", id); conf->setValue("init_location/landscape_name", id);
skipping to change at line 419 skipping to change at line 393
QStringList result; QStringList result;
// We just look over the map of names to IDs and extract the keys // We just look over the map of names to IDs and extract the keys
foreach (QString i, nameToDirMap.keys()) foreach (QString i, nameToDirMap.keys())
{ {
result += i; result += i;
} }
return result; return result;
} }
QStringList LandscapeMgr::getAllLandscapeIDs() const
{
QMap<QString,QString> nameToDirMap = getNameToDirMap();
QStringList result;
// We just look over the map of names to IDs and extract the keys
foreach (QString i, nameToDirMap.values())
{
result += i;
}
return result;
}
QString LandscapeMgr::getCurrentLandscapeName() const QString LandscapeMgr::getCurrentLandscapeName() const
{ {
return landscape->getName(); return landscape->getName();
} }
QString LandscapeMgr::getCurrentLandscapeHtmlDescription() const QString LandscapeMgr::getCurrentLandscapeHtmlDescription() const
{ {
QString desc = QString("<h3>%1</h3>").arg(landscape->getName()); QString desc = QString("<h3>%1</h3>").arg(landscape->getName());
desc += landscape->getDescription(); desc += landscape->getDescription();
desc+="<br><br>"; desc+="<br><br>";
skipping to change at line 516 skipping to change at line 503
return atmosphere->getLightPollutionLuminance(); return atmosphere->getLightPollutionLuminance();
} }
//! Set the light pollution following the Bortle Scale //! Set the light pollution following the Bortle Scale
void LandscapeMgr::setAtmosphereBortleLightPollution(int bIndex) void LandscapeMgr::setAtmosphereBortleLightPollution(int bIndex)
{ {
// This is an empirical formula // This is an empirical formula
setAtmosphereLightPollutionLuminance(qMax(0.,0.0020*std::pow(bIndex- 1, 2.1))); setAtmosphereLightPollutionLuminance(qMax(0.,0.0020*std::pow(bIndex- 1, 2.1)));
} }
void LandscapeMgr::setZRotation(double d)
{
if (landscape)
landscape->setZRotation(d);
}
float LandscapeMgr::getLuminance(void) float LandscapeMgr::getLuminance(void)
{ {
return atmosphere->getRealDisplayIntensityFactor(); return atmosphere->getRealDisplayIntensityFactor();
} }
Landscape* LandscapeMgr::createFromFile(const QString& landscapeFile, const QString& landscapeId) Landscape* LandscapeMgr::createFromFile(const QString& landscapeFile, const QString& landscapeId)
{ {
QSettings landscapeIni(landscapeFile, StelIniFormat); QSettings landscapeIni(landscapeFile, StelIniFormat);
QString s; QString s;
if (landscapeIni.status() != QSettings::NoError) if (landscapeIni.status() != QSettings::NoError)
skipping to change at line 565 skipping to change at line 558
// NOTE: textures should be full filename (and path) // NOTE: textures should be full filename (and path)
if (param["type"]=="old_style") if (param["type"]=="old_style")
{ {
LandscapeOldStyle* ldscp = new LandscapeOldStyle(); LandscapeOldStyle* ldscp = new LandscapeOldStyle();
ldscp->create(1, param); ldscp->create(1, param);
return ldscp; return ldscp;
} }
else if (param["type"]=="spherical") else if (param["type"]=="spherical")
{ {
LandscapeSpherical* ldscp = new LandscapeSpherical(); LandscapeSpherical* ldscp = new LandscapeSpherical();
ldscp->create(param["name"], 1, param["path"] + param["mapte x"],param["angleRotatez"].toDouble()); ldscp->create(param["name"], 1, param["path"] + param["mapte x"],param["angleRotateZ"].toDouble());
return ldscp; return ldscp;
} }
else else
{ // if (s=="fisheye") { // if (s=="fisheye")
LandscapeFisheye* ldscp = new LandscapeFisheye(); LandscapeFisheye* ldscp = new LandscapeFisheye();
ldscp->create(param["name"], 1, param["path"] + param["mapte x"], ldscp->create(param["name"], 1, param["path"] + param["mapte x"],
param["texturefov"].toDouble(), param["texturefov"].toDouble(),
param["angleRotatez"].toDouble()); param["angleRotateZ"].toDouble());
return ldscp; return ldscp;
} }
} }
QString LandscapeMgr::nameToID(const QString& name) QString LandscapeMgr::nameToID(const QString& name)
{ {
QMap<QString,QString> nameToDirMap = getNameToDirMap(); QMap<QString,QString> nameToDirMap = getNameToDirMap();
if (nameToDirMap.find(name)!=nameToDirMap.end()) if (nameToDirMap.find(name)!=nameToDirMap.end())
{ {
assert(0); Q_ASSERT(0);
return "error"; return "error";
} }
else else
{ {
return nameToDirMap[name]; return nameToDirMap[name];
} }
} }
/************************************************************************** ** /************************************************************************** **
get a map of landscape name (from landscape.ini name field) to ID (dir nam e) get a map of landscape name (from landscape.ini name field) to ID (dir nam e)
skipping to change at line 626 skipping to change at line 619
result[k] = dir; result[k] = dir;
} }
catch (std::runtime_error& e) catch (std::runtime_error& e)
{ {
//qDebug << "WARNING: unable to successfully read la ndscape.ini file from landscape " << dir; //qDebug << "WARNING: unable to successfully read la ndscape.ini file from landscape " << dir;
} }
} }
return result; return result;
} }
bool LandscapeMgr::doSetCurrentLandscapeID(const QString& id)
{
if (id.isEmpty())
{
emit(requestCompleteSetCurrentLandscapeID(false));
return false;
}
// we want to lookup the landscape ID (dir) from the name.
StelFileMgr& fileMan = StelApp::getInstance().getFileMgr();
Landscape* newLandscape = NULL;
try
{
newLandscape = createFromFile(fileMan.findFile("landscapes/"
+ id + "/landscape.ini"), id);
}
catch (std::runtime_error& e)
{
qWarning() << "ERROR while loading landscape " << "landscape
s/" + id + "/landscape.ini" << ", (" << e.what() << ")" << endl;
}
if (!newLandscape)
{
emit(requestCompleteSetCurrentLandscapeID(false));
return false;
}
if (landscape)
{
// Copy display parameters from previous landscape to new on
e
newLandscape->setFlagShow(landscape->getFlagShow());
newLandscape->setFlagShowFog(landscape->getFlagShowFog());
delete landscape;
landscape = newLandscape;
}
currentLandscapeID = id;
if (getFlagLandscapeSetsLocation())
{
StelApp::getInstance().getCore()->getNavigator()->moveObserv
erTo(landscape->getLocation());
}
emit(requestCompleteSetCurrentLandscapeID(true));
return true;
}
bool LandscapeMgr::doSetCurrentLandscapeName(const QString& name)
{
if (name.isEmpty())
{
emit(requestCompleteSetCurrentLandscapeName(false));
return false;
}
QMap<QString,QString> nameToDirMap = getNameToDirMap();
if (nameToDirMap.find(name)!=nameToDirMap.end())
{
bool result = setCurrentLandscapeID(nameToDirMap[name], true
);
emit(requestCompleteSetCurrentLandscapeName(result));
return result;
}
else
{
qWarning() << "Can't find a landscape with name=" << name <<
endl;
emit(requestCompleteSetCurrentLandscapeName(false));
return false;
}
}
 End of changes. 36 change blocks. 
83 lines changed or deleted 74 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/