StarMgr.cpp   StarMgr.cpp 
skipping to change at line 459 skipping to change at line 459
Vec3d pos=obj->getJ2000EquatorialPos(core); Vec3d pos=obj->getJ2000EquatorialPos(core);
Vec3d screenpos; Vec3d screenpos;
// Compute 2D pos and return if outside screen // Compute 2D pos and return if outside screen
if (!sPainter.getProjector()->project(pos, screenpos)) if (!sPainter.getProjector()->project(pos, screenpos))
return; return;
Vec3f c(obj->getInfoColor()); Vec3f c(obj->getInfoColor());
sPainter.setColor(c[0], c[1], c[2]); sPainter.setColor(c[0], c[1], c[2]);
texPointer->bind(); texPointer->bind();
sPainter.enableTexture2d(true); sPainter.setBlending(true);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // Normal
transparency mode
sPainter.drawSprite2dMode(screenpos[0], screenpos[1], 13.f, StelApp::getInstance().getAnimationTime()*40.); sPainter.drawSprite2dMode(screenpos[0], screenpos[1], 13.f, StelApp::getInstance().getAnimationTime()*40.);
} }
} }
bool StarMgr::checkAndLoadCatalog(const QVariantMap& catDesc) bool StarMgr::checkAndLoadCatalog(const QVariantMap& catDesc)
{ {
const bool checked = catDesc.value("checked").toBool(); const bool checked = catDesc.value("checked").toBool();
QString catalogFileName = catDesc.value("fileName").toString(); QString catalogFileName = catDesc.value("fileName").toString();
// See if it is an absolute path, else prepend default path // See if it is an absolute path, else prepend default path
skipping to change at line 717 skipping to change at line 715
<< " - empty name field"; << " - empty name field";
continue; continue;
} }
const QString englishNameCap = englishCommonName.toU pper(); const QString englishNameCap = englishCommonName.toU pper();
if (commonNamesMap.find(hip)!=commonNamesMap.end()) if (commonNamesMap.find(hip)!=commonNamesMap.end())
{ {
if (additionalNamesMap.find(hip)!=additional NamesMap.end()) if (additionalNamesMap.find(hip)!=additional NamesMap.end())
{ {
QString sname = additionalNamesMap[h ip].append(" - " + englishCommonName); QString sname = additionalNamesMap[h ip].append(" - " + englishCommonName);
QString snamecap = sname.toUpper();
additionalNamesMap[hip] = sname; additionalNamesMap[hip] = sname;
additionalNamesMapI18n[hip] = sname; additionalNamesMapI18n[hip] = sname;
additionalNamesIndex.remove(englishN additionalNamesIndex[englishNameCap]
ameCap); = hip;
additionalNamesIndexI18n.remove(engl additionalNamesIndexI18n[englishName
ishNameCap); Cap] = hip;
additionalNamesIndex[snamecap] = hip
;
additionalNamesIndexI18n[snamecap] =
hip;
} }
else else
{ {
additionalNamesMap[hip] = englishCom monName; additionalNamesMap[hip] = englishCom monName;
additionalNamesMapI18n[hip] = englis hCommonName; additionalNamesMapI18n[hip] = englis hCommonName;
additionalNamesIndex[englishNameCap] = hip; additionalNamesIndex[englishNameCap] = hip;
additionalNamesIndexI18n[englishName Cap] = hip; additionalNamesIndexI18n[englishName Cap] = hip;
} }
} }
else else
skipping to change at line 1244 skipping to change at line 1239
commonNamesMapI18n[i] = t; commonNamesMapI18n[i] = t;
commonNamesIndexI18n[t.toUpper()] = i; commonNamesIndexI18n[t.toUpper()] = i;
} }
for (QHash<int,QString>::ConstIterator ita(additionalNamesMap.constB egin());ita!=additionalNamesMap.constEnd();ita++) for (QHash<int,QString>::ConstIterator ita(additionalNamesMap.constB egin());ita!=additionalNamesMap.constEnd();ita++)
{ {
const int i = ita.key(); const int i = ita.key();
QStringList a = ita.value().split(" - "); QStringList a = ita.value().split(" - ");
QStringList tn; QStringList tn;
foreach(const QString &str, a) foreach(const QString &str, a)
{ {
tn << trans.qtranslate(str); QString tns = trans.qtranslate(str);
tn << tns;
additionalNamesIndexI18n[tns.toUpper()] = i;
} }
const QString r = tn.join(" - "); const QString r = tn.join(" - ");
additionalNamesMapI18n[i] = r; additionalNamesMapI18n[i] = r;
additionalNamesIndexI18n[r.toUpper()] = i;
} }
} }
// Search the star by HP number // Search the star by HP number
StelObjectP StarMgr::searchHP(int hp) const StelObjectP StarMgr::searchHP(int hp) const
{ {
if (0 < hp && hp <= NR_OF_HIP) if (0 < hp && hp <= NR_OF_HIP)
{ {
const Star1 *const s = hipIndex[hp].s; const Star1 *const s = hipIndex[hp].s;
if (s) if (s)
skipping to change at line 1320 skipping to change at line 1316
} }
// Search by I18n common name // Search by I18n common name
QMap<QString,int>::const_iterator it(commonNamesIndexI18n.find(objw) ); QMap<QString,int>::const_iterator it(commonNamesIndexI18n.find(objw) );
if (it!=commonNamesIndexI18n.end()) if (it!=commonNamesIndexI18n.end())
{ {
return searchHP(it.value()); return searchHP(it.value());
} }
// Search by I18n additional common names // Search by I18n additional common names
QMap<QString, int>::iterator ita; QMap<QString,int>::const_iterator ita(additionalNamesIndexI18n.find(
for (ita = additionalNamesIndexI18n.begin(); ita != additionalNamesI objw));
ndexI18n.end(); ++ita) if (ita!=additionalNamesIndexI18n.end())
{ {
if (ita.key().contains(objw, Qt::CaseInsensitive)) return searchHP(ita.value());
return searchHP(ita.value());
} }
// Search by sci name // Search by sci name
QMap<QString,int>::const_iterator it2 = sciNamesIndexI18n.find(objw) ; QMap<QString,int>::const_iterator it2 = sciNamesIndexI18n.find(objw) ;
if (it2!=sciNamesIndexI18n.end()) if (it2!=sciNamesIndexI18n.end())
{ {
return searchHP(it2.value()); return searchHP(it2.value());
} }
// Search by additional sci name // Search by additional sci name
skipping to change at line 1410 skipping to change at line 1405
} }
// Search by English common name // Search by English common name
QMap<QString,int>::const_iterator it(commonNamesIndex.find(objw)); QMap<QString,int>::const_iterator it(commonNamesIndex.find(objw));
if (it!=commonNamesIndex.end()) if (it!=commonNamesIndex.end())
{ {
return searchHP(it.value()); return searchHP(it.value());
} }
// Search by English additional common names // Search by English additional common names
QMap<QString, int>::iterator ita; QMap<QString,int>::const_iterator ita(additionalNamesIndex.find(objw
for (ita = additionalNamesIndex.begin(); ita != additionalNamesIndex ));
.end(); ++ita) if (ita!=additionalNamesIndex.end())
{ {
if (ita.key().contains(objw, Qt::CaseInsensitive)) return searchHP(ita.value());
return searchHP(ita.value());
} }
// Search by sci name // Search by sci name
QMap<QString,int>::const_iterator it2 = sciNamesIndexI18n.find(objw) ; QMap<QString,int>::const_iterator it2 = sciNamesIndexI18n.find(objw) ;
if (it2!=sciNamesIndexI18n.end()) if (it2!=sciNamesIndexI18n.end())
{ {
return searchHP(it2.value()); return searchHP(it2.value());
} }
// Search by additional sci name // Search by additional sci name
skipping to change at line 1517 skipping to change at line 1511
foreach (QString name, names) foreach (QString name, names)
{ {
if (name.contains(objw, Qt::CaseInse nsitive)) if (name.contains(objw, Qt::CaseInse nsitive))
{ {
result.append(name); result.append(name);
--maxNbItem; --maxNbItem;
} }
} }
} }
} }
} }
// Search for sci names // Search for sci names
QString bayerPattern = objw; QString bayerPattern = objw;
QRegExp bayerRegEx(bayerPattern); QRegExp bayerRegEx(bayerPattern);
// if the first character is a Greek letter, check if there's an ind ex // if the first character is a Greek letter, check if there's an ind ex
// after it, such as "alpha1 Cen". // after it, such as "alpha1 Cen".
if (objw.at(0).unicode() >= 0x0391 && objw.at(0).unicode() <= 0x03A9 ) if (objw.at(0).unicode() >= 0x0391 && objw.at(0).unicode() <= 0x03A9 )
bayerRegEx.setPattern(bayerPattern.insert(1,"\\d?")); bayerRegEx.setPattern(bayerPattern.insert(1,"\\d?"));
 End of changes. 10 change blocks. 
26 lines changed or deleted 16 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/