LandscapeMgr.cpp   LandscapeMgr.cpp 
skipping to change at line 295 skipping to change at line 295
if (landscapeBrightness>0.95) if (landscapeBrightness>0.95)
landscapeBrightness = 0.95; landscapeBrightness = 0.95;
if (core->getCurrentLocation().planetName.contains("Sun")) if (core->getCurrentLocation().planetName.contains("Sun"))
{ {
// NOTE: Simple workaround for brightness of landscape when observing from the Sun. // NOTE: Simple workaround for brightness of landscape when observing from the Sun.
landscape->setBrightness(1.f, 0.0f); landscape->setBrightness(1.f, 0.0f);
} }
else else
{ float lightscapeBrightness=0.0f; { float lightscapeBrightness=0.0f;
// night pollution brightness is mixed in at -3...-8 degrees . // light pollution layer is mixed in at -3...-8 degrees.
if (sunPos[2]<-0.14f) lightscapeBrightness=1.0f; if (sunPos[2]<-0.14f) lightscapeBrightness=1.0f;
else if (sunPos[2]<-0.05f) lightscapeBrightness = 1.0f-(sunP os[2]+0.14)/(-0.05+0.14); else if (sunPos[2]<-0.05f) lightscapeBrightness = 1.0f-(sunP os[2]+0.14)/(-0.05+0.14);
landscape->setBrightness(landscapeBrightness, lightscapeBrig htness); landscape->setBrightness(landscapeBrightness, lightscapeBrig htness);
} }
} }
void LandscapeMgr::draw(StelCore* core) void LandscapeMgr::draw(StelCore* core)
{ {
// Draw the atmosphere // Draw the atmosphere
atmosphere->draw(core); atmosphere->draw(core);
skipping to change at line 337 skipping to change at line 337
setAtmosphereLightPollutionLuminance(conf->value("viewing/light_poll ution_luminance",0.0).toFloat()); setAtmosphereLightPollutionLuminance(conf->value("viewing/light_poll ution_luminance",0.0).toFloat());
setFlagUseLightPollutionFromDatabase(conf->value("viewing/flag_light _pollution_database", false).toBool()); setFlagUseLightPollutionFromDatabase(conf->value("viewing/flag_light _pollution_database", false).toBool());
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());
setFlagLandscapeAutoSelection(conf->value("viewing/flag_landscape_au toselection", false).toBool()); setFlagLandscapeAutoSelection(conf->value("viewing/flag_landscape_au toselection", false).toBool());
// Set minimal brightness for landscape. This feature has been added for folks which say "landscape is super dark, please add light". --AW // Set minimal brightness for landscape. This feature has been added for folks which say "landscape is super dark, please add light". --AW
setDefaultMinimalBrightness(conf->value("landscape/minimal_brightnes s", 0.01).toFloat()); setDefaultMinimalBrightness(conf->value("landscape/minimal_brightnes s", 0.01).toFloat());
setFlagLandscapeUseMinimalBrightness(conf->value("landscape/flag_min imal_brightness", false).toBool()); setFlagLandscapeUseMinimalBrightness(conf->value("landscape/flag_min imal_brightness", false).toBool());
setFlagLandscapeSetsMinimalBrightness(conf->value("landscape/flag_la ndscape_sets_minimal_brightness",false).toBool()); setFlagLandscapeSetsMinimalBrightness(conf->value("landscape/flag_la ndscape_sets_minimal_brightness",false).toBool());
setFlagAtmosphereAutoEnable(conf->value("viewing/flag_atmopshere_aut setFlagAtmosphereAutoEnable(conf->value("viewing/flag_atmosphere_aut
o_enable",true).toBool()); o_enable",true).toBool());
setFlagIllumination(conf->value("landscape/flag_enable_illumination_
layer", true).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;
} }
StelApp *app = &StelApp::getInstance(); StelApp *app = &StelApp::getInstance();
connect(app, SIGNAL(languageChanged()), this, SLOT(updateI18n())); connect(app, SIGNAL(languageChanged()), this, SLOT(updateI18n()));
connect(app, SIGNAL(colorSchemeChanged(const QString&)), this, SLOT( setStelStyle(const QString&))); connect(app, SIGNAL(colorSchemeChanged(const QString&)), this, SLOT( setStelStyle(const QString&)));
QString displayGroup = N_("Display Options"); QString displayGroup = N_("Display Options");
addAction("actionShow_Atmosphere", displayGroup, N_("Atmosphere"), " atmosphereDisplayed", "A"); addAction("actionShow_Atmosphere", displayGroup, N_("Atmosphere"), " atmosphereDisplayed", "A");
addAction("actionShow_Fog", displayGroup, N_("Fog"), "fogDisplayed", "F"); addAction("actionShow_Fog", displayGroup, N_("Fog"), "fogDisplayed", "F");
addAction("actionShow_Cardinal_Points", displayGroup, N_("Cardinal p oints"), "cardinalsPointsDisplayed", "Q"); addAction("actionShow_Cardinal_Points", displayGroup, N_("Cardinal p oints"), "cardinalsPointsDisplayed", "Q");
addAction("actionShow_Ground", displayGroup, N_("Ground"), "landscap eDisplayed", "G"); addAction("actionShow_Ground", displayGroup, N_("Ground"), "landscap eDisplayed", "G");
addAction("actionShow_LandscapeIllumination", displayGroup, N_("Illu mination"), "illuminationDisplayed", "Shift+G");
} }
void LandscapeMgr::setStelStyle(const QString& section) void LandscapeMgr::setStelStyle(const QString& section)
{ {
// Load colors from config file // Load colors from config file
QSettings* conf = StelApp::getInstance().getSettings(); QSettings* conf = StelApp::getInstance().getSettings();
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()));
} }
skipping to change at line 386 skipping to change at line 388
{ {
qWarning() << "ERROR while loading default landscape " << "l andscapes/" + id + "/landscape.ini"; qWarning() << "ERROR while loading default landscape " << "l andscapes/" + id + "/landscape.ini";
return false; return false;
} }
if (landscape) if (landscape)
{ {
// Copy display parameters from previous landscape to new on e // Copy display parameters from previous landscape to new on e
newLandscape->setFlagShow(landscape->getFlagShow()); newLandscape->setFlagShow(landscape->getFlagShow());
newLandscape->setFlagShowFog(landscape->getFlagShowFog()); newLandscape->setFlagShowFog(landscape->getFlagShowFog());
newLandscape->setFlagShowIllumination(landscape->getFlagShow Illumination());
delete landscape; delete landscape;
landscape = newLandscape; landscape = newLandscape;
} }
currentLandscapeID = id; currentLandscapeID = id;
if (getFlagLandscapeSetsLocation() && landscape->hasLocation()) if (getFlagLandscapeSetsLocation() && landscape->hasLocation())
{ {
StelApp::getInstance().getCore()->moveObserverTo(landscape-> getLocation()); StelApp::getInstance().getCore()->moveObserverTo(landscape-> getLocation());
StelSkyDrawer* drawer=StelApp::getInstance().getCore()->getS kyDrawer(); StelSkyDrawer* drawer=StelApp::getInstance().getCore()->getS kyDrawer();
skipping to change at line 510 skipping to change at line 513
landscape->setFlagShowFog(displayed); landscape->setFlagShowFog(displayed);
emit fogDisplayedChanged(displayed); emit fogDisplayedChanged(displayed);
} }
} }
bool LandscapeMgr::getFlagFog() const bool LandscapeMgr::getFlagFog() const
{ {
return landscape->getFlagShowFog(); return landscape->getFlagShowFog();
} }
void LandscapeMgr::setFlagIllumination(const bool displayed)
{
if (landscape->getFlagShowIllumination() != displayed) {
landscape->setFlagShowIllumination(displayed);
emit illuminationDisplayedChanged(displayed);
}
}
bool LandscapeMgr::getFlagIllumination() const
{
return landscape->getFlagShowIllumination();
}
void LandscapeMgr::setFlagLandscapeAutoSelection(bool enableAutoSelect) void LandscapeMgr::setFlagLandscapeAutoSelection(bool enableAutoSelect)
{ {
flagLandscapeAutoSelection = enableAutoSelect; flagLandscapeAutoSelection = enableAutoSelect;
} }
bool LandscapeMgr::getFlagLandscapeAutoSelection() const bool LandscapeMgr::getFlagLandscapeAutoSelection() const
{ {
return flagLandscapeAutoSelection; return flagLandscapeAutoSelection;
} }
skipping to change at line 585 skipping to change at line 601
return landscape->getName(); return landscape->getName();
} }
QString LandscapeMgr::getCurrentLandscapeHtmlDescription() const QString LandscapeMgr::getCurrentLandscapeHtmlDescription() const
{ {
QString desc = getDescription(); QString desc = getDescription();
desc+="<p>"; desc+="<p>";
desc+="<b>"+q_("Author: ")+"</b>"; desc+="<b>"+q_("Author: ")+"</b>";
desc+=landscape->getAuthorName(); desc+=landscape->getAuthorName();
desc+="<br>"; desc+="<br>";
desc+="<b>"+q_("Location: ")+"</b>"; // This previously showed 0/0 for locationless landscapes!
if (landscape->getLocation().longitude>-500.0 && landscape->getLocat if (landscape->hasLocation())
ion().latitude>-500.0)
{ {
desc+="<b>"+q_("Location: ")+"</b>";
desc += StelUtils::radToDmsStrAdapt(landscape->getLocation() .longitude * M_PI/180.); desc += StelUtils::radToDmsStrAdapt(landscape->getLocation() .longitude * M_PI/180.);
desc += "/" + StelUtils::radToDmsStrAdapt(landscape->getLoca tion().latitude *M_PI/180.); desc += "/" + StelUtils::radToDmsStrAdapt(landscape->getLoca tion().latitude *M_PI/180.);
desc += QString(q_(", %1 m")).arg(landscape->getLocation().a ltitude); desc += QString(q_(", %1 m")).arg(landscape->getLocation().a ltitude);
QString planetName = landscape->getLocation().planetName; QString planetName = landscape->getLocation().planetName;
if (!planetName.isEmpty()) if (!planetName.isEmpty())
{ {
desc += "<br><b>"+q_("Planet: ")+"</b>"+ q_(planetNa const StelTranslator& trans = StelApp::getInstance()
me); .getLocaleMgr().getSkyTranslator();
desc += "<br><b>"+q_("Celestial body:")+"</b> "+ tra
ns.qtranslate(planetName);
} }
desc += "<br><br>"; desc += "<br><br>";
} }
// TBD: Activate this or delete?
//else
// desc+="<b>"+q_("Location: ")+"</b>" + q_("not specified (jus
t decoration)") + "<br><br>";
return desc; return desc;
} }
//! Set flag for displaying Cardinals Points //! Set flag for displaying Cardinals Points
void LandscapeMgr::setFlagCardinalsPoints(const bool displayed) void LandscapeMgr::setFlagCardinalsPoints(const bool displayed)
{ {
if (cardinalsPoints->getFlagShow() != displayed) { if (cardinalsPoints->getFlagShow() != displayed) {
cardinalsPoints->setFlagShow(displayed); cardinalsPoints->setFlagShow(displayed);
emit cardinalsPointsDisplayedChanged(displayed); emit cardinalsPointsDisplayedChanged(displayed);
} }
skipping to change at line 637 skipping to change at line 658
/////////////////////////////////////////////////////////////////////////// //////////// /////////////////////////////////////////////////////////////////////////// ////////////
// Atmosphere // Atmosphere
//! Set flag for displaying Atmosphere //! Set flag for displaying Atmosphere
void LandscapeMgr::setFlagAtmosphere(const bool displayed) void LandscapeMgr::setFlagAtmosphere(const bool displayed)
{ {
if (atmosphere->getFlagShow() != displayed) { if (atmosphere->getFlagShow() != displayed) {
atmosphere->setFlagShow(displayed); atmosphere->setFlagShow(displayed);
StelApp::getInstance().getCore()->getSkyDrawer()->setFlagHas Atmosphere(displayed); StelApp::getInstance().getCore()->getSkyDrawer()->setFlagHas Atmosphere(displayed);
emit atmosphereDisplayedChanged(displayed); emit atmosphereDisplayedChanged(displayed);
if (StelApp::getInstance().getSettings()->value("landscape/f //if (StelApp::getInstance().getSettings()->value("landscape
lag_fog", true).toBool()) /flag_fog", true).toBool())
setFlagFog(displayed); // sync of visibility of fog // setFlagFog(displayed); // sync of visibility of fog
because this is atmospheric phenomena because this is atmospheric phenomena
// GZ This did not work as it may have been intended. Switch
off fog, switch off atmosphere. Switch on atmosphere, and you have fog?
// --> Fog is only drawn in Landscape if atmosphere is switc
hed on!
} }
} }
//! Get flag for displaying Atmosphere //! Get flag for displaying Atmosphere
bool LandscapeMgr::getFlagAtmosphere() const bool LandscapeMgr::getFlagAtmosphere() const
{ {
return atmosphere->getFlagShow(); return atmosphere->getFlagShow();
} }
//! Set atmosphere fade duration in s //! Set atmosphere fade duration in s
 End of changes. 10 change blocks. 
12 lines changed or deleted 39 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/