Nebula.cpp   Nebula.cpp 
skipping to change at line 48 skipping to change at line 48
#include <QBuffer> #include <QBuffer>
StelTextureSP Nebula::texCircle; StelTextureSP Nebula::texCircle;
StelTextureSP Nebula::texGalaxy; StelTextureSP Nebula::texGalaxy;
StelTextureSP Nebula::texOpenCluster; StelTextureSP Nebula::texOpenCluster;
StelTextureSP Nebula::texGlobularCluster; StelTextureSP Nebula::texGlobularCluster;
StelTextureSP Nebula::texPlanetaryNebula; StelTextureSP Nebula::texPlanetaryNebula;
StelTextureSP Nebula::texDiffuseNebula; StelTextureSP Nebula::texDiffuseNebula;
StelTextureSP Nebula::texDarkNebula; StelTextureSP Nebula::texDarkNebula;
StelTextureSP Nebula::texOpenClusterWithNebulosity; StelTextureSP Nebula::texOpenClusterWithNebulosity;
float Nebula::circleScale = 1.f;
bool Nebula::drawHintProportional = false; bool Nebula::drawHintProportional = false;
bool Nebula::surfaceBrightnessUsage = false; bool Nebula::surfaceBrightnessUsage = false;
float Nebula::hintsBrightness = 0; bool Nebula::designationUsage = false;
Vec3f Nebula::labelColor = Vec3f(0.4,0.3,0.5); float Nebula::hintsBrightness = 0.f;
Vec3f Nebula::circleColor = Vec3f(0.8,0.8,0.1); Vec3f Nebula::labelColor = Vec3f(0.4f,0.3f,0.5f);
Vec3f Nebula::galaxyColor = Vec3f(1.0,0.2,0.2); Vec3f Nebula::circleColor = Vec3f(0.8f,0.8f,0.1f);
Vec3f Nebula::radioGalaxyColor = Vec3f(0.3,0.3,0.3); Vec3f Nebula::galaxyColor = Vec3f(1.0f,0.2f,0.2f);
Vec3f Nebula::activeGalaxyColor = Vec3f(0.8,0.8,0.1); Vec3f Nebula::radioGalaxyColor = Vec3f(0.3f,0.3f,0.3f);
Vec3f Nebula::interactingGalaxyColor = Vec3f(0.8,0.8,0.1); Vec3f Nebula::activeGalaxyColor = Vec3f(0.8f,0.8f,0.1f);
Vec3f Nebula::quasarColor = Vec3f(1.0,0.2,0.2); Vec3f Nebula::interactingGalaxyColor = Vec3f(0.8f,0.8f,0.1f);
Vec3f Nebula::nebulaColor = Vec3f(0.1,1.0,0.1); Vec3f Nebula::quasarColor = Vec3f(1.0f,0.2f,0.2f);
Vec3f Nebula::planetaryNebulaColor = Vec3f(0.1,1.0,0.1); Vec3f Nebula::nebulaColor = Vec3f(0.1f,1.0f,0.1f);
Vec3f Nebula::reflectionNebulaColor = Vec3f(0.1,1.0,0.1); Vec3f Nebula::planetaryNebulaColor = Vec3f(0.1f,1.0f,0.1f);
Vec3f Nebula::bipolarNebulaColor = Vec3f(0.1,1.0,0.1); Vec3f Nebula::reflectionNebulaColor = Vec3f(0.1f,1.0f,0.1f);
Vec3f Nebula::emissionNebulaColor = Vec3f(0.1,1.0,0.1); Vec3f Nebula::bipolarNebulaColor = Vec3f(0.1f,1.0f,0.1f);
Vec3f Nebula::darkNebulaColor = Vec3f(0.3,0.3,0.3); Vec3f Nebula::emissionNebulaColor = Vec3f(0.1f,1.0f,0.1f);
Vec3f Nebula::hydrogenRegionColor = Vec3f(0.1,1.0,0.1); Vec3f Nebula::darkNebulaColor = Vec3f(0.3f,0.3f,0.3f);
Vec3f Nebula::supernovaRemnantColor = Vec3f(0.1,1.0,0.1); Vec3f Nebula::hydrogenRegionColor = Vec3f(0.1f,1.0f,0.1f);
Vec3f Nebula::interstellarMatterColor = Vec3f(0.1,1.0,0.1); Vec3f Nebula::supernovaRemnantColor = Vec3f(0.1f,1.0f,0.1f);
Vec3f Nebula::clusterWithNebulosityColor = Vec3f(0.1,1.0,0.1); Vec3f Nebula::interstellarMatterColor = Vec3f(0.1f,1.0f,0.1f);
Vec3f Nebula::clusterColor = Vec3f(1.0,1.0,0.1); Vec3f Nebula::clusterWithNebulosityColor = Vec3f(0.1f,1.0f,0.1f);
Vec3f Nebula::openClusterColor = Vec3f(1.0,1.0,0.1); Vec3f Nebula::clusterColor = Vec3f(1.0f,1.0f,0.1f);
Vec3f Nebula::globularClusterColor = Vec3f(1.0,1.0,0.1); Vec3f Nebula::openClusterColor = Vec3f(1.0f,1.0f,0.1f);
Vec3f Nebula::stellarAssociationColor = Vec3f(1.0,1.0,0.1); Vec3f Nebula::globularClusterColor = Vec3f(1.0f,1.0f,0.1f);
Vec3f Nebula::starCloudColor = Vec3f(1.0,1.0,0.1); Vec3f Nebula::stellarAssociationColor = Vec3f(1.0f,1.0f,0.1f);
Vec3f Nebula::emissionObjectColor = Vec3f(1.0,1.0,0.1); Vec3f Nebula::starCloudColor = Vec3f(1.0f,1.0f,0.1f);
Vec3f Nebula::blLacObjectColor = Vec3f(1.0,1.0,0.1); Vec3f Nebula::emissionObjectColor = Vec3f(1.0f,1.0f,0.1f);
Vec3f Nebula::blazarColor = Vec3f(1.0,1.0,0.1); Vec3f Nebula::blLacObjectColor = Vec3f(1.0f,1.0f,0.1f);
Vec3f Nebula::molecularCloudColor = Vec3f(1.0,1.0,0.1); Vec3f Nebula::blazarColor = Vec3f(1.0f,1.0f,0.1f);
Vec3f Nebula::youngStellarObjectColor = Vec3f(1.0,1.0,0.1); Vec3f Nebula::molecularCloudColor = Vec3f(1.0f,1.0f,0.1f);
Vec3f Nebula::possibleQuasarColor = Vec3f(1.0,0.2,0.2); Vec3f Nebula::youngStellarObjectColor = Vec3f(1.0f,1.0f,0.1f);
Vec3f Nebula::possiblePlanetaryNebulaColor = Vec3f(1.0,1.0,0.1); Vec3f Nebula::possibleQuasarColor = Vec3f(1.0f,0.2f,0.2f);
Vec3f Nebula::protoplanetaryNebulaColor = Vec3f(1.0,1.0,0.1); Vec3f Nebula::possiblePlanetaryNebulaColor = Vec3f(1.0f,1.0f,0.1f);
Vec3f Nebula::starColor = Vec3f(1.0,1.0,0.1); Vec3f Nebula::protoplanetaryNebulaColor = Vec3f(1.0f,1.0f,0.1f);
bool Nebula::flagUsageTypeFilter = false; Vec3f Nebula::starColor = Vec3f(1.0f,1.0f,0.1f);
bool Nebula::flagUseTypeFilters = false;
Nebula::CatalogGroup Nebula::catalogFilters = Nebula::CatalogGroup(0); Nebula::CatalogGroup Nebula::catalogFilters = Nebula::CatalogGroup(0);
Nebula::TypeGroup Nebula::typeFilters = Nebula::TypeGroup(Nebula::AllTypes) ; Nebula::TypeGroup Nebula::typeFilters = Nebula::TypeGroup(Nebula::AllTypes) ;
Nebula::Nebula() Nebula::Nebula()
: DSO_nb(0) : DSO_nb(0)
, M_nb(0) , M_nb(0)
, NGC_nb(0) , NGC_nb(0)
, IC_nb(0) , IC_nb(0)
, C_nb(0) , C_nb(0)
, B_nb(0) , B_nb(0)
skipping to change at line 202 skipping to change at line 202
if (vMag < 50.f && flags&Magnitude) if (vMag < 50.f && flags&Magnitude)
{ {
if (nType == NebDn) if (nType == NebDn)
{ {
oss << q_("Opacity: <b>%1</b>").arg(getVMagnitude(co re), 0, 'f', 2) << "<br>"; oss << q_("Opacity: <b>%1</b>").arg(getVMagnitude(co re), 0, 'f', 2) << "<br>";
} }
else else
{ {
if (core->getSkyDrawer()->getFlagHasAtmosphere() && (alt_app>-3.0*M_PI/180.0)) // Don't show extincted magnitude much below hor izon where model is meaningless. if (core->getSkyDrawer()->getFlagHasAtmosphere() && (alt_app>-3.0*M_PI/180.0)) // Don't show extincted magnitude much below hor izon where model is meaningless.
oss << q_("Magnitude: <b>%1</b> (extincted t oss << q_("Magnitude: <b>%1</b> (after extin
o: <b>%2</b>)").arg(QString::number(getVMagnitude(core), 'f', 2), ction: <b>%2</b>)").arg(QString::number(getVMagnitude(core), 'f', 2),
QString::number(getVMagnitudeWithExtinction(core), 'f', QString::number(getVMagnitudeWithExtinction(core),
2)) << "<br>"; 'f', 2)) << "<br>";
else else
oss << q_("Magnitude: <b>%1</b>").arg(getVMa gnitude(core), 0, 'f', 2) << "<br>"; oss << q_("Magnitude: <b>%1</b>").arg(getVMa gnitude(core), 0, 'f', 2) << "<br>";
} }
} }
if (bMag < 50.f && vMag > 50.f && flags&Magnitude) if (bMag < 50.f && vMag > 50.f && flags&Magnitude)
{ {
oss << q_("Magnitude: <b>%1</b>").arg(bMag, 0, 'f', 2) oss << q_("Magnitude: <b>%1</b>").arg(bMag, 0, 'f', 2)
<< q_(" (Photometric system: B)") << q_(" (Photometric system: B)")
<< "<br>"; << "<br>";
} }
if (flags&Extra) if (flags&Extra)
{ {
if (vMag < 50 && bMag < 50) if (vMag < 50 && bMag < 50)
oss << q_("Color Index (B-V): <b>%1</b>").arg(QStrin g::number(bMag-vMag, 'f', 2)) << "<br>"; oss << q_("Color Index (B-V): <b>%1</b>").arg(QStrin g::number(bMag-vMag, 'f', 2)) << "<br>";
} }
if (nType != NebDn && vMag < 50 && flags&Extra) if (nType != NebDn && vMag < 50 && flags&Extra)
{ {
if (core->getSkyDrawer()->getFlagHasAtmosphere() && (alt_app >-3.0*M_PI/180.0)) // Don't show extincted surface brightness much below ho rizon where model is meaningless. if (core->getSkyDrawer()->getFlagHasAtmosphere() && (alt_app >-3.0*M_PI/180.0)) // Don't show extincted surface brightness much below ho rizon where model is meaningless.
{ {
if (getSurfaceBrightness(core)<99 && getSurfaceBrigh tnessWithExtinction(core)<99) if (getSurfaceBrightness(core)<99 && getSurfaceBrigh tnessWithExtinction(core)<99)
oss << q_("Surface brightness: <b>%1</b> (ex oss << q_("Surface brightness: <b>%1</b> (af
tincted to: <b>%2</b>)").arg(QString::number(getSurfaceBrightness(core), 'f ter extinction: <b>%2</b>)").arg(QString::number(getSurfaceBrightness(core)
', 2), , 'f', 2),
QString::number(getSurfaceBrightnessWithExtinc QString::number(getSurfaceBrightnessWithEx
tion(core), 'f', 2)) << "<br>"; tinction(core), 'f', 2)) << "<br>";
} }
else else
{ {
if (getSurfaceBrightness(core)<99) if (getSurfaceBrightness(core)<99)
oss << q_("Surface brightness: <b>%1</b>").a rg(QString::number(getSurfaceBrightness(core), 'f', 2)) << "<br>"; oss << q_("Surface brightness: <b>%1</b>").a rg(QString::number(getSurfaceBrightness(core), 'f', 2)) << "<br>";
} }
} }
oss << getPositionInfoString(core, flags); oss << getPositionInfoString(core, flags);
skipping to change at line 274 skipping to change at line 274
if (oDistance==0.f) if (oDistance==0.f)
{ {
//TRANSLATORS: Unit of measure for distance - Light Years //TRANSLATORS: Unit of measure for distance - Light Years
oss << q_("Distance: %1 ly").arg(dx) << "<br >"; oss << q_("Distance: %1 ly").arg(dx) << "<br >";
} }
} }
if (oDistance>0.f) if (oDistance>0.f)
{ {
QString dx, du; QString dx, dy, du;
if (oDistanceErr>0.f) if (oDistanceErr>0.f)
{
dx = QString("%1%2%3").arg(QString::number(o Distance, 'f', 3)).arg(QChar(0x00B1)).arg(QString::number(oDistanceErr, 'f' , 3)); dx = QString("%1%2%3").arg(QString::number(o Distance, 'f', 3)).arg(QChar(0x00B1)).arg(QString::number(oDistanceErr, 'f' , 3));
dy = QString("%1%2%3").arg(QString::number(o
Distance*3262, 'f', 1)).arg(QChar(0x00B1)).arg(QString::number(oDistanceErr
*3262, 'f', 1));
}
else else
{
dx = QString("%1").arg(QString::number(oDist ance, 'f', 3)); dx = QString("%1").arg(QString::number(oDist ance, 'f', 3));
dy = QString("%1").arg(QString::number(oDist
ance*3262, 'f', 1));
}
if (nType==NebAGx || nType==NebGx || nType==NebRGx | | nType==NebIGx || nType==NebQSO || nType==NebISM) if (nType==NebAGx || nType==NebGx || nType==NebRGx | | nType==NebIGx || nType==NebQSO || nType==NebISM)
{ {
//TRANSLATORS: Unit of measure for distance - megaparsecs //TRANSLATORS: Unit of measure for distance - megaparsecs
du = q_("Mpc"); du = q_("Mpc");
} }
else else
{ {
//TRANSLATORS: Unit of measure for distance du = QString("%1 (%2 %3)")
- kiloparsecs //TRANSLATORS: Unit of measu
du = q_("kpc"); re for distance - kiloparsecs
.arg(q_("kpc"))
.arg(dy)
//TRANSLATORS: Unit of measu
re for distance - Light Years
.arg(q_("ly"));
} }
oss << q_("Distance: %1 %2").arg(dx).arg(du) << "<br >"; oss << q_("Distance: %1 %2").arg(dx).arg(du) << "<br >";
} }
} }
if (flags&Extra) if (flags&Extra)
{ {
if (redshift<99.f) if (redshift<99.f)
{ {
QString z; QString z;
if (redshiftErr>0.f) if (redshiftErr>0.f)
skipping to change at line 651 skipping to change at line 660
Vec3f col(labelColor[0], labelColor[1], labelColor[2]); Vec3f col(labelColor[0], labelColor[1], labelColor[2]);
if (objectInDisplayedType()) if (objectInDisplayedType())
sPainter.setColor(col[0], col[1], col[2], hintsBrightness); sPainter.setColor(col[0], col[1], col[2], hintsBrightness);
else else
sPainter.setColor(col[0], col[1], col[2], 0.f); sPainter.setColor(col[0], col[1], col[2], 0.f);
float size = getAngularSize(NULL)*M_PI/180.*sPainter.getProjector()- >getPixelPerRadAtCenter(); float size = getAngularSize(NULL)*M_PI/180.*sPainter.getProjector()- >getPixelPerRadAtCenter();
float shift = 4.f + (drawHintProportional ? size : size/1.8f); float shift = 4.f + (drawHintProportional ? size : size/1.8f);
QString str = getNameI18n(); QString str = getNameI18n();
if (str.isEmpty()) if (str.isEmpty() || designationUsage)
{ str = getDSODesignation();
// On screen label: one only, priority as given here.
if (catalogFilters&CatM && M_nb>0)
str = QString("M %1").arg(M_nb);
else if (catalogFilters&CatC && C_nb>0)
str = QString("C %1").arg(C_nb);
else if (catalogFilters&CatNGC && NGC_nb>0)
str = QString("NGC %1").arg(NGC_nb);
else if (catalogFilters&CatIC && IC_nb>0)
str = QString("IC %1").arg(IC_nb);
else if (catalogFilters&CatB && B_nb>0)
str = QString("B %1").arg(B_nb);
else if (catalogFilters&CatSh2 && Sh2_nb>0)
str = QString("Sh 2-%1").arg(Sh2_nb);
else if (catalogFilters&CatVdB && VdB_nb>0)
str = QString("VdB %1").arg(VdB_nb);
else if (catalogFilters&CatRCW && RCW_nb>0)
str = QString("RCW %1").arg(RCW_nb);
else if (catalogFilters&CatLDN && LDN_nb>0)
str = QString("LDN %1").arg(LDN_nb);
else if (catalogFilters&CatLBN && LBN_nb > 0)
str = QString("LBN %1").arg(LBN_nb);
else if (catalogFilters&CatCr && Cr_nb > 0)
str = QString("Cr %1").arg(Cr_nb);
else if (catalogFilters&CatMel && Mel_nb > 0)
str = QString("Mel %1").arg(Mel_nb);
else if (catalogFilters&CatPGC && PGC_nb > 0)
str = QString("PGC %1").arg(PGC_nb);
else if (catalogFilters&CatUGC && UGC_nb > 0)
str = QString("UGC %1").arg(UGC_nb);
else if (catalogFilters&CatCed && !Ced_nb.isEmpty())
str = QString("Ced %1").arg(Ced_nb);
}
sPainter.drawText(XY[0]+shift, XY[1]+shift, str, 0, 0, 0, false); sPainter.drawText(XY[0]+shift, XY[1]+shift, str, 0, 0, 0, false);
} }
QString Nebula::getDSODesignation()
{
QString str = "";
// Get designation for DSO with priority as given here.
if (catalogFilters&CatM && M_nb>0)
str = QString("M %1").arg(M_nb);
else if (catalogFilters&CatC && C_nb>0)
str = QString("C %1").arg(C_nb);
else if (catalogFilters&CatNGC && NGC_nb>0)
str = QString("NGC %1").arg(NGC_nb);
else if (catalogFilters&CatIC && IC_nb>0)
str = QString("IC %1").arg(IC_nb);
else if (catalogFilters&CatB && B_nb>0)
str = QString("B %1").arg(B_nb);
else if (catalogFilters&CatSh2 && Sh2_nb>0)
str = QString("Sh 2-%1").arg(Sh2_nb);
else if (catalogFilters&CatVdB && VdB_nb>0)
str = QString("VdB %1").arg(VdB_nb);
else if (catalogFilters&CatRCW && RCW_nb>0)
str = QString("RCW %1").arg(RCW_nb);
else if (catalogFilters&CatLDN && LDN_nb>0)
str = QString("LDN %1").arg(LDN_nb);
else if (catalogFilters&CatLBN && LBN_nb > 0)
str = QString("LBN %1").arg(LBN_nb);
else if (catalogFilters&CatCr && Cr_nb > 0)
str = QString("Cr %1").arg(Cr_nb);
else if (catalogFilters&CatMel && Mel_nb > 0)
str = QString("Mel %1").arg(Mel_nb);
else if (catalogFilters&CatPGC && PGC_nb > 0)
str = QString("PGC %1").arg(PGC_nb);
else if (catalogFilters&CatUGC && UGC_nb > 0)
str = QString("UGC %1").arg(UGC_nb);
else if (catalogFilters&CatCed && !Ced_nb.isEmpty())
str = QString("Ced %1").arg(Ced_nb);
return str;
}
void Nebula::readDSO(QDataStream &in) void Nebula::readDSO(QDataStream &in)
{ {
float ra, dec; float ra, dec;
unsigned int oType; unsigned int oType;
in >> DSO_nb >> ra >> dec >> bMag >> vMag >> oType >> mTypeStri ng >> majorAxisSize >> minorAxisSize in >> DSO_nb >> ra >> dec >> bMag >> vMag >> oType >> mTypeStri ng >> majorAxisSize >> minorAxisSize
>> orientationAngle >> redshift >> redshiftErr >> parallax > > parallaxErr >> oDistance >> oDistanceErr >> orientationAngle >> redshift >> redshiftErr >> parallax > > parallaxErr >> oDistance >> oDistanceErr
>> NGC_nb >> IC_nb >> M_nb >> C_nb >> B_nb >> Sh2_nb >> VdB_ nb >> RCW_nb >> LDN_nb >> LBN_nb >> Cr_nb >> NGC_nb >> IC_nb >> M_nb >> C_nb >> B_nb >> Sh2_nb >> VdB_ nb >> RCW_nb >> LDN_nb >> LBN_nb >> Cr_nb
>> Mel_nb >> PGC_nb >> UGC_nb >> Ced_nb; >> Mel_nb >> PGC_nb >> UGC_nb >> Ced_nb;
StelUtils::spheToRect(ra,dec,XYZ); StelUtils::spheToRect(ra,dec,XYZ);
Q_ASSERT(fabs(XYZ.lengthSquared()-1.)<0.000000001); Q_ASSERT(fabs(XYZ.lengthSquared()-1.)<0.000000001);
nType = (Nebula::NebulaType)oType; nType = (Nebula::NebulaType)oType;
pointRegion = SphericalRegionP(new SphericalPoint(getJ2000Equatorial Pos(NULL))); pointRegion = SphericalRegionP(new SphericalPoint(getJ2000Equatorial Pos(NULL)));
} }
bool Nebula::objectInDisplayedType() const bool Nebula::objectInDisplayedType() const
{ {
if (!flagUsageTypeFilter) if (!flagUseTypeFilters)
return true; return true;
bool r = false; bool r = false;
int cntype = -1; int cntype = -1;
switch (nType) switch (nType)
{ {
case NebGx: case NebGx:
cntype = 0; // Galaxies cntype = 0; // Galaxies
break; break;
case NebAGx: case NebAGx:
skipping to change at line 967 skipping to change at line 982
case 0: case 0:
rtx << qc_("the illuminating star is embedde d in the nebulosity", "Reflection Nebulae Classification"); rtx << qc_("the illuminating star is embedde d in the nebulosity", "Reflection Nebulae Classification");
break; break;
case 1: case 1:
rtx << qc_("star is located outside the illu minated nebulosity", "Reflection Nebulae Classification"); rtx << qc_("star is located outside the illu minated nebulosity", "Reflection Nebulae Classification");
break; break;
case 2: case 2:
rtx << qc_("star is located on the corner of the illuminated nebulosity", "Reflection Nebulae Classification"); rtx << qc_("star is located on the corner of the illuminated nebulosity", "Reflection Nebulae Classification");
break; break;
case 3: case 3:
{
// TRANSLATORS: peculiar: odd or unusual, cf
. peculiar star, peculiar galaxy
rtx << qc_("star is located outside the illu minated peculiar nebulosity", "Reflection Nebulae Classification"); rtx << qc_("star is located outside the illu minated peculiar nebulosity", "Reflection Nebulae Classification");
break; break;
}
case 4: case 4:
{
// TRANSLATORS: peculiar: odd or unusual, cf
. peculiar star, peculiar galaxy
rtx << qc_("the illuminated peculiar nebulos ity", "Reflection Nebulae Classification"); rtx << qc_("the illuminated peculiar nebulos ity", "Reflection Nebulae Classification");
break; break;
}
default: default:
rtx << qc_("undocumented reflection nebulae" , "Reflection Nebulae Classification"); rtx << qc_("undocumented reflection nebulae" , "Reflection Nebulae Classification");
break; break;
} }
r = rtx.join(",<br>"); r = rtx.join(",<br>");
} }
QRegExp HIIRx("\\.*(\\d+),\\s+(\\d+),\\s+(\\d+)\\.*"); QRegExp HIIRx("\\.*(\\d+),\\s+(\\d+),\\s+(\\d+)\\.*");
idx = HIIRx.indexIn(mTypeString); idx = HIIRx.indexIn(mTypeString);
if (idx>0) if (idx>0)
 End of changes. 18 change blocks. 
85 lines changed or deleted 112 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/