LandscapeMgr.cpp   LandscapeMgr.cpp 
skipping to change at line 72 skipping to change at line 72
void setFlagShow(bool b){fader = b;} void setFlagShow(bool b){fader = b;}
bool getFlagShow() const {return fader;} bool getFlagShow() const {return fader;}
private: private:
float radius; float radius;
QFont font; QFont 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), color(0.6,0.2,0.2) Cardinals::Cardinals(float _radius) : radius(_radius), color(0.6,0.2,0.2), sNorth("N"), sSouth("S"), sEast("E"), sWest("W")
{ {
// Font size is 30 // Font size is 30
font.setPixelSize(StelApp::getInstance().getBaseFontSize()+17); font.setPixelSize(StelApp::getInstance().getBaseFontSize()+17);
// Default labels - if sky locale specified, loaded later
// Improvement for gettext translation
sNorth = "N";
sSouth = "S";
sEast = "E";
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 StelCore* core, double latitude) const void Cardinals::draw(const StelCore* core, double latitude) const
{ {
skipping to change at line 415 skipping to change at line 409
setAtmosphereBortleLightPollution(drawer->getBortleScaleIndex()); setAtmosphereBortleLightPollution(drawer->getBortleScaleIndex());
connect(app->getCore(), SIGNAL(locationChanged(StelLocation)), this, SLOT(updateLocationBasedPollution(StelLocation))); connect(app->getCore(), SIGNAL(locationChanged(StelLocation)), this, SLOT(updateLocationBasedPollution(StelLocation)));
connect(drawer, SIGNAL(bortleScaleIndexChanged(int)), this, SLOT(set AtmosphereBortleLightPollution(int))); connect(drawer, SIGNAL(bortleScaleIndexChanged(int)), this, SLOT(set AtmosphereBortleLightPollution(int)));
connect(app, SIGNAL(languageChanged()), this, SLOT(updateI18n())); connect(app, SIGNAL(languageChanged()), this, SLOT(updateI18n()));
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 addAction("actionShow_LandscapeIllumination", displayGroup, N_("Land
mination"), "illuminationDisplayed", "Shift+G"); scape illumination"), "illuminationDisplayed", "Shift+G");
addAction("actionShow_LandscapeLabels", displayGroup, N_("Labels"), addAction("actionShow_LandscapeLabels", displayGroup, N_("Landscape
"labelsDisplayed", "Ctrl+Shift+G"); labels"), "labelsDisplayed", "Ctrl+Shift+G");
addAction("actionShow_LightPollution_Database", displayGroup, N_("Li ght pollution data from locations database"), "databaseUsage"); addAction("actionShow_LightPollution_Database", displayGroup, N_("Li ght pollution data from locations database"), "databaseUsage");
} }
bool LandscapeMgr::setCurrentLandscapeID(const QString& id, const double ch angeLocationDuration) bool LandscapeMgr::setCurrentLandscapeID(const QString& id, const double ch angeLocationDuration)
{ {
if (id.isEmpty()) if (id.isEmpty())
return false; return false;
//prevent unnecessary changes/file access //prevent unnecessary changes/file access
if(id==currentLandscapeID) if(id==currentLandscapeID)
skipping to change at line 457 skipping to change at line 451
//in case we already fade out one old landscape (if switchin g too rapidly): the old one has to go immediately. //in case we already fade out one old landscape (if switchin g too rapidly): the old one has to go immediately.
if (oldLandscape) if (oldLandscape)
delete oldLandscape; delete oldLandscape;
oldLandscape = landscape; // keep old while transitioning! oldLandscape = landscape; // keep old while transitioning!
} }
landscape=newLandscape; landscape=newLandscape;
currentLandscapeID = id; currentLandscapeID = id;
if (getFlagLandscapeSetsLocation() && landscape->hasLocation()) if (getFlagLandscapeSetsLocation() && landscape->hasLocation())
{ {
StelApp::getInstance().getCore()->moveObserverTo(landscape-> StelCore *core = StelApp::getInstance().getCore();
getLocation(), changeLocationDuration); core->moveObserverTo(landscape->getLocation(), changeLocatio
StelSkyDrawer* drawer=StelApp::getInstance().getCore()->getS nDuration);
kyDrawer(); StelSkyDrawer* drawer=core->getSkyDrawer();
if (landscape->getDefaultFogSetting() >-1) if (landscape->getDefaultFogSetting() >-1)
{ {
setFlagFog((bool) landscape->getDefaultFogSetting()) ; setFlagFog((bool) landscape->getDefaultFogSetting()) ;
landscape->setFlagShowFog((bool) landscape->getDefau ltFogSetting()); landscape->setFlagShowFog((bool) landscape->getDefau ltFogSetting());
} }
if (landscape->getDefaultBortleIndex() > 0) if (landscape->getDefaultBortleIndex() > 0)
{ {
drawer->setBortleScaleIndex(landscape->getDefaultBor tleIndex()); drawer->setBortleScaleIndex(landscape->getDefaultBor tleIndex());
} }
if (landscape->getDefaultAtmosphericExtinction() >= 0.0) if (landscape->getDefaultAtmosphericExtinction() >= 0.0f)
{ {
drawer->setExtinctionCoefficient(landscape->getDefau ltAtmosphericExtinction()); drawer->setExtinctionCoefficient(landscape->getDefau ltAtmosphericExtinction());
} }
if (landscape->getDefaultAtmosphericTemperature() > -273.15) if (landscape->getDefaultAtmosphericTemperature() > -273.15f )
{ {
drawer->setAtmosphereTemperature(landscape->getDefau ltAtmosphericTemperature()); drawer->setAtmosphereTemperature(landscape->getDefau ltAtmosphericTemperature());
} }
if (landscape->getDefaultAtmosphericPressure() >= 0.0) if (landscape->getDefaultAtmosphericPressure() >= 0.0f)
{ {
drawer->setAtmospherePressure(landscape->getDefaultA tmosphericPressure()); drawer->setAtmospherePressure(landscape->getDefaultA tmosphericPressure());
} }
else if (landscape->getDefaultAtmosphericPressure() == -1.0) else if (landscape->getDefaultAtmosphericPressure() == -1.0f )
{ {
// compute standard pressure for standard atmosphere in given altitude if landscape.ini coded as atmospheric_pressure=-1 // compute standard pressure for standard atmosphere in given altitude if landscape.ini coded as atmospheric_pressure=-1
// International altitude formula found in Wikipedia . // International altitude formula found in Wikipedia .
double alt=landscape->getLocation().altitude; double alt=landscape->getLocation().altitude;
double p=1013.25*std::pow(1-(0.0065*alt)/288.15, 5.2 55); double p=1013.25*std::pow(1-(0.0065*alt)/288.15, 5.2 55);
drawer->setAtmospherePressure(p); drawer->setAtmospherePressure(p);
} }
} }
emit currentLandscapeChanged(currentLandscapeID,getCurrentLandscapeN ame()); emit currentLandscapeChanged(currentLandscapeID,getCurrentLandscapeN ame());
skipping to change at line 743 skipping to change at line 738
//! Get flag for displaying Cardinals Points //! Get flag for displaying Cardinals Points
bool LandscapeMgr::getFlagCardinalsPoints() const bool LandscapeMgr::getFlagCardinalsPoints() const
{ {
return cardinalsPoints->getFlagShow(); return cardinalsPoints->getFlagShow();
} }
//! Set Cardinals Points color //! Set Cardinals Points color
void LandscapeMgr::setColorCardinalPoints(const Vec3f& v) void LandscapeMgr::setColorCardinalPoints(const Vec3f& v)
{ {
cardinalsPoints->setColor(v); if(v != getColorCardinalPoints())
{
cardinalsPoints->setColor(v);
emit cardinalsPointsColorChanged(v);
}
} }
//! Get Cardinals Points color //! Get Cardinals Points color
Vec3f LandscapeMgr::getColorCardinalPoints() const Vec3f LandscapeMgr::getColorCardinalPoints() const
{ {
return cardinalsPoints->get_color(); return cardinalsPoints->get_color();
} }
/////////////////////////////////////////////////////////////////////////// //////////// /////////////////////////////////////////////////////////////////////////// ////////////
// Atmosphere // Atmosphere
 End of changes. 9 change blocks. 
20 lines changed or deleted 18 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/