Supernova.cpp   Supernova.cpp 
skipping to change at line 27 skipping to change at line 27
*/ */
#include "Supernova.hpp" #include "Supernova.hpp"
#include "StelObject.hpp" #include "StelObject.hpp"
#include "StelApp.hpp" #include "StelApp.hpp"
#include "StelCore.hpp" #include "StelCore.hpp"
#include "StelUtils.hpp" #include "StelUtils.hpp"
#include "StelTranslator.hpp" #include "StelTranslator.hpp"
#include "StelModuleMgr.hpp" #include "StelModuleMgr.hpp"
#include "StelSkyDrawer.hpp" #include "StelSkyDrawer.hpp"
#include "StarMgr.hpp"
#include "StelRenderer.hpp" #include "StelRenderer.hpp"
#include "StelLocaleMgr.hpp"
#include <QTextStream> #include <QTextStream>
#include <QDebug> #include <QDebug>
#include <QVariant> #include <QVariant>
#include <QVariantMap> #include <QVariantMap>
#include <QVariant> #include <QVariant>
#include <QList> #include <QList>
Supernova::Supernova(const QVariantMap& map) Supernova::Supernova(const QVariantMap& map)
: initialized(false) : initialized(false)
skipping to change at line 99 skipping to change at line 101
QString Supernova::getEnglishName(void) const QString Supernova::getEnglishName(void) const
{ {
QString name = designation; QString name = designation;
if (note.size()!=0) if (note.size()!=0)
name = QString("%1 (%2)").arg(name).arg(note); name = QString("%1 (%2)").arg(name).arg(note);
return name; return name;
} }
QString Supernova::getMaxBrightnessDate(const double JD) const
{
return StelApp::getInstance().getLocaleMgr().getPrintableDateLocal(J
D);
}
QString Supernova::getInfoString(const StelCore* core, const InfoStringGrou p& flags) const QString Supernova::getInfoString(const StelCore* core, const InfoStringGrou p& flags) const
{ {
QString str; QString str;
QTextStream oss(&str); QTextStream oss(&str);
double mag = getVMagnitude(core, false); double mag = getVMagnitude(core, false);
if (flags&Name) if (flags&Name)
{ {
oss << "<h2>" << designation; oss << "<h2>" << designation;
if (note.size()!=0) if (note.size()!=0)
skipping to change at line 132 skipping to change at line 139
else else
oss << q_("Magnitude: <b>%1</b>").arg(mag, 0, 'f', 2) << "<b r>"; oss << q_("Magnitude: <b>%1</b>").arg(mag, 0, 'f', 2) << "<b r>";
} }
// Ra/Dec etc. // Ra/Dec etc.
oss << getPositionInfoString(core, flags); oss << getPositionInfoString(core, flags);
if (flags&Extra1) if (flags&Extra1)
{ {
oss << q_("Type of supernova: %1").arg(sntype) << "<br>"; oss << q_("Type of supernova: %1").arg(sntype) << "<br>";
oss << q_("Maximum brightness: %1").arg(getMaxBrightnessDate (peakJD)) << "<br>";
if (distance>0) if (distance>0)
oss << q_("Distance: %1 Light Years").arg(distance*1 000) << "<br>"; oss << q_("Distance: %1 Light Years").arg(distance*1 000) << "<br>";
} }
postProcessInfoString(str, flags); postProcessInfoString(str, flags);
return str; return str;
} }
Vec3f Supernova::getInfoColor(void) const Vec3f Supernova::getInfoColor(void) const
{ {
skipping to change at line 224 skipping to change at line 232
} }
void Supernova::update(double deltaTime) void Supernova::update(double deltaTime)
{ {
labelsFader.update((int)(deltaTime*1000)); labelsFader.update((int)(deltaTime*1000));
} }
void Supernova::draw(StelCore* core, StelRenderer* renderer, StelProjectorP projector) void Supernova::draw(StelCore* core, StelRenderer* renderer, StelProjectorP projector)
{ {
StelSkyDrawer* sd = core->getSkyDrawer(); StelSkyDrawer* sd = core->getSkyDrawer();
StarMgr* smgr = GETSTELMODULE(StarMgr); // It's need for checking di splaying of labels for stars
Vec3f color = Vec3f(1.f,1.f,1.f); Vec3f color = Vec3f(1.f,1.f,1.f);
if (StelApp::getInstance().getVisionModeNight()) if (StelApp::getInstance().getVisionModeNight())
color = StelUtils::getNightColor(color); color = StelUtils::getNightColor(color);
float rcMag[2], size, shift; float rcMag[2], size, shift;
double mag; double mag;
StelUtils::spheToRect(snra, snde, XYZ); StelUtils::spheToRect(snra, snde, XYZ);
mag = getVMagnitude(core, true); mag = getVMagnitude(core, true);
sd->preDrawPointSource(); sd->preDrawPointSource();
float mlimit = sd->getLimitMagnitude();
if (mag <= sd->getLimitMagnitude()) if (mag <= mlimit)
{ {
sd->computeRCMag(mag, rcMag); sd->computeRCMag(mag, rcMag);
const Vec3f XYZf(XYZ[0], XYZ[1], XYZ[2]); const Vec3f XYZf(XYZ[0], XYZ[1], XYZ[2]);
Vec3f win; Vec3f win;
if(sd->pointSourceVisible(&(*projector), XYZf, rcMag, false, win)) if(sd->pointSourceVisible(&(*projector), XYZf, rcMag, false, win))
{ {
sd->drawPointSource(win, rcMag, color); sd->drawPointSource(win, rcMag, color);
} }
renderer->setGlobalColor(color[0], color[1], color[2], 1); renderer->setGlobalColor(color[0], color[1], color[2], 1);
size = getAngularSize(NULL)*M_PI/180.*projector->getPixelPer RadAtCenter(); size = getAngularSize(NULL)*M_PI/180.*projector->getPixelPer RadAtCenter();
shift = 6.f + size/1.8f; shift = 6.f + size/1.8f;
if (labelsFader.getInterstate()<=0.f) if (labelsFader.getInterstate()<=0.f && (mag+5.f)<mlimit && smgr->getFlagLabels())
{ {
renderer->drawText(TextParams(XYZ, projector, design ation).shift(shift, shift).useGravity()); renderer->drawText(TextParams(XYZ, projector, design ation).shift(shift, shift).useGravity());
} }
} }
sd->postDrawPointSource(projector); sd->postDrawPointSource(projector);
} }
 End of changes. 8 change blocks. 
2 lines changed or deleted 13 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/