Satellite.cpp   Satellite.cpp 
skipping to change at line 22 skipping to change at line 22
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#include "Satellite.hpp" #include "Satellite.hpp"
#include "StelObject.hpp" #include "StelObject.hpp"
#include "StelPainter.hpp"
#include "StelApp.hpp" #include "StelApp.hpp"
#include "StelLocation.hpp" #include "StelLocation.hpp"
#include "StelCore.hpp" #include "StelCore.hpp"
#include "StelTexture.hpp"
#include "VecMath.hpp" #include "VecMath.hpp"
#include "StelUtils.hpp" #include "StelUtils.hpp"
#include "StelTranslator.hpp" #include "StelTranslator.hpp"
#include "renderer/StelCircleArcRenderer.hpp"
#include "renderer/StelRenderer.hpp"
#include "renderer/StelTextureNew.hpp"
#include <QTextStream> #include <QTextStream>
#include <QRegExp> #include <QRegExp>
#include <QDebug> #include <QDebug>
#include <QVariant> #include <QVariant>
#include <QSettings> #include <QSettings>
#include <QByteArray> #include <QByteArray>
#include "gsatellite/gTime.hpp" #include "gsatellite/gTime.hpp"
#include <cmath> #include <cmath>
// static data members - will be initialised in the Satallites class (the S telObjectMgr) // static data members - will be initialised in the Satallites class (the S telObjectMgr)
StelTextureSP Satellite::hintTexture;
float Satellite::showLabels = true; float Satellite::showLabels = true;
float Satellite::hintBrightness = 0.0; float Satellite::hintBrightness = 0.0;
float Satellite::hintScale = 1.f; float Satellite::hintScale = 1.f;
SphericalCap Satellite::viewportHalfspace = SphericalCap(); SphericalCap Satellite::viewportHalfspace = SphericalCap();
int Satellite::orbitLineSegments = 90; int Satellite::orbitLineSegments = 90;
int Satellite::orbitLineFadeSegments = 4; int Satellite::orbitLineFadeSegments = 4;
int Satellite::orbitLineSegmentDuration = 20; int Satellite::orbitLineSegmentDuration = 20;
bool Satellite::orbitLinesFlag = true; bool Satellite::orbitLinesFlag = true;
bool Satellite::realisticModeFlag = false;
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),
stdMag(99.),
height(0.),
range(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),
phaseAngle(0.),
lastEpochCompForOrbit(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.setPixelSize(16); font.setPixelSize(16);
id = identifier; id = identifier;
name = map.value("name").toString(); name = map.value("name").toString();
if (name.isEmpty()) if (name.isEmpty())
return; return;
// If there are no such keys, these will be initialized with the def ault // If there are no such keys, these will be initialized with the def ault
// values given them above. // values given them above.
description = map.value("description", description).toString().trimm ed(); description = map.value("description", description).toString().trimm ed();
displayed = map.value("visible", displayed).toBool(); displayed = map.value("visible", displayed).toBool();
orbitDisplayed = map.value("orbitVisible", orbitDisplayed).toBool(); orbitDisplayed = map.value("orbitVisible", orbitDisplayed).toBool();
userDefined = map.value("userDefined", userDefined).toBool(); userDefined = map.value("userDefined", userDefined).toBool();
stdMag = map.value("stdMag", 99.f).toDouble();
// Satellite hint color // Satellite hint color
QVariantList list = map.value("hintColor", QVariantList()).toList(); QVariantList list = map.value("hintColor", QVariantList()).toList();
if (list.count() == 3) if (list.count() == 3)
{ {
hintColor[0] = list.at(0).toDouble(); hintColor[0] = list.at(0).toDouble();
hintColor[1] = list.at(1).toDouble(); hintColor[1] = list.at(1).toDouble();
hintColor[2] = list.at(2).toDouble(); hintColor[2] = list.at(2).toDouble();
} }
// Satellite orbit section color // Satellite orbit section color
list = map.value("orbitColor", QVariantList()).toList(); list = map.value("orbitColor", QVariantList()).toList();
if (list.count() == 3) if (list.count() == 3)
{ {
orbitColorNormal[0] = list.at(0).toDouble(); orbitColor[0] = list.at(0).toDouble();
orbitColorNormal[1] = list.at(1).toDouble(); orbitColor[1] = list.at(1).toDouble();
orbitColorNormal[2] = list.at(2).toDouble(); orbitColor[2] = list.at(2).toDouble();
} }
else else
{ {
orbitColorNormal = hintColor; orbitColor = hintColor;
} }
// Set the night color of orbit lines to red with the
// intensity of the average of the RGB for the day color.
float orbitColorBrightness = (orbitColorNormal[0] + orbitColorNormal
[1] + orbitColorNormal[2])/3;
orbitColorNight[0] = orbitColorBrightness;
orbitColorNight[1] = 0;
orbitColorNight[2] = 0;
if (StelApp::getInstance().getVisionModeNight())
orbitColor = &orbitColorNight;
else
orbitColor = &orbitColorNormal;
if (map.contains("comms")) if (map.contains("comms"))
{ {
foreach(const QVariant &comm, map.value("comms").toList()) foreach(const QVariant &comm, map.value("comms").toList())
{ {
QVariantMap commMap = comm.toMap(); QVariantMap commMap = comm.toMap();
CommLink c; CommLink c;
if (commMap.contains("frequency")) c.frequency = com mMap.value("frequency").toDouble(); if (commMap.contains("frequency")) c.frequency = com mMap.value("frequency").toDouble();
if (commMap.contains("modulation")) c.modulation = c ommMap.value("modulation").toString(); if (commMap.contains("modulation")) c.modulation = c ommMap.value("modulation").toString();
if (commMap.contains("description")) c.description = commMap.value("description").toString(); if (commMap.contains("description")) c.description = commMap.value("description").toString();
comms.append(c); comms.append(c);
skipping to change at line 174 skipping to change at line 173
double Satellite::roundToDp(float n, int dp) double Satellite::roundToDp(float n, int dp)
{ {
// round n to dp decimal places // round n to dp decimal places
return floor(n * pow(10., dp) + .5) / pow(10., dp); return floor(n * pow(10., dp) + .5) / pow(10., dp);
} }
QVariantMap Satellite::getMap(void) QVariantMap Satellite::getMap(void)
{ {
QVariantMap map; QVariantMap map;
map["name"] = name; map["name"] = name;
map["stdMag"] = stdMag;
map["tle1"] = tleElements.first.data(); map["tle1"] = tleElements.first.data();
map["tle2"] = tleElements.second.data(); map["tle2"] = tleElements.second.data();
if (!description.isEmpty()) if (!description.isEmpty())
map["description"] = description; map["description"] = description;
map["visible"] = displayed; map["visible"] = displayed;
map["orbitVisible"] = orbitDisplayed; map["orbitVisible"] = orbitDisplayed;
if (userDefined) if (userDefined)
map.insert("userDefined", userDefined); map.insert("userDefined", userDefined);
QVariantList col, orbitCol; QVariantList col, orbitCol;
col << roundToDp(hintColor[0],3) << roundToDp(hintColor[1], 3) << ro undToDp(hintColor[2], 3); col << roundToDp(hintColor[0],3) << roundToDp(hintColor[1], 3) << ro undToDp(hintColor[2], 3);
orbitCol << roundToDp(orbitColorNormal[0], 3) << roundToDp(orbitColo rNormal[1], 3) << roundToDp(orbitColorNormal[2],3); orbitCol << roundToDp(orbitColor[0], 3) << roundToDp(orbitColor[1], 3) << roundToDp(orbitColor[2],3);
map["hintColor"] = col; map["hintColor"] = col;
map["orbitColor"] = orbitCol; map["orbitColor"] = orbitCol;
QVariantList commList; QVariantList commList;
foreach(const CommLink &c, comms) foreach(const CommLink &c, comms)
{ {
QVariantMap commMap; QVariantMap commMap;
commMap["frequency"] = c.frequency; commMap["frequency"] = c.frequency;
if (!c.modulation.isEmpty() && c.modulation != "") commMap[" modulation"] = c.modulation; if (!c.modulation.isEmpty() && c.modulation != "") commMap[" modulation"] = c.modulation;
if (!c.description.isEmpty() && c.description != "") commMap ["description"] = c.description; if (!c.description.isEmpty() && c.description != "") commMap ["description"] = c.description;
commList << commMap; commList << commMap;
skipping to change at line 248 skipping to change at line 248
.arg(id); .arg(id);
else else
catalogNumbers = QString("%1: %2; %3: %4") catalogNumbers = QString("%1: %2; %3: %4")
.arg(q_("Catalog #")) .arg(q_("Catalog #"))
.arg(id) .arg(id)
.arg(q_("International Designator") ) .arg(q_("International Designator") )
.arg(internationalDesignator); .arg(internationalDesignator);
oss << catalogNumbers << "<br/><br/>"; oss << catalogNumbers << "<br/><br/>";
} }
if (flags & Extra1) if (flags & ObjectType)
{ {
oss << q_("Type: <b>%1</b>").arg(q_("artificial satellite")) << "<br/>"; oss << q_("Type: <b>%1</b>").arg(q_("artificial satellite")) << "<br/>";
} }
if ((flags & Magnitude) && (stdMag!=99.f))
{
oss << q_("Approx. magnitude: <b>%1</b>").arg(QString::numbe
r(getVMagnitude(core), 'f', 2)) << "<br/>";
}
// Ra/Dec etc. // Ra/Dec etc.
oss << getPositionInfoString(core, flags); oss << getPositionInfoString(core, flags);
if (flags & Extra1) if (flags & Extra)
{ {
oss << "<br/>"; oss << "<br/>";
// TRANSLATORS: Slant range: distance between the satellite and the observer // TRANSLATORS: Slant range: distance between the satellite and the observer
oss << QString(q_("Range (km): %1")).arg(range, 5, 'f', 2); oss << QString(q_("Range (km): %1")).arg(range, 5, 'f', 2);
oss << "<br/>"; oss << "<br/>";
// TRANSLATORS: Rate at which the distance changes // TRANSLATORS: Rate at which the distance changes
oss << QString(q_("Range rate (km/s): %1")).arg(rangeRate, 5 , 'f', 3); oss << QString(q_("Range rate (km/s): %1")).arg(rangeRate, 5 , 'f', 3);
oss << "<br/>"; oss << "<br/>";
// TRANSLATORS: Satellite altitude // TRANSLATORS: Satellite altitude
oss << QString(q_("Altitude (km): %1")).arg(height, 5, 'f', 2); oss << QString(q_("Altitude (km): %1")).arg(height, 5, 'f', 2);
skipping to change at line 298 skipping to change at line 303
.arg(velocity[1], 5, 'f', 2) .arg(velocity[1], 5, 'f', 2)
.arg(velocity[2], 5, 'f', 2); .arg(velocity[2], 5, 'f', 2);
// TRANSLATORS: TEME is an Earth-centered inertial coordinat e system // TRANSLATORS: TEME is an Earth-centered inertial coordinat e system
oss << QString(q_("TEME velocity (km/s): %1")).arg(temeVel); oss << QString(q_("TEME velocity (km/s): %1")).arg(temeVel);
oss << "<br/>"; oss << "<br/>";
//Visibility: Full text //Visibility: Full text
//TODO: Move to a more prominent place. //TODO: Move to a more prominent place.
switch (visibility) switch (visibility)
{ {
case RADAR_SUN: case RADAR_SUN:
oss << q_("The satellite and the observer are in sun oss << q_("The satellite and the observer ar
light.") << "<br/>"; e in sunlight.") << "<br/>";
break; break;
case VISIBLE: case VISIBLE:
oss << q_("The satellite is visible.") << "<br/>"; oss << q_("The satellite is visible.") << "<
break; br/>";
case RADAR_NIGHT: break;
oss << q_("The satellite is eclipsed.") << "<br/>"; case RADAR_NIGHT:
break; oss << q_("The satellite is eclipsed.") << "
case NOT_VISIBLE: <br/>";
oss << q_("The satellite is not visible") << "<br/>" break;
; case NOT_VISIBLE:
break; oss << q_("The satellite is not visible") <<
default: "<br/>";
break; break;
default:
break;
} }
}
if (flags&Extra2 && comms.size() > 0) if (comms.size() > 0)
{
foreach(const CommLink &c, comms)
{ {
double dop = getDoppler(c.frequency); foreach(const CommLink &c, comms)
double ddop = dop;
char sign;
if (dop<0.)
{ {
sign='-'; double dop = getDoppler(c.frequency);
ddop*=-1; double ddop = dop;
char sign;
if (dop<0.)
{
sign='-';
ddop*=-1;
}
else
sign='+';
oss << "<br/>";
if (!c.modulation.isEmpty() && c.modulation
!= "") oss << " " << c.modulation;
if (!c.description.isEmpty() && c.descriptio
n != "") oss << " " << c.description;
if ((!c.modulation.isEmpty() && c.modulation
!= "") || (!c.description.isEmpty() && c.description != "")) oss << "<br/>
";
oss << QString(q_("%1 MHz (%2%3 kHz)"))
.arg(c.frequency, 8, 'f', 5)
.arg(sign)
.arg(ddop, 6, 'f', 3);
oss << "<br/>";
} }
else
sign='+';
oss << "<br/>";
if (!c.modulation.isEmpty() && c.modulation != "") o
ss << " " << c.modulation;
if (!c.description.isEmpty() && c.description != "")
oss << " " << c.description;
if ((!c.modulation.isEmpty() && c.modulation != "")
|| (!c.description.isEmpty() && c.description != "")) oss << "<br/>";
oss << QString(q_("%1 MHz (%2%3 kHz)"))
.arg(c.frequency, 8, 'f', 5)
.arg(sign)
.arg(ddop, 6, 'f', 3);
oss << "<br/>";
} }
} }
postProcessInfoString(str, flags); postProcessInfoString(str, flags);
return str; return str;
} }
Vec3d Satellite::getJ2000EquatorialPos(const StelCore* core) const Vec3d Satellite::getJ2000EquatorialPos(const StelCore* core) const
{ {
return core->altAzToJ2000(elAzPosition);; return core->altAzToJ2000(elAzPosition);;
} }
Vec3f Satellite::getInfoColor(void) const Vec3f Satellite::getInfoColor(void) const
{ {
return StelApp::getInstance().getVisionModeNight() ? Vec3f(0.6, 0.0, 0.0) : hintColor; return hintColor;
} }
float Satellite::getVMagnitude(const StelCore* core, bool withExtinction) c onst float Satellite::getVMagnitude(const StelCore* core) const
{ {
float extinctionMag=0.0; // track magnitude loss Q_UNUSED(core);
if (withExtinction && core->getSkyDrawer()->getFlagHasAtmosphere()) float vmag = 7.f; // Optimistic value of magnitude for artificial sa
{ tellite without data for standard magnitude
Vec3d altAz=getAltAzPosApparent(core); if (!realisticModeFlag)
altAz.normalize(); vmag = 5.0;
core->getSkyDrawer()->getExtinction().forward(&altAz[2], &extinction
Mag);
}
return 5.0 + extinctionMag; if (stdMag!=99.f)
{
// OK, artificial satellite has value for standard magnitude
if (visibility==VISIBLE)
{
// Calculation of approx. visual magnitude for artif
icial satellites
// described here: http://www.prismnet.com/~mmccants
/tles/mccdesc.html
double fracil = calculateIlluminatedFraction();
if (fracil==0)
fracil = 0.000001;
vmag = stdMag - 15.75 + 2.5 * std::log10(range * ran
ge / fracil);
}
else
vmag = 17.f; // Artificial satellite is invisible an
d 17 is hypothetical value of magnitude
}
return vmag;
}
// Calculate illumination fraction of artifical satellite
float Satellite::calculateIlluminatedFraction() const
{
return (1 + cos(phaseAngle))/2;
} }
double Satellite::getAngularSize(const StelCore*) const double Satellite::getAngularSize(const StelCore*) const
{ {
return 0.00001; return 0.00001;
} }
void Satellite::setNewTleElements(const QString& tle1, const QString& tle2) void Satellite::setNewTleElements(const QString& tle1, const QString& tle2)
{ {
if (pSatWrapper) if (pSatWrapper)
skipping to change at line 425 skipping to change at line 448
qWarning() << "Satellite has invalid orbit:" << name << id; qWarning() << "Satellite has invalid orbit:" << name << id;
orbitValid = false; orbitValid = false;
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();
// Compute orbit points to draw orbit line. // Compute orbit points to draw orbit line.
if (orbitDisplayed) computeOrbitPoints(); if (orbitDisplayed) computeOrbitPoints();
} }
} }
double Satellite::getDoppler(double freq) const double Satellite::getDoppler(double freq) const
{ {
double result; double result;
double f = freq * 1000000; double f = freq * 1000000;
skipping to change at line 511 skipping to change at line 535
if (comp > 0) if (comp > 0)
return false; return false;
// 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(const StelCore* core, StelRenderer* renderer, void Satellite::draw(StelCore* core, StelPainter& painter, float)
StelProjectorP projector, StelTextureNew* hintTexture)
{ {
if (core->getJDay() < jdLaunchYearJan1) return; if (core->getJDay() < jdLaunchYearJan1) return;
XYZ = getJ2000EquatorialPos(core); XYZ = getJ2000EquatorialPos(core);
Vec3f drawColor; StelSkyDrawer* sd = core->getSkyDrawer();
(visibility==RADAR_NIGHT) ? drawColor = Vec3f(0.2f,0.2f,0.2f) : draw Vec3f drawColor(0.2f,0.2f,0.2f);
Color = hintColor; if (visibility != RADAR_NIGHT)
StelApp::getInstance().getVisionModeNight() drawColor = hintColor;
? renderer->setGlobalColor(0.6,0.0,0.0,1.0) painter.setColor(drawColor[0], drawColor[1], drawColor[2], hintBrigh
: renderer->setGlobalColor(drawColor[0],drawColor[1],drawCol tness);
or[2], Satellite::hintBrightness);
Vec3d xy; StelProjectorP prj = core->getProjection(StelCore::FrameJ2000);
if (core->getProjection(StelCore::FrameJ2000)->project(XYZ,xy))
if (realisticModeFlag)
{ {
if (Satellite::showLabels) double mag = getVMagnitude(core);
RCMag rcMag;
Vec3f color = Vec3f(1.f,1.f,1.f);
StelProjectorP origP = painter.getProjector(); // Save proje
ctor state
painter.setProjector(prj);
sd->preDrawPointSource(&painter);
if (mag <= sd->getLimitMagnitude())
{ {
renderer->drawText(TextParams(xy[0], xy[1], name).sh sd->computeRCMag(mag, &rcMag);
ift(10, 10).useGravity()); sd->drawPointSource(&painter, Vec3f(XYZ[0], XYZ[1],
XYZ[2]), rcMag, color, true);
painter.setColor(color[0], color[1], color[2], 1);
if (Satellite::showLabels)
painter.drawText(XYZ, name, 0, 10, 10, false
);
} }
renderer->drawTexturedRect(xy[0] - 11, xy[1] - 11, 22, 22);
if (orbitDisplayed && Satellite::orbitLinesFlag) {drawOrbit( sd->postDrawPointSource(&painter);
renderer, projector);}
painter.setProjector(origP); // Restrore projector state
}
else
{
Vec3d xy;
if (prj->project(XYZ,xy))
{
if (Satellite::showLabels)
painter.drawText(xy[0], xy[1], name, 0, 10,
10, false);
Satellite::hintTexture->bind();
painter.drawSprite2dMode(xy[0], xy[1], 11);
}
} }
if (orbitDisplayed && Satellite::orbitLinesFlag) drawOrbit(painter);
} }
void Satellite::drawOrbit(StelRenderer* renderer, StelProjectorP projector) void Satellite::drawOrbit(StelPainter& painter)
{ {
Vec3d position,previousPosition; Vec3d position,previousPosition;
glDisable(GL_TEXTURE_2D);
QList<Vec3d>::iterator it= orbitPoints.begin(); QList<Vec3d>::iterator it= orbitPoints.begin();
//First point projection calculation //First point projection calculation
previousPosition.set(it->operator [](0), it->operator [](1), it->ope rator [](2)); previousPosition.set(it->operator [](0), it->operator [](1), it->ope rator [](2));
it++; it++;
StelVertexArray vertexArray;
vertexArray.primitiveType=StelVertexArray::Lines;
QVector<Vec3d> orbitArcPoints;
StelCircleArcRenderer circleArcRenderer(renderer, projector);
//Rest of points //Rest of points
for (int i=1; i<orbitPoints.size(); i++) for (int i=1; i<orbitPoints.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();
previousPosition.normalize(); previousPosition.normalize();
// Draw end (fading) parts of orbit lines one segment at a t ime. // Draw end (fading) parts of orbit lines one segment at a t ime.
if (i<=orbitLineFadeSegments || orbitLineSegments-i < orbitL ineFadeSegments) if (i<=orbitLineFadeSegments || orbitLineSegments-i < orbitL ineFadeSegments)
{ {
renderer->setGlobalColor((*orbitColor)[0], (*orbitCo painter.setColor(orbitColor[0], orbitColor[1], orbit
lor)[1], (*orbitColor)[2], Color[2], hintBrightness * calculateOrbitSegmentIntensity(i));
hintBrightness * calculateO painter.drawGreatCircleArc(previousPosition, positio
rbitSegmentIntensity(i)); n, &viewportHalfspace);
circleArcRenderer.drawGreatCircleArc(previousPositio
n, position, &viewportHalfspace);
} }
else else
{ {
orbitArcPoints << previousPosition << position; vertexArray.vertex << previousPosition << position;
} }
previousPosition = position; previousPosition = position;
} }
// Draw center section of orbit in one go // Draw center section of orbit in one go
renderer->setGlobalColor((*orbitColor)[0], (*orbitColor)[1], (*orbit painter.setColor(orbitColor[0], orbitColor[1], orbitColor[2], hintBr
Color)[2], ightness);
hintBrightness); painter.drawGreatCircleArcs(vertexArray, &viewportHalfspace);
circleArcRenderer.drawGreatCircleArcs(orbitArcPoints, PrimitiveType_
Lines, &viewportHalfspace); glEnable(GL_TEXTURE_2D);
} }
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
{ {
return (endDist + 1) / (orbitLineFadeSegments + 1.0); return (endDist + 1) / (orbitLineFadeSegments + 1.0);
} }
} }
void Satellite::setNightColors(bool night)
{
if (night)
orbitColor = &orbitColorNight;
else
orbitColor = &orbitColorNormal;
}
void Satellite::computeOrbitPoints() void Satellite::computeOrbitPoints()
{ {
gTimeSpan computeInterval(0, 0, 0, orbitLineSegmentDuration); gTimeSpan computeInterval(0, 0, 0, orbitLineSegmentDuration);
gTimeSpan orbitSpan(0, 0, 0, orbitLineSegments*orbitLineSegmentDurat ion/2); gTimeSpan orbitSpan(0, 0, 0, orbitLineSegments*orbitLineSegmentDurat ion/2);
gTime epochTm; gTime epochTm;
gTime epoch(epochTime); gTime epoch(epochTime);
gTime lastEpochComp(lastEpochCompForOrbit); gTime lastEpochComp(lastEpochCompForOrbit);
Vec3d elAzVector; Vec3d elAzVector;
int diffSlots; int diffSlots;
 End of changes. 43 change blocks. 
117 lines changed or deleted 169 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/