MeteorShower.cpp   MeteorShower.cpp 
skipping to change at line 30 skipping to change at line 30
#include "MeteorShower.hpp" #include "MeteorShower.hpp"
#include "MeteorShowers.hpp" #include "MeteorShowers.hpp"
#include "StelApp.hpp" #include "StelApp.hpp"
#include "StelCore.hpp" #include "StelCore.hpp"
#include "StelModuleMgr.hpp" #include "StelModuleMgr.hpp"
#include "StelTexture.hpp" #include "StelTexture.hpp"
#include "StelUtils.hpp" #include "StelUtils.hpp"
StelTextureSP MeteorShower::radiantTexture; StelTextureSP MeteorShower::radiantTexture;
float MeteorShower::showLabels = true; bool MeteorShower::showLabels = true;
bool MeteorShower::radiantMarkerEnabled = true; bool MeteorShower::radiantMarkerEnabled = true;
bool MeteorShower::showActiveRadiantsOnly = true; bool MeteorShower::showActiveRadiantsOnly = true;
MeteorShower::MeteorShower(const QVariantMap& map) MeteorShower::MeteorShower(const QVariantMap& map)
: initialized(false) : initialized(false)
, active(false) , active(false)
, speed(0) , speed(0)
, rAlphaPeak(0) , rAlphaPeak(0)
, rDeltaPeak(0) , rDeltaPeak(0)
, driftAlpha(0) , driftAlpha(0)
skipping to change at line 95 skipping to change at line 95
colors.append(colorPair(color, intensity)); colors.append(colorPair(color, intensity));
} }
} }
updateCurrentData(getSkyQDateTime()); updateCurrentData(getSkyQDateTime());
// ensures that all objects will be drawn once // ensures that all objects will be drawn once
// that's to avoid crashes by trying select a nonexistent object // that's to avoid crashes by trying select a nonexistent object
StelPainter painter(StelApp::getInstance().getCore()->getProjection( StelCore::FrameJ2000)); StelPainter painter(StelApp::getInstance().getCore()->getProjection( StelCore::FrameJ2000));
draw(painter); draw(painter);
qsrand(QDateTime::currentMSecsSinceEpoch());
initialized = true; initialized = true;
} }
MeteorShower::~MeteorShower() MeteorShower::~MeteorShower()
{ {
// //
} }
QVariantMap MeteorShower::getMap(void) QVariantMap MeteorShower::getMap(void)
{ {
skipping to change at line 440 skipping to change at line 442
void MeteorShower::draw(StelPainter &painter) void MeteorShower::draw(StelPainter &painter)
{ {
StelUtils::spheToRect(radiantAlpha, radiantDelta, XYZ); StelUtils::spheToRect(radiantAlpha, radiantDelta, XYZ);
painter.getProjector()->project(XYZ, XY); painter.getProjector()->project(XYZ, XY);
glEnable(GL_BLEND); glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE); glBlendFunc(GL_SRC_ALPHA, GL_ONE);
qreal r, g, b; qreal r, g, b;
float alpha = 0.85f + ((double) rand() / (RAND_MAX))/10; float alpha = 0.85f + ((double) qrand() / (RAND_MAX))/10;
switch(status) switch(status)
{ {
case ACTIVE_REAL: //Active, real data case ACTIVE_REAL: //Active, real data
GETSTELMODULE(MeteorShowers)->getColorARR().getRgbF( &r,&g,&b); GETSTELMODULE(MeteorShowers)->getColorARR().getRgbF( &r,&g,&b);
break; break;
case ACTIVE_GENERIC: //Active, generic data case ACTIVE_GENERIC: //Active, generic data
GETSTELMODULE(MeteorShowers)->getColorARG().getRgbF( &r,&g,&b); GETSTELMODULE(MeteorShowers)->getColorARG().getRgbF( &r,&g,&b);
break; break;
default: //Inactive default: //Inactive
GETSTELMODULE(MeteorShowers)->getColorIR().getRgbF(& r,&g,&b); GETSTELMODULE(MeteorShowers)->getColorIR().getRgbF(& r,&g,&b);
} }
painter.setColor(r, g, b, alpha); painter.setColor(r, g, b, alpha);
Vec3d win; Vec3d win;
if (MeteorShower::radiantMarkerEnabled && painter.getProjector()->pr ojectCheck(XYZ, win)) if (MeteorShower::radiantMarkerEnabled && painter.getProjector()->pr ojectCheck(XYZ, win))
{ {
MeteorShower::radiantTexture->bind(); MeteorShower::radiantTexture->bind();
painter.drawSprite2dMode(XY[0], XY[1], 10); painter.drawSprite2dMode(XY[0], XY[1], 45);
if (MeteorShower::showLabels) if (MeteorShower::showLabels)
{ {
float size = getAngularSize(NULL)*M_PI/180.*painter. getProjector()->getPixelPerRadAtCenter(); float size = getAngularSize(NULL)*M_PI/180.*painter. getProjector()->getPixelPerRadAtCenter();
float shift = 8.f + size/1.8f; float shift = 8.f + size/1.8f;
painter.drawText(XY[0]+shift, XY[1]+shift, getNameI1 8n(), 0, 0, 0, false); painter.drawText(XY[0]+shift, XY[1]+shift, getNameI1 8n(), 0, 0, 0, false);
} }
} }
} }
 End of changes. 4 change blocks. 
3 lines changed or deleted 5 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/