NebulaMgr.cpp   NebulaMgr.cpp 
skipping to change at line 116 skipping to change at line 116
void NebulaMgr::setYoungStellarObjectColor(const Vec3f& c) {Nebula::youngSt ellarObjectColor = c;} void NebulaMgr::setYoungStellarObjectColor(const Vec3f& c) {Nebula::youngSt ellarObjectColor = c;}
const Vec3f &NebulaMgr::getYoungStellarObjectColor(void) const {return Nebu la::youngStellarObjectColor;} const Vec3f &NebulaMgr::getYoungStellarObjectColor(void) const {return Nebu la::youngStellarObjectColor;}
void NebulaMgr::setPossibleQuasarColor(const Vec3f& c) {Nebula::possibleQua sarColor = c;} void NebulaMgr::setPossibleQuasarColor(const Vec3f& c) {Nebula::possibleQua sarColor = c;}
const Vec3f &NebulaMgr::getPossibleQuasarColor(void) const {return Nebula:: possibleQuasarColor;} const Vec3f &NebulaMgr::getPossibleQuasarColor(void) const {return Nebula:: possibleQuasarColor;}
void NebulaMgr::setPossiblePlanetaryNebulaColor(const Vec3f& c) {Nebula::po ssiblePlanetaryNebulaColor = c;} void NebulaMgr::setPossiblePlanetaryNebulaColor(const Vec3f& c) {Nebula::po ssiblePlanetaryNebulaColor = c;}
const Vec3f &NebulaMgr::getPossiblePlanetaryNebulaColor(void) const {return Nebula::possiblePlanetaryNebulaColor;} const Vec3f &NebulaMgr::getPossiblePlanetaryNebulaColor(void) const {return Nebula::possiblePlanetaryNebulaColor;}
void NebulaMgr::setProtoplanetaryNebulaColor(const Vec3f& c) {Nebula::proto planetaryNebulaColor = c;} void NebulaMgr::setProtoplanetaryNebulaColor(const Vec3f& c) {Nebula::proto planetaryNebulaColor = c;}
const Vec3f &NebulaMgr::getProtoplanetaryNebulaColor(void) const {return Ne bula::protoplanetaryNebulaColor;} const Vec3f &NebulaMgr::getProtoplanetaryNebulaColor(void) const {return Ne bula::protoplanetaryNebulaColor;}
void NebulaMgr::setStarColor(const Vec3f& c) {Nebula::starColor = c;} void NebulaMgr::setStarColor(const Vec3f& c) {Nebula::starColor = c;}
const Vec3f &NebulaMgr::getStarColor(void) const {return Nebula::starColor; } const Vec3f &NebulaMgr::getStarColor(void) const {return Nebula::starColor; }
void NebulaMgr::setCircleScale(float scale) {Nebula::circleScale = scale;} void NebulaMgr::setHintsProportional(const bool proportional) {if(Nebula::d
float NebulaMgr::getCircleScale(void) const {return Nebula::circleScale;} rawHintProportional!=proportional){ Nebula::drawHintProportional=proportion
void NebulaMgr::setHintsProportional(const bool proportional) {Nebula::draw al; emit hintsProportionalChanged(proportional);}}
HintProportional=proportional;}
bool NebulaMgr::getHintsProportional(void) const {return Nebula::drawHintPr oportional;} bool NebulaMgr::getHintsProportional(void) const {return Nebula::drawHintPr oportional;}
void NebulaMgr::setDesignationUsage(const bool flag) {if(Nebula::designatio
nUsage!=flag){ Nebula::designationUsage=flag; emit designationUsageChanged(
flag);}}
bool NebulaMgr::getDesignationUsage(void) const {return Nebula::designation
Usage; }
NebulaMgr::NebulaMgr(void) NebulaMgr::NebulaMgr(void)
: nebGrid(200) : nebGrid(200)
, hintsAmount(0) , hintsAmount(0)
, labelsAmount(0) , labelsAmount(0)
, flagConverter(false) , flagConverter(false)
, flagDecimalCoordinates(true) , flagDecimalCoordinates(true)
{ {
setObjectName("NebulaMgr"); setObjectName("NebulaMgr");
} }
skipping to change at line 174 skipping to change at line 174
Nebula::texPlanetaryNebula = StelApp::getInstance().get TextureManager().createTexture(StelFileMgr::getInstallationDir()+"/textures /neb_pnb.png"); // Load planetary nebula marker texture Nebula::texPlanetaryNebula = StelApp::getInstance().get TextureManager().createTexture(StelFileMgr::getInstallationDir()+"/textures /neb_pnb.png"); // Load planetary nebula marker texture
Nebula::texDiffuseNebula = StelApp::getInstance().get TextureManager().createTexture(StelFileMgr::getInstallationDir()+"/textures /neb_dif.png"); // Load diffuse nebula marker texture Nebula::texDiffuseNebula = StelApp::getInstance().get TextureManager().createTexture(StelFileMgr::getInstallationDir()+"/textures /neb_dif.png"); // Load diffuse nebula marker texture
Nebula::texDarkNebula = StelApp::getInstance().get TextureManager().createTexture(StelFileMgr::getInstallationDir()+"/textures /neb_drk.png"); // Load dark nebula marker texture Nebula::texDarkNebula = StelApp::getInstance().get TextureManager().createTexture(StelFileMgr::getInstallationDir()+"/textures /neb_drk.png"); // Load dark nebula marker texture
Nebula::texOpenClusterWithNebulosity = StelApp::getInstance().get TextureManager().createTexture(StelFileMgr::getInstallationDir()+"/textures /neb_ocln.png"); // Load Ocl/Nebula marker texture Nebula::texOpenClusterWithNebulosity = StelApp::getInstance().get TextureManager().createTexture(StelFileMgr::getInstallationDir()+"/textures /neb_ocln.png"); // Load Ocl/Nebula marker texture
texPointer = StelApp::getInstance().getTextureManager().createTextur e(StelFileMgr::getInstallationDir()+"/textures/pointeur5.png"); // Load p ointer texture texPointer = StelApp::getInstance().getTextureManager().createTextur e(StelFileMgr::getInstallationDir()+"/textures/pointeur5.png"); // Load p ointer texture
setFlagShow(conf->value("astro/flag_nebula",true).toBool()); setFlagShow(conf->value("astro/flag_nebula",true).toBool());
setFlagHints(conf->value("astro/flag_nebula_name",false).toBool()); setFlagHints(conf->value("astro/flag_nebula_name",false).toBool());
setHintsAmount(conf->value("astro/nebula_hints_amount", 3).toFloat() ); setHintsAmount(conf->value("astro/nebula_hints_amount", 3).toFloat() );
setLabelsAmount(conf->value("astro/nebula_labels_amount", 3).toFloat ()); setLabelsAmount(conf->value("astro/nebula_labels_amount", 3).toFloat ());
setCircleScale(conf->value("astro/nebula_scale",1.0f).toFloat());
setHintsProportional(conf->value("astro/flag_nebula_hints_proportion al", false).toBool()); setHintsProportional(conf->value("astro/flag_nebula_hints_proportion al", false).toBool());
setDesignationUsage(conf->value("gui/flag_dso_designation_usage", fa lse).toBool());
setFlagSurfaceBrightnessUsage(conf->value("astro/flag_surface_bright ness_usage", false).toBool()); setFlagSurfaceBrightnessUsage(conf->value("astro/flag_surface_bright ness_usage", false).toBool());
// Load colors from config file
// Upgrade config keys
if (conf->contains("color/nebula_label_color"))
{
conf->setValue("color/dso_label_color", conf->value("color/n
ebula_label_color", "0.4,0.3,0.5").toString());
conf->remove("color/nebula_label_color");
}
if (conf->contains("color/nebula_circle_color"))
{
conf->setValue("color/dso_circle_color", conf->value("color/
nebula_circle_color", "0.8,0.8,0.1").toString());
conf->remove("color/nebula_circle_color");
}
if (conf->contains("color/nebula_galaxy_color"))
{
conf->setValue("color/dso_galaxy_color", conf->value("color/
nebula_galaxy_color", "1.0,0.2,0.2").toString());
conf->remove("color/nebula_galaxy_color");
}
if (conf->contains("color/nebula_radioglx_color"))
{
conf->setValue("color/dso_radio_galaxy_color", conf->value("
color/nebula_radioglx_color", "0.3,0.3,0.3").toString());
conf->remove("color/nebula_radioglx_color");
}
if (conf->contains("color/nebula_activeglx_color"))
{
conf->setValue("color/dso_active_galaxy_color", conf->value(
"color/nebula_activeglx_color", "1.0,0.5,0.2").toString());
conf->remove("color/nebula_activeglx_color");
}
if (conf->contains("color/nebula_intglx_color"))
{
conf->setValue("color/dso_interacting_galaxy_color", conf->v
alue("color/nebula_intglx_color", "0.2,0.5,1.0").toString());
conf->remove("color/nebula_intglx_color");
}
if (conf->contains("color/nebula_brightneb_color"))
{
conf->setValue("color/dso_nebula_color", conf->value("color/
nebula_brightneb_color", "0.1,1.0,0.1").toString());
conf->remove("color/nebula_brightneb_color");
}
if (conf->contains("color/nebula_darkneb_color"))
{
conf->setValue("color/dso_dark_nebula_color", conf->value("c
olor/nebula_darkneb_color", "0.3,0.3,0.3").toString());
conf->remove("color/nebula_darkneb_color");
}
if (conf->contains("color/nebula_hregion_color"))
{
conf->setValue("color/dso_hydrogen_region_color", conf->valu
e("color/nebula_hregion_color", "0.1,1.0,0.1").toString());
conf->remove("color/nebula_hregion_color");
}
if (conf->contains("color/nebula_snr_color"))
{
conf->setValue("color/dso_supernova_remnant_color", conf->va
lue("color/nebula_snr_color", "0.1,1.0,0.1").toString());
conf->remove("color/nebula_snr_color");
}
if (conf->contains("color/nebula_cluster_color"))
{
conf->setValue("color/dso_cluster_color", conf->value("color
/nebula_cluster_color", "0.8,0.8,0.1").toString());
conf->remove("color/nebula_cluster_color");
}
// Set colors for markers
setLabelsColor(StelUtils::strToVec3f(conf->value("color/dso_label_co
lor", "0.2,0.6,0.7").toString()));
setCirclesColor(StelUtils::strToVec3f(conf->value("color/dso_circle_
color", "1.0,0.7,0.2").toString()));
QString defaultGalaxyColor = conf->value("color/dso_galaxy_color", "
1.0,0.2,0.2").toString();
setGalaxyColor(StelUtils::strToVec3f(defaultGalaxyColor));
setRadioGalaxyColor(StelUtils::strToVec3f(conf->value("color/dso_rad
io_galaxy_color", "0.3,0.3,0.3").toString()));
setActiveGalaxyColor(StelUtils::strToVec3f(conf->value("color/dso_ac
tive_galaxy_color", "1.0,0.5,0.2").toString()));
setInteractingGalaxyColor(StelUtils::strToVec3f(conf->value("color/d
so_interacting_galaxy_color", "0.2,0.5,1.0").toString()));
setQuasarColor(StelUtils::strToVec3f(conf->value("color/dso_quasar_c
olor", defaultGalaxyColor).toString()));
setPossibleQuasarColor(StelUtils::strToVec3f(conf->value("color/dso_
possible_quasar_color", defaultGalaxyColor).toString()));
setBlLacObjectColor(StelUtils::strToVec3f(conf->value("color/dso_bl_
lac_color", defaultGalaxyColor).toString()));
setBlazarColor(StelUtils::strToVec3f(conf->value("color/dso_blazar_c
olor", defaultGalaxyColor).toString()));
QString defaultNebulaColor = conf->value("color/dso_nebula_color", "
0.1,1.0,0.1").toString();
setNebulaColor(StelUtils::strToVec3f(defaultNebulaColor));
setPlanetaryNebulaColor(StelUtils::strToVec3f(conf->value("color/dso
_planetary_nebula_color", defaultNebulaColor).toString()));
setReflectionNebulaColor(StelUtils::strToVec3f(conf->value("color/ds
o_reflection_nebula_color", defaultNebulaColor).toString()));
setBipolarNebulaColor(StelUtils::strToVec3f(conf->value("color/dso_b
ipolar_nebula_color", defaultNebulaColor).toString()));
setEmissionNebulaColor(StelUtils::strToVec3f(conf->value("color/dso_
emission_nebula_color", defaultNebulaColor).toString()));
setDarkNebulaColor(StelUtils::strToVec3f(conf->value("color/dso_dark
_nebula_color", "0.3,0.3,0.3").toString()));
setHydrogenRegionColor(StelUtils::strToVec3f(conf->value("color/dso_
hydrogen_region_color", defaultNebulaColor).toString()));
setSupernovaRemnantColor(StelUtils::strToVec3f(conf->value("color/ds
o_supernova_remnant_color", defaultNebulaColor).toString()));
setInterstellarMatterColor(StelUtils::strToVec3f(conf->value("color/
dso_interstellar_matter_color", defaultNebulaColor).toString()));
setClusterWithNebulosityColor(StelUtils::strToVec3f(conf->value("col
or/dso_cluster_with_nebulosity_color", defaultNebulaColor).toString()));
setMolecularCloudColor(StelUtils::strToVec3f(conf->value("color/dso_
molecular_cloud_color", defaultNebulaColor).toString()));
setPossiblePlanetaryNebulaColor(StelUtils::strToVec3f(conf->value("c
olor/dso_possible_planetary_nebula_color", defaultNebulaColor).toString()))
;
setProtoplanetaryNebulaColor(StelUtils::strToVec3f(conf->value("colo
r/dso_protoplanetary_nebula_color", defaultNebulaColor).toString()));
QString defaultClusterColor = conf->value("color/dso_cluster_color",
"1.0,1.0,0.1").toString();
setClusterColor(StelUtils::strToVec3f(defaultClusterColor));
setOpenClusterColor(StelUtils::strToVec3f(conf->value("color/dso_ope
n_cluster_color", defaultClusterColor).toString()));
setGlobularClusterColor(StelUtils::strToVec3f(conf->value("color/dso
_globular_cluster_color", defaultClusterColor).toString()));
setStellarAssociationColor(StelUtils::strToVec3f(conf->value("color/
dso_stellar_association_color", defaultClusterColor).toString()));
setStarCloudColor(StelUtils::strToVec3f(conf->value("color/dso_star_
cloud_color", defaultClusterColor).toString()));
QString defaultStellarColor = conf->value("color/dso_star_color", "1
.0,0.7,0.2").toString();
setStarColor(StelUtils::strToVec3f(defaultStellarColor));
setEmissionObjectColor(StelUtils::strToVec3f(conf->value("color/dso_
emission_object_color", defaultStellarColor).toString()));
setYoungStellarObjectColor(StelUtils::strToVec3f(conf->value("color/
dso_young_stellar_object_color", defaultStellarColor).toString()));
// for DSO convertor (for developers!) // for DSO convertor (for developers!)
flagConverter = conf->value("devel/convert_dso_catalog", false).toBo ol(); flagConverter = conf->value("devel/convert_dso_catalog", false).toBo ol();
flagDecimalCoordinates = conf->value("devel/convert_dso_decimal_coor d", true).toBool(); flagDecimalCoordinates = conf->value("devel/convert_dso_decimal_coor d", true).toBool();
setFlagTypeFiltersUsage(conf->value("astro/flag_use_type_filter", fa lse).toBool()); setFlagUseTypeFilters(conf->value("astro/flag_use_type_filter", fals e).toBool());
Nebula::CatalogGroup catalogFilters = Nebula::CatalogGroup(0); Nebula::CatalogGroup catalogFilters = Nebula::CatalogGroup(0);
conf->beginGroup("dso_catalog_filters"); conf->beginGroup("dso_catalog_filters");
if (conf->value("flag_show_ngc", true).toBool()) if (conf->value("flag_show_ngc", true).toBool())
catalogFilters |= Nebula::CatNGC; catalogFilters |= Nebula::CatNGC;
if (conf->value("flag_show_ic", true).toBool()) if (conf->value("flag_show_ic", true).toBool())
catalogFilters |= Nebula::CatIC; catalogFilters |= Nebula::CatIC;
if (conf->value("flag_show_m", true).toBool()) if (conf->value("flag_show_m", true).toBool())
catalogFilters |= Nebula::CatM; catalogFilters |= Nebula::CatM;
skipping to change at line 263 skipping to change at line 362
// 3. flag in nebula_textures.fab (yuk) // 3. flag in nebula_textures.fab (yuk)
// 4. info.ini file in each set containing a "load at startup" item // 4. info.ini file in each set containing a "load at startup" item
// For now (0.9.0), just load the default set // For now (0.9.0), just load the default set
// NB: nebula set loaded inside setter of catalog filter --AW // NB: nebula set loaded inside setter of catalog filter --AW
// loadNebulaSet("default"); // loadNebulaSet("default");
updateI18n(); updateI18n();
StelApp *app = &StelApp::getInstance(); StelApp *app = &StelApp::getInstance();
connect(app, SIGNAL(languageChanged()), this, SLOT(updateI18n())); connect(app, SIGNAL(languageChanged()), this, SLOT(updateI18n()));
connect(app, SIGNAL(colorSchemeChanged(const QString&)), this, SLOT( setStelStyle(const QString&)));
GETSTELMODULE(StelObjectMgr)->registerStelObjectMgr(this); GETSTELMODULE(StelObjectMgr)->registerStelObjectMgr(this);
addAction("actionShow_Nebulas", N_("Display Options"), N_("Deep-sky objects"), "flagHintDisplayed", "D", "N"); addAction("actionShow_Nebulas", N_("Display Options"), N_("Deep-sky objects"), "flagHintDisplayed", "D", "N");
addAction("actionSet_Nebula_TypeFilterUsage", N_("Display Options"), N_("Toggle DSO type filter"), "flagTypeFiltersUsage");
} }
struct DrawNebulaFuncObject struct DrawNebulaFuncObject
{ {
DrawNebulaFuncObject(float amaxMagHints, float amaxMagLabels, StelPa inter* p, StelCore* aCore, bool acheckMaxMagHints) DrawNebulaFuncObject(float amaxMagHints, float amaxMagLabels, StelPa inter* p, StelCore* aCore, bool acheckMaxMagHints)
: maxMagHints(amaxMagHints) : maxMagHints(amaxMagHints)
, maxMagLabels(amaxMagLabels) , maxMagLabels(amaxMagLabels)
, sPainter(p) , sPainter(p)
, core(aCore) , core(aCore)
, checkMaxMagHints(acheckMaxMagHints) , checkMaxMagHints(acheckMaxMagHints)
skipping to change at line 303 skipping to change at line 402
} }
} }
float maxMagHints; float maxMagHints;
float maxMagLabels; float maxMagLabels;
StelPainter* sPainter; StelPainter* sPainter;
StelCore* core; StelCore* core;
float angularSizeLimit; float angularSizeLimit;
bool checkMaxMagHints; bool checkMaxMagHints;
}; };
void NebulaMgr::setCatalogFilters(const Nebula::CatalogGroup &cflags) void NebulaMgr::setCatalogFilters(Nebula::CatalogGroup cflags)
{ {
Nebula::catalogFilters = cflags; if(static_cast<int>(cflags) != static_cast<int>(Nebula::catalogFilte
rs))
{
Nebula::catalogFilters = cflags;
dsoArray.clear();
dsoIndex.clear();
nebGrid.clear();
bool status = getFlagShow();
StelApp::getInstance().getStelObjectMgr().unSelect();
dsoArray.clear(); qWarning() << "Reloading DSO data...";
dsoIndex.clear(); setFlagShow(false);
nebGrid.clear(); loadNebulaSet("default");
bool status = getFlagShow(); setFlagShow(status);
StelApp::getInstance().getStelObjectMgr().unSelect(); updateI18n(); // OK, update localized names of DSO
qWarning() << "Reloading DSO data..."; emit catalogFiltersChanged(cflags);
setFlagShow(false); }
loadNebulaSet("default"); }
setFlagShow(status);
void NebulaMgr::setTypeFilters(Nebula::TypeGroup tflags)
{
if(static_cast<int>(tflags) != static_cast<int>(Nebula::typeFilters)
)
{
Nebula::typeFilters = tflags;
emit typeFiltersChanged(tflags);
}
} }
float NebulaMgr::computeMaxMagHint(const StelSkyDrawer* skyDrawer) const float NebulaMgr::computeMaxMagHint(const StelSkyDrawer* skyDrawer) const
{ {
return skyDrawer->getLimitMagnitude()*1.2f-2.f+(hintsAmount *1.2f)-2 .f; return skyDrawer->getLimitMagnitude()*1.2f-2.f+(hintsAmount *1.2f)-2 .f;
} }
// Draw all the Nebulae // Draw all the Nebulae
void NebulaMgr::draw(StelCore* core) void NebulaMgr::draw(StelCore* core)
{ {
skipping to change at line 381 skipping to change at line 496
glEnable(GL_BLEND); glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // Normal transparency mode glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // Normal transparency mode
// Size on screen // Size on screen
float size = obj->getAngularSize(core)*M_PI/180.*prj->getPix elPerRadAtCenter(); float size = obj->getAngularSize(core)*M_PI/180.*prj->getPix elPerRadAtCenter();
if (size>120.f) // avoid oversized marker if (size>120.f) // avoid oversized marker
size = 120.f; size = 120.f;
if (Nebula::drawHintProportional) if (Nebula::drawHintProportional)
size*=1.2f; size*=1.2f;
size+=20.f + 10.f*std::sin(3.f * StelApp::getInstance().getT otalRunTime()); size+=20.f + 10.f*std::sin(3.f * StelApp::getInstance().getA nimationTime());
sPainter.drawSprite2dMode(pos[0]-size/2, pos[1]-size/2, 10, 90); sPainter.drawSprite2dMode(pos[0]-size/2, pos[1]-size/2, 10, 90);
sPainter.drawSprite2dMode(pos[0]-size/2, pos[1]+size/2, 10, 0); sPainter.drawSprite2dMode(pos[0]-size/2, pos[1]+size/2, 10, 0);
sPainter.drawSprite2dMode(pos[0]+size/2, pos[1]+size/2, 10, -90); sPainter.drawSprite2dMode(pos[0]+size/2, pos[1]+size/2, 10, -90);
sPainter.drawSprite2dMode(pos[0]+size/2, pos[1]-size/2, 10, -180); sPainter.drawSprite2dMode(pos[0]+size/2, pos[1]-size/2, 10, -180);
} }
} }
void NebulaMgr::setStelStyle(const QString& section)
{
// Load colors from config file
QSettings* conf = StelApp::getInstance().getSettings();
// Upgrade config keys
if (conf->contains(section+"/nebula_label_color"))
{
conf->setValue(section+"/dso_label_color", conf->value(secti
on+"/nebula_label_color", "0.4,0.3,0.5").toString());
conf->remove(section+"/nebula_label_color");
}
if (conf->contains(section+"/nebula_circle_color"))
{
conf->setValue(section+"/dso_circle_color", conf->value(sect
ion+"/nebula_circle_color", "0.8,0.8,0.1").toString());
conf->remove(section+"/nebula_circle_color");
}
if (conf->contains(section+"/nebula_galaxy_color"))
{
conf->setValue(section+"/dso_galaxy_color", conf->value(sect
ion+"/nebula_galaxy_color", "1.0,0.2,0.2").toString());
conf->remove(section+"/nebula_galaxy_color");
}
if (conf->contains(section+"/nebula_radioglx_color"))
{
conf->setValue(section+"/dso_radio_galaxy_color", conf->valu
e(section+"/nebula_radioglx_color", "0.3,0.3,0.3").toString());
conf->remove(section+"/nebula_radioglx_color");
}
if (conf->contains(section+"/nebula_activeglx_color"))
{
conf->setValue(section+"/dso_active_galaxy_color", conf->val
ue(section+"/nebula_activeglx_color", "1.0,0.5,0.2").toString());
conf->remove(section+"/nebula_activeglx_color");
}
if (conf->contains(section+"/nebula_intglx_color"))
{
conf->setValue(section+"/dso_interacting_galaxy_color", conf
->value(section+"/nebula_intglx_color", "0.2,0.5,1.0").toString());
conf->remove(section+"/nebula_intglx_color");
}
if (conf->contains(section+"/nebula_brightneb_color"))
{
conf->setValue(section+"/dso_nebula_color", conf->value(sect
ion+"/nebula_brightneb_color", "0.1,1.0,0.1").toString());
conf->remove(section+"/nebula_brightneb_color");
}
if (conf->contains(section+"/nebula_darkneb_color"))
{
conf->setValue(section+"/dso_dark_nebula_color", conf->value
(section+"/nebula_darkneb_color", "0.3,0.3,0.3").toString());
conf->remove(section+"/nebula_darkneb_color");
}
if (conf->contains(section+"/nebula_hregion_color"))
{
conf->setValue(section+"/dso_hydrogen_region_color", conf->v
alue(section+"/nebula_hregion_color", "0.1,1.0,0.1").toString());
conf->remove(section+"/nebula_hregion_color");
}
if (conf->contains(section+"/nebula_snr_color"))
{
conf->setValue(section+"/dso_supernova_remnant_color", conf-
>value(section+"/nebula_snr_color", "0.1,1.0,0.1").toString());
conf->remove(section+"/nebula_snr_color");
}
if (conf->contains(section+"/nebula_cluster_color"))
{
conf->setValue(section+"/dso_cluster_color", conf->value(sec
tion+"/nebula_cluster_color", "0.8,0.8,0.1").toString());
conf->remove(section+"/nebula_cluster_color");
}
// Set colors for markers
setLabelsColor(StelUtils::strToVec3f(conf->value(section+"/dso_label
_color", "0.2,0.6,0.7").toString()));
setCirclesColor(StelUtils::strToVec3f(conf->value(section+"/dso_circ
le_color", "1.0,0.7,0.2").toString()));
QString defaultGalaxyColor = conf->value(section+"/dso_galaxy_color"
, "1.0,0.2,0.2").toString();
setGalaxyColor(StelUtils::strToVec3f(defaultGalaxyColor));
setRadioGalaxyColor(StelUtils::strToVec3f(conf->value(section+"/dso_
radio_galaxy_color", "0.3,0.3,0.3").toString()));
setActiveGalaxyColor(StelUtils::strToVec3f(conf->value(section+"/dso
_active_galaxy_color", "1.0,0.5,0.2").toString()));
setInteractingGalaxyColor(StelUtils::strToVec3f(conf->value(section+
"/dso_interacting_galaxy_color", "0.2,0.5,1.0").toString()));
setQuasarColor(StelUtils::strToVec3f(conf->value(section+"/dso_quasa
r_color", defaultGalaxyColor).toString()));
setPossibleQuasarColor(StelUtils::strToVec3f(conf->value(section+"/d
so_possible_quasar_color", defaultGalaxyColor).toString()));
setBlLacObjectColor(StelUtils::strToVec3f(conf->value(section+"/dso_
bl_lac_color", defaultGalaxyColor).toString()));
setBlazarColor(StelUtils::strToVec3f(conf->value(section+"/dso_blaza
r_color", defaultGalaxyColor).toString()));
QString defaultNebulaColor = conf->value(section+"/dso_nebula_color"
, "0.1,1.0,0.1").toString();
setNebulaColor(StelUtils::strToVec3f(defaultNebulaColor));
setPlanetaryNebulaColor(StelUtils::strToVec3f(conf->value(section+"/
dso_planetary_nebula_color", defaultNebulaColor).toString()));
setReflectionNebulaColor(StelUtils::strToVec3f(conf->value(section+"
/dso_reflection_nebula_color", defaultNebulaColor).toString()));
setBipolarNebulaColor(StelUtils::strToVec3f(conf->value(section+"/ds
o_bipolar_nebula_color", defaultNebulaColor).toString()));
setEmissionNebulaColor(StelUtils::strToVec3f(conf->value(section+"/d
so_emission_nebula_color", defaultNebulaColor).toString()));
setDarkNebulaColor(StelUtils::strToVec3f(conf->value(section+"/dso_d
ark_nebula_color", "0.3,0.3,0.3").toString()));
setHydrogenRegionColor(StelUtils::strToVec3f(conf->value(section+"/d
so_hydrogen_region_color", defaultNebulaColor).toString()));
setSupernovaRemnantColor(StelUtils::strToVec3f(conf->value(section+"
/dso_supernova_remnant_color", defaultNebulaColor).toString()));
setInterstellarMatterColor(StelUtils::strToVec3f(conf->value(section
+"/dso_interstellar_matter_color", defaultNebulaColor).toString()));
setClusterWithNebulosityColor(StelUtils::strToVec3f(conf->value(sect
ion+"/dso_cluster_with_nebulosity_color", defaultNebulaColor).toString()));
setMolecularCloudColor(StelUtils::strToVec3f(conf->value(section+"/d
so_molecular_cloud_color", defaultNebulaColor).toString()));
setPossiblePlanetaryNebulaColor(StelUtils::strToVec3f(conf->value(se
ction+"/dso_possible_planetary_nebula_color", defaultNebulaColor).toString(
)));
setProtoplanetaryNebulaColor(StelUtils::strToVec3f(conf->value(secti
on+"/dso_protoplanetary_nebula_color", defaultNebulaColor).toString()));
QString defaultClusterColor = conf->value(section+"/dso_cluster_colo
r", "1.0,1.0,0.1").toString();
setClusterColor(StelUtils::strToVec3f(defaultClusterColor));
setOpenClusterColor(StelUtils::strToVec3f(conf->value(section+"/dso_
open_cluster_color", defaultClusterColor).toString()));
setGlobularClusterColor(StelUtils::strToVec3f(conf->value(section+"/
dso_globular_cluster_color", defaultClusterColor).toString()));
setStellarAssociationColor(StelUtils::strToVec3f(conf->value(section
+"/dso_stellar_association_color", defaultClusterColor).toString()));
setStarCloudColor(StelUtils::strToVec3f(conf->value(section+"/dso_st
ar_cloud_color", defaultClusterColor).toString()));
QString defaultStellarColor = conf->value(section+"/dso_star_color",
"1.0,0.7,0.2").toString();
setStarColor(StelUtils::strToVec3f(defaultStellarColor));
setEmissionObjectColor(StelUtils::strToVec3f(conf->value(section+"/d
so_emission_object_color", defaultStellarColor).toString()));
setYoungStellarObjectColor(StelUtils::strToVec3f(conf->value(section
+"/dso_young_stellar_object_color", defaultStellarColor).toString()));
}
// Search by name // Search by name
NebulaP NebulaMgr::search(const QString& name) NebulaP NebulaMgr::search(const QString& name)
{ {
QString uname = name.toUpper(); QString uname = name.toUpper();
foreach (const NebulaP& n, dsoArray) foreach (const NebulaP& n, dsoArray)
{ {
QString testName = n->getEnglishName().toUpper(); QString testName = n->getEnglishName().toUpper();
if (testName==uname) return n; if (testName==uname) return n;
} }
skipping to change at line 740 skipping to change at line 751
} }
NebulaP NebulaMgr::searchCed(QString Ced) NebulaP NebulaMgr::searchCed(QString Ced)
{ {
foreach (const NebulaP& n, dsoArray) foreach (const NebulaP& n, dsoArray)
if (n->Ced_nb.trimmed().toUpper() == Ced.trimmed().toUpper() ) if (n->Ced_nb.trimmed().toUpper() == Ced.trimmed().toUpper() )
return n; return n;
return NebulaP(); return NebulaP();
} }
QString NebulaMgr::getLatestSelectedDSODesignation()
{
QString result = "";
const QList<StelObjectP> selected = GETSTELMODULE(StelObjectMgr)->ge
tSelectedObject("Nebula");
if (!selected.empty())
{
foreach (const NebulaP& n, dsoArray)
if (n==selected[0])
result = n->getDSODesignation(); // Get desi
gnation for latest selected DSO
}
return result;
}
void NebulaMgr::convertDSOCatalog(const QString &in, const QString &out, bo ol decimal=false) void NebulaMgr::convertDSOCatalog(const QString &in, const QString &out, bo ol decimal=false)
{ {
QFile dsoIn(in); QFile dsoIn(in);
if (!dsoIn.open(QIODevice::ReadOnly | QIODevice::Text)) if (!dsoIn.open(QIODevice::ReadOnly | QIODevice::Text))
return; return;
QFile dsoOut(out); QFile dsoOut(out);
if (!dsoOut.open(QIODevice::WriteOnly)) if (!dsoOut.open(QIODevice::WriteOnly))
return; return;
skipping to change at line 804 skipping to change at line 830
majorAxisSize = list.at(7).toFloat(); // major axis size (arcmin) majorAxisSize = list.at(7).toFloat(); // major axis size (arcmin)
minorAxisSize = list.at(8).toFloat(); // minor axis size (arcmin) minorAxisSize = list.at(8).toFloat(); // minor axis size (arcmin)
orientationAngle = list.at(9).toInt(); // orientation angle (degrees) orientationAngle = list.at(9).toInt(); // orientation angle (degrees)
z = list.at(10).toFloat(); // redshift z = list.at(10).toFloat(); // redshift
zErr = list.at(11).toFloat(); // error of redshift zErr = list.at(11).toFloat(); // error of redshift
plx = list.at(12).toFloat(); // parallax (mas) plx = list.at(12).toFloat(); // parallax (mas)
plxErr = list.at(13).toFloat(); // error of parallax (mas) plxErr = list.at(13).toFloat(); // error of parallax (mas)
dist = list.at(14).toFloat(); // distance (Mpc for galaxies, kpc for other objects) dist = list.at(14).toFloat(); // distance (Mpc for galaxies, kpc for other objects)
distErr = list.at(15).toFloat(); // distance error (Mpc for galaxies, kpc for other objects) distErr = list.at(15).toFloat(); // distance error (Mpc for galaxies, kpc for other objects)
// ----------------------------------------------- // -----------------------------------------------
// cross-index data // cross-identification data
// ----------------------------------------------- // -----------------------------------------------
NGC = list.at(16).toInt(); // NGC number NGC = list.at(16).toInt(); // NGC number
IC = list.at(17).toInt(); // IC number IC = list.at(17).toInt(); // IC number
M = list.at(18).toInt(); // M number M = list.at(18).toInt(); // M number
C = list.at(19).toInt(); // C number C = list.at(19).toInt(); // C number
B = list.at(20).toInt(); // B number B = list.at(20).toInt(); // B number
Sh2 = list.at(21).toInt(); // Sh2 number Sh2 = list.at(21).toInt(); // Sh2 number
VdB = list.at(22).toInt(); // VdB number VdB = list.at(22).toInt(); // VdB number
RCW = list.at(23).toInt(); // RCW number RCW = list.at(23).toInt(); // RCW number
LDN = list.at(24).toInt(); // LDN number LDN = list.at(24).toInt(); // LDN number
skipping to change at line 1499 skipping to change at line 1525
foreach (const NebulaP& n, dsoArray) foreach (const NebulaP& n, dsoArray)
{ {
if (QString("CED%1").arg(n->Ced_nb.trimmed().toUpper ()) == objw.trimmed() || QString("CED %1").arg(n->Ced_nb.trimmed().toUpper( )) == objw.trimmed()) if (QString("CED%1").arg(n->Ced_nb.trimmed().toUpper ()) == objw.trimmed() || QString("CED %1").arg(n->Ced_nb.trimmed().toUpper( )) == objw.trimmed())
return qSharedPointerCast<StelObject>(n); return qSharedPointerCast<StelObject>(n);
} }
} }
return NULL; return NULL;
} }
//! Find and return the list of at most maxNbItem objects auto-completing t //! Find and return the list of at most maxNbItem objects auto-completing t
he passed object I18n name he passed object name
QStringList NebulaMgr::listMatchingObjectsI18n(const QString& objPrefix, in QStringList NebulaMgr::listMatchingObjects(const QString& objPrefix, int ma
t maxNbItem, bool useStartOfWords) const xNbItem, bool useStartOfWords, bool inEnglish) const
{ {
QStringList result; QStringList result;
if (maxNbItem==0) return result; if (maxNbItem <= 0)
{
return result;
}
QString objw = objPrefix.toUpper(); QString objw = objPrefix.toUpper();
// Search by Messier objects number (possible formats are "M31" or " M 31") // Search by Messier objects number (possible formats are "M31" or " M 31")
if (objw.size()>=1 && objw.left(1)=="M" && objw.left(3)!="MEL") if (objw.size()>=1 && objw.left(1)=="M" && objw.left(3)!="MEL")
{ {
foreach (const NebulaP& n, dsoArray) foreach (const NebulaP& n, dsoArray)
{ {
if (n->M_nb==0) continue; if (n->M_nb==0) continue;
QString constw = QString("M%1").arg(n->M_nb); QString constw = QString("M%1").arg(n->M_nb);
QString constws = constw.mid(0, objw.size()); QString constws = constw.mid(0, objw.size());
if (constws==objw) if (constws==objw)
{ {
skipping to change at line 1583 skipping to change at line 1613
{ {
result << constws; result << constws;
continue; continue;
} }
constw = QString("NGC %1").arg(n->NGC_nb); constw = QString("NGC %1").arg(n->NGC_nb);
constws = constw.mid(0, objw.size()); constws = constw.mid(0, objw.size());
if (constws==objw) if (constws==objw)
result << constw; result << constw;
} }
// Search by PGC objects number (possible formats are "PGC31" or "PG C 31") // Search by PGC object numbers (possible formats are "PGC31" or "PG C 31")
if (objw.size()>=1 && objw.left(3)=="PGC") if (objw.size()>=1 && objw.left(3)=="PGC")
{ {
foreach (const NebulaP& n, dsoArray) foreach (const NebulaP& n, dsoArray)
{ {
if (n->PGC_nb==0) continue; if (n->PGC_nb==0) continue;
QString constw = QString("PGC%1").arg(n->PGC_nb); QString constw = QString("PGC%1").arg(n->PGC_nb);
QString constws = constw.mid(0, objw.size()); QString constws = constw.mid(0, objw.size());
if (constws==objw) if (constws==objw)
{ {
result << constws; result << constws; // Prevent adding bo
continue; // Prevent adding both forms th forms for name
for name continue;
} }
constw = QString("PGC %1").arg(n->PGC_nb); constw = QString("PGC %1").arg(n->PGC_nb);
constws = constw.mid(0, objw.size()); constws = constw.mid(0, objw.size());
if (constws==objw) if (constws==objw)
result << constw; result << constw;
} }
} }
// Search by UGC objects number (possible formats are "UGC31" or "UG C 31") // Search by UGC object numbers (possible formats are "UGC31" or "UG C 31")
if (objw.size()>=1 && objw.left(3)=="UGC") if (objw.size()>=1 && objw.left(3)=="UGC")
{ {
foreach (const NebulaP& n, dsoArray) foreach (const NebulaP& n, dsoArray)
{ {
if (n->UGC_nb==0) continue; if (n->UGC_nb==0) continue;
QString constw = QString("UGC%1").arg(n->UGC_nb); QString constw = QString("UGC%1").arg(n->UGC_nb);
QString constws = constw.mid(0, objw.size()); QString constws = constw.mid(0, objw.size());
if (constws==objw) if (constws==objw)
{ {
result << constws; result << constws;
skipping to change at line 1803 skipping to change at line 1833
result << constws; result << constws;
continue; // Prevent adding both forms for name continue; // Prevent adding both forms for name
} }
constw = QString("LBN %1").arg(n->LBN_nb); constw = QString("LBN %1").arg(n->LBN_nb);
constws = constw.mid(0, objw.size()); constws = constw.mid(0, objw.size());
if (constws==objw) if (constws==objw)
result << constw; result << constw;
} }
} }
QString dson;
bool find;
// Search by common names // Search by common names
foreach (const NebulaP& n, dsoArray) foreach (const NebulaP& n, dsoArray)
{ {
dson = n->nameI18; QString name = inEnglish ? n->englishName : n->nameI18;
find = false; if (matchObjectName(name, objPrefix, useStartOfWords))
if (useStartOfWords)
{ {
if (dson.mid(0, objw.size()).toUpper()==objw) result.append(name);
find = true;
} }
else
{
if (dson.contains(objPrefix, Qt::CaseInsensitive))
find = true;
}
if (find)
result << dson;
} }
result.sort(); result.sort();
if (maxNbItem > 0) if (result.size() > maxNbItem)
{ {
if (result.size()>maxNbItem) result.erase(result.begin()+max result.erase(result.begin() + maxNbItem, result.end());
NbItem, result.end());
}
return result;
}
//! Find and return the list of at most maxNbItem objects auto-completing t
he passed object English name
QStringList NebulaMgr::listMatchingObjects(const QString& objPrefix, int ma
xNbItem, bool useStartOfWords) const
{
QStringList result;
if (maxNbItem==0) return result;
QString objw = objPrefix.toUpper();
// Search by Messier objects number (possible formats are "M31" or "
M 31")
if (objw.size()>=1 && objw.left(1)=="M" && objw.left(2)!="ME")
{
foreach (const NebulaP& n, dsoArray)
{
if (n->M_nb==0) continue;
QString constw = QString("M%1").arg(n->M_nb);
QString constws = constw.mid(0, objw.size());
if (constws==objw)
{
result << constws;
continue; // Prevent adding both forms
for name
}
constw = QString("M %1").arg(n->M_nb);
constws = constw.mid(0, objw.size());
if (constws==objw)
result << constw;
}
}
// Search by Melotte objects number (possible formats are "Mel31" or
"Mel 31")
if (objw.size()>=1 && objw.left(3)=="MEL")
{
foreach (const NebulaP& n, dsoArray)
{
if (n->Mel_nb==0) continue;
QString constw = QString("MEL%1").arg(n->Mel_nb);
QString constws = constw.mid(0, objw.size());
if (constws==objw)
{
result << constws;
continue; // Prevent adding both forms
for name
}
constw = QString("MEL %1").arg(n->Mel_nb);
constws = constw.mid(0, objw.size());
if (constws==objw)
result << constw;
}
}
// Search by IC objects number (possible formats are "IC466" or "IC
466")
if (objw.size()>=1 && objw.left(2)=="IC")
{
foreach (const NebulaP& n, dsoArray)
{
if (n->IC_nb==0) continue;
QString constw = QString("IC%1").arg(n->IC_nb);
QString constws = constw.mid(0, objw.size());
if (constws==objw)
{
result << constws;
continue; // Prevent adding both forms
for name
}
constw = QString("IC %1").arg(n->IC_nb);
constws = constw.mid(0, objw.size());
if (constws==objw)
result << constw;
}
}
// Search by NGC numbers (possible formats are "NGC31" or "NGC 31")
foreach (const NebulaP& n, dsoArray)
{
if (n->NGC_nb==0) continue;
QString constw = QString("NGC%1").arg(n->NGC_nb);
QString constws = constw.mid(0, objw.size());
if (constws==objw)
{
result << constws;
continue;
}
constw = QString("NGC %1").arg(n->NGC_nb);
constws = constw.mid(0, objw.size());
if (constws==objw)
result << constw;
}
// Search by PGC numbers (possible formats are "PGC31" or "PGC 31")
if (objw.size()>=1 && objw.left(3)=="PGC")
{
foreach (const NebulaP& n, dsoArray)
{
if (n->PGC_nb==0) continue;
QString constw = QString("PGC%1").arg(n->PGC_nb);
QString constws = constw.mid(0, objw.size());
if (constws==objw)
{
result << constws;
continue;
}
constw = QString("PGC %1").arg(n->PGC_nb);
constws = constw.mid(0, objw.size());
if (constws==objw)
result << constw;
}
}
// Search by UGC numbers (possible formats are "UGC31" or "UGC 31")
if (objw.size()>=1 && objw.left(3)=="UGC")
{
foreach (const NebulaP& n, dsoArray)
{
if (n->UGC_nb==0) continue;
QString constw = QString("UGC%1").arg(n->UGC_nb);
QString constws = constw.mid(0, objw.size());
if (constws==objw)
{
result << constws;
continue;
}
constw = QString("UGC %1").arg(n->UGC_nb);
constws = constw.mid(0, objw.size());
if (constws==objw)
result << constw;
}
}
// Search by Ced numbers (possible formats are "Ced31" or "Ced 31")
if (objw.size()>=1 && objw.left(3)=="CED")
{
foreach (const NebulaP& n, dsoArray)
{
if (n->Ced_nb==0) continue;
QString constw = QString("Ced%1").arg(n->Ced_nb.trim
med());
QString constws = constw.mid(0, objw.size());
if (constws.toUpper()==objw.toUpper())
{
result << constws;
continue;
}
constw = QString("Ced %1").arg(n->Ced_nb.trimmed());
constws = constw.mid(0, objw.size());
if (constws.toUpper()==objw.toUpper())
result << constw;
}
}
// Search by Caldwell objects number (possible formats are "C31" or
"C 31")
if (objw.size()>=1 && objw.left(1)=="C" && objw.left(2)!="CR" && obj
w.left(2)!="CE")
{
foreach (const NebulaP& n, dsoArray)
{
if (n->C_nb==0) continue;
QString constw = QString("C%1").arg(n->C_nb);
QString constws = constw.mid(0, objw.size());
if (constws==objw)
{
result << constws;
continue; // Prevent adding both forms
for name
}
constw = QString("C %1").arg(n->C_nb);
constws = constw.mid(0, objw.size());
if (constws==objw)
result << constw;
}
}
// Search by Collinder objects number (possible formats are "Cr31" o
r "Cr 31")
if (objw.size()>=1 && objw.left(2)=="CR")
{
foreach (const NebulaP& n, dsoArray)
{
if (n->Cr_nb==0) continue;
QString constw = QString("CR%1").arg(n->Cr_nb);
QString constws = constw.mid(0, objw.size());
if (constws==objw)
{
result << constws;
continue; // Prevent adding both forms
for name
}
constw = QString("CR %1").arg(n->Cr_nb);
constws = constw.mid(0, objw.size());
if (constws==objw)
result << constw;
}
}
// Search by Barnard objects number (possible formats are "B31" or "
B 31")
if (objw.size()>=1 && objw.left(1)=="B")
{
foreach (const NebulaP& n, dsoArray)
{
if (n->B_nb==0) continue;
QString constw = QString("B%1").arg(n->B_nb);
QString constws = constw.mid(0, objw.size());
if (constws==objw)
{
result << constws;
continue; // Prevent adding both forms
for name
}
constw = QString("B %1").arg(n->B_nb);
constws = constw.mid(0, objw.size());
if (constws==objw)
result << constw;
}
}
// Search by Sharpless objects number (possible formats are "Sh2-31"
or "Sh 2-31")
if (objw.size()>=1 && objw.left(2)=="SH")
{
foreach (const NebulaP& n, dsoArray)
{
if (n->Sh2_nb==0) continue;
QString constw = QString("SH2-%1").arg(n->Sh2_nb);
QString constws = constw.mid(0, objw.size());
if (constws==objw)
{
result << constws;
continue; // Prevent adding both forms
for name
}
constw = QString("SH 2-%1").arg(n->Sh2_nb);
constws = constw.mid(0, objw.size());
if (constws==objw)
result << constw;
}
}
// Search by Van den Bergh objects number (possible formats are "VdB
31" or "VdB 31")
if (objw.size()>=1 && objw.left(3)=="VDB")
{
foreach (const NebulaP& n, dsoArray)
{
if (n->VdB_nb==0) continue;
QString constw = QString("VDB%1").arg(n->VdB_nb);
QString constws = constw.mid(0, objw.size());
if (constws==objw)
{
result << constws;
continue; // Prevent adding both forms
for name
}
constw = QString("VDB %1").arg(n->VdB_nb);
constws = constw.mid(0, objw.size());
if (constws==objw)
result << constw;
}
}
// Search by RCW objects number (possible formats are "RCW31" or "RC
W 31")
if (objw.size()>=1 && objw.left(3)=="RCW")
{
foreach (const NebulaP& n, dsoArray)
{
if (n->RCW_nb==0) continue;
QString constw = QString("RCW%1").arg(n->RCW_nb);
QString constws = constw.mid(0, objw.size());
if (constws==objw)
{
result << constws;
continue; // Prevent adding both forms
for name
}
constw = QString("RCW %1").arg(n->RCW_nb);
constws = constw.mid(0, objw.size());
if (constws==objw)
result << constw;
}
}
// Search by LDN objects number (possible formats are "LDN31" or "LD
N 31")
if (objw.size()>=1 && objw.left(3)=="LDN")
{
foreach (const NebulaP& n, dsoArray)
{
if (n->LDN_nb==0) continue;
QString constw = QString("LDN%1").arg(n->LDN_nb);
QString constws = constw.mid(0, objw.size());
if (constws==objw)
{
result << constws;
continue; // Prevent adding both forms
for name
}
constw = QString("LDN %1").arg(n->LDN_nb);
constws = constw.mid(0, objw.size());
if (constws==objw)
result << constw;
}
}
// Search by LBN objects number (possible formats are "LBN31" or "LB
N 31")
if (objw.size()>=1 && objw.left(3)=="LBN")
{
foreach (const NebulaP& n, dsoArray)
{
if (n->LBN_nb==0) continue;
QString constw = QString("LBN%1").arg(n->LBN_nb);
QString constws = constw.mid(0, objw.size());
if (constws==objw)
{
result << constws;
continue; // Prevent adding both forms
for name
}
constw = QString("LBN %1").arg(n->LBN_nb);
constws = constw.mid(0, objw.size());
if (constws==objw)
result << constw;
}
}
QString dson;
bool find;
// Search by common names
foreach (const NebulaP& n, dsoArray)
{
dson = n->englishName;
find = false;
if (useStartOfWords)
{
if (dson.mid(0, objw.size()).toUpper()==objw)
find = true;
}
else
{
if (dson.contains(objPrefix, Qt::CaseInsensitive))
find = true;
}
if (find)
result << dson;
}
result.sort();
if (maxNbItem > 0)
{
if (result.size()>maxNbItem) result.erase(result.begin()+max
NbItem, result.end());
} }
return result; return result;
} }
QStringList NebulaMgr::listAllObjects(bool inEnglish) const QStringList NebulaMgr::listAllObjects(bool inEnglish) const
{ {
QStringList result; QStringList result;
foreach(const NebulaP& n, dsoArray) foreach(const NebulaP& n, dsoArray)
{ {
skipping to change at line 2210 skipping to change at line 1894
result << n->getName I18n(); result << n->getName I18n();
} }
else if (n->NGC_nb>0) else if (n->NGC_nb>0)
result << QString("NGC %1"). arg(n->NGC_nb); result << QString("NGC %1"). arg(n->NGC_nb);
else if (n->IC_nb>0) else if (n->IC_nb>0)
result << QString("IC %1").a rg(n->IC_nb); result << QString("IC %1").a rg(n->IC_nb);
else if (n->M_nb>0) else if (n->M_nb>0)
result << QString("M %1").ar g(n->M_nb); result << QString("M %1").ar g(n->M_nb);
else if (n->C_nb>0) else if (n->C_nb>0)
result << QString("C %1").ar g(n->C_nb); result << QString("C %1").ar g(n->C_nb);
} }
} }
break; break;
case 100: // Messier Catalogue? case 100: // Messier Catalogue?
foreach(const NebulaP& n, dsoArray) foreach(const NebulaP& n, dsoArray)
{ {
if (n->M_nb>0) if (n->M_nb>0)
result << QString("M%1").arg(n->M_nb ); result << QString("M%1").arg(n->M_nb );
} }
break; break;
skipping to change at line 2271 skipping to change at line 1954
} }
break; break;
case 107: // Melotte Catalogue case 107: // Melotte Catalogue
foreach(const NebulaP& n, dsoArray) foreach(const NebulaP& n, dsoArray)
{ {
if (n->Mel_nb>0) if (n->Mel_nb>0)
result << QString("Mel %1").arg(n->M el_nb); result << QString("Mel %1").arg(n->M el_nb);
} }
break; break;
case 150: // Dwarf galaxies case 150: // Dwarf galaxies
{ {
QStringList dwarfGalaxies; QStringList dwarfGalaxies;
dwarfGalaxies << "PGC 3589" << "PGC 3792" << "PGC 6 830" << "PGC 10074" << "PGC 19441" dwarfGalaxies << "PGC 3589" << "PGC 3792" << "PGC 6 830" << "PGC 10074" << "PGC 19441"
<< "PGC 28913" << "PGC 29194" << "PGC 29653" << "PGC 50779" << "PGC 54074" << "PGC 28913" << "PGC 29194" << "PGC 29653" << "PGC 50779" << "PGC 54074"
<< "PGC 60095" << "PGC 63287" << "PGC 69519" << "PGC 88608" << "PGC 2807155" << "PGC 60095" << "PGC 63287" << "PGC 69519" << "PGC 88608" << "PGC 2807155"
<< "PGC 3097691"; << "PGC 3097691";
result = dwarfGalaxies; result = dwarfGalaxies;
}
break; break;
}
case 151: // Herschel 400 Catalogue
{
QList<int> h400list;
h400list << 40 << 129 << 136 << 157 << 185 <<
205 << 225 << 246 << 247 << 253
<< 278 << 288 << 381 << 404 << 436 <<
457 << 488 << 524 << 559 << 584
<< 596 << 598 << 613 << 615 << 637 <<
650 << 654 << 659 << 663 << 720
<< 752 << 772 << 779 << 869 << 884 <<
891 << 908 << 936 << 1022 << 1023
<< 1027 << 1052 << 1055 << 1084 << 1245 <<
1342 << 1407 << 1444 << 1501 << 1502
<< 1513 << 1528 << 1535 << 1545 << 1647 <<
1664 << 1788 << 1817 << 1857 << 1907
<< 1931 << 1961 << 1964 << 1980 << 1999 <<
2022 << 2024 << 2126 << 2129 << 2158
<< 2169 << 2185 << 2186 << 2194 << 2204 <<
2215 << 2232 << 2244 << 2251 << 2264
<< 2266 << 2281 << 2286 << 2301 << 2304 <<
2311 << 2324 << 2335 << 2343 << 2353
<< 2354 << 2355 << 2360 << 2362 << 2371 <<
2372 << 2392 << 2395 << 2403 << 2419
<< 2420 << 2421 << 2422 << 2423 << 2438 <<
2440 << 2479 << 2482 << 2489 << 2506
<< 2509 << 2527 << 2539 << 2548 << 2567 <<
2571 << 2613 << 2627 << 2655 << 2681
<< 2683 << 2742 << 2768 << 2775 << 2782 <<
2787 << 2811 << 2841 << 2859 << 2903
<< 2950 << 2964 << 2974 << 2976 << 2985 <<
3034 << 3077 << 3079 << 3115 << 3147
<< 3166 << 3169 << 3184 << 3190 << 3193 <<
3198 << 3226 << 3227 << 3242 << 3245
<< 3277 << 3294 << 3310 << 3344 << 3377 <<
3379 << 3384 << 3395 << 3412 << 3414
<< 3432 << 3486 << 3489 << 3504 << 3521 <<
3556 << 3593 << 3607 << 3608 << 3610
<< 3613 << 3619 << 3621 << 3626 << 3628 <<
3631 << 3640 << 3655 << 3665 << 3675
<< 3686 << 3726 << 3729 << 3810 << 3813 <<
3877 << 3893 << 3898 << 3900 << 3912
<< 3938 << 3941 << 3945 << 3949 << 3953 <<
3962 << 3982 << 3992 << 3998 << 4026
<< 4027 << 4030 << 4036 << 4039 << 4041 <<
4051 << 4085 << 4088 << 4102 << 4111
<< 4143 << 4147 << 4150 << 4151 << 4179 <<
4203 << 4214 << 4216 << 4245 << 4251
<< 4258 << 4261 << 4273 << 4274 << 4278 <<
4281 << 4293 << 4303 << 4314 << 4346
<< 4350 << 4361 << 4365 << 4371 << 4394 <<
4414 << 4419 << 4429 << 4435 << 4438
<< 4442 << 4448 << 4449 << 4450 << 4459 <<
4473 << 4477 << 4478 << 4485 << 4490
<< 4494 << 4526 << 4527 << 4535 << 4536 <<
4546 << 4548 << 4550 << 4559 << 4565
<< 4570 << 4594 << 4596 << 4618 << 4631 <<
4636 << 4643 << 4654 << 4656 << 4660
<< 4665 << 4666 << 4689 << 4697 << 4698 <<
4699 << 4725 << 4753 << 4754 << 4762
<< 4781 << 4800 << 4845 << 4856 << 4866 <<
4900 << 4958 << 4995 << 5005 << 5033
<< 5054 << 5195 << 5248 << 5273 << 5322 <<
5363 << 5364 << 5466 << 5473 << 5474
<< 5557 << 5566 << 5576 << 5631 << 5634 <<
5676 << 5689 << 5694 << 5746 << 5846
<< 5866 << 5897 << 5907 << 5982 << 6118 <<
6144 << 6171 << 6207 << 6217 << 6229
<< 6235 << 6284 << 6287 << 6293 << 6304 <<
6316 << 6342 << 6355 << 6356 << 6369
<< 6401 << 6426 << 6440 << 6445 << 6451 <<
6514 << 6517 << 6520 << 6522 << 6528
<< 6540 << 6543 << 6544 << 6553 << 6568 <<
6569 << 6583 << 6624 << 6629 << 6633
<< 6638 << 6642 << 6645 << 6664 << 6712 <<
6755 << 6756 << 6781 << 6802 << 6818
<< 6823 << 6826 << 6830 << 6834 << 6866 <<
6882 << 6885 << 6905 << 6910 << 6934
<< 6939 << 6940 << 6946 << 7000 << 7006 <<
7008 << 7009 << 7044 << 7062 << 7086
<< 7128 << 7142 << 7160 << 7209 << 7217 <<
7243 << 7296 << 7331 << 7380 << 7448
<< 7479 << 7510 << 7606 << 7662 << 7686 <<
7723 << 7727 << 7789 << 7790 << 7814;
for (int i=0; i < h400list.size(); i++)
result << QString("NGC %1").arg(h400list.at(
i));
break;
}
default: default:
foreach(const NebulaP& n, dsoArray) {
foreach (const NebulaP& n, dsoArray)
{ {
if (n->nType==type) if (n->nType==type)
{ {
if (!n->getEnglishName().isEmpty()) if (!n->getEnglishName().isEmpty())
{ {
if (inEnglish) if (inEnglish)
result << n->getEngl ishName(); result << n->getEngl ishName();
else else
result << n->getName I18n(); result << n->getName I18n();
} }
skipping to change at line 2320 skipping to change at line 2051
else if (n->LDN_nb>0) else if (n->LDN_nb>0)
result << QString("LDN %1"). arg(n->LDN_nb); result << QString("LDN %1"). arg(n->LDN_nb);
else if (n->Cr_nb>0) else if (n->Cr_nb>0)
result << QString("Cr %1").a rg(n->Cr_nb); result << QString("Cr %1").a rg(n->Cr_nb);
else if (n->Mel_nb>0) else if (n->Mel_nb>0)
result << QString("Mel %1"). arg(n->Mel_nb); result << QString("Mel %1"). arg(n->Mel_nb);
} }
} }
break; break;
}
} }
result.removeDuplicates(); result.removeDuplicates();
return result; return result;
} }
 End of changes. 35 change blocks. 
560 lines changed or deleted 313 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/