Satellite.cpp   Satellite.cpp 
skipping to change at line 70 skipping to change at line 70
bool Satellite::realisticModeFlag = false; bool Satellite::realisticModeFlag = false;
Vec3f Satellite::invisibleSatelliteColor = Vec3f(0.2,0.2,0.2); Vec3f Satellite::invisibleSatelliteColor = Vec3f(0.2,0.2,0.2);
#ifdef IRIDIUM_SAT_TEXT_DEBUG #ifdef IRIDIUM_SAT_TEXT_DEBUG
QString Satellite::myText = ""; QString Satellite::myText = "";
#endif #endif
double Satellite::sunReflAngle = 180.; double Satellite::sunReflAngle = 180.;
double Satellite::timeShift = 0.; double Satellite::timeShift = 0.;
Satellite::Satellite(const QString& identifier, const QVariantMap& map) Satellite::Satellite(const QString& identifier, const QVariantMap& map)
: initialized(false), : initialized(false)
displayed(true), , displayed(true)
orbitDisplayed(false), , orbitDisplayed(false)
userDefined(false), , userDefined(false)
newlyAdded(false), , newlyAdded(false)
orbitValid(false), , orbitValid(false)
jdLaunchYearJan1(0), , jdLaunchYearJan1(0)
stdMag(99.), , stdMag(99.)
height(0.), , height(0.)
range(0.), , range(0.)
rangeRate(0.), , rangeRate(0.)
hintColor(0.0,0.0,0.0), , hintColor(0.0,0.0,0.0)
lastUpdated(), , lastUpdated()
pSatWrapper(NULL), , pSatWrapper(NULL)
visibility(0), , visibility(0)
phaseAngle(0.), , phaseAngle(0.)
lastEpochCompForOrbit(0.), , lastEpochCompForOrbit(0.)
epochTime(0.) , epochTime(0.)
{ {
// return initialized if the mandatory fields are not present // return initialized if the mandatory fields are not present
if (identifier.isEmpty()) if (identifier.isEmpty())
return; return;
if (!map.contains("name") || !map.contains("tle1") || !map.contains( "tle2")) if (!map.contains("name") || !map.contains("tle1") || !map.contains( "tle2"))
return; return;
// Font size is 16 // Font size is 16
font.setPixelSize(StelApp::getInstance().getBaseFontSize()+3); font.setPixelSize(StelApp::getInstance().getBaseFontSize()+3);
skipping to change at line 766 skipping to change at line 765
{ {
sd->computeRCMag(mag, &rcMag); sd->computeRCMag(mag, &rcMag);
sd->drawPointSource(&painter, Vec3f(XYZ[0],X YZ[1],XYZ[2]), rcMag, color, true); sd->drawPointSource(&painter, Vec3f(XYZ[0],X YZ[1],XYZ[2]), rcMag, color, true);
} }
sd->postDrawPointSource(&painter); sd->postDrawPointSource(&painter);
float txtMag = mag; float txtMag = mag;
if (visibility != VISIBLE) if (visibility != VISIBLE)
{ {
txtMag = mag - 10.f; // Oops... Artificial s atellite is invisible, but let's make the label visible txtMag = mag - 10.f; // Oops... Artificial s atellite is invisible, but let's make the label visible
painter.setColor(invisibleSatelliteColor[0], invisibleSatelliteColor[1], invisibleSatelliteColor[2], 1); painter.setColor(invisibleSatelliteColor[0], invisibleSatelliteColor[1], invisibleSatelliteColor[2], 1.f);
} }
else else
painter.setColor(color[0], color[1], color[2 ], 1); painter.setColor(color[0], color[1], color[2 ], 1.f);
// Draw the label of the satellite when it enabled // Draw the label of the satellite when it enabled
if (txtMag <= sd->getLimitMagnitude() && Satellite:: showLabels) if (txtMag <= sd->getLimitMagnitude() && Satellite:: showLabels)
painter.drawText(XYZ, name, 0, 10, 10, false ); painter.drawText(XYZ, name, 0, 10, 10, false );
painter.setProjector(origP); // Restrore projector s tate painter.setProjector(origP); // Restrore projector s tate
} }
else else
{ {
if (Satellite::showLabels) if (Satellite::showLabels)
skipping to change at line 794 skipping to change at line 793
Satellite::hintTexture->bind(); Satellite::hintTexture->bind();
painter.drawSprite2dMode(xy[0], xy[1], 11); painter.drawSprite2dMode(xy[0], xy[1], 11);
} }
} }
if (orbitDisplayed && Satellite::orbitLinesFlag && orbitValid) drawO rbit(painter); if (orbitDisplayed && Satellite::orbitLinesFlag && orbitValid) drawO rbit(painter);
} }
void Satellite::drawOrbit(StelPainter& painter) void Satellite::drawOrbit(StelPainter& painter)
{ {
Vec3d position; Vec3d position, onscreen;
Vec3f drawColor; Vec3f drawColor;
int size = orbitPoints.size(); int size = orbitPoints.size();
glDisable(GL_TEXTURE_2D); glDisable(GL_TEXTURE_2D);
QList<Vec3d>::iterator it= orbitPoints.begin(); QList<Vec3d>::iterator it= orbitPoints.begin();
it++; it++;
QVector<Vec3d> vertexArray; QVector<Vec3d> vertexArray;
QVector<Vec4f> colorArray; QVector<Vec4f> colorArray;
StelProjectorP prj = painter.getProjector();
vertexArray.resize(size); vertexArray.resize(size);
colorArray.resize(size); colorArray.resize(size);
painter.enableClientStates(true, false, false);
//Rest of points //Rest of points
for (int i=1; i<size; i++) for (int i=1; i<size; i++)
{ {
position.set(it->operator [](0), it->operator [](1), it->ope rator [](2)); position.set(it->operator [](0), it->operator [](1), it->ope rator [](2));
it++; it++;
position.normalize(); position.normalize();
vertexArray[i] = position; if (prj->project(position, onscreen)) // check position on t
drawColor = invisibleSatelliteColor; he screen
if (visibilityPoints[i] == VISIBLE) {
drawColor = orbitColor; vertexArray.append(position);
colorArray[i] = Vec4f(drawColor[0], drawColor[1], drawColor[ drawColor = invisibleSatelliteColor;
2], hintBrightness * calculateOrbitSegmentIntensity(i)); if (visibilityPoints[i] == VISIBLE)
drawColor = orbitColor;
colorArray.append(Vec4f(drawColor[0], drawColor[1],
drawColor[2], hintBrightness * calculateOrbitSegmentIntensity(i)));
}
} }
painter.drawPath(vertexArray, colorArray); painter.drawPath(vertexArray, colorArray);
glEnable(GL_TEXTURE_2D); glEnable(GL_TEXTURE_2D);
painter.enableClientStates(false);
} }
float Satellite::calculateOrbitSegmentIntensity(int segNum) float Satellite::calculateOrbitSegmentIntensity(int segNum)
{ {
int endDist = (orbitLineSegments/2) - abs(segNum-1 - (orbitLineSegme nts/2) % orbitLineSegments); int endDist = (orbitLineSegments/2) - abs(segNum-1 - (orbitLineSegme nts/2) % orbitLineSegments);
if (endDist > orbitLineFadeSegments) if (endDist > orbitLineFadeSegments)
{ {
return 1.0; return 1.0;
} }
else else
 End of changes. 9 change blocks. 
29 lines changed or deleted 34 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/