MeteorShower.cpp   MeteorShower.cpp 
skipping to change at line 58 skipping to change at line 58
qWarning() << "MeteorShower: INVALID meteor shower!" << map. value("showerID").toString(); qWarning() << "MeteorShower: INVALID meteor shower!" << map. value("showerID").toString();
qWarning() << "MeteorShower: Please, check your 'showers.jso n' catalog!"; qWarning() << "MeteorShower: Please, check your 'showers.jso n' catalog!";
return; return;
} }
m_showerID = map.value("showerID").toString(); m_showerID = map.value("showerID").toString();
m_designation = map.value("designation").toString(); m_designation = map.value("designation").toString();
m_speed = map.value("speed").toInt(); m_speed = map.value("speed").toInt();
m_radiantAlpha = StelUtils::getDecAngle(map.value("radiantAlpha").to String()); m_radiantAlpha = StelUtils::getDecAngle(map.value("radiantAlpha").to String());
m_radiantDelta = StelUtils::getDecAngle(map.value("radiantDelta").to String()); m_radiantDelta = StelUtils::getDecAngle(map.value("radiantDelta").to String());
// initialize position to keep valgrind happy
StelUtils::spheToRect(m_radiantAlpha, m_radiantDelta, m_position);
m_parentObj = map.value("parentObj").toString(); m_parentObj = map.value("parentObj").toString();
m_pidx = map.value("pidx").toFloat(); m_pidx = map.value("pidx").toFloat();
// the catalog (IMO) will give us the drift for a five-day interval from peak // the catalog (IMO) will give us the drift for a five-day interval from peak
m_driftAlpha = StelUtils::getDecAngle(map.value("driftAlpha").toStri ng()) / 5.f; m_driftAlpha = StelUtils::getDecAngle(map.value("driftAlpha").toStri ng()) / 5.f;
m_driftDelta = StelUtils::getDecAngle(map.value("driftDelta").toStri ng()) / 5.f; m_driftDelta = StelUtils::getDecAngle(map.value("driftDelta").toStri ng()) / 5.f;
m_rAlphaPeak = m_radiantAlpha; m_rAlphaPeak = m_radiantAlpha;
m_rDeltaPeak = m_radiantDelta; m_rDeltaPeak = m_radiantDelta;
skipping to change at line 197 skipping to change at line 199
m_colors.push_back(Meteor::ColorPair("white", 100)); m_colors.push_back(Meteor::ColorPair("white", 100));
} }
m_status = UNDEFINED; m_status = UNDEFINED;
} }
MeteorShower::~MeteorShower() MeteorShower::~MeteorShower()
{ {
qDeleteAll(m_activeMeteors); qDeleteAll(m_activeMeteors);
m_activeMeteors.clear(); m_activeMeteors.clear();
m_colors.clear();
} }
bool MeteorShower::enabled() const bool MeteorShower::enabled() const
{ {
if (m_status == INVALID) if (m_status == INVALID)
{ {
return false; return false;
} }
else if (m_status == UNDEFINED) else if (m_status == UNDEFINED)
{ {
skipping to change at line 268 skipping to change at line 271
double daysToPeak = currentJD - m_activity.peak.toJulianDay( ); double daysToPeak = currentJD - m_activity.peak.toJulianDay( );
m_radiantAlpha += m_driftAlpha * daysToPeak; m_radiantAlpha += m_driftAlpha * daysToPeak;
m_radiantDelta += m_driftDelta * daysToPeak; m_radiantDelta += m_driftDelta * daysToPeak;
} }
// step through and update all active meteors // step through and update all active meteors
foreach (MeteorObj* m, m_activeMeteors) foreach (MeteorObj* m, m_activeMeteors)
{ {
if (!m->update(deltaTime)) if (!m->update(deltaTime))
{ {
//important to delete when no longer active
delete m;
m_activeMeteors.removeOne(m); m_activeMeteors.removeOne(m);
} }
} }
// paused | forward | backward ? // paused | forward | backward ?
// don't create new meteors // don't create new meteors
if(!core->getRealTimeSpeed()) if(!core->getRealTimeSpeed())
{ {
return; return;
} }
skipping to change at line 331 skipping to change at line 336
} }
void MeteorShower::drawRadiant(StelCore *core) void MeteorShower::drawRadiant(StelCore *core)
{ {
StelPainter painter(core->getProjection(StelCore::FrameJ2000)); StelPainter painter(core->getProjection(StelCore::FrameJ2000));
Vec3d XY; Vec3d XY;
StelUtils::spheToRect(m_radiantAlpha, m_radiantDelta, m_position); StelUtils::spheToRect(m_radiantAlpha, m_radiantDelta, m_position);
painter.getProjector()->project(m_position, XY); painter.getProjector()->project(m_position, XY);
glEnable(GL_TEXTURE_2D); painter.setBlending(true, GL_SRC_ALPHA, GL_ONE);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
Vec3f rgb; Vec3f rgb;
float alpha = 0.85f + ((float) qrand() / (float) RAND_MAX) / 10.f; float alpha = 0.85f + ((float) qrand() / (float) RAND_MAX) / 10.f;
switch(m_status) switch(m_status)
{ {
case ACTIVE_CONFIRMED: //Active, confirmed data case ACTIVE_CONFIRMED: //Active, confirmed data
rgb = m_mgr->getColorARC(); rgb = m_mgr->getColorARC();
break; break;
case ACTIVE_GENERIC: //Active, generic data case ACTIVE_GENERIC: //Active, generic data
rgb = m_mgr->getColorARG(); rgb = m_mgr->getColorARG();
skipping to change at line 476 skipping to change at line 479
} }
float maxZHR = m_activity.zhr == -1 ? m_activity.variable.at(1) : m_ activity.zhr; float maxZHR = m_activity.zhr == -1 ? m_activity.variable.at(1) : m_ activity.zhr;
float minZHR = m_activity.zhr == -1 ? m_activity.variable.at(0) : 0; float minZHR = m_activity.zhr == -1 ? m_activity.variable.at(0) : 0;
float gaussian = maxZHR * qExp( - qPow(currentJD - peakJD, 2) / (2 * sd * sd) ) + minZHR; float gaussian = maxZHR * qExp( - qPow(currentJD - peakJD, 2) / (2 * sd * sd) ) + minZHR;
return qRound(gaussian); return qRound(gaussian);
} }
QString MeteorShower::getSolarLongitude(QDate date) const QString MeteorShower::getSolarLongitude(QDate date)
{ {
//The number of days (positive or negative) since Greenwich noon, //The number of days (positive or negative) since Greenwich noon,
//Terrestrial Time, on 1 January 2000 (J2000.0) //Terrestrial Time, on 1 January 2000 (J2000.0)
double n = date.toJulianDay() - 2451545.0; double n = date.toJulianDay() - 2451545.0;
//The mean longitude of the Sun, corrected for the aberration of lig ht //The mean longitude of the Sun, corrected for the aberration of lig ht
float l = 280.460 + 0.9856474 * n; float l = 280.460 + 0.9856474 * n;
// put it in the range 0 to 360 degrees // put it in the range 0 to 360 degrees
l /= 360.f; l /= 360.f;
skipping to change at line 632 skipping to change at line 635
} }
oss << "<br />"; oss << "<br />";
} }
} }
} }
postProcessInfoString(str, flags); postProcessInfoString(str, flags);
return str; return str;
} }
QVariantMap MeteorShower::getInfoMap(const StelCore *core) const
{
QVariantMap map = StelObject::getInfoMap(core);
if (enabled())
{
QString mstdata;
if (m_status == ACTIVE_GENERIC)
{
mstdata = "generic-data";
}
else if (m_status == ACTIVE_CONFIRMED)
{
mstdata = "confirmed-data";
}
else if (m_status == INACTIVE)
{
mstdata = "inactive";
}
map.insert("status", mstdata);
if (!m_showerID.toInt())
{
map.insert("id", m_showerID);
}
else
{
map.insert("id", "?");
}
map.insert("velocity", m_speed);
map.insert("population-index", m_pidx);
map.insert("parent", m_parentObj);
if(m_activity.zhr > 0)
{
map.insert("zhr-max", m_activity.zhr);
}
else
{
QString varStr="variable";
if(m_activity.variable.size() == 2)
{
varStr=QString("%1; %2-%3")
.arg("variable")
.arg(m_activity.variable.at(0))
.arg(m_activity.variable.at(1));
}
map.insert("zhr-max", varStr);
}
}
return map;
}
 End of changes. 6 change blocks. 
4 lines changed or deleted 7 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/