Satellite.cpp   Satellite.cpp 
skipping to change at line 230 skipping to change at line 230
QString Satellite::getInfoString(const StelCore *core, const InfoStringGrou p& flags) const QString Satellite::getInfoString(const StelCore *core, const InfoStringGrou p& flags) const
{ {
QString str; QString str;
QTextStream oss(&str); QTextStream oss(&str);
if (flags & Name) if (flags & Name)
{ {
oss << "<h2>" << name << "</h2>"; oss << "<h2>" << name << "</h2>";
if (!description.isEmpty()) if (!description.isEmpty())
oss << q_(description) << "<br/>"; {
// Let's convert possibile \n chars into <br/> in de
scription of satellite
oss << q_(description).replace("\n", "<br/>") << "<b
r/>";
}
} }
if (flags & CatalogNumber) if (flags & CatalogNumber)
{ {
QString catalogNumbers; QString catalogNumbers;
if (internationalDesignator.isEmpty()) if (internationalDesignator.isEmpty())
catalogNumbers = QString("%1: %2") catalogNumbers = QString("%1: %2")
.arg(q_("Catalog #")) .arg(q_("Catalog #"))
.arg(id); .arg(id);
else else
skipping to change at line 441 skipping to change at line 444
if (height <= 0.0) if (height <= 0.0)
{ {
// The orbit is no longer valid. Causes include ver y out of date // The orbit is no longer valid. Causes include ver y out of date
// TLE, system date and time out of a reasonable ran ge, and orbital // TLE, system date and time out of a reasonable ran ge, and orbital
// degradation and re-entry of a satellite. In any of these cases // degradation and re-entry of a satellite. In any of these cases
// we might end up with a problem - usually a crash of Stellarium // we might end up with a problem - usually a crash of Stellarium
// because of a div/0 or something. To prevent this , we turn off // because of a div/0 or something. To prevent this , we turn off
// the satellite. // the satellite.
qWarning() << "Satellite has invalid orbit:" << name << id; qWarning() << "Satellite has invalid orbit:" << name << id;
orbitValid = false; orbitValid = false;
displayed = false; // He shouldn't be displayed!
return; return;
} }
elAzPosition = pSatWrapper->getAltAz(); elAzPosition = pSatWrapper->getAltAz();
elAzPosition.normalize(); elAzPosition.normalize();
pSatWrapper->getSlantRange(range, rangeRate); pSatWrapper->getSlantRange(range, rangeRate);
visibility = pSatWrapper->getVisibilityPredict(); visibility = pSatWrapper->getVisibilityPredict();
phaseAngle = pSatWrapper->getPhaseAngle(); phaseAngle = pSatWrapper->getPhaseAngle();
skipping to change at line 538 skipping to change at line 542
// If the names are the same, compare IDs, i.e. NORAD numbers. // If the names are the same, compare IDs, i.e. NORAD numbers.
if (id < another.id) if (id < another.id)
return true; return true;
else else
return false; return false;
} }
void Satellite::draw(StelCore* core, StelPainter& painter, float) void Satellite::draw(StelCore* core, StelPainter& painter, float)
{ {
if (core->getJDay() < jdLaunchYearJan1) return; if (core->getJDay()<jdLaunchYearJan1 || !displayed)
return;
XYZ = getJ2000EquatorialPos(core); XYZ = getJ2000EquatorialPos(core);
StelSkyDrawer* sd = core->getSkyDrawer(); StelSkyDrawer* sd = core->getSkyDrawer();
Vec3f drawColor(0.2f,0.2f,0.2f); Vec3f drawColor(0.2f,0.2f,0.2f);
if (visibility != RADAR_NIGHT) if (visibility != RADAR_NIGHT)
drawColor = hintColor; drawColor = hintColor;
painter.setColor(drawColor[0], drawColor[1], drawColor[2], hintBrigh tness); painter.setColor(drawColor[0], drawColor[1], drawColor[2], hintBrigh tness);
StelProjectorP prj = core->getProjection(StelCore::FrameJ2000); StelProjectorP prj = core->getProjection(StelCore::FrameJ2000);
if (realisticModeFlag) Vec3d xy;
if (prj->projectCheck(XYZ,xy))
{ {
double mag = getVMagnitude(core); if (realisticModeFlag)
RCMag rcMag; {
Vec3f color = Vec3f(1.f,1.f,1.f); double mag = getVMagnitude(core);
RCMag rcMag;
Vec3f color = Vec3f(1.f,1.f,1.f);
StelProjectorP origP = painter.getProjector(); // Save proje StelProjectorP origP = painter.getProjector(); // Sa
ctor state ve projector state
painter.setProjector(prj); painter.setProjector(prj);
sd->preDrawPointSource(&painter); sd->preDrawPointSource(&painter);
if (mag <= sd->getLimitMagnitude()) if (mag <= sd->getLimitMagnitude())
{ {
sd->computeRCMag(mag, &rcMag); sd->computeRCMag(mag, &rcMag);
sd->drawPointSource(&painter, Vec3f(XYZ[0], XYZ[1], sd->drawPointSource(&painter, Vec3f(XYZ[0],
XYZ[2]), rcMag, color, true); XYZ[1], XYZ[2]), rcMag, color, true);
painter.setColor(color[0], color[1], color[2], 1); painter.setColor(color[0], color[1], color[2
], 1);
if (Satellite::showLabels) if (Satellite::showLabels)
painter.drawText(XYZ, name, 0, 10, 10, false painter.drawText(XYZ, name, 0, 10, 1
); 0, false);
} }
sd->postDrawPointSource(&painter); sd->postDrawPointSource(&painter);
painter.setProjector(origP); // Restrore projector state painter.setProjector(origP); // Restrore projector s
} tate
else }
{ else
Vec3d xy;
if (prj->project(XYZ,xy))
{ {
if (Satellite::showLabels) if (Satellite::showLabels)
painter.drawText(xy[0], xy[1], name, 0, 10, 10, false); painter.drawText(xy[0], xy[1], name, 0, 10, 10, false);
Satellite::hintTexture->bind(); Satellite::hintTexture->bind();
painter.drawSprite2dMode(xy[0], xy[1], 11); painter.drawSprite2dMode(xy[0], xy[1], 11);
} }
} }
if (orbitDisplayed && Satellite::orbitLinesFlag) drawOrbit(painter); if (orbitDisplayed && Satellite::orbitLinesFlag && orbitValid) drawO rbit(painter);
} }
void Satellite::drawOrbit(StelPainter& painter) void Satellite::drawOrbit(StelPainter& painter)
{ {
Vec3d position,previousPosition; Vec3d position,previousPosition;
glDisable(GL_TEXTURE_2D); glDisable(GL_TEXTURE_2D);
QList<Vec3d>::iterator it= orbitPoints.begin(); QList<Vec3d>::iterator it= orbitPoints.begin();
 End of changes. 12 change blocks. 
28 lines changed or deleted 37 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/