SolarSystem.cpp   SolarSystem.cpp 
skipping to change at line 72 skipping to change at line 72
: shadowPlanetCount(0) : shadowPlanetCount(0)
, flagMoonScale(false) , flagMoonScale(false)
, moonScale(1.) , moonScale(1.)
, labelsAmount(false) , labelsAmount(false)
, flagOrbits(false) , flagOrbits(false)
, flagLightTravelTime(false) , flagLightTravelTime(false)
, flagShow(false) , flagShow(false)
, flagMarker(false) , flagMarker(false)
, allTrails(NULL) , allTrails(NULL)
{ {
planetNameFont.setPixelSize(StelApp::getInstance().getSettings()->va lue("gui/base_font_size", 13).toInt()); planetNameFont.setPixelSize(StelApp::getInstance().getBaseFontSize() );
setObjectName("SolarSystem"); setObjectName("SolarSystem");
} }
void SolarSystem::setFontSize(float newFontSize) void SolarSystem::setFontSize(float newFontSize)
{ {
planetNameFont.setPixelSize(newFontSize); planetNameFont.setPixelSize(newFontSize);
} }
SolarSystem::~SolarSystem() SolarSystem::~SolarSystem()
{ {
skipping to change at line 122 skipping to change at line 122
return StelApp::getInstance().getModuleMgr().getModule("Star Mgr")->getCallOrder(actionName)+10; return StelApp::getInstance().getModuleMgr().getModule("Star Mgr")->getCallOrder(actionName)+10;
return 0; return 0;
} }
// Init and load the solar system data // Init and load the solar system data
void SolarSystem::init() void SolarSystem::init()
{ {
QSettings* conf = StelApp::getInstance().getSettings(); QSettings* conf = StelApp::getInstance().getSettings();
Q_ASSERT(conf); Q_ASSERT(conf);
Planet::init();
loadPlanets(); // Load planets data loadPlanets(); // Load planets data
// Compute position and matrix of sun and all the satellites (ie pla nets) // Compute position and matrix of sun and all the satellites (ie pla nets)
// for the first initialization Q_ASSERT that center is sun center ( only impacts on light speed correction) // for the first initialization Q_ASSERT that center is sun center ( only impacts on light speed correction)
computePositions(StelUtils::getJDFromSystem()); computePositions(StelUtils::getJDFromSystem());
setSelected(""); // Fix a bug on macosX! Thanks Fumio! setSelected(""); // Fix a bug on macosX! Thanks Fumio!
setFlagMoonScale(conf->value("viewing/flag_moon_scaled", conf->value ("viewing/flag_init_moon_scaled", "false").toBool()).toBool()); // name ch ange setFlagMoonScale(conf->value("viewing/flag_moon_scaled", conf->value ("viewing/flag_init_moon_scaled", "false").toBool()).toBool()); // name ch ange
setMoonScale(conf->value("viewing/moon_scale", 4.0).toFloat()); setMoonScale(conf->value("viewing/moon_scale", 4.0).toFloat());
setFlagPlanets(conf->value("astro/flag_planets").toBool()); setFlagPlanets(conf->value("astro/flag_planets").toBool());
skipping to change at line 904 skipping to change at line 905
if (systemPlanets.isEmpty()) if (systemPlanets.isEmpty())
{ {
qWarning() << "No Solar System objects loaded from" << QDir: :toNativeSeparators(filePath); qWarning() << "No Solar System objects loaded from" << QDir: :toNativeSeparators(filePath);
return false; return false;
} }
// special case: load earth shadow texture // special case: load earth shadow texture
Planet::texEarthShadow = StelApp::getInstance().getTextureManager(). createTexture(StelFileMgr::getInstallationDir()+"/textures/earth-shadow.png "); Planet::texEarthShadow = StelApp::getInstance().getTextureManager(). createTexture(StelFileMgr::getInstallationDir()+"/textures/earth-shadow.png ");
// GZ: Also comets just have static textures.
Comet::comaTexture = StelApp::getInstance().getTextureManager().crea
teTextureThread(StelFileMgr::getInstallationDir()+"/textures/cometComa.png"
, StelTexture::StelTextureParams(true, GL_LINEAR, GL_CLAMP_TO_EDGE));
//GZ: tail textures. We use a paraboloid tail body, textured like a
fisheye sphere, i.e. center=head. The texture should be something like a mo
ttled star to give some structure.
Comet::tailTexture = StelApp::getInstance().getTextureManager().crea
teTextureThread(StelFileMgr::getInstallationDir()+"/textures/cometTail.png"
, StelTexture::StelTextureParams(true, GL_LINEAR, GL_CLAMP_TO_EDGE));
//GZ: I think we need only one texture for the tails.
return true; return true;
} }
// Compute the position for every elements of the solar system. // Compute the position for every elements of the solar system.
// The order is not important since the position is computed relatively to the mother body // The order is not important since the position is computed relatively to the mother body
void SolarSystem::computePositions(double date, const Vec3d& observerPos) void SolarSystem::computePositions(double date, const Vec3d& observerPos)
{ {
if (flagLightTravelTime) if (flagLightTravelTime)
{ {
foreach (PlanetP p, systemPlanets) foreach (PlanetP p, systemPlanets)
skipping to change at line 1047 skipping to change at line 1054
StelObjectP SolarSystem::searchByName(const QString& name) const StelObjectP SolarSystem::searchByName(const QString& name) const
{ {
foreach (const PlanetP& p, systemPlanets) foreach (const PlanetP& p, systemPlanets)
{ {
if (p->getEnglishName() == name) if (p->getEnglishName() == name)
return qSharedPointerCast<StelObject>(p); return qSharedPointerCast<StelObject>(p);
} }
return StelObjectP(); return StelObjectP();
} }
float SolarSystem::getPlanetVMagnitude(QString planetName) const float SolarSystem::getPlanetVMagnitude(QString planetName, bool withExtinct ion) const
{ {
PlanetP p = searchByEnglishName(planetName); PlanetP p = searchByEnglishName(planetName);
float r = 0.f; float r = 0.f;
r = p->getVMagnitude(StelApp::getInstance().getCore()); if (withExtinction)
r = p->getVMagnitudeWithExtinction(StelApp::getInstance().ge
tCore());
else
r = p->getVMagnitude(StelApp::getInstance().getCore());
return r; return r;
} }
QString SolarSystem::getPlanetType(QString planetName) const
{
PlanetP p = searchByEnglishName(planetName);
return p->getPlanetTypeString();
}
double SolarSystem::getDistanceToPlanet(QString planetName) const double SolarSystem::getDistanceToPlanet(QString planetName) const
{ {
PlanetP p = searchByEnglishName(planetName); PlanetP p = searchByEnglishName(planetName);
double r = 0.f; double r = 0.f;
r = p->getDistance(); r = p->getDistance();
return r; return r;
} }
double SolarSystem::getElongationForPlanet(QString planetName) const double SolarSystem::getElongationForPlanet(QString planetName) const
{ {
skipping to change at line 1356 skipping to change at line 1372
if (find) if (find)
{ {
result << sson; result << sson;
if (result.size()==maxNbItem) if (result.size()==maxNbItem)
return result; return result;
} }
} }
return result; return result;
} }
QStringList SolarSystem::listAllObjects(bool inEnglish) const QStringList SolarSystem::listAllObjectsByType(const QString &objType, bool inEnglish) const
{ {
QStringList result; QStringList result;
if (inEnglish) if (inEnglish)
{ {
foreach(const PlanetP& p, systemPlanets) foreach(const PlanetP& p, systemPlanets)
{ {
result << p->getEnglishName(); if (p->getPlanetTypeString()==objType)
result << p->getEnglishName();
} }
} }
else else
{ {
foreach(const PlanetP& p, systemPlanets) foreach(const PlanetP& p, systemPlanets)
{ {
result << p->getNameI18n(); if (p->getPlanetTypeString()==objType)
result << p->getNameI18n();
} }
} }
return result; return result;
} }
void SolarSystem::selectedObjectChange(StelModule::StelModuleSelectAction) void SolarSystem::selectedObjectChange(StelModule::StelModuleSelectAction)
{ {
const QList<StelObjectP> newSelected = GETSTELMODULE(StelObjectMgr)- >getSelectedObject("Planet"); const QList<StelObjectP> newSelected = GETSTELMODULE(StelObjectMgr)- >getSelectedObject("Planet");
if (!newSelected.empty()) if (!newSelected.empty())
setSelected(qSharedPointerCast<Planet>(newSelected[0])); setSelected(qSharedPointerCast<Planet>(newSelected[0]));
 End of changes. 9 change blocks. 
6 lines changed or deleted 31 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/