Nebula.cpp   Nebula.cpp 
skipping to change at line 85 skipping to change at line 85
Vec3f Nebula::starCloudColor = Vec3f(1.0f,1.0f,0.1f); Vec3f Nebula::starCloudColor = Vec3f(1.0f,1.0f,0.1f);
Vec3f Nebula::emissionObjectColor = Vec3f(1.0f,1.0f,0.1f); Vec3f Nebula::emissionObjectColor = Vec3f(1.0f,1.0f,0.1f);
Vec3f Nebula::blLacObjectColor = Vec3f(1.0f,1.0f,0.1f); Vec3f Nebula::blLacObjectColor = Vec3f(1.0f,1.0f,0.1f);
Vec3f Nebula::blazarColor = Vec3f(1.0f,1.0f,0.1f); Vec3f Nebula::blazarColor = Vec3f(1.0f,1.0f,0.1f);
Vec3f Nebula::molecularCloudColor = Vec3f(1.0f,1.0f,0.1f); Vec3f Nebula::molecularCloudColor = Vec3f(1.0f,1.0f,0.1f);
Vec3f Nebula::youngStellarObjectColor = Vec3f(1.0f,1.0f,0.1f); Vec3f Nebula::youngStellarObjectColor = Vec3f(1.0f,1.0f,0.1f);
Vec3f Nebula::possibleQuasarColor = Vec3f(1.0f,0.2f,0.2f); Vec3f Nebula::possibleQuasarColor = Vec3f(1.0f,0.2f,0.2f);
Vec3f Nebula::possiblePlanetaryNebulaColor = Vec3f(1.0f,1.0f,0.1f); Vec3f Nebula::possiblePlanetaryNebulaColor = Vec3f(1.0f,1.0f,0.1f);
Vec3f Nebula::protoplanetaryNebulaColor = Vec3f(1.0f,1.0f,0.1f); Vec3f Nebula::protoplanetaryNebulaColor = Vec3f(1.0f,1.0f,0.1f);
Vec3f Nebula::starColor = Vec3f(1.0f,1.0f,0.1f); Vec3f Nebula::starColor = Vec3f(1.0f,1.0f,0.1f);
Vec3f Nebula::symbioticStarColor = Vec3f(1.0f,1.0f,0.1f);
Vec3f Nebula::emissionLineStarColor = Vec3f(1.0f,1.0f,0.1f);
Vec3f Nebula::supernovaCandidateColor = Vec3f(0.1f,1.0f,0.1f);
Vec3f Nebula::supernovaRemnantCandidateColor = Vec3f(0.1f,1.0f,0.1f);
Vec3f Nebula::galaxyClusterColor = Vec3f(0.8f,0.8f,0.5f);
bool Nebula::flagUseTypeFilters = false; 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) ;
bool Nebula::flagUseArcsecSurfaceBrightness = false; bool Nebula::flagUseArcsecSurfaceBrightness = false;
bool Nebula::flagUseShortNotationSurfaceBrightness = true;
bool Nebula::flagUseOutlines = false;
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)
, Sh2_nb(0) , Sh2_nb(0)
, VdB_nb(0) , VdB_nb(0)
skipping to change at line 110 skipping to change at line 117
, LDN_nb(0) , LDN_nb(0)
, LBN_nb(0) , LBN_nb(0)
, Cr_nb(0) , Cr_nb(0)
, Mel_nb(0) , Mel_nb(0)
, PGC_nb(0) , PGC_nb(0)
, UGC_nb(0) , UGC_nb(0)
, Arp_nb(0) , Arp_nb(0)
, VV_nb(0) , VV_nb(0)
, Ced_nb("") , Ced_nb("")
, PK_nb("") , PK_nb("")
, PNG_nb("")
, SNRG_nb("")
, ACO_nb("")
, withoutID(false) , withoutID(false)
, nameI18("") , nameI18("")
, mTypeString() , mTypeString()
, bMag(99.) , bMag(99.)
, vMag(99.) , vMag(99.)
, majorAxisSize(0.) , majorAxisSize(0.)
, minorAxisSize(0.) , minorAxisSize(0.)
, orientationAngle(0) , orientationAngle(0)
, oDistance(0.) , oDistance(0.)
, oDistanceErr(0.) , oDistanceErr(0.)
, redshift(99.) , redshift(99.)
, redshiftErr(0.) , redshiftErr(0.)
, parallax(0.) , parallax(0.)
, parallaxErr(0.) , parallaxErr(0.)
, nType() , nType()
{ {
outlineSegments.clear();
} }
Nebula::~Nebula() Nebula::~Nebula()
{ {
} }
QString Nebula::getInfoString(const StelCore *core, const InfoStringGroup& flags) const QString Nebula::getInfoString(const StelCore *core, const InfoStringGroup& flags) const
{ {
QString str; QString str;
QTextStream oss(&str); QTextStream oss(&str);
skipping to change at line 190 skipping to change at line 201
if (UGC_nb > 0) if (UGC_nb > 0)
catIds << QString("UGC %1").arg(UGC_nb); catIds << QString("UGC %1").arg(UGC_nb);
if (!Ced_nb.isEmpty()) if (!Ced_nb.isEmpty())
catIds << QString("Ced %1").arg(Ced_nb); catIds << QString("Ced %1").arg(Ced_nb);
if (Arp_nb > 0) if (Arp_nb > 0)
catIds << QString("Arp %1").arg(Arp_nb); catIds << QString("Arp %1").arg(Arp_nb);
if (VV_nb > 0) if (VV_nb > 0)
catIds << QString("VV %1").arg(VV_nb); catIds << QString("VV %1").arg(VV_nb);
if (!PK_nb.isEmpty()) if (!PK_nb.isEmpty())
catIds << QString("PK %1").arg(PK_nb); catIds << QString("PK %1").arg(PK_nb);
if (!PNG_nb.isEmpty())
catIds << QString("PN G%1").arg(PNG_nb);
if (!SNRG_nb.isEmpty())
catIds << QString("SNR G%1").arg(SNRG_nb);
if (!ACO_nb.isEmpty())
catIds << QString("ACO %1").arg(ACO_nb);
if (!nameI18.isEmpty() && !catIds.isEmpty() && flags&Name) if (!nameI18.isEmpty() && !catIds.isEmpty() && flags&Name)
oss << "<br>"; oss << "<br>";
oss << catIds.join(" - "); oss << catIds.join(" - ");
} }
if ((flags&Name) || (flags&CatalogNumber)) if ((flags&Name) || (flags&CatalogNumber))
oss << "</h2>"; oss << "</h2>";
if (flags&ObjectType) if (flags&ObjectType)
{ {
QString mt = getMorphologicalTypeString(); QString mt = getMorphologicalTypeString();
if (mt.isEmpty()) if (mt.isEmpty())
oss << q_("Type: <b>%1</b>").arg(getTypeString()) << "<br>"; oss << QString("%1: <b>%2</b>").arg(q_("Type"), getT ypeString()) << "<br>";
else else
oss << q_("Type: <b>%1</b> (%2)").arg(getTypeString( )).arg(mt) << "<br>"; oss << QString("%1: <b>%2</b> (%3)").arg(q_("Type"), getTypeString(), mt) << "<br>";
} }
if (vMag < 50.f && flags&Magnitude) if (vMag < 50.f && flags&Magnitude)
{ {
QString emag = "";
QString tmag = q_("Magnitude");
if (nType == NebDn) if (nType == NebDn)
{ tmag = q_("Opacity");
oss << q_("Opacity: <b>%1</b>").arg(getVMagnitude(co
re), 0, 'f', 2) << "<br>"; if (nType != NebDn && core->getSkyDrawer()->getFlagHasAtmosp
} here() && (alt_app>-3.0*M_PI/180.0)) // Don't show extincted magnitude much
else below horizon where model is meaningless.
{ emag = QString(" (%1: <b>%2</b>)").arg(q_("extincted
if (core->getSkyDrawer()->getFlagHasAtmosphere() && to"), QString::number(getVMagnitudeWithExtinction(core), 'f', 2));
(alt_app>-3.0*M_PI/180.0)) // Don't show extincted magnitude much below hor
izon where model is meaningless. oss << QString("%1: <b>%2</b>%3").arg(tmag, QString::number(
oss << q_("Magnitude: <b>%1</b> (after extin getVMagnitude(core), 'f', 2), emag) << "<br />";
ction: <b>%2</b>)").arg(QString::number(getVMagnitude(core), 'f', 2),
QString::number(getVMagnitudeWithExtinction(core),
'f', 2)) << "<br>";
else
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 << QString("%1: <b>%2</b> (%3: B)").arg(q_("Magnitude"),
oss << q_("Magnitude: <b>%1</b>").arg(bMag, 0, 'f', 2) QString::number(bMag, 'f', 2), q_("Photometric system")) << "<br />";
<< q_(" (Photometric system: B)")
<< "<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 << QString("%1: <b>%2</b>").arg(q_("Color Index (B-V)"), QString::number(bMag-vMag, 'f', 2)) << "<br />";
} }
float mmag = qMin(vMag,bMag); float mmag = qMin(vMag,bMag);
if (nType != NebDn && mmag < 50 && flags&Extra) if (nType != NebDn && mmag < 50 && flags&Extra)
{ {
QString sb = q_("Surface brightness"); QString sb = q_("Surface brightness");
QString ae = q_("after extinction"); QString ae = q_("after extinction");
QString mu = QString("<sup>m</sup>/%1'").arg(QChar(0x2B1C)); QString mu;
if (flagUseArcsecSurfaceBrightness) if (flagUseShortNotationSurfaceBrightness)
mu = QString("<sup>m</sup>/%1\"").arg(QChar(0x2B1C))
;
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) mu = QString("<sup>m</sup>/%1'").arg(QChar(0x2B1C));
{ if (flagUseArcsecSurfaceBrightness)
if (getSurfaceBrightnessWithExtinction(core) mu = QString("<sup>m</sup>/%1\"").arg(QChar(
<99) 0x2B1C));
oss << QString("%1: <b>%2</b> %5 (%3
: <b>%4</b> %5)").arg(sb, QString::number(getSurfaceBrightness(core, flagUs
eArcsecSurfaceBrightness), 'f', 2),
ae, QString::number(getSurfaceBrightnessWithExtinctio
n(core, flagUseArcsecSurfaceBrightness), 'f', 2), mu) << "<br>";
else
oss << QString("%1: <b>%2</b> %3").a
rg(sb, QString::number(getSurfaceBrightness(core, flagUseArcsecSurfaceBrigh
tness), 'f', 2), mu) << "<br>";
oss << q_("Contrast index: %1").arg(QString:
:number(getContrastIndex(core), 'f', 2)) << "<br />";
}
} }
else else
{ {
if (getSurfaceBrightness(core)<99) mu = QString("%1/%2<sup>2</sup>").arg(qc_("mag", "ma
gnitude"), q_("arcmin"));
if (flagUseArcsecSurfaceBrightness)
mu = QString("%1/%2<sup>2</sup>").arg(qc_("m
ag", "magnitude"), q_("arcsec"));
}
if (getSurfaceBrightness(core)<99)
{
if (core->getSkyDrawer()->getFlagHasAtmosphere() &&
(alt_app>-3.0*M_PI/180.0) && getSurfaceBrightnessWithExtinction(core)<99) /
/ Don't show extincted surface brightness much below horizon where model is
meaningless.
{ {
oss << QString("%1: <b>%2</b> %3").arg(sb, Q oss << QString("%1: <b>%2</b> %5 (%3: <b>%4<
String::number(getSurfaceBrightness(core, flagUseArcsecSurfaceBrightness), /b> %5)").arg(sb, QString::number(getSurfaceBrightness(core, flagUseArcsecS
'f', 2), mu) << "<br>"; urfaceBrightness), 'f', 2),
oss << q_("Contrast index: %1").arg(QString:
:number(getContrastIndex(core), 'f', 2)) << "<br />"; ae, QString::number(getSurfaceBrightnessWithExtinction(core,
flagUseArcsecSurfaceBrightness), 'f', 2), mu) << "<br />";
} }
else
oss << QString("%1: <b>%2</b> %3").arg(sb, Q
String::number(getSurfaceBrightness(core, flagUseArcsecSurfaceBrightness),
'f', 2), mu) << "<br />";
oss << QString("%1: %2").arg(q_("Contrast index"), Q
String::number(getContrastIndex(core), 'f', 2)) << "<br />";
} }
} }
oss << getPositionInfoString(core, flags); oss << getCommonInfoString(core, flags);
if (majorAxisSize>0 && flags&Size) if (majorAxisSize>0 && flags&Size)
{ {
if (majorAxisSize==minorAxisSize || minorAxisSize==0.f) if (majorAxisSize==minorAxisSize || minorAxisSize==0.f)
oss << q_("Size: %1").arg(StelUtils::radToDmsStr(maj orAxisSize*M_PI/180.)) << "<br>"; oss << QString("%1: %2").arg(q_("Size"), StelUtils:: radToDmsStr(majorAxisSize*M_PI/180.)) << "<br />";
else else
{ {
oss << q_("Size: %1 x %2").arg(StelUtils::radToDmsSt oss << QString("%1: %2 x %3").arg(q_("Size"), StelUt
r(majorAxisSize*M_PI/180.)).arg(StelUtils::radToDmsStr(minorAxisSize*M_PI/1 ils::radToDmsStr(majorAxisSize*M_PI/180.), StelUtils::radToDmsStr(minorAxis
80.)) << "<br>"; Size*M_PI/180.)) << "<br />";
if (orientationAngle>0.f) if (orientationAngle>0)
oss << q_("Orientation angle: %1%2").arg(ori oss << QString("%1: %2%3").arg(q_("Orientati
entationAngle).arg(QChar(0x00B0)) << "<br>"; on angle")).arg(orientationAngle).arg(QChar(0x00B0)) << "<br />";
} }
} }
if (flags&Distance) if (flags&Distance)
{ {
if (parallax!=0.f) if (parallax!=0.f)
{ {
QString dx; QString dx;
// distance in light years from parallax // distance in light years from parallax
float distance = 3.162e-5/(qAbs(parallax)*4.848e-9); float distance = 3.162e-5/(qAbs(parallax)*4.848e-9);
skipping to change at line 300 skipping to change at line 313
if (parallaxErr>0.f) if (parallaxErr>0.f)
distanceErr = 3.162e-5/(qAbs(parallaxErr)*4. 848e-9); distanceErr = 3.162e-5/(qAbs(parallaxErr)*4. 848e-9);
if (distanceErr>0.f) if (distanceErr>0.f)
dx = QString("%1%2%3").arg(QString::number(d istance, 'f', 3)).arg(QChar(0x00B1)).arg(QString::number(distanceErr, 'f', 3)); dx = QString("%1%2%3").arg(QString::number(d istance, 'f', 3)).arg(QChar(0x00B1)).arg(QString::number(distanceErr, 'f', 3));
else else
dx = QString("%1").arg(QString::number(dista nce, 'f', 3)); dx = QString("%1").arg(QString::number(dista nce, 'f', 3));
if (oDistance==0.f) if (oDistance==0.f)
{ {
//TRANSLATORS: Unit of measure for distance // TRANSLATORS: Unit of measure for distance
- Light Years - Light Years
oss << q_("Distance: %1 ly").arg(dx) << "<br QString ly = qc_("ly", "distance");
>"; oss << QString("%1: %2 %3").arg(q_("Distance
"), dx, ly) << "<br />";
} }
} }
if (oDistance>0.f) if (oDistance>0.f)
{ {
QString dx, dy; QString dx, dy;
float dc = 3262.f; float dc = 3262.f;
int ms = 1; int ms = 1;
//TRANSLATORS: Unit of measure for distance - kilopa rsecs //TRANSLATORS: Unit of measure for distance - kilopa rsecs
QString dupc = q_("kpc"); QString dupc = qc_("kpc", "distance");
//TRANSLATORS: Unit of measure for distance - Light Years //TRANSLATORS: Unit of measure for distance - Light Years
QString duly = q_("ly"); QString duly = qc_("ly", "distance");
if (nType==NebAGx || nType==NebGx || nType==NebRGx | | nType==NebIGx || nType==NebQSO || nType==NebPossQSO) if (nType==NebAGx || nType==NebGx || nType==NebRGx | | nType==NebIGx || nType==NebQSO || nType==NebPossQSO)
{ {
dc = 3.262f; dc = 3.262f;
ms = 3; ms = 3;
//TRANSLATORS: Unit of measure for distance - Megaparsecs //TRANSLATORS: Unit of measure for distance - Megaparsecs
dupc = q_("Mpc"); dupc = qc_("Mpc", "distance");
//TRANSLATORS: Unit of measure for distance - Millions of Light Years //TRANSLATORS: Unit of measure for distance - Millions of Light Years
duly = q_("Mio. ly"); duly = qc_("Mio. ly", "distance");
} }
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*dc, 'f', ms)).arg(QChar(0x00B1)).arg(QString::number(oDistanceErr* dc, 'f', ms)); dy = QString("%1%2%3").arg(QString::number(o Distance*dc, 'f', ms)).arg(QChar(0x00B1)).arg(QString::number(oDistanceErr* dc, 'f', ms));
} }
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*dc, 'f', ms)); dy = QString("%1").arg(QString::number(oDist ance*dc, 'f', ms));
} }
oss << q_("Distance: %1 %2 (%3 %4)").arg(dx).arg(dup c).arg(dy).arg(duly) << "<br>"; oss << QString("%1: %2 %3 (%4 %5)").arg(q_("Distance "), dx, dupc, dy, duly) << "<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)
z = QString("%1%2%3").arg(QString::number(re dshift, 'f', 6)).arg(QChar(0x00B1)).arg(QString::number(redshiftErr, 'f', 6 )); z = QString("%1%2%3").arg(QString::number(re dshift, 'f', 6)).arg(QChar(0x00B1)).arg(QString::number(redshiftErr, 'f', 6 ));
else else
z = QString("%1").arg(QString::number(redshi ft, 'f', 6)); z = QString("%1").arg(QString::number(redshi ft, 'f', 6));
oss << q_("Redshift: %1").arg(z) << "<br>"; oss << QString("%1: %2").arg(q_("Redshift"), z) << " <br />";
} }
if (parallax!=0.f) if (parallax!=0.f)
{ {
QString px; QString px;
if (parallaxErr>0.f) if (parallaxErr>0.f)
px = QString("%1%2%3").arg(QString::number(q Abs(parallax)*0.001, 'f', 5)).arg(QChar(0x00B1)).arg(QString::number(parall axErr*0.001, 'f', 5)); px = QString("%1%2%3").arg(QString::number(q Abs(parallax)*0.001, 'f', 5)).arg(QChar(0x00B1)).arg(QString::number(parall axErr*0.001, 'f', 5));
else else
px = QString("%1").arg(QString::number(qAbs( parallax)*0.001, 'f', 5)); px = QString("%1").arg(QString::number(qAbs( parallax)*0.001, 'f', 5));
oss << q_("Parallax: %1\"").arg(px) << "<br>"; oss << QString("%1: %2\"").arg(q_("Parallax"), px) < < "<br />";
} }
if (!getMorphologicalTypeDescription().isEmpty()) if (!getMorphologicalTypeDescription().isEmpty())
oss << q_("Morphological description: ") << getMorph ologicalTypeDescription() << ".<br>"; oss << QString("%1: %2.").arg(q_("Morphological desc ription"), getMorphologicalTypeDescription()) << "<br />";
} }
postProcessInfoString(str, flags); postProcessInfoString(str, flags);
return str; return str;
} }
QVariantMap Nebula::getInfoMap(const StelCore *core) const QVariantMap Nebula::getInfoMap(const StelCore *core) const
{ {
skipping to change at line 417 skipping to change at line 431
float Nebula::getVMagnitude(const StelCore* core) const float Nebula::getVMagnitude(const StelCore* core) const
{ {
Q_UNUSED(core); Q_UNUSED(core);
return vMag; return vMag;
} }
double Nebula::getAngularSize(const StelCore *) const double Nebula::getAngularSize(const StelCore *) const
{ {
float size = majorAxisSize; float size = majorAxisSize;
if (majorAxisSize!=minorAxisSize || minorAxisSize>0) if (majorAxisSize!=minorAxisSize || minorAxisSize>0)
size = (majorAxisSize+minorAxisSize)/2.f; size = majorAxisSize+minorAxisSize;
return size*0.5f; return size*0.5f;
} }
float Nebula::getSelectPriority(const StelCore* core) const float Nebula::getSelectPriority(const StelCore* core) const
{ {
const NebulaMgr* nebMgr = ((NebulaMgr*)StelApp::getInstance().getMod uleMgr().getModule("NebulaMgr")); const NebulaMgr* nebMgr = ((NebulaMgr*)StelApp::getInstance().getMod uleMgr().getModule("NebulaMgr"));
// minimize unwanted selection of the deep-sky objects // minimize unwanted selection of the deep-sky objects
if (!nebMgr->getFlagHints()) if (!nebMgr->getFlagHints())
return StelObject::getSelectPriority(core)+3.f; return StelObject::getSelectPriority(core)+3.f;
if (!objectInDisplayedType())
return StelObject::getSelectPriority(core)+3.f;
const float maxMagHint = nebMgr->computeMaxMagHint(core->getSkyDrawe
r());
// make very easy to select if labeled
float lim, mag; float lim, mag;
lim = mag = getVMagnitude(core); lim = mag = getVMagnitude(core);
float mLim = 15.0f;
if (!objectInDisplayedCatalog() || !objectInDisplayedType())
return StelObject::getSelectPriority(core)+mLim;
const StelSkyDrawer* drawer = core->getSkyDrawer();
if (drawer->getFlagNebulaMagnitudeLimit() && (mag>drawer->getCustomN
ebulaMagnitudeLimit()))
return StelObject::getSelectPriority(core)+mLim;
const float maxMagHint = nebMgr->computeMaxMagHint(drawer);
// make very easy to select if labeled
if (surfaceBrightnessUsage) if (surfaceBrightnessUsage)
{
lim = mag = getSurfaceBrightness(core); lim = mag = getSurfaceBrightness(core);
mLim += 1.f;
}
if (nType==NebDn) if (nType==NebDn)
lim=15.0f - mag - 2.0f*qMin(1.5f, majorAxisSize); // Note th at "mag" field is used for opacity in this catalog! lim=mLim - mag - 2.0f*qMin(1.5f, majorAxisSize); // Note tha t "mag" field is used for opacity in this catalog!
else if (nType==NebHII) // Sharpless and LBN else if (nType==NebHII) // Sharpless and LBN
lim=10.0f - 2.0f*qMin(1.5f, majorAxisSize); // Unfortunately , in Sh catalog, we always have mag=99=unknown! lim=10.0f - 2.0f*qMin(1.5f, majorAxisSize); // Unfortunately , in Sh catalog, we always have mag=99=unknown!
if (std::min(15.f, lim)<maxMagHint) if (std::min(mLim, lim)<maxMagHint || outlineSegments.size()>0) // H igh priority for big DSO (with outlines)
return -10.f; return -10.f;
else else
return StelObject::getSelectPriority(core)-2.f; return StelObject::getSelectPriority(core)-2.f;
} }
Vec3f Nebula::getInfoColor(void) const Vec3f Nebula::getInfoColor(void) const
{ {
return ((NebulaMgr*)StelApp::getInstance().getModuleMgr().getModule( "NebulaMgr"))->getLabelsColor(); return ((NebulaMgr*)StelApp::getInstance().getModuleMgr().getModule( "NebulaMgr"))->getLabelsColor();
} }
skipping to change at line 466 skipping to change at line 490
{ {
return majorAxisSize>0 ? majorAxisSize * 4 : 1; return majorAxisSize>0 ? majorAxisSize * 4 : 1;
} }
float Nebula::getSurfaceBrightness(const StelCore* core, bool arcsec) const float Nebula::getSurfaceBrightness(const StelCore* core, bool arcsec) const
{ {
float mag = getVMagnitude(core); float mag = getVMagnitude(core);
float sq = 3600.f; // arcmin^2 float sq = 3600.f; // arcmin^2
if (arcsec) if (arcsec)
sq = 12.96e6; // 3600.f*3600.f, i.e. arcsec^2 sq = 12.96e6; // 3600.f*3600.f, i.e. arcsec^2
if (bMag < 50.f && mag > 50.f) if (bMag < 90.f && mag > 90.f)
mag = bMag; mag = bMag;
if (mag<99.f && majorAxisSize>0 && nType!=NebDn) if (mag<99.f && majorAxisSize>0 && nType!=NebDn)
return mag + 2.5*log10(getSurfaceArea()*sq); return mag + 2.5*log10(getSurfaceArea()*sq);
else else
return 99.f; return 99.f;
} }
float Nebula::getSurfaceBrightnessWithExtinction(const StelCore* core, bool arcsec) const float Nebula::getSurfaceBrightnessWithExtinction(const StelCore* core, bool arcsec) const
{ {
float sq = 3600.f; // arcmin^2 float sq = 3600.f; // arcmin^2
skipping to change at line 507 skipping to change at line 531
} }
float Nebula::getSurfaceArea(void) const float Nebula::getSurfaceArea(void) const
{ {
if (majorAxisSize==minorAxisSize || minorAxisSize==0) if (majorAxisSize==minorAxisSize || minorAxisSize==0)
return M_PI*(majorAxisSize/2.f)*(majorAxisSize/2.f); // S = pi*R^2 = pi*(D/2)^2 return M_PI*(majorAxisSize/2.f)*(majorAxisSize/2.f); // S = pi*R^2 = pi*(D/2)^2
else else
return M_PI*(majorAxisSize/2.f)*(minorAxisSize/2.f); // S = pi*a*b return M_PI*(majorAxisSize/2.f)*(minorAxisSize/2.f); // S = pi*a*b
} }
void Nebula::drawHints(StelPainter& sPainter, float maxMagHints) const Vec3f Nebula::getHintColor(void) const
{ {
StelCore* core = StelApp::getInstance().getCore(); Vec3f color=circleColor;
switch (nType)
{
case NebGx:
color=galaxyColor;
break;
case NebIGx:
color=interactingGalaxyColor;
break;
case NebAGx:
color=activeGalaxyColor;
break;
case NebQSO:
color=quasarColor;
break;
case NebPossQSO:
color=possibleQuasarColor;
break;
case NebBLL:
color=blLacObjectColor;
break;
case NebBLA:
color=blazarColor;
break;
case NebRGx:
color=radioGalaxyColor;
break;
case NebOc:
color=openClusterColor;
break;
case NebSA:
color=stellarAssociationColor;
break;
case NebSC:
color=starCloudColor;
break;
case NebCl:
color=clusterColor;
break;
case NebGc:
color=globularClusterColor;
break;
case NebN:
color=nebulaColor;
break;
case NebHII:
color=hydrogenRegionColor;
break;
case NebMolCld:
color=molecularCloudColor;
break;
case NebYSO:
color=youngStellarObjectColor;
break;
case NebRn:
color=reflectionNebulaColor;
break;
case NebSNR:
color=supernovaRemnantColor;
break;
case NebBn:
color=bipolarNebulaColor;
break;
case NebEn:
color=emissionNebulaColor;
break;
case NebPn:
color=planetaryNebulaColor;
break;
case NebPossPN:
color=possiblePlanetaryNebulaColor;
break;
case NebPPN:
color=protoplanetaryNebulaColor;
break;
case NebDn:
color=darkNebulaColor;
break;
case NebCn:
color=clusterWithNebulosityColor;
break;
case NebEMO:
color=emissionObjectColor;
break;
case NebStar:
color=starColor;
break;
case NebSymbioticStar:
color=symbioticStarColor;
break;
case NebEmissionLineStar:
color=emissionLineStarColor;
break;
case NebSNC:
color=supernovaCandidateColor;
break;
case NebSNRC:
color=supernovaRemnantCandidateColor;
break;
case NebGxCl:
color=galaxyClusterColor;
break;
default:
color=circleColor;
}
Vec3d win; return color;
// Check visibility of DSO hints }
if (!(sPainter.getProjector()->projectCheck(XYZ, win)))
return; float Nebula::getVisibilityLevelByMagnitude(void) const
{
StelCore* core = StelApp::getInstance().getCore();
float lim = qMin(vMag, bMag); float lim = qMin(vMag, bMag);
float mLim = 15.0f;
if (surfaceBrightnessUsage) if (surfaceBrightnessUsage)
{ {
lim = getSurfaceBrightness(core) - 3.f; lim = getSurfaceBrightness(core) - 3.f;
if (lim > 50) lim = 16.f; if (lim > 90) lim = mLim + 1.f;
} }
else else
{ {
float mag = getVMagnitude(core); float mag = getVMagnitude(core);
if (lim > 50) lim = 15.f; if (lim > 90) lim = mLim;
// Dark nebulae. Not sure how to assess visibility from opac ity? --GZ // Dark nebulae. Not sure how to assess visibility from opac ity? --GZ
if (nType==NebDn) if (nType==NebDn)
{ {
// GZ: ad-hoc visibility formula: assuming good visi bility if objects of mag9 are visible, "usual" opacity 5 and size 30', bett er visibility (discernability) comes with higher opacity and larger size, // GZ: ad-hoc visibility formula: assuming good visi bility if objects of mag9 are visible, "usual" opacity 5 and size 30', bett er visibility (discernability) comes with higher opacity and larger size,
// 9-(opac-5)-2*(angularSize-0.5) // 9-(opac-5)-2*(angularSize-0.5)
// GZ Not good for non-Barnards. weak opacity and la rge surface are antagonists. (some LDN are huge, but opacity 2 is not much to discern). // GZ Not good for non-Barnards. weak opacity and la rge surface are antagonists. (some LDN are huge, but opacity 2 is not much to discern).
// The qMin() maximized the visibility gain for larg e objects. // The qMin() maximized the visibility gain for larg e objects.
if (majorAxisSize>0 && mag<50) if (majorAxisSize>0 && mag<90)
lim = 15.0f - mag - 2.0f*qMin(majorAxisSize, lim = mLim - mag - 2.0f*qMin(majorAxisSize,
1.5f); 1.5f);
else if (B_nb>0) else if (B_nb>0)
lim = 9.0f; lim = 9.0f;
else else
lim= 12.0f; // GZ I assume LDN objects are r ather elusive. lim= 12.0f; // GZ I assume LDN objects are r ather elusive.
} }
else if (nType==NebHII) // NebHII={Sharpless, LBN, RCW} else if (nType==NebHII) // NebHII={Sharpless, LBN, RCW}
{ // artificially increase visibility of (most) Sharpless ob jects? No magnitude recorded:-( { // artificially increase visibility of (most) Sharpless ob jects? No magnitude recorded:-(
lim=9.0f; lim=9.0f;
} }
} }
if (lim>maxMagHints) return lim;
}
void Nebula::drawOutlines(StelPainter &sPainter, float maxMagHints) const
{
size_t segments = outlineSegments.size();
Vec3f color = getHintColor();
// tune limits for outlines
float oLim = getVisibilityLevelByMagnitude() - 3.f;
float lum = 1.f;
Vec3f col(color[0]*lum*hintsBrightness, color[1]*lum*hintsBrightness
, color[2]*lum*hintsBrightness);
if (!objectInDisplayedType())
col = Vec3f(0.f,0.f,0.f);
sPainter.setColor(col[0], col[1], col[2], 1);
// Show outlines
if (segments>0 && flagUseOutlines && oLim<=maxMagHints)
{
unsigned int i, j;
Vec3f pt1, pt2;
Vec3d ptd1, ptd2;
std::vector<Vec3f> *points;
sPainter.setBlending(true);
sPainter.setLineSmooth(true);
const SphericalCap& viewportHalfspace = sPainter.getProjecto
r()->getBoundingCap();
for (i=0;i<segments;i++)
{
points = outlineSegments[i];
for (j=0;j<points->size()-1;j++)
{
pt1 = points->at(j);
pt2 = points->at(j+1);
ptd1.set(pt1[0], pt1[1], pt1[2]);
ptd2.set(pt2[0], pt2[1], pt2[2]);
sPainter.drawGreatCircleArc(ptd1, ptd2, &vie
wportHalfspace);
}
}
sPainter.setLineSmooth(false);
}
}
void Nebula::drawHints(StelPainter& sPainter, float maxMagHints) const
{
size_t segments = outlineSegments.size();
Vec3d win;
// Check visibility of DSO hints
if (!(sPainter.getProjector()->projectCheck(XYZ, win)))
return; return;
sPainter.setBlending(true, GL_ONE, GL_ONE); if (getVisibilityLevelByMagnitude()>maxMagHints)
float lum = 1.f;//qMin(1,4.f/getOnScreenSize(core))*0.8; return;
Vec3f color=circleColor; Vec3f color = getHintColor();
switch (nType) switch (nType)
{ {
case NebGx: case NebGx:
Nebula::texGalaxy->bind(); Nebula::texGalaxy->bind();
color=galaxyColor;
break; break;
case NebIGx: case NebIGx:
Nebula::texGalaxy->bind(); Nebula::texGalaxy->bind();
color=interactingGalaxyColor;
break; break;
case NebAGx: case NebAGx:
Nebula::texGalaxy->bind(); Nebula::texGalaxy->bind();
color=activeGalaxyColor;
break; break;
case NebQSO: case NebQSO:
Nebula::texGalaxy->bind(); Nebula::texGalaxy->bind();
color=quasarColor;
break; break;
case NebPossQSO: case NebPossQSO:
Nebula::texGalaxy->bind(); Nebula::texGalaxy->bind();
color=possibleQuasarColor;
break; break;
case NebBLL: case NebBLL:
Nebula::texGalaxy->bind(); Nebula::texGalaxy->bind();
color=blLacObjectColor;
break; break;
case NebBLA: case NebBLA:
Nebula::texGalaxy->bind(); Nebula::texGalaxy->bind();
color=blazarColor;
break; break;
case NebRGx: case NebRGx:
Nebula::texGalaxy->bind(); Nebula::texGalaxy->bind();
color=radioGalaxyColor;
break; break;
case NebOc: case NebOc:
Nebula::texOpenCluster->bind(); Nebula::texOpenCluster->bind();
color=openClusterColor;
break; break;
case NebSA: case NebSA:
Nebula::texOpenCluster->bind(); Nebula::texOpenCluster->bind();
color=stellarAssociationColor;
break; break;
case NebSC: case NebSC:
Nebula::texOpenCluster->bind(); Nebula::texOpenCluster->bind();
color=starCloudColor;
break; break;
case NebCl: case NebCl:
Nebula::texOpenCluster->bind(); Nebula::texOpenCluster->bind();
color=clusterColor;
break; break;
case NebGc: case NebGc:
Nebula::texGlobularCluster->bind(); Nebula::texGlobularCluster->bind();
color=globularClusterColor;
break; break;
case NebN: case NebN:
Nebula::texDiffuseNebula->bind(); Nebula::texDiffuseNebula->bind();
color=nebulaColor;
break; break;
case NebHII: case NebHII:
Nebula::texDiffuseNebula->bind(); Nebula::texDiffuseNebula->bind();
color=hydrogenRegionColor;
break; break;
case NebMolCld: case NebMolCld:
Nebula::texDiffuseNebula->bind(); Nebula::texDiffuseNebula->bind();
color=molecularCloudColor;
break; break;
case NebYSO: case NebYSO:
Nebula::texDiffuseNebula->bind(); Nebula::texDiffuseNebula->bind();
color=youngStellarObjectColor;
break; break;
case NebRn: case NebRn:
Nebula::texDiffuseNebula->bind(); Nebula::texDiffuseNebula->bind();
color=reflectionNebulaColor;
break; break;
case NebSNR: case NebSNR:
Nebula::texDiffuseNebula->bind(); Nebula::texDiffuseNebula->bind();
color=supernovaRemnantColor;
break; break;
case NebBn: case NebBn:
Nebula::texDiffuseNebula->bind(); Nebula::texDiffuseNebula->bind();
color=bipolarNebulaColor;
break; break;
case NebEn: case NebEn:
Nebula::texDiffuseNebula->bind(); Nebula::texDiffuseNebula->bind();
color=emissionNebulaColor;
break; break;
case NebPn: case NebPn:
Nebula::texPlanetaryNebula->bind(); Nebula::texPlanetaryNebula->bind();
color=planetaryNebulaColor;
break; break;
case NebPossPN: case NebPossPN:
Nebula::texPlanetaryNebula->bind(); Nebula::texPlanetaryNebula->bind();
color=possiblePlanetaryNebulaColor;
break; break;
case NebPPN: case NebPPN:
Nebula::texPlanetaryNebula->bind(); Nebula::texPlanetaryNebula->bind();
color=protoplanetaryNebulaColor;
break; break;
case NebDn: case NebDn:
Nebula::texDarkNebula->bind(); Nebula::texDarkNebula->bind();
color=darkNebulaColor;
break; break;
case NebCn: case NebCn:
Nebula::texOpenClusterWithNebulosity->bind(); Nebula::texOpenClusterWithNebulosity->bind();
color=clusterWithNebulosityColor;
break; break;
case NebEMO: case NebEMO:
Nebula::texCircle->bind(); Nebula::texCircle->bind();
color=emissionObjectColor; break;
case NebStar:
Nebula::texCircle->bind();
break;
case NebSymbioticStar:
Nebula::texCircle->bind();
break;
case NebEmissionLineStar:
Nebula::texCircle->bind();
break;
case NebSNC:
Nebula::texDiffuseNebula->bind();
break;
case NebSNRC:
Nebula::texDiffuseNebula->bind();
break;
case NebGxCl:
Nebula::texGalaxy->bind();
break; break;
default: default:
Nebula::texCircle->bind(); Nebula::texCircle->bind();
} }
float lum = 1.f;
Vec3f col(color[0]*lum*hintsBrightness, color[1]*lum*hintsBrightness , color[2]*lum*hintsBrightness); Vec3f col(color[0]*lum*hintsBrightness, color[1]*lum*hintsBrightness , color[2]*lum*hintsBrightness);
if (!objectInDisplayedType()) if (!objectInDisplayedType())
col = Vec3f(0.f,0.f,0.f); col = Vec3f(0.f,0.f,0.f);
sPainter.setColor(col[0], col[1], col[2], 1); sPainter.setColor(col[0], col[1], col[2], 1);
float size = 6.0f; float size = 6.0f;
float scaledSize = 0.0f; float scaledSize = 0.0f;
if (drawHintProportional) if (drawHintProportional && segments==0)
{ {
if (majorAxisSize>0.) if (majorAxisSize>0.)
scaledSize = majorAxisSize *0.5 *M_PI/180.*sPainter. getProjector()->getPixelPerRadAtCenter(); scaledSize = majorAxisSize *0.5 *M_PI/180.*sPainter. getProjector()->getPixelPerRadAtCenter();
else else
scaledSize = minorAxisSize *0.5 *M_PI/180.*sPainter. getProjector()->getPixelPerRadAtCenter(); scaledSize = minorAxisSize *0.5 *M_PI/180.*sPainter. getProjector()->getPixelPerRadAtCenter();
} }
sPainter.setBlending(true, GL_ONE, GL_ONE);
// Rotation looks good only for galaxies. // Rotation looks good only for galaxies.
if ((nType <=NebQSO) || (nType==NebBLA) || (nType==NebBLL) ) if ((nType <=NebQSO) || (nType==NebBLA) || (nType==NebBLL) )
{ {
// The rotation angle in drawSprite2dMode() is relative to s creen. Make sure to compute correct angle from 90+orientationAngle. // The rotation angle in drawSprite2dMode() is relative to s creen. Make sure to compute correct angle from 90+orientationAngle.
// Find an on-screen direction vector from a point offset so mewhat in declination from our object. // Find an on-screen direction vector from a point offset so mewhat in declination from our object.
Vec3d XYZrel(XYZ); Vec3d XYZrel(XYZ);
XYZrel[2]*=0.99; XYZrel[2]*=0.99;
Vec3d XYrel; Vec3d XYrel;
sPainter.getProjector()->project(XYZrel, XYrel); sPainter.getProjector()->project(XYZrel, XYrel);
float screenAngle=atan2(XYrel[1]-XY[1], XYrel[0]-XY[0]); float screenAngle=atan2(XYrel[1]-XY[1], XYrel[0]-XY[0]);
sPainter.drawSprite2dMode(XY[0], XY[1], qMax(size, scaledSiz e), screenAngle*180./M_PI + orientationAngle); sPainter.drawSprite2dMode(XY[0], XY[1], qMax(size, scaledSiz e), screenAngle*180./M_PI + orientationAngle);
} }
else // no galaxy else // no galaxy
sPainter.drawSprite2dMode(XY[0], XY[1], qMax(size, scaledSiz e)); sPainter.drawSprite2dMode(XY[0], XY[1], qMax(size, scaledSiz e));
} }
void Nebula::drawLabel(StelPainter& sPainter, float maxMagLabel) const void Nebula::drawLabel(StelPainter& sPainter, float maxMagLabel) const
{ {
StelCore* core = StelApp::getInstance().getCore();
Vec3d win; Vec3d win;
// Check visibility of DSO labels // Check visibility of DSO labels
if (!(sPainter.getProjector()->projectCheck(XYZ, win))) if (!(sPainter.getProjector()->projectCheck(XYZ, win)))
return; return;
float lim = qMin(vMag, bMag); if (getVisibilityLevelByMagnitude()>maxMagLabel)
if (surfaceBrightnessUsage)
{
lim = getSurfaceBrightness(core) - 3.f;
if (lim > 50) lim = 16.f;
}
else
{
float mag = getVMagnitude(core);
if (lim > 50) lim = 15.f;
// Dark nebulae. Not sure how to assess visibility from opac
ity? --GZ
if (nType==NebDn)
{
// GZ: ad-hoc visibility formula: assuming good visi
bility if objects of mag9 are visible, "usual" opacity 5 and size 30', bett
er visibility (discernability) comes with higher opacity and larger size,
// 9-(opac-5)-2*(angularSize-0.5)
if (majorAxisSize>0 && mag<50)
lim = 15.0f - mag - 2.0f*qMin(majorAxisSize,
2.5f);
else if (B_nb>0)
lim = 9.0f;
else
lim= 12.0f; // GZ I assume some LDN objects
are rather elusive.
}
else if (nType==NebHII)
lim=9.0f;
}
if (lim>maxMagLabel)
return; return;
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(Q_NULLPTR)*M_PI/180.*sPainter.getProject or()->getPixelPerRadAtCenter(); float size = getAngularSize(Q_NULLPTR)*M_PI/180.*sPainter.getProject or()->getPixelPerRadAtCenter();
float shift = 4.f + (drawHintProportional ? size : size/1.8f); float shift = 4.f + (drawHintProportional ? size : size/1.8f);
skipping to change at line 798 skipping to change at line 944
else if (catalogFilters&CatUGC && UGC_nb > 0) else if (catalogFilters&CatUGC && UGC_nb > 0)
str = QString("UGC %1").arg(UGC_nb); str = QString("UGC %1").arg(UGC_nb);
else if (catalogFilters&CatCed && !Ced_nb.isEmpty()) else if (catalogFilters&CatCed && !Ced_nb.isEmpty())
str = QString("Ced %1").arg(Ced_nb); str = QString("Ced %1").arg(Ced_nb);
else if (catalogFilters&CatArp && Arp_nb > 0) else if (catalogFilters&CatArp && Arp_nb > 0)
str = QString("Arp %1").arg(Arp_nb); str = QString("Arp %1").arg(Arp_nb);
else if (catalogFilters&CatVV && VV_nb > 0) else if (catalogFilters&CatVV && VV_nb > 0)
str = QString("VV %1").arg(VV_nb); str = QString("VV %1").arg(VV_nb);
else if (catalogFilters&CatPK && !PK_nb.isEmpty()) else if (catalogFilters&CatPK && !PK_nb.isEmpty())
str = QString("PK %1").arg(PK_nb); str = QString("PK %1").arg(PK_nb);
else if (catalogFilters&CatPNG && !PNG_nb.isEmpty())
str = QString("PN G%1").arg(PNG_nb);
else if (catalogFilters&CatSNRG && !SNRG_nb.isEmpty())
str = QString("SNR G%1").arg(SNRG_nb);
else if (catalogFilters&CatACO && !ACO_nb.isEmpty())
str = QString("ACO %1").arg(ACO_nb);
return str; 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 >> Arp_nb >> VV_nb > > PK_nb; >> Mel_nb >> PGC_nb >> UGC_nb >> Ced_nb >> Arp_nb >> VV_nb > > PK_nb >> PNG_nb >> SNRG_nb >> ACO_nb;
int f = 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 + Arp_nb + VV_nb; int f = 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 + Arp_nb + VV_nb;
if (f==0 && Ced_nb.isEmpty() && PK_nb.isEmpty()) if (f==0 && Ced_nb.isEmpty() && PK_nb.isEmpty() && PNG_nb.isEmpty() && SNRG_nb.isEmpty() && ACO_nb.isEmpty())
withoutID = true; withoutID = true;
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(Q_NULLPTR))); pointRegion = SphericalRegionP(new SphericalPoint(getJ2000Equatorial Pos(Q_NULLPTR)));
} }
bool Nebula::objectInDisplayedType() const bool Nebula::objectInDisplayedType() const
{ {
skipping to change at line 873 skipping to change at line 1025
case NebMolCld: case NebMolCld:
case NebYSO: case NebYSO:
cntype = 6; // Dark Nebulae cntype = 6; // Dark Nebulae
break; break;
case NebPn: case NebPn:
case NebPossPN: case NebPossPN:
case NebPPN: case NebPPN:
cntype = 7; // Planetary Nebulae cntype = 7; // Planetary Nebulae
break; break;
case NebSNR: case NebSNR:
case NebSNC:
case NebSNRC:
cntype = 8; // Supernova Remnants cntype = 8; // Supernova Remnants
break; break;
case NebCn: case NebCn:
cntype = 9; cntype = 9;
break; break;
default: case NebGxCl:
cntype = 10; cntype = 10;
break; break;
default:
cntype = 11;
break;
} }
if (typeFilters&TypeGalaxies && cntype==0) if (typeFilters&TypeGalaxies && cntype==0)
r = true; r = true;
else if (typeFilters&TypeActiveGalaxies && cntype==1) else if (typeFilters&TypeActiveGalaxies && cntype==1)
r = true; r = true;
else if (typeFilters&TypeInteractingGalaxies && cntype==2) else if (typeFilters&TypeInteractingGalaxies && cntype==2)
r = true; r = true;
else if (typeFilters&TypeStarClusters && cntype==3) else if (typeFilters&TypeStarClusters && cntype==3)
r = true; r = true;
else if (typeFilters&TypeHydrogenRegions && cntype==4) else if (typeFilters&TypeHydrogenRegions && cntype==4)
skipping to change at line 902 skipping to change at line 1059
else if (typeFilters&TypeBrightNebulae && cntype==5) else if (typeFilters&TypeBrightNebulae && cntype==5)
r = true; r = true;
else if (typeFilters&TypeDarkNebulae && cntype==6) else if (typeFilters&TypeDarkNebulae && cntype==6)
r = true; r = true;
else if (typeFilters&TypePlanetaryNebulae && cntype==7) else if (typeFilters&TypePlanetaryNebulae && cntype==7)
r = true; r = true;
else if (typeFilters&TypeSupernovaRemnants && cntype==8) else if (typeFilters&TypeSupernovaRemnants && cntype==8)
r = true; r = true;
else if (typeFilters&TypeStarClusters && (typeFilters&TypeBrightNebu lae || typeFilters&TypeHydrogenRegions) && cntype==9) else if (typeFilters&TypeStarClusters && (typeFilters&TypeBrightNebu lae || typeFilters&TypeHydrogenRegions) && cntype==9)
r = true; r = true;
else if (typeFilters&TypeOther && cntype==10) else if (typeFilters&TypeGalaxyClusters && cntype==10)
r = true;
else if (typeFilters&TypeOther && cntype==11)
r = true;
return r;
}
bool Nebula::objectInDisplayedCatalog() const
{
bool r = false;
if ((catalogFilters&CatM) && (M_nb>0))
r = true;
else if ((catalogFilters&CatC) && (C_nb>0))
r = true;
else if ((catalogFilters&CatNGC) && (NGC_nb>0))
r = true;
else if ((catalogFilters&CatIC) && (IC_nb>0))
r = true;
else if ((catalogFilters&CatB) && (B_nb>0))
r = true;
else if ((catalogFilters&CatSh2) && (Sh2_nb>0))
r = true;
else if ((catalogFilters&CatVdB) && (VdB_nb>0))
r = true;
else if ((catalogFilters&CatRCW) && (RCW_nb>0))
r = true;
else if ((catalogFilters&CatLDN) && (LDN_nb>0))
r = true;
else if ((catalogFilters&CatLBN) && (LBN_nb>0))
r = true;
else if ((catalogFilters&CatCr) && (Cr_nb>0))
r = true;
else if ((catalogFilters&CatMel) && (Mel_nb>0))
r = true;
else if ((catalogFilters&CatPGC) && (PGC_nb>0))
r = true;
else if ((catalogFilters&CatUGC) && (UGC_nb>0))
r = true;
else if ((catalogFilters&CatCed) && !(Ced_nb.isEmpty()))
r = true;
else if ((catalogFilters&CatArp) && (Arp_nb>0))
r = true;
else if ((catalogFilters&CatVV) && (VV_nb>0))
r = true;
else if ((catalogFilters&CatPK) && !(PK_nb.isEmpty()))
r = true;
else if ((catalogFilters&CatPNG) && !(PNG_nb.isEmpty()))
r = true;
else if ((catalogFilters&CatSNRG) && !(SNRG_nb.isEmpty()))
r = true;
else if ((catalogFilters&CatACO) && (!ACO_nb.isEmpty()))
r = true;
// Special case: objects without ID from current catalogs
if (withoutID)
r = true; r = true;
return r; return r;
} }
QString Nebula::getMorphologicalTypeString(void) const QString Nebula::getMorphologicalTypeString(void) const
{ {
return mTypeString; return mTypeString;
} }
QString Nebula::getMorphologicalTypeDescription(void) const QString Nebula::getMorphologicalTypeDescription(void) const
{ {
QString m, r = ""; QString m, r = "";
// Let's avoid showing a wrong morphological description for galaxie s // Let's avoid showing a wrong morphological description for galaxie s
// NOTE: Is required the morphological description for galaxies? // NOTE: Is required the morphological description for galaxies?
if (nType==NebGx || nType==NebAGx || nType==NebRGx || nType==NebIGx || nType==NebQSO || nType==NebPossQSO || nType==NebBLA || nType==NebBLL) if (nType==NebGx || nType==NebAGx || nType==NebRGx || nType==NebIGx || nType==NebQSO || nType==NebPossQSO || nType==NebBLA || nType==NebBLL || nType==NebGxCl)
return QString(); return QString();
QRegExp GlClRx("\\.*(I|II|III|IV|V|VI|VI|VII|VIII|IX|X|XI|XII)\\.*") ; QRegExp GlClRx("\\.*(I|II|III|IV|V|VI|VI|VII|VIII|IX|X|XI|XII)\\.*") ;
int idx = GlClRx.indexIn(mTypeString); int idx = GlClRx.indexIn(mTypeString);
if (idx>0) if (idx>0)
m = mTypeString.mid(idx); m = mTypeString.mid(idx);
else else
m = mTypeString; m = mTypeString;
QStringList glclass; QStringList glclass;
skipping to change at line 1037 skipping to change at line 1249
case 2: case 2:
rtxt << qc_("rich cluster with more than 100 stars", "Trumpler's Number of Members Class"); rtxt << qc_("rich cluster with more than 100 stars", "Trumpler's Number of Members Class");
break; break;
default: default:
rtxt << qc_("undocumented number of members class", "Trumpler's Number of Members Class"); rtxt << qc_("undocumented number of members class", "Trumpler's Number of Members Class");
break; break;
} }
if (!OClRx.capturedTexts().at(4).trimmed().isEmpty()) if (!OClRx.capturedTexts().at(4).trimmed().isEmpty())
rtxt << qc_("the cluster lies within nebulosity", "n ebulosity factor of open clusters"); rtxt << qc_("the cluster lies within nebulosity", "n ebulosity factor of open clusters");
r = rtxt.join(",<br>"); r = rtxt.join(",<br />");
} }
QRegExp VdBRx("\\.*(I|II|I-II|II P|P),\\s+(VBR|VB|BR|M|F|VF|:)\\.*") ; QRegExp VdBRx("\\.*(I|II|I-II|II P|P),\\s+(VBR|VB|BR|M|F|VF|:)\\.*") ;
idx = VdBRx.indexIn(mTypeString); idx = VdBRx.indexIn(mTypeString);
if (idx>0) if (idx>0)
m = mTypeString.mid(idx); m = mTypeString.mid(idx);
else else
m = mTypeString; m = mTypeString;
if (VdBRx.exactMatch(m)) // Reflection Nebulae if (VdBRx.exactMatch(m)) // Reflection Nebulae
skipping to change at line 1104 skipping to change at line 1316
case 4: case 4:
{ {
// TRANSLATORS: peculiar: odd or unusual, cf . peculiar star, peculiar galaxy // 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)
m = mTypeString.mid(idx); m = mTypeString.mid(idx);
else else
m = mTypeString; m = mTypeString;
if (HIIRx.exactMatch(m)) // HII regions if (HIIRx.exactMatch(m)) // HII regions
skipping to change at line 1165 skipping to change at line 1377
case 2: case 2:
morph << qc_("moderate brightness", "HII reg ion brightness"); morph << qc_("moderate brightness", "HII reg ion brightness");
break; break;
case 3: case 3:
morph << qc_("brightest", "HII region bright ness"); morph << qc_("brightest", "HII region bright ness");
break; break;
default: default:
morph << q_("undocumented brightness"); morph << q_("undocumented brightness");
break; break;
} }
r = morph.join(",<br>"); r = morph.join(",<br />");
}
if (nType==NebSNR)
{
QString delim = "";
if (!r.isEmpty())
delim = ";<br />";
if (mTypeString.contains("S") && !mTypeString.contains("S?")
)
r = qc_("remnant shows a shell radio structure", "su
pernova remnant structure classification") + delim + r;
if (mTypeString.contains("F") && !mTypeString.contains("F?")
)
r = qc_("remnant shows a filled center ('plerion') r
adio structure", "supernova remnant structure classification") + delim + r;
if (mTypeString.contains("C") && !mTypeString.contains("C?")
)
r = qc_("remnant shows a composite (or combination)
radio structure", "supernova remnant structure classification") + delim + r
;
if (mTypeString.contains("S?"))
r = qc_("remnant shows a shell radio structure with
some uncertainty", "supernova remnant structure classification") + delim +
r;
if (mTypeString.contains("F?"))
r = qc_("remnant shows a filled center ('plerion') r
adio structure with some uncertainty", "supernova remnant structure classif
ication") + delim + r;
if (mTypeString.contains("C?"))
r = qc_("remnant shows a composite (or combination)
radio structure with some uncertainty", "supernova remnant structure classi
fication") + delim + r;
} }
return r; return r;
} }
QString Nebula::getTypeString(void) const QString Nebula::getTypeString(void) const
{ {
QString wsType; QString wsType;
switch(nType) switch(nType)
skipping to change at line 1228 skipping to change at line 1465
break; break;
case NebHII: case NebHII:
wsType = q_("HII region"); wsType = q_("HII region");
break; break;
case NebRn: case NebRn:
wsType = q_("reflection nebula"); wsType = q_("reflection nebula");
break; break;
case NebSNR: case NebSNR:
wsType = q_("supernova remnant"); wsType = q_("supernova remnant");
break; break;
case NebSNC:
wsType = q_("supernova candidate");
break;
case NebSNRC:
wsType = q_("supernova remnant candidate");
break;
case NebSA: case NebSA:
wsType = q_("stellar association"); wsType = q_("stellar association");
break; break;
case NebSC: case NebSC:
wsType = q_("star cloud"); wsType = q_("star cloud");
break; break;
case NebISM: case NebISM:
wsType = q_("interstellar matter"); wsType = q_("interstellar matter");
break; break;
case NebEMO: case NebEMO:
skipping to change at line 1264 skipping to change at line 1507
break; break;
case NebPossPN: case NebPossPN:
wsType = q_("possible planetary nebula"); wsType = q_("possible planetary nebula");
break; break;
case NebPPN: case NebPPN:
wsType = q_("protoplanetary nebula"); wsType = q_("protoplanetary nebula");
break; break;
case NebStar: case NebStar:
wsType = q_("star"); wsType = q_("star");
break; break;
case NebSymbioticStar:
wsType = q_("symbiotic star");
break;
case NebEmissionLineStar:
wsType = q_("emission-line star");
break;
case NebGxCl:
wsType = q_("cluster of galaxies");
break;
case NebUnknown: case NebUnknown:
wsType = q_("object of unknown nature"); wsType = q_("object of unknown nature");
break; break;
default: default:
wsType = q_("undocumented type"); wsType = q_("undocumented type");
break; break;
} }
return wsType; return wsType;
} }
 End of changes. 91 change blocks. 
176 lines changed or deleted 436 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/