Planet.cpp   Planet.cpp 
skipping to change at line 220 skipping to change at line 220
sphereScale(1.f), sphereScale(1.f),
lastJDE(J2000), lastJDE(J2000),
coordFunc(coordFunc), coordFunc(coordFunc),
orbitPtr(anOrbitPtr), orbitPtr(anOrbitPtr),
osculatingFunc(osculatingFunc), osculatingFunc(osculatingFunc),
parent(Q_NULLPTR), parent(Q_NULLPTR),
flagLabels(true), flagLabels(true),
hidden(hidden), hidden(hidden),
atmosphere(hasAtmosphere), atmosphere(hasAtmosphere),
halo(hasHalo), halo(hasHalo),
gl(Q_NULLPTR) gl(Q_NULLPTR),
iauMoonNumber("")
{ {
// Initialize pType with the key found in pTypeMap, or mark planet t ype as undefined. // Initialize pType with the key found in pTypeMap, or mark planet t ype as undefined.
// The latter condition should obviously never happen. // The latter condition should obviously never happen.
pType = pTypeMap.key(pTypeStr, Planet::isUNDEFINED); pType = pTypeMap.key(pTypeStr, Planet::isUNDEFINED);
// 0.16: Ensure type is always given! // 0.16: Ensure type is always given!
// AW: I've commented the code to the allow flying on spaceship (imp lemented as an artificial planet)! // AW: I've commented the code to the allow flying on spaceship (imp lemented as an artificial planet)!
if (pType==Planet::isUNDEFINED) if (pType==Planet::isUNDEFINED)
{ {
qCritical() << "Planet " << englishName << "has no type. Ple ase edit one of ssystem_major.ini or ssystem_minor.ini to ensure operation. "; qCritical() << "Planet " << englishName << "has no type. Ple ase edit one of ssystem_major.ini or ssystem_minor.ini to ensure operation. ";
exit(-1); exit(-1);
skipping to change at line 330 skipping to change at line 331
} }
else else
{ {
if (getFlagTranslatedName()) if (getFlagTranslatedName())
nameI18 = trans.qtranslate(englishName); nameI18 = trans.qtranslate(englishName);
else else
nameI18 = englishName; nameI18 = englishName;
} }
} }
void Planet::setIAUMoonNumber(QString designation)
{
if (!iauMoonNumber.isEmpty())
return;
iauMoonNumber = designation;
}
QString Planet::getEnglishName() const QString Planet::getEnglishName() const
{ {
return englishName; return englishName;
} }
QString Planet::getNameI18n() const QString Planet::getNameI18n() const
{ {
return nameI18; return nameI18;
} }
skipping to change at line 354 skipping to change at line 363
QTextStream oss(&str); QTextStream oss(&str);
double az_app, alt_app; double az_app, alt_app;
StelUtils::rectToSphe(&az_app,&alt_app,getAltAzPosApparent(core)); StelUtils::rectToSphe(&az_app,&alt_app,getAltAzPosApparent(core));
bool withDecimalDegree = StelApp::getInstance().getFlagShowDecimalDe grees(); bool withDecimalDegree = StelApp::getInstance().getFlagShowDecimalDe grees();
double distanceAu = getJ2000EquatorialPos(core).length(); double distanceAu = getJ2000EquatorialPos(core).length();
Q_UNUSED(az_app); Q_UNUSED(az_app);
if (flags&Name) if (flags&Name)
{ {
oss << "<h2>" << getNameI18n(); // UI translation can diffe r from sky translation oss << "<h2>" << getNameI18n(); // UI translation can diffe r from sky translation
if (!iauMoonNumber.isEmpty())
oss << QString(" (%1)").arg(iauMoonNumber);
oss.setRealNumberNotation(QTextStream::FixedNotation); oss.setRealNumberNotation(QTextStream::FixedNotation);
oss.setRealNumberPrecision(1); oss.setRealNumberPrecision(1);
if (sphereScale != 1.f) if (sphereScale != 1.f)
oss << QString::fromUtf8(" (\xC3\x97") << sphereScal e << ")"; oss << QString::fromUtf8(" (\xC3\x97") << sphereScal e << ")";
oss << "</h2>"; oss << "</h2>";
} }
if (flags&ObjectType && getPlanetType()!=isUNDEFINED) if (flags&ObjectType && getPlanetType()!=isUNDEFINED)
{ {
oss << q_("Type: <b>%1</b>").arg(q_(getPlanetTypeString())) << "<br />"; oss << QString("%1: <b>%2</b>").arg(q_("Type"), q_(getPlanet TypeString())) << "<br />";
} }
if (flags&Magnitude && getVMagnitude(core)!=std::numeric_limits<floa t>::infinity()) if (flags&Magnitude && getVMagnitude(core)!=std::numeric_limits<floa t>::infinity())
{ {
QString emag = "";
if (core->getSkyDrawer()->getFlagHasAtmosphere() && (alt_app >-3.0*M_PI/180.0)) // Don't show extincted magnitude much below horizon whe re model is meaningless. if (core->getSkyDrawer()->getFlagHasAtmosphere() && (alt_app >-3.0*M_PI/180.0)) // Don't show extincted magnitude much below horizon whe re model is meaningless.
oss << q_("Magnitude: <b>%1</b> (after extinction: < emag = QString(" (%1: <b>%2</b>)").arg(q_("extincted
b>%2</b>)").arg(QString::number(getVMagnitude(core), 'f', 2), to"), QString::number(getVMagnitudeWithExtinction(core), 'f', 2));
QString::number(getVMagnitudeWithExtinction(core), 'f', 2)) oss << QString("%1: <b>%2</b>%3").arg(q_("Magnitude"), QStri
<< "<br>"; ng::number(getVMagnitude(core), 'f', 2), emag) << "<br />";
else
oss << q_("Magnitude: <b>%1</b>").arg(getVMagnitude(
core), 0, 'f', 2) << "<br>";
} }
if (flags&AbsoluteMagnitude && (getAbsoluteMagnitude() > -99.)) if (flags&AbsoluteMagnitude && (getAbsoluteMagnitude() > -99.))
{ {
oss << q_("Absolute Magnitude: %1").arg(getAbsoluteMagnitude (), 0, 'f', 2) << "<br>"; oss << QString("%1: %2").arg(q_("Absolute Magnitude")).arg(g etAbsoluteMagnitude(), 0, 'f', 2) << "<br />";
const float moMag=getMeanOppositionMagnitude(); const float moMag=getMeanOppositionMagnitude();
if (moMag<50.f) if (moMag<50.f)
oss << q_("Mean Opposition Magnitude: %1").arg(moMag , 0, 'f', 2) << "<br>"; oss << QString("%1: %2").arg(q_("Mean Opposition Mag nitude")).arg(moMag, 0, 'f', 2) << "<br />";
} }
oss << getPositionInfoString(core, flags); oss << getCommonInfoString(core, flags);
// Debug help. // Debug help.
//oss << "Apparent Magnitude Algorithm: " << getApparentMagnitudeAlg orithmString() << " " << vMagAlgorithm << "<br>"; //oss << "Apparent Magnitude Algorithm: " << getApparentMagnitudeAlg orithmString() << " " << vMagAlgorithm << "<br>";
// GZ This is mostly for debugging. Maybe also useful for letting pe ople use our results to cross-check theirs, but we should not act as refere nce, currently... // GZ This is mostly for debugging. Maybe also useful for letting pe ople use our results to cross-check theirs, but we should not act as refere nce, currently...
// TODO: maybe separate this out into: // TODO: maybe separate this out into:
//if (flags&EclipticCoordXYZ) //if (flags&EclipticCoordXYZ)
// For now: add to EclipticCoord // For now: add to EclipticCoordJ2000 group
//if (flags&EclipticCoord) //if (flags&EclipticCoordJ2000)
// oss << q_("Ecliptical XYZ (VSOP87A): %1/%2/%3").arg(QString: //{
:number(eclipticPos[0], 'f', 3), QString::number(eclipticPos[1], 'f', 3), Q // Vec3d eclPos=(englishName=="Sun" ? GETSTELMODULE(SolarSystem
String::number(eclipticPos[2], 'f', 3)) << "<br>"; )->getLightTimeSunPosition() : eclipticPos);
// oss << q_("Ecliptical XYZ (VSOP87A): %1/%2/%3").arg(QString:
:number(eclPos[0], 'f', 7), QString::number(eclPos[1], 'f', 7), QString::nu
mber(eclPos[2], 'f', 7)) << "<br>";
//}
if (flags&Distance) if (flags&Distance)
{ {
double hdistanceAu = getHeliocentricEclipticPos().length(); double hdistanceAu = getHeliocentricEclipticPos().length();
double hdistanceKm = AU * hdistanceAu; double hdistanceKm = AU * hdistanceAu;
// TRANSLATORS: Unit of measure for distance - astronomical
unit
QString au = qc_("AU", "distance, astronomical unit");
// TRANSLATORS: Unit of measure for distance - kilometers
QString km = qc_("km", "distance");
QString distAU, distKM;
if (englishName!="Sun") if (englishName!="Sun")
{ {
if (hdistanceAu < 0.1) if (hdistanceAu < 0.1)
{ {
// xgettext:no-c-format distAU = QString::number(hdistanceAu, 'f', 6
oss << QString(q_("Distance from Sun: %1AU ( );
%2 km)")) distKM = QString::number(hdistanceKm, 'f', 3
.arg(hdistanceAu, 0, 'f', 6) );
.arg(hdistanceKm, 0, 'f', 3);
} }
else else
{ {
// xgettext:no-c-format distAU = QString::number(hdistanceAu, 'f', 3
oss << QString(q_("Distance from Sun: %1AU ( );
%2 Mio km)")) distKM = QString::number(hdistanceKm / 1.0e6
.arg(hdistanceAu, 0, 'f', 3) , 'f', 3);
.arg(hdistanceKm / 1.0e6, 0, 'f', 3); // TRANSLATORS: Unit of measure for distance
- milliones kilometers
km = qc_("Mio km", "distance");
} }
oss << "<br>";
oss << QString("%1: %2%3 (%4 %5)").arg(q_("Distance
from Sun"), distAU, au, distKM, km) << "<br />";
} }
double distanceKm = AU * distanceAu; double distanceKm = AU * distanceAu;
if (distanceAu < 0.1) if (distanceAu < 0.1)
{ {
// xgettext:no-c-format distAU = QString::number(distanceAu, 'f', 6);
oss << QString(q_("Distance: %1AU (%2 km)")) distKM = QString::number(distanceKm, 'f', 3);
.arg(distanceAu, 0, 'f', 6) }
.arg(distanceKm, 0, 'f', 3);
}
else else
{ {
// xgettext:no-c-format distAU = QString::number(distanceAu, 'f', 3);
oss << QString(q_("Distance: %1AU (%2 Mio km)")) distKM = QString::number(distanceKm / 1.0e6, 'f', 3)
.arg(distanceAu, 0, 'f', 3) ;
.arg(distanceKm / 1.0e6, 0, 'f', 3); // TRANSLATORS: Unit of measure for distance - milli
ones kilometers
km = qc_("Mio km", "distance");
} }
oss << "<br>";
oss << QString("%1: %2%3 (%4 %5)").arg(q_("Distance"), distA
U, au, distKM, km) << "<br />";
} }
if (flags&Size) double angularSize = 2.*getAngularSize(core)*M_PI/180.;
if (flags&Size && angularSize>=4.8e-7)
{ {
double angularSize = 2.*getAngularSize(core)*M_PI/180.; QString s1, s2, sizeStr = "";
if (rings) if (rings)
{ {
double withoutRings = 2.*getSpheroidAngularSize(core )*M_PI/180.; double withoutRings = 2.*getSpheroidAngularSize(core )*M_PI/180.;
if (withDecimalDegree) if (withDecimalDegree)
oss << q_("Apparent diameter: %1, with rings {
: %2") s1 = StelUtils::radToDecDegStr(withoutRings,
.arg(StelUtils::radToDecDegStr(withou 4,false,true);
tRings,4,false,true), s2 = StelUtils::radToDecDegStr(angularSize,4
StelUtils::radToDecDegStr(angula ,false,true);
rSize,4,false,true)); }
else else
oss << q_("Apparent diameter: %1, with rings {
: %2") s1 = StelUtils::radToDmsStr(withoutRings, tr
.arg(StelUtils::radToDmsStr(withoutRi ue);
ngs, true), s2 = StelUtils::radToDmsStr(angularSize, tru
StelUtils::radToDmsStr(angularSi e);
ze, true)); }
sizeStr = QString("%1, %2: %3").arg(s1, q_("with rin
gs"), s2);
} }
else else
{ {
if (sphereScale!=1.f) // We must give correct diamet ers even if upscaling (e.g. Moon) if (sphereScale!=1.f) // We must give correct diamet ers even if upscaling (e.g. Moon)
{ {
if (withDecimalDegree) if (withDecimalDegree)
oss << q_("Apparent diameter: %1, sc {
aled up to: %2") s1 = StelUtils::radToDecDegStr(angul
.arg(StelUtils::radToDecDegSt arSize / sphereScale,5,false,true);
r(angularSize / sphereScale,5,false,true)) s2 = StelUtils::radToDecDegStr(angul
.arg(StelUtils::radToDecDegSt arSize,5,false,true);
r(angularSize,5,false,true)); }
else else
oss << q_("Apparent diameter: %1, sc {
aled up to: %2") s1 = StelUtils::radToDmsStr(angularS
.arg(StelUtils::radToDmsStr(a ize / sphereScale, true);
ngularSize / sphereScale, true)) s2 = StelUtils::radToDmsStr(angularS
.arg(StelUtils::radToDmsStr(a ize, true);
ngularSize, true)); }
sizeStr = QString("%1, %2: %3").arg(s1, q_("
scaled up to"), s2);
} }
else else
{ {
if (withDecimalDegree) if (withDecimalDegree)
oss << q_("Apparent diameter: %1").a rg(StelUtils::radToDecDegStr(angularSize,5,false,true)); sizeStr = StelUtils::radToDecDegStr( angularSize,5,false,true);
else else
oss << q_("Apparent diameter: %1").a rg(StelUtils::radToDmsStr(angularSize, true)); sizeStr = StelUtils::radToDmsStr(ang ularSize, true);
} }
} }
oss << "<br>"; oss << QString("%1: %2").arg(q_("Apparent diameter"), sizeSt r) << "<br />";
} }
double siderealPeriod = getSiderealPeriod(); double siderealPeriod = getSiderealPeriod();
double siderealDay = getSiderealDay(); double siderealDay = getSiderealDay();
if (flags&Extra) if (flags&Extra)
{ {
// This is a string you can activate for debugging. It shows the distance between observer and center of the body you are standing on. // This is a string you can activate for debugging. It shows the distance between observer and center of the body you are standing on.
// May be helpful for debugging critical parallax correction s for eclipses. // May be helpful for debugging critical parallax correction s for eclipses.
// For general use, find a better location first. // For general use, find a better location first.
// oss << q_("Planetocentric distance &rho;: %1 (km)").arg(c ore->getCurrentObserver()->getDistanceFromCenter() * AU) <<"<br>"; // oss << q_("Planetocentric distance &rho;: %1 (km)").arg(c ore->getCurrentObserver()->getDistanceFromCenter() * AU) <<"<br>";
if (siderealPeriod>0) if (siderealPeriod>0)
{ {
// TRANSLATORS: Sidereal (orbital) period for solar QString days = qc_("days", "duration");
system bodies in days and in Julian years (symbol: a) // Sidereal (orbital) period for solar system bodies
oss << q_("Sidereal period: %1 days (%2 a)").arg(QSt in days and in Julian years (symbol: a)
ring::number(siderealPeriod, 'f', 2)).arg(QString::number(siderealPeriod/36 oss << QString("%1: %2 %3 (%4 a)").arg(q_("Sidereal
5.25, 'f', 3)) << "<br>"; period"), QString::number(siderealPeriod, 'f', 2), days, QString::number(si
derealPeriod/365.25, 'f', 3)) << "<br />";
if (qAbs(siderealDay)>0) if (qAbs(siderealDay)>0)
{ {
oss << q_("Sidereal day: %1").arg(StelUtils: oss << QString("%1: %2").arg(q_("Sidereal da
:hoursToHmsStr(qAbs(siderealDay*24))) << "<br>"; y"), StelUtils::hoursToHmsStr(qAbs(siderealDay*24))) << "<br />";
oss << q_("Mean solar day: %1").arg(StelUtil oss << QString("%1: %2").arg(q_("Mean solar
s::hoursToHmsStr(qAbs(getMeanSolarDay()*24))) << "<br>"; day"), StelUtils::hoursToHmsStr(qAbs(getMeanSolarDay()*24))) << "<br />";
} }
else if (re.period==0.) else if (re.period==0.)
{ {
oss << q_("The period of rotation is chaotic ") << "<br>"; oss << q_("The period of rotation is chaotic ") << "<br />";
} }
} }
if (englishName != "Sun") if (englishName != "Sun")
{ {
const Vec3d& observerHelioPos = core->getObserverHel iocentricEclipticPos(); const Vec3d& observerHelioPos = core->getObserverHel iocentricEclipticPos();
const double elongation = getElongation(observerHeli oPos); const double elongation = getElongation(observerHeli oPos);
QString moonPhase = ""; QString moonPhase = "";
if (englishName=="Moon" && core->getCurrentLocation( ).planetName=="Earth") if (englishName=="Moon" && core->getCurrentLocation( ).planetName=="Earth")
{ {
double eclJDE = GETSTELMODULE(SolarSystem)-> getEarth()->getRotObliquity(core->getJDE()); double eclJDE = GETSTELMODULE(SolarSystem)-> getEarth()->getRotObliquity(core->getJDE());
skipping to change at line 528 skipping to change at line 555
if (deltaLong==225) if (deltaLong==225)
moonPhase = qc_("Waning Gibbous", "M oon phase"); moonPhase = qc_("Waning Gibbous", "M oon phase");
if (deltaLong==270) if (deltaLong==270)
moonPhase = qc_("Third Quarter", "Mo on phase"); moonPhase = qc_("Third Quarter", "Mo on phase");
if (deltaLong==315) if (deltaLong==315)
moonPhase = qc_("Waning Crescent", " Moon phase"); moonPhase = qc_("Waning Crescent", " Moon phase");
if (deltaLong==0 || deltaLong==360) if (deltaLong==0 || deltaLong==360)
moonPhase = qc_("New Moon", "Moon ph ase"); moonPhase = qc_("New Moon", "Moon ph ase");
} }
QString pha, elo;
if (withDecimalDegree) if (withDecimalDegree)
{ {
oss << QString(q_("Phase Angle: %1")).arg(St pha = StelUtils::radToDecDegStr(getPhaseAngl
elUtils::radToDecDegStr(getPhaseAngle(observerHelioPos),4,false,true)) << " e(observerHelioPos),4,false,true);
<br>"; elo = StelUtils::radToDecDegStr(elongation,4
oss << QString(q_("Elongation: %1")).arg(Ste ,false,true);
lUtils::radToDecDegStr(elongation,4,false,true)) << "<br>";
} }
else else
{ {
oss << QString(q_("Phase Angle: %1")).arg(St pha = StelUtils::radToDmsStr(getPhaseAngle(o
elUtils::radToDmsStr(getPhaseAngle(observerHelioPos), true)) << "<br>"; bserverHelioPos), true);
oss << QString(q_("Elongation: %1")).arg(Ste elo = StelUtils::radToDmsStr(elongation, tru
lUtils::radToDmsStr(elongation, true)) << "<br>"; e);
} }
oss << QString(q_("Phase: %1")).arg(getPhase(observe oss << QString("%1: %2").arg(q_("Phase angle"), pha)
rHelioPos), 0, 'f', 2); << "<br />";
oss << QString("%1: %2").arg(q_("Elongation"), elo)
<< "<br />";
oss << QString("%1: %2%").arg(q_("Illuminated"), QSt
ring::number(getPhase(observerHelioPos) * 100, 'f', 1)) << "<br />";
oss << QString("%1: %2").arg(q_("Albedo"), QString::
number(getAlbedo(), 'f', 3)) << "<br />";
if (!moonPhase.isEmpty()) if (!moonPhase.isEmpty())
oss << " (" << moonPhase << ")"; oss << QString("%1: %2").arg(q_("Phase"), mo
oss << "<br>"; onPhase) << "<br />";
oss << QString(q_("Illuminated: %1%")).arg(getPhase(
observerHelioPos) * 100, 0, 'f', 1) << "<br>";
oss << QString(q_("Albedo: %1")).arg(QString::number
(getAlbedo(), 'f', 3)) << "<br>";
} }
if (englishName=="Sun") if (englishName=="Sun")
{ {
// Only show during eclipse, show percent? // Only show during eclipse, show percent?
static SolarSystem *ssystem=GETSTELMODULE(SolarSyste m); static SolarSystem *ssystem=GETSTELMODULE(SolarSyste m);
// Debug solution:
// float eclipseFactor = ssyste
m->getEclipseFactor(core);
// oss << QString(q_("Eclipse F
actor: %1 alpha: %2")).arg(eclipseFactor).arg(-0.1f*qMax(-10.0f, (float) st
d::log10(eclipseFactor))) << "<br>";
// Release version:
float eclipseFactor = 100.f*(1.f-ssystem->getEclipse Factor(core)); float eclipseFactor = 100.f*(1.f-ssystem->getEclipse Factor(core));
if (eclipseFactor>1.e-7) // needed to avoid false di splay of 1e-14 or so. if (eclipseFactor>1.e-7) // needed to avoid false di splay of 1e-14 or so.
oss << QString(q_("Eclipse Factor: %1%")).ar g(eclipseFactor) << "<br>"; oss << QString("%1: %2%").arg(q_("Eclipse Fa ctor")).arg(QString::number(eclipseFactor, 'f', 2)) << "<br />";
} }
} }
postProcessInfoString(str, flags); postProcessInfoString(str, flags);
return str; return str;
} }
QVariantMap Planet::getInfoMap(const StelCore *core) const QVariantMap Planet::getInfoMap(const StelCore *core) const
skipping to change at line 662 skipping to change at line 687
re.obliquity = _obliquity; re.obliquity = _obliquity;
re.ascendingNode = _ascendingNode; re.ascendingNode = _ascendingNode;
re.precessionRate = _precessionRate; re.precessionRate = _precessionRate;
re.siderealPeriod = _siderealPeriod; // used for drawing orbit line s re.siderealPeriod = _siderealPeriod; // used for drawing orbit line s
deltaOrbitJDE = re.siderealPeriod/ORBIT_SEGMENTS; deltaOrbitJDE = re.siderealPeriod/ORBIT_SEGMENTS;
} }
Vec3d Planet::getJ2000EquatorialPos(const StelCore *core) const Vec3d Planet::getJ2000EquatorialPos(const StelCore *core) const
{ {
return StelCore::matVsop87ToJ2000.multiplyWithoutTranslation(getHeli if (englishName=="Sun")
ocentricEclipticPos() - core->getObserverHeliocentricEclipticPos()); return StelCore::matVsop87ToJ2000.multiplyWithoutTranslation
(GETSTELMODULE(SolarSystem)->getLightTimeSunPosition() - core->getObserverH
eliocentricEclipticPos());
else
return StelCore::matVsop87ToJ2000.multiplyWithoutTranslation
(getHeliocentricEclipticPos() - core->getObserverHeliocentricEclipticPos())
;
} }
// Compute the position in the parent Planet coordinate system // Compute the position in the parent Planet coordinate system
// Actually call the provided function to compute the ecliptical position // Actually call the provided function to compute the ecliptical position
void Planet::computePositionWithoutOrbits(const double dateJDE) void Planet::computePositionWithoutOrbits(const double dateJDE)
{ {
if (fabs(lastJDE-dateJDE)>deltaJDE) if (fabs(lastJDE-dateJDE)>deltaJDE)
{ {
coordFunc(dateJDE, eclipticPos, orbitPtr); coordFunc(dateJDE, eclipticPos, orbitPtr);
lastJDE = dateJDE; lastJDE = dateJDE;
skipping to change at line 1294 skipping to change at line 1322
const double sinx=sin(i)*cos(beta)*s in(lambda-Omega)-cos(i)*sin(beta); const double sinx=sin(i)*cos(beta)*s in(lambda-Omega)-cos(i)*sin(beta);
double rings = -2.6*fabs(sinx) + 1.2 5*sinx*sinx; // ExplSup2013: added term as (10.81) double rings = -2.6*fabs(sinx) + 1.2 5*sinx*sinx; // ExplSup2013: added term as (10.81)
return -8.88 + d + 0.044*phaseDeg + rings; return -8.88 + d + 0.044*phaseDeg + rings;
} }
if (englishName=="Uranus") if (englishName=="Uranus")
return -7.19 + d + 0.002*phaseDeg; return -7.19 + d + 0.002*phaseDeg;
if (englishName=="Neptune") if (englishName=="Neptune")
return -6.87 + d; return -6.87 + d;
if (englishName=="Pluto") if (englishName=="Pluto")
return -1.01 + d; return -1.01 + d;
// AW2017: I've added special case for Jupit
er's moons when they are in the shadow of Jupiter.
// FIXME: Need experimental data to
fitting to real world or the scientific paper with description of model.
// GZ 2017-09: Phase coefficients for I and
III corrected, based on original publication (Stebbins&Jacobsen 1928) now.
if (englishName=="Io") if (englishName=="Io")
return -1.68 + d + phaseDeg*(0.46 - 0.0010*phaseDeg); return shadowFactor<1.0 ? 21.0 : (-1 .68 + d + phaseDeg*(0.046 - 0.0010 *phaseDeg));
if (englishName=="Europa") if (englishName=="Europa")
return -1.41 + d + phaseDeg*(0.0312 - 0.00125*phaseDeg); return shadowFactor<1.0 ? 21.0 : (-1 .41 + d + phaseDeg*(0.0312 - 0.00125*phaseDeg));
if (englishName=="Ganymede") if (englishName=="Ganymede")
return -2.09 + d + phaseDeg*(0.323 - 0.00066*phaseDeg); return shadowFactor<1.0 ? 21.0 : (-2 .09 + d + phaseDeg*(0.0323 - 0.00066*phaseDeg));
if (englishName=="Callisto") if (englishName=="Callisto")
return -1.05 + d + phaseDeg*(0.078 return shadowFactor<1.0 ? 21.0 : (-1
- 0.00274*phaseDeg); .05 + d + phaseDeg*(0.078 - 0.00274*phaseDeg));
if ((absoluteMagnitude!=-99.) && (englishNam e!="Moon")) if ((absoluteMagnitude!=-99.) && (englishNam e!="Moon"))
return absoluteMagnitude+d; return absoluteMagnitude+d;
break; break;
} }
case Expl_Sup_1992: case Expl_Sup_1992:
{ {
// Algorithm provided by Pere Planesas (Obse rvatorio Astronomico Nacional) // Algorithm provided by Pere Planesas (Obse rvatorio Astronomico Nacional)
// GZ2016: Actually, this is taken straight from the Explanatory Supplement to the Astronomical Ephemeris 1992! (chap. 7.12) // GZ2016: Actually, this is taken straight from the Explanatory Supplement to the Astronomical Ephemeris 1992! (chap. 7.12)
skipping to change at line 1483 skipping to change at line 1516
// Problematic: Early-out here of course disables the wanted hint ci rcles for dim asteroids. // Problematic: Early-out here of course disables the wanted hint ci rcles for dim asteroids.
// The line makes hints for asteroids 5 magnitudes below sky limitin g magnitude visible. // The line makes hints for asteroids 5 magnitudes below sky limitin g magnitude visible.
// If asteroid is too faint to be seen, don't bother rendering. (Mas sive speedup if people have hundreds of orbital elements!) // If asteroid is too faint to be seen, don't bother rendering. (Mas sive speedup if people have hundreds of orbital elements!)
// AW: Added a special case for educational purpose to drawing orbit s for the Solar System Observer // AW: Added a special case for educational purpose to drawing orbit s for the Solar System Observer
// Details: https://sourceforge.net/p/stellarium/discussion/278769/t hread/4828ebe4/ // Details: https://sourceforge.net/p/stellarium/discussion/278769/t hread/4828ebe4/
if (((getVMagnitude(core)-5.0f) > core->getSkyDrawer()->getLimitMagn itude()) && pType>=Planet::isAsteroid && !core->getCurrentLocation().planet Name.contains("Observer", Qt::CaseInsensitive)) if (((getVMagnitude(core)-5.0f) > core->getSkyDrawer()->getLimitMagn itude()) && pType>=Planet::isAsteroid && !core->getCurrentLocation().planet Name.contains("Observer", Qt::CaseInsensitive))
{ {
return; return;
} }
Mat4d mat = Mat4d::translation(eclipticPos) * rotLocalToParent; Mat4d mat;
if (englishName=="Sun")
{
mat = Mat4d::translation(GETSTELMODULE(SolarSystem)->getLigh
tTimeSunPosition()) * rotLocalToParent;
}
else
{
mat = Mat4d::translation(eclipticPos) * rotLocalToParent;
}
PlanetP p = parent; PlanetP p = parent;
while (p && p->parent) while (p && p->parent)
{ {
mat = Mat4d::translation(p->eclipticPos) * mat * p->rotLocal ToParent; mat = Mat4d::translation(p->eclipticPos) * mat * p->rotLocal ToParent;
p = p->parent; p = p->parent;
} }
// This removed totally the Planet shaking bug!!! // This removed totally the Planet shaking bug!!!
StelProjector::ModelViewTranformP transfo = core->getHeliocentricEcl ipticModelViewTransform(); StelProjector::ModelViewTranformP transfo = core->getHeliocentricEcl ipticModelViewTransform();
transfo->combine(mat); transfo->combine(mat);
skipping to change at line 2118 skipping to change at line 2160
// Let's hide halo when inner planet between Sun and observe r (or moon between planet and observer). // Let's hide halo when inner planet between Sun and observe r (or moon between planet and observer).
// Do not hide Earth's moon's halo below ~-45degrees when ob serving from earth. // Do not hide Earth's moon's halo below ~-45degrees when ob serving from earth.
Vec3d obj = getJ2000EquatorialPos(core); Vec3d obj = getJ2000EquatorialPos(core);
Vec3d par = getParent()->getJ2000EquatorialPos(core); Vec3d par = getParent()->getJ2000EquatorialPos(core);
double angle = obj.angle(par)*180.f/M_PI; double angle = obj.angle(par)*180.f/M_PI;
double asize = getParent()->getSpheroidAngularSize(core); double asize = getParent()->getSpheroidAngularSize(core);
if (angle<=asize) if (angle<=asize)
allowDrawHalo = false; allowDrawHalo = false;
} }
// Draw the halo if it enabled in the ssystem.ini file (+ special ca se for backward compatible for the Sun) // Draw the halo if enabled in the ssystem_*.ini files (+ special ca se for backward compatible for the Sun)
if ((hasHalo() || this==ssm->getSun()) && allowDrawHalo) if ((hasHalo() || this==ssm->getSun()) && allowDrawHalo)
{ {
// Prepare openGL lighting parameters according to luminance // Prepare openGL lighting parameters according to luminance
float surfArcMin2 = getSpheroidAngularSize(core)*60; float surfArcMin2 = getSpheroidAngularSize(core)*60;
surfArcMin2 = surfArcMin2*surfArcMin2*M_PI; // the total ill uminated area in arcmin^2 surfArcMin2 = surfArcMin2*surfArcMin2*M_PI; // the total ill uminated area in arcmin^2
StelPainter sPainter(core->getProjection(StelCore::FrameJ200 0)); StelPainter sPainter(core->getProjection(StelCore::FrameJ200 0));
Vec3d tmp = getJ2000EquatorialPos(core); Vec3d tmp = getJ2000EquatorialPos(core);
// Find new extincted color for halo. The method is again ra ther ad-hoc, but does not look too bad. // Find new extincted color for halo. The method is again ra ther ad-hoc, but does not look too bad.
skipping to change at line 2353 skipping to change at line 2395
{ {
return; return;
} }
} }
painter->setBlending(false); painter->setBlending(false);
painter->setCullFace(true); painter->setCullFace(true);
// Draw the spheroid itself // Draw the spheroid itself
// Adapt the number of facets according with the size of the sphere for optimization // Adapt the number of facets according with the size of the sphere for optimization
int nb_facet = (int)(screenSz * 40.f/50.f); // 40 facets for 102 int nb_facet = qBound(10, (int)(screenSz * 40.f/50.f), 100); // 4
4 pixels diameter on screen 0 facets for 1024 pixels diameter on screen
if (nb_facet<10) nb_facet = 10;
if (nb_facet>100) nb_facet = 100;
// Generates the vertice // Generates the vertice
Planet3DModel model; Planet3DModel model;
sSphere(&model, radius*sphereScale, oneMinusOblateness, nb_facet, nb _facet); sSphere(&model, radius*sphereScale, oneMinusOblateness, nb_facet, nb _facet);
QVector<float> projectedVertexArr(model.vertexArr.size()); QVector<float> projectedVertexArr(model.vertexArr.size());
for (int i=0;i<model.vertexArr.size()/3;++i) for (int i=0;i<model.vertexArr.size()/3;++i)
painter->getProjector()->project(*((Vec3f*)(model.vertexArr. constData()+i*3)), *((Vec3f*)(projectedVertexArr.data()+i*3))); painter->getProjector()->project(*((Vec3f*)(model.vertexArr. constData()+i*3)), *((Vec3f*)(projectedVertexArr.data()+i*3)));
const SolarSystem* ssm = GETSTELMODULE(SolarSystem); const SolarSystem* ssm = GETSTELMODULE(SolarSystem);
 End of changes. 45 change blocks. 
116 lines changed or deleted 167 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/