SolarSystem.cpp   SolarSystem.cpp 
skipping to change at line 785 skipping to change at line 785
} }
} }
else else
{ {
p = PlanetP(new Planet(englishName, p = PlanetP(new Planet(englishName,
pd.value(secname+"/lighting").toBool( ), pd.value(secname+"/lighting").toBool( ),
pd.value(secname+"/radius").toDouble( )/AU, pd.value(secname+"/radius").toDouble( )/AU,
pd.value(secname+"/oblateness", 0.0). toDouble(), pd.value(secname+"/oblateness", 0.0). toDouble(),
StelUtils::strToVec3f(pd.value(secnam e+"/color").toString()), StelUtils::strToVec3f(pd.value(secnam e+"/color").toString()),
pd.value(secname+"/albedo").toFloat() , pd.value(secname+"/albedo").toFloat() ,
pd.value(secname+"/tex_map").toString (), pd.value(secname+"/tex_map").toString (),
posfunc, posfunc,
userDataPtr, userDataPtr,
osculatingFunc, osculatingFunc,
closeOrbit, closeOrbit,
pd.value(secname+"/hidden", 0).toBool (), pd.value(secname+"/hidden", 0).toBool (),
pd.value(secname+"/atmosphere", false ).toBool())); pd.value(secname+"/atmosphere", false ).toBool()));
} }
if (!parent.isNull()) if (!parent.isNull())
{ {
parent->satellites.append(p); parent->satellites.append(p);
skipping to change at line 1040 skipping to change at line 1040
QList<StelObjectP> SolarSystem::searchAround(const Vec3d& vv, double limitF ov, const StelCore* core) const QList<StelObjectP> SolarSystem::searchAround(const Vec3d& vv, double limitF ov, const StelCore* core) const
{ {
QList<StelObjectP> result; QList<StelObjectP> result;
if (!getFlagPlanets()) if (!getFlagPlanets())
return result; return result;
Vec3d v = core->j2000ToEquinoxEqu(vv); Vec3d v = core->j2000ToEquinoxEqu(vv);
v.normalize(); v.normalize();
double cosLimFov = std::cos(limitFov * M_PI/180.); double cosLimFov = std::cos(limitFov * M_PI/180.);
Vec3d equPos; Vec3d equPos;
double cosAngularSize;
foreach (const PlanetP& p, systemPlanets) foreach (const PlanetP& p, systemPlanets)
{ {
equPos = p->getEquinoxEquatorialPos(core); equPos = p->getEquinoxEquatorialPos(core);
equPos.normalize(); equPos.normalize();
if (equPos*v>=cosLimFov)
cosAngularSize = std::cos(p->getSpheroidAngularSize(core) *
M_PI/180.);
if (equPos*v>=std::min(cosLimFov, cosAngularSize))
{ {
result.append(qSharedPointerCast<StelObject>(p)); result.append(qSharedPointerCast<StelObject>(p));
} }
} }
return result; return result;
} }
// Update i18 names from english names according to current translator // Update i18 names from english names according to current translator
void SolarSystem::updateI18n() void SolarSystem::updateI18n()
{ {
skipping to change at line 1280 skipping to change at line 1284
QStringList SolarSystem::getAllPlanetLocalizedNames() const QStringList SolarSystem::getAllPlanetLocalizedNames() const
{ {
QStringList res; QStringList res;
foreach (const PlanetP& p, systemPlanets) foreach (const PlanetP& p, systemPlanets)
res.append(p->nameI18); res.append(p->nameI18);
return res; return res;
} }
void SolarSystem::reloadPlanets() void SolarSystem::reloadPlanets()
{ {
//Save flag states // Save flag states
bool flagScaleMoon = getFlagMoonScale(); bool flagScaleMoon = getFlagMoonScale();
float moonScale = getMoonScale(); float moonScale = getMoonScale();
bool flagPlanets = getFlagPlanets(); bool flagPlanets = getFlagPlanets();
bool flagHints = getFlagHints(); bool flagHints = getFlagHints();
bool flagLabels = getFlagLabels(); bool flagLabels = getFlagLabels();
bool flagOrbits = getFlagOrbits(); bool flagOrbits = getFlagOrbits();
//Unload all Solar System objects // Save observer location (fix for LP bug # 969211)
// TODO: This can probably be done better with a better understandin
g of StelObserver --BM
StelCore* core = StelApp::getInstance().getCore();
StelLocation loc = core->getCurrentLocation();
// Unload all Solar System objects
selected.clear();//Release the selected one selected.clear();//Release the selected one
foreach (Orbit* orb, orbits) foreach (Orbit* orb, orbits)
{ {
delete orb; delete orb;
orb = NULL; orb = NULL;
} }
orbits.clear(); orbits.clear();
sun.clear(); sun.clear();
moon.clear(); moon.clear();
skipping to change at line 1311 skipping to change at line 1320
delete allTrails; delete allTrails;
allTrails = NULL; allTrails = NULL;
foreach (PlanetP p, systemPlanets) foreach (PlanetP p, systemPlanets)
{ {
p->satellites.clear(); p->satellites.clear();
p.clear(); p.clear();
} }
systemPlanets.clear(); systemPlanets.clear();
//Memory leak? What's the proper way of cleaning shared pointers? // Memory leak? What's the proper way of cleaning shared pointers?
//Re-load the ssystem.ini file // Re-load the ssystem.ini file
loadPlanets(); loadPlanets();
computePositions(StelUtils::getJDFromSystem()); computePositions(StelUtils::getJDFromSystem());
setSelected(""); setSelected("");
recreateTrails(); recreateTrails();
//Restore flag states // Restore observer location
core->moveObserverTo(loc, 0., 0.);
// Restore flag states
setFlagMoonScale(flagScaleMoon); setFlagMoonScale(flagScaleMoon);
setMoonScale(moonScale); setMoonScale(moonScale);
setFlagPlanets(flagPlanets); setFlagPlanets(flagPlanets);
setFlagHints(flagHints); setFlagHints(flagHints);
setFlagLabels(flagLabels); setFlagLabels(flagLabels);
setFlagOrbits(flagOrbits); setFlagOrbits(flagOrbits);
//Restore translations // Restore translations
updateI18n(); updateI18n();
} }
 End of changes. 10 change blocks. 
9 lines changed or deleted 23 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/