StarWrapper.cpp   StarWrapper.cpp 
skipping to change at line 43 skipping to change at line 43
template<typename T> inline bool isNan(T value) template<typename T> inline bool isNan(T value)
{ {
return value != value; return value != value;
} }
template<typename T> inline bool isInf(T value) template<typename T> inline bool isInf(T value)
{ {
return std::numeric_limits<T>::has_infinity && value == std::numeric _limits<T>::infinity(); return std::numeric_limits<T>::has_infinity && value == std::numeric _limits<T>::infinity();
} }
namespace BigStarCatalogExtension {
QString StarWrapperBase::getInfoString(const StelCore *core, const InfoStri ngGroup& flags) const QString StarWrapperBase::getInfoString(const StelCore *core, const InfoStri ngGroup& flags) const
{ {
QString str; QString str;
QTextStream oss(&str); QTextStream oss(&str);
if (flags&Extra1) if (flags&ObjectType)
{ {
oss << q_("Type: <b>%1</b>").arg(q_("star")) << "<br />"; oss << q_("Type: <b>%1</b>").arg(q_("star")) << "<br />";
} }
if (flags&Magnitude) if (flags&Magnitude)
{ {
oss << q_("Magnitude: <b>%1</b> (B-V: %2)").arg(QString::num ber(getVMagnitude(core, false), 'f', 2), QString::number(getBV(), 'f', 2)) << "<br>";
if (core->getSkyDrawer()->getFlagHasAtmosphere()) if (core->getSkyDrawer()->getFlagHasAtmosphere())
{ oss << q_("Magnitude: <b>%1</b> (extincted to: <b>%2
oss << q_("Apparent Magnitude: <b>%1</b> (by extinct </b>)")
ion)").arg(QString::number(getVMagnitude(core, true), 'f', 2)) << "<br>"; .arg(QString::number(getVMagnitude(core), 'f'
} , 2))
} .arg(QString::number(getVMagnitudeWithExtinct
oss << getPositionInfoString(core, flags); ion(core), 'f', 2)) << "<br>";
else
oss << q_("Magnitude: <b>%1</b>").arg(QString::numbe
r(getVMagnitude(core), 'f', 2)) << "<br>";
}
if (flags&Extra)
{
oss << q_("Color Index (B-V): <b>%1</b>").arg(QString::numbe
r(getBV(), 'f', 2)) << "<br>";
}
oss << getPositionInfoString(core, flags);
StelObject::postProcessInfoString(str, flags); StelObject::postProcessInfoString(str, flags);
return str; return str;
} }
QString StarWrapper1::getEnglishName(void) const QString StarWrapper1::getEnglishName(void) const
{ {
if (s->hip) if (s->hip)
return QString("HIP %1").arg(s->hip); return QString("HIP %1").arg(s->hip);
skipping to change at line 131 skipping to change at line 136
if (flags&CatalogNumber || (nameWasEmpty && (flags&Name))) if (flags&CatalogNumber || (nameWasEmpty && (flags&Name)))
oss << "HIP " << s->hip; oss << "HIP " << s->hip;
if (s->componentIds) if (s->componentIds)
oss << " " << StarMgr::convertToComponentIds(s->comp onentIds); oss << " " << StarMgr::convertToComponentIds(s->comp onentIds);
if ((flags&Name) || (flags&CatalogNumber)) if ((flags&Name) || (flags&CatalogNumber))
oss << "</h2>"; oss << "</h2>";
} }
bool ebsFlag = false; bool ebsFlag = false;
if (flags&Extra1) if (flags&ObjectType)
{ {
QString varstartype = ""; QString varstartype = "";
QString startype = ""; QString startype = "";
if(!varType.isEmpty()) if(!varType.isEmpty())
{ {
if (QString("FU GCAS I IA IB IN INA INB INT IT IN(YY ) IS ISA ISB RCB RS SDOR UV UVN WR").contains(varType)) if (QString("FU GCAS I IA IB IN INA INB INT IT IN(YY ) IS ISA ISB RCB RS SDOR UV UVN WR").contains(varType))
varstartype = q_("eruptive variable star"); varstartype = q_("eruptive variable star");
else if (QString("ACYG BCEP BCEPS CEP CEP(B) CW CWA CWB DCEP DCEPS DSCT DSCTC GDOR L LB LC M PVTEL RPHS RR RR(B) RRAB RRC RV RV A RVB SR SRA SRB SRC SRD SXPHE ZZ ZZA ZZB").contains(varType)) else if (QString("ACYG BCEP BCEPS CEP CEP(B) CW CWA CWB DCEP DCEPS DSCT DSCTC GDOR L LB LC M PVTEL RPHS RR RR(B) RRAB RRC RV RV A RVB SR SRA SRB SRC SRD SXPHE ZZ ZZA ZZB").contains(varType))
varstartype = q_("pulsating variable star"); varstartype = q_("pulsating variable star");
else if (QString("ACV, ACVO, BY, ELL, FKCOM, PSR, SX ARI").contains(varType)) else if (QString("ACV, ACVO, BY, ELL, FKCOM, PSR, SX ARI").contains(varType))
skipping to change at line 174 skipping to change at line 179
oss << q_("Type: <b>%1</b>").arg(varstartype ); oss << q_("Type: <b>%1</b>").arg(varstartype );
oss << " (" << varType << ")<br />"; oss << " (" << varType << ")<br />";
} else } else
oss << q_("Type: <b>%1</b>").arg(startype) << "<br / >"; oss << q_("Type: <b>%1</b>").arg(startype) << "<br / >";
} }
if (flags&Magnitude) if (flags&Magnitude)
{ {
if (core->getSkyDrawer()->getFlagHasAtmosphere()) if (core->getSkyDrawer()->getFlagHasAtmosphere())
oss << q_("Magnitude: <b>%1</b> (extincted to: <b>%2 oss << q_("Magnitude: <b>%1</b> (extincted to: <b>%2
</b>. B-V: <b>%3</b>)").arg(QString::number(getVMagnitude(core, false), 'f' </b>)").arg(QString::number(getVMagnitude(core), 'f', 2))
, 2), .arg(QString::number(getVMagnitudeWithExt
inction(core), 'f', 2)) << "<br>";
QString::number(getVMagnitude(core, true), 'f',
2),
QString::number(s->getBV(), 'f', 2)) << "<br>";
else else
oss << q_("Magnitude: <b>%1</b> (B-V: <b>%2</b>)").a oss << q_("Magnitude: <b>%1</b>").arg(QString::numbe
rg(QString::number(getVMagnitude(core, false), 'f', 2), r(getVMagnitude(core), 'f', 2)) << "<br>";
QString::number(s->getBV(), 'f', 2)) << "<br>";
} }
if ((flags&AbsoluteMagnitude) && s->plx && !isNan(s->plx) && !isInf( s->plx)) if ((flags&AbsoluteMagnitude) && s->plx && !isNan(s->plx) && !isInf( s->plx))
oss << q_("Absolute Magnitude: %1").arg(getVMagnitude(core, false)+5.*(1.+std::log10(0.00001*s->plx)), 0, 'f', 2) << "<br>"; oss << q_("Absolute Magnitude: %1").arg(getVMagnitude(core)+ 5.*(1.+std::log10(0.00001*s->plx)), 0, 'f', 2) << "<br>";
if (flags&Magnitude) if (flags&Extra)
{
oss << q_("Color Index (B-V): <b>%1</b>").arg(QString::numbe
r(s->getBV(), 'f', 2)) << "<br>";
}
if (flags&Extra)
{ {
if (!varType.isEmpty()) if (!varType.isEmpty())
{ {
float minimumM1 = minVMag; float minimumM1 = minVMag;
float minimumM2 = min2VMag; float minimumM2 = min2VMag;
if (magFlag==1) // Amplitude if (magFlag==1) // Amplitude
{ {
minimumM1 += maxVMag; minimumM1 += maxVMag;
minimumM2 += maxVMag; minimumM2 += maxVMag;
} }
if (min2VMag==99.f) if (min2VMag==99.f)
oss << q_("Magnitude range: <b>%1</b>%2<b>%3 </b> (Photometric system: %4)").arg(QString::number(maxVMag, 'f', 2)).arg(Q Char(0x00F7)).arg(QString::number(minimumM1, 'f', 2)).arg(photoVSys) << "<b r />"; oss << q_("Magnitude range: <b>%1</b>%2<b>%3 </b> (Photometric system: %4)").arg(QString::number(maxVMag, 'f', 2)).arg(Q Char(0x00F7)).arg(QString::number(minimumM1, 'f', 2)).arg(photoVSys) << "<b r />";
else else
oss << q_("Magnitude range: <b>%1</b>%2<b>%3 /%4</b> (Photometric system: %5)").arg(QString::number(maxVMag, 'f', 2)).ar g(QChar(0x00F7)).arg(QString::number(minimumM1, 'f', 2)).arg(QString::numbe r(minimumM2, 'f', 2)).arg(photoVSys) << "<br />"; oss << q_("Magnitude range: <b>%1</b>%2<b>%3 /%4</b> (Photometric system: %5)").arg(QString::number(maxVMag, 'f', 2)).ar g(QChar(0x00F7)).arg(QString::number(minimumM1, 'f', 2)).arg(QString::numbe r(minimumM2, 'f', 2)).arg(photoVSys) << "<br />";
} }
} }
oss << getPositionInfoString(core, flags); oss << getPositionInfoString(core, flags);
if (s->spInt && flags&Extra1)
{
oss << q_("Spectral Type: %1").arg(StarMgr::convertToSpectra
lType(s->spInt)) << "<br />";
}
if ((flags&Distance) && s->plx && !isNan(s->plx) && !isInf(s->plx)) if ((flags&Distance) && s->plx && !isNan(s->plx) && !isInf(s->plx))
oss << q_("Distance: %1 Light Years").arg((AU/(SPEED_OF_LIGH T*86400*365.25)) / (s->plx*((0.00001/3600)*(M_PI/180))), 0, 'f', 2) << "<br >"; oss << q_("Distance: %1 Light Years").arg((AU/(SPEED_OF_LIGH T*86400*365.25)) / (s->plx*((0.00001/3600)*(M_PI/180))), 0, 'f', 2) << "<br >";
if (s->plx && flags&Extra2) if (flags&Extra)
oss << q_("Parallax: %1\"").arg(0.00001*s->plx, 0, 'f', 5) <
< "<br />";
if (vEpoch>0 && flags&Extra1)
{ {
double vsEpoch = 2400000+vEpoch; if (s->spInt)
if (ebsFlag) oss << q_("Spectral Type: %1").arg(StarMgr::convertT
oss << q_("Epoch for minimum light: %1 JD").arg(QStr oSpectralType(s->spInt)) << "<br />";
ing::number(vsEpoch, 'f', 5)) << "<br />";
else
oss << q_("Epoch for maximum light: %1 JD").arg(QStr
ing::number(vsEpoch, 'f', 5)) << "<br />";
}
if (vPeriod>0 && flags&Extra1) if (s->plx)
oss << q_("Period: %1 days").arg(vPeriod) << "<br />"; oss << q_("Parallax: %1\"").arg(0.00001*s->plx, 0, '
f', 5) << "<br />";
if (vEpoch>0 && vPeriod>0 && flags&Extra1) if (vEpoch>0)
{ {
// Calculate next minimum or maximum light double vsEpoch = 2400000+vEpoch;
double vsEpoch = 2400000+vEpoch; if (ebsFlag)
int npDelta = (core->getJDay()-vsEpoch)/vPeriod; oss << q_("Epoch for minimum light: %1 JD").
double npDate = vsEpoch + ((npDelta+1)*vPeriod); arg(QString::number(vsEpoch, 'f', 5)) << "<br />";
QString nextDate = StelUtils::julianDayToISO8601String(npDat else
e).replace("T", " "); oss << q_("Epoch for maximum light: %1 JD").
if (ebsFlag) arg(QString::number(vsEpoch, 'f', 5)) << "<br />";
oss << q_("Next minimum light: %1 UTC").arg(nextDate }
) << "<br />";
else
oss << q_("Next maximum light: %1 UTC").arg(nextDate
) << "<br />";
}
if (vMm>0 && flags&Extra1) if (vPeriod>0)
{ oss << q_("Period: %1 days").arg(vPeriod) << "<br />
if (ebsFlag) ";
oss << q_("Duration of eclipse: %1%").arg(vMm) << "<
br />"; if (vEpoch>0 && vPeriod>0)
else {
oss << q_("Rising time: %1%").arg(vMm) << "<br />"; // Calculate next minimum or maximum light
double vsEpoch = 2400000+vEpoch;
int npDelta = (core->getJDay()-vsEpoch)/vPeriod;
double npDate = vsEpoch + ((npDelta+1)*vPeriod);
QString nextDate = StelUtils::julianDayToISO8601Stri
ng(npDate).replace("T", " ");
if (ebsFlag)
oss << q_("Next minimum light: %1 UTC").arg(
nextDate) << "<br />";
else
oss << q_("Next maximum light: %1 UTC").arg(
nextDate) << "<br />";
}
if (vMm>0)
{
if (ebsFlag)
oss << q_("Duration of eclipse: %1%").arg(vM
m) << "<br />";
else
oss << q_("Rising time: %1%").arg(vMm) << "<
br />";
}
} }
StelObject::postProcessInfoString(str, flags); StelObject::postProcessInfoString(str, flags);
return str; return str;
} }
StelObjectP Star1::createStelObject(const SpecialZoneArray<Star1> *a, StelObjectP Star1::createStelObject(const SpecialZoneArray<Star1> *a,
cons t SpecialZoneData<Star1> *z) const { cons t SpecialZoneData<Star1> *z) const {
return StelObjectP(new StarWrapper1(a,z,this), true); return StelObjectP(new StarWrapper1(a,z,this), true);
skipping to change at line 269 skipping to change at line 278
StelObjectP Star2::createStelObject(const SpecialZoneArray<Star2> *a, StelObjectP Star2::createStelObject(const SpecialZoneArray<Star2> *a,
cons t SpecialZoneData<Star2> *z) const { cons t SpecialZoneData<Star2> *z) const {
return StelObjectP(new StarWrapper2(a,z,this), true); return StelObjectP(new StarWrapper2(a,z,this), true);
} }
StelObjectP Star3::createStelObject(const SpecialZoneArray<Star3> *a, StelObjectP Star3::createStelObject(const SpecialZoneArray<Star3> *a,
cons t SpecialZoneData<Star3> *z) const { cons t SpecialZoneData<Star3> *z) const {
return StelObjectP(new StarWrapper3(a,z,this), true); return StelObjectP(new StarWrapper3(a,z,this), true);
} }
} // namespace BigStarCatalogExtension
 End of changes. 16 change blocks. 
68 lines changed or deleted 80 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/