Comet.cpp   Comet.cpp 
skipping to change at line 85 skipping to change at line 85
atexMapName, atexMapName,
"", "",
coordFunc, coordFunc,
auserDataPtr, auserDataPtr,
osculatingFunc, osculatingFunc,
acloseOrbit, acloseOrbit,
hidden, hidden,
false, //No atmosphere false, //No atmosphere
true, //halo true, //halo
pTypeStr), pTypeStr),
absoluteMagnitude(0.),
slopeParameter(-1.), //== uninitialized: used in getVMagnitude()
semiMajorAxis(0.),
isCometFragment(false),
nameIsProvisionalDesignation(false),
tailFactors(-1., -1.), // mark "invalid"
tailActive(false), tailActive(false),
tailBright(false), tailBright(false),
deltaJDEtail(15.0*StelCore::JD_MINUTE), // update tail geometry ev
ery 15 minutes only
lastJDEtail(0.0),
dustTailWidthFactor(dustTailWidthFact), dustTailWidthFactor(dustTailWidthFact),
dustTailLengthFactor(dustTailLengthFact), dustTailLengthFactor(dustTailLengthFact),
dustTailBrightnessFactor(dustTailBrightnessFact) dustTailBrightnessFactor(dustTailBrightnessFact)
{ {
texMapName = atexMapName;
lastOrbitJDE =0;
deltaJDE = StelCore::JD_SECOND;
deltaJDEtail=15.0*StelCore::JD_MINUTE; // update tail geometry every
15 minutes only
lastJDEtail=0.0;
orbitCached = 0;
closeOrbit = acloseOrbit;
eclipticPos=Vec3d(0.,0.,0.); eclipticPos=Vec3d(0.,0.,0.);
rotLocalToParent = Mat4d::identity(); rotLocalToParent = Mat4d::identity();
texMap = StelApp::getInstance().getTextureManager().createTextureThr ead(StelFileMgr::getInstallationDir()+"/textures/"+texMapName, StelTexture: :StelTextureParams(true, GL_LINEAR, GL_REPEAT)); texMap = StelApp::getInstance().getTextureManager().createTextureThr ead(StelFileMgr::getInstallationDir()+"/textures/"+texMapName, StelTexture: :StelTextureParams(true, GL_LINEAR, GL_REPEAT));
tailFactors[0]=-1.0f; tailFactors[1]=-1.0f; // mark "invalid"
gastailVertexArr.clear(); gastailVertexArr.clear();
dusttailVertexArr.clear(); dusttailVertexArr.clear();
comaVertexArr.clear(); comaVertexArr.clear();
gastailColorArr.clear(); gastailColorArr.clear();
dusttailColorArr.clear(); dusttailColorArr.clear();
//Comet specific members
absoluteMagnitude = 0;
slopeParameter = -1;//== uninitialized: used in getVMagnitude()
//TODO: Name processing? //TODO: Name processing?
nameI18 = englishName;
flagLabels = true;
semiMajorAxis = 0.;
isCometFragment = false;
nameIsProvisionalDesignation = false;
} }
Comet::~Comet() Comet::~Comet()
{ {
} }
void Comet::setAbsoluteMagnitudeAndSlope(const double magnitude, const doub le slope) void Comet::setAbsoluteMagnitudeAndSlope(const double magnitude, const doub le slope)
{ {
if (slope < 0 || slope > 20.0) if (slope < 0 || slope > 20.0)
{ {
skipping to change at line 155 skipping to change at line 143
nameI18 = translator.qtranslate(englishName); nameI18 = translator.qtranslate(englishName);
} }
QString Comet::getInfoString(const StelCore *core, const InfoStringGroup &f lags) const QString Comet::getInfoString(const StelCore *core, const InfoStringGroup &f lags) const
{ {
//Mostly copied from Planet::getInfoString(): //Mostly copied from Planet::getInfoString():
QString str; QString str;
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();
Q_UNUSED(az_app); Q_UNUSED(az_app);
if (flags&Name) if (flags&Name)
{ {
oss << "<h2>"; oss << "<h2>";
oss << getNameI18n(); // UI translation can differ from sky translation oss << getNameI18n(); // UI translation can differ from sky translation
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 << ")";
skipping to change at line 203 skipping to change at line 192
if (slopeParameter >= 0) if (slopeParameter >= 0)
oss << q_("Absolute Magnitude: %1").arg(absoluteMagn itude, 0, 'f', 2) << "<br>"; oss << q_("Absolute Magnitude: %1").arg(absoluteMagn itude, 0, 'f', 2) << "<br>";
} }
oss << getPositionInfoString(core, flags); oss << getPositionInfoString(core, flags);
if (flags&Distance) if (flags&Distance)
{ {
double distanceAu = getHeliocentricEclipticPos().length(); double distanceAu = getHeliocentricEclipticPos().length();
double distanceKm = AU * distanceAu; double distanceKm = AU * distanceAu;
if (englishName!="Sun") if (distanceAu < 0.1)
{ {
if (distanceAu < 0.1) // xgettext:no-c-format
{ oss << QString(q_("Distance from Sun: %1AU (%2 km)")
// xgettext:no-c-format )
oss << QString(q_("Distance from Sun: %1AU ( .arg(distanceAu, 0, 'f', 6)
%2 km)")) .arg(distanceKm, 0, 'f', 3);
.arg(distanceAu, 0, 'f', 6) }
.arg(distanceKm, 0, 'f', 3); else
} {
else // xgettext:no-c-format
{ oss << QString(q_("Distance from Sun: %1AU (%2 Mio k
// xgettext:no-c-format m)"))
oss << QString(q_("Distance from Sun: %1AU ( .arg(distanceAu, 0, 'f', 3)
%2 Mio km)")) .arg(distanceKm / 1.0e6, 0, 'f', 3);
.arg(distanceAu, 0, 'f', 3)
.arg(distanceKm / 1.0e6, 0, 'f', 3);
}
oss << "<br>";
} }
oss << "<br>";
distanceAu = getJ2000EquatorialPos(core).length(); distanceAu = getJ2000EquatorialPos(core).length();
distanceKm = AU * distanceAu; distanceKm = AU * distanceAu;
if (distanceAu < 0.1) if (distanceAu < 0.1)
{ {
// xgettext:no-c-format // xgettext:no-c-format
oss << QString(q_("Distance: %1AU (%2 km)")) oss << QString(q_("Distance: %1AU (%2 km)"))
.arg(distanceAu, 0, 'f', 6) .arg(distanceAu, 0, 'f', 6)
.arg(distanceKm, 0, 'f', 3); .arg(distanceKm, 0, 'f', 3);
} }
else else
skipping to change at line 255 skipping to change at line 241
// TRANSLATORS: Sidereal (orbital) period for comets in Julian years (symbol: a) // TRANSLATORS: Sidereal (orbital) period for comets in Julian years (symbol: a)
oss << q_("Sidereal period: %1 a").arg(QString::numb er(siderealPeriod/365.25, 'f', 3)) << "<br>"; oss << q_("Sidereal period: %1 a").arg(QString::numb er(siderealPeriod/365.25, 'f', 3)) << "<br>";
} }
// GZ: Add speed. I don't know where else to place that bit of information. // GZ: Add speed. I don't know where else to place that bit of information.
// xgettext:no-c-format // xgettext:no-c-format
oss << QString(q_("Speed: %1 km/s")) oss << QString(q_("Speed: %1 km/s"))
.arg(((CometOrbit*)userDataPtr)->getVelocity().le ngth()*AU/86400.0, 0, 'f', 3); .arg(((CometOrbit*)userDataPtr)->getVelocity().le ngth()*AU/86400.0, 0, 'f', 3);
oss << "<br>"; oss << "<br>";
const Vec3d& observerHelioPos = core->getObserverHeliocentri
cEclipticPos();
const double elongation = getElongation(observerHelioPos);
if (withDecimalDegree)
{
oss << QString(q_("Phase Angle: %1")).arg(StelUtils:
:radToDecDegStr(getPhaseAngle(observerHelioPos),4,false,true)) << "<br>";
oss << QString(q_("Elongation: %1")).arg(StelUtils::
radToDecDegStr(elongation,4,false,true)) << "<br>";
}
else
{
oss << QString(q_("Phase Angle: %1")).arg(StelUtils:
:radToDmsStr(getPhaseAngle(observerHelioPos), true)) << "<br>";
oss << QString(q_("Elongation: %1")).arg(StelUtils::
radToDmsStr(elongation, true)) << "<br>";
}
} }
if ((flags&Size) && (tailFactors[0]>0.0f)) if ((flags&Size) && (tailFactors[0]>0.0f))
{ {
// GZ: Add estimates for coma diameter and tail length. // GZ: Add estimates for coma diameter and tail length.
// xgettext:no-c-format // xgettext:no-c-format
oss << QString(q_("Coma diameter (estimate): %1 km")) oss << QString(q_("Coma diameter (estimate): %1 km"))
.arg(floor(tailFactors[0]*AU/1000.0f)*1000.0f, 0, 'f', 0); .arg(floor(tailFactors[0]*AU/1000.0f)*1000.0f, 0, 'f', 0);
oss << "<br>"; oss << "<br>";
// xgettext:no-c-format // xgettext:no-c-format
skipping to change at line 483 skipping to change at line 483
if (getEnglishName() == core->getCurrentLocation().planetName) if (getEnglishName() == core->getCurrentLocation().planetName)
{ // Maybe even don't do that? E.g., draw tail while riding the come t? Decide later. { // Maybe even don't do that? E.g., draw tail while riding the come t? Decide later.
return; return;
} }
// This test seemed necessary for reasonable fps in case too many co met elements are loaded. // This test seemed necessary for reasonable fps in case too many co met elements are loaded.
// Problematic: Early-out here of course disables the wanted hint ci rcles for dim comets. // Problematic: Early-out here of course disables the wanted hint ci rcles for dim comets.
// The line makes hints for comets 5 magnitudes below sky limiting m agnitude visible. // The line makes hints for comets 5 magnitudes below sky limiting m agnitude visible.
// If comet is too faint to be seen, don't bother rendering. (Massiv e speedup if people have hundreds of comet elements!) // If comet is too faint to be seen, don't bother rendering. (Massiv e speedup if people have hundreds of comet elements!)
if ((getVMagnitude(core)-5.0f) > core->getSkyDrawer()->getLimitMagni tude()) if ((getVMagnitude(core)-5.0f) > core->getSkyDrawer()->getLimitMagni tude() && !core->getCurrentLocation().planetName.contains("Observer", Qt::C aseInsensitive))
{ {
return; return;
} }
// The CometOrbit is in fact available in userDataPtr! // The CometOrbit is in fact available in userDataPtr!
CometOrbit* orbit=(CometOrbit*)userDataPtr; CometOrbit* orbit=(CometOrbit*)userDataPtr;
Q_ASSERT(orbit); Q_ASSERT(orbit);
if (!orbit->objectDateValid(core->getJDE())) return; // don't draw a t all if out of useful date range. This allows having hundreds of comet ele ments. if (!orbit->objectDateValid(core->getJDE())) return; // don't draw a t all if out of useful date range. This allows having hundreds of comet ele ments.
Mat4d mat = Mat4d::translation(eclipticPos) * rotLocalToParent; Mat4d mat = Mat4d::translation(eclipticPos) * rotLocalToParent;
// This removed totally the Planet shaking bug!!! // This removed totally the Planet shaking bug!!!
 End of changes. 12 change blocks. 
40 lines changed or deleted 45 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/