ConstellationMgr.cpp   ConstellationMgr.cpp 
skipping to change at line 21 skipping to change at line 21
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#include <vector>
#include <QDebug>
#include <QFile>
#include <QImageReader>
#include <QSettings>
#include <QRegExp>
#include <QString>
#include <QStringList>
#include <QDir>
#include "ConstellationMgr.hpp" #include "ConstellationMgr.hpp"
#include "Constellation.hpp" #include "Constellation.hpp"
#include "StarMgr.hpp" #include "StarMgr.hpp"
#include "StelUtils.hpp" #include "StelUtils.hpp"
#include "StelApp.hpp" #include "StelApp.hpp"
#include "renderer/StelRenderer.hpp" #include "StelTextureMgr.hpp"
#include "StelProjector.hpp" #include "StelProjector.hpp"
#include "StelObjectMgr.hpp" #include "StelObjectMgr.hpp"
#include "StelLocaleMgr.hpp" #include "StelLocaleMgr.hpp"
#include "StelSkyCultureMgr.hpp" #include "StelSkyCultureMgr.hpp"
#include "StelModuleMgr.hpp" #include "StelModuleMgr.hpp"
#include "StelFileMgr.hpp" #include "StelFileMgr.hpp"
#include "StelCore.hpp" #include "StelCore.hpp"
#include "StelPainter.hpp"
#include "StelSkyDrawer.hpp" #include "StelSkyDrawer.hpp"
#include <vector>
#include <QDebug>
#include <QFile>
#include <QSettings>
#include <QRegExp>
#include <QString>
#include <QStringList>
#include <QDir>
using namespace std; using namespace std;
// constructor which loads all data from appropriate files // constructor which loads all data from appropriate files
ConstellationMgr::ConstellationMgr(StarMgr *_hip_stars) ConstellationMgr::ConstellationMgr(StarMgr *_hip_stars)
: hipStarMgr(_hip_stars), : hipStarMgr(_hip_stars),
artFadeDuration(2.0f), artFadeDuration(1.),
artIntensity(0.5f), artIntensity(0),
artDisplayed(0), artDisplayed(0),
boundariesDisplayed(0), boundariesDisplayed(0),
linesDisplayed(0), linesDisplayed(0),
namesDisplayed(0) namesDisplayed(0)
{ {
setObjectName("ConstellationMgr"); setObjectName("ConstellationMgr");
Q_ASSERT(hipStarMgr); Q_ASSERT(hipStarMgr);
isolateSelected = false; isolateSelected = false;
asterFont.setPixelSize(15); asterFont.setPixelSize(15);
} }
skipping to change at line 87 skipping to change at line 87
} }
allBoundarySegments.clear(); allBoundarySegments.clear();
} }
void ConstellationMgr::init() void ConstellationMgr::init()
{ {
QSettings* conf = StelApp::getInstance().getSettings(); QSettings* conf = StelApp::getInstance().getSettings();
Q_ASSERT(conf); Q_ASSERT(conf);
lastLoadedSkyCulture = "dummy"; lastLoadedSkyCulture = "dummy";
asterFont.setPixelSize(conf->value("viewing/constellation_font_size" , 16).toInt()); asterFont.setPixelSize(conf->value("viewing/constellation_font_size" , 14).toInt());
setFlagLines(conf->value("viewing/flag_constellation_drawing").toBoo l()); setFlagLines(conf->value("viewing/flag_constellation_drawing").toBoo l());
setFlagLabels(conf->value("viewing/flag_constellation_name").toBool( )); setFlagLabels(conf->value("viewing/flag_constellation_name").toBool( ));
setFlagBoundaries(conf->value("viewing/flag_constellation_boundaries ",false).toBool()); setFlagBoundaries(conf->value("viewing/flag_constellation_boundaries ",false).toBool());
setArtIntensity(conf->value("viewing/constellation_art_intensity", 0 .5f).toFloat()); setArtIntensity(conf->value("viewing/constellation_art_intensity", 0 .5f).toFloat());
setArtFadeDuration(conf->value("viewing/constellation_art_fade_durat ion",2.f).toFloat()); setArtFadeDuration(conf->value("viewing/constellation_art_fade_durat ion",2.f).toFloat());
setFlagArt(conf->value("viewing/flag_constellation_art").toBool()); setFlagArt(conf->value("viewing/flag_constellation_art").toBool());
setFlagIsolateSelected(conf->value("viewing/flag_constellation_isola te_selected", setFlagIsolateSelected(conf->value("viewing/flag_constellation_isola te_selected",
conf->value("viewing/flag_constel lation_pick", false).toBool() ).toBool()); conf->value("viewing/flag_constel lation_pick", false).toBool() ).toBool());
StelObjectMgr *objectManager = GETSTELMODULE(StelObjectMgr); StelObjectMgr *objectManager = GETSTELMODULE(StelObjectMgr);
objectManager->registerStelObjectMgr(this); objectManager->registerStelObjectMgr(this);
connect(objectManager, SIGNAL(selectedObjectChanged(StelModule::Stel ModuleSelectAction)), connect(objectManager, SIGNAL(selectedObjectChanged(StelModule::Stel ModuleSelectAction)),
this, SLOT(selectedObjectChange(StelModule::StelModu leSelectAction))); this, SLOT(selectedObjectChange(StelModule::StelModu leSelectAction)));
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(skyCultureChanged(const QString&)), this, SLOT(u pdateSkyCulture(const QString&))); connect(app, SIGNAL(skyCultureChanged(const QString&)), this, SLOT(u pdateSkyCulture(const QString&)));
connect(app, SIGNAL(colorSchemeChanged(const QString&)), this, SLOT( setStelStyle(const QString&))); connect(app, SIGNAL(colorSchemeChanged(const QString&)), this, SLOT( setStelStyle(const QString&)));
QString displayGroup = N_("Display Options");
addAction("actionShow_Constellation_Lines", displayGroup, N_("Conste
llation lines"), "linesDisplayed", "C");
addAction("actionShow_Constellation_Art", displayGroup, N_("Constell
ation art"), "artDisplayed", "R");
addAction("actionShow_Constellation_Labels", displayGroup, N_("Const
ellation labels"), "namesDisplayed", "V");
addAction("actionShow_Constellation_Boundaries", displayGroup, N_("C
onstellation boundaries"), "boundariesDisplayed", "B");
} }
/************************************************************************* /*************************************************************************
Reimplementation of the getCallOrder method Reimplementation of the getCallOrder method
*************************************************************************/ *************************************************************************/
double ConstellationMgr::getCallOrder(StelModuleActionName actionName) cons t double ConstellationMgr::getCallOrder(StelModuleActionName actionName) cons t
{ {
if (actionName==StelModule::ActionDraw) if (actionName==StelModule::ActionDraw)
return StelApp::getInstance().getModuleMgr().getModule("Grid LinesMgr")->getCallOrder(actionName)+10; return StelApp::getInstance().getModuleMgr().getModule("Grid LinesMgr")->getCallOrder(actionName)+10;
return 0; return 0;
} }
void ConstellationMgr::updateSkyCulture(const QString& skyCultureDir) void ConstellationMgr::updateSkyCulture(const QString& skyCultureDir)
{ {
// Check if the sky culture changed since last load, if not don't lo ad anything // Check if the sky culture changed since last load, if not don't lo ad anything
if (lastLoadedSkyCulture == skyCultureDir) if (lastLoadedSkyCulture == skyCultureDir)
return; return;
// Find constellation art. If this doesn't exist, warn, but continu e using "" // Find constellation art. If this doesn't exist, warn, but continu e using ""
// the loadLinesAndArt function knows how to handle this (just loads lines). // the loadLinesAndArt function knows how to handle this (just loads lines).
QString conArtFile; QString conArtFile = StelFileMgr::findFile("skycultures/"+skyCulture
try Dir+"/constellationsart.fab");
{ if (conArtFile.isEmpty())
conArtFile = StelFileMgr::findFile("skycultures/"+skyCulture
Dir+"/constellationsart.fab");
}
catch (std::runtime_error& e)
{ {
qDebug() << "No constellationsart.fab file found for sky cul ture " << QDir::toNativeSeparators(skyCultureDir); qDebug() << "No constellationsart.fab file found for sky cul ture " << QDir::toNativeSeparators(skyCultureDir);
} }
try // first of all, remove constellations from the list of selected obj
{ ects in StelObjectMgr, since we are going to delete them
// first of all, remove constellations from the list of sele deselectConstellations();
cted objects in StelObjectMgr, since we are going to delete them
deselectConstellations();
loadLinesAndArt(StelFileMgr::findFile("skycultures/"+skyCult QString fic = StelFileMgr::findFile("skycultures/"+skyCultureDir+"/c
ureDir+"/constellationship.fab"), conArtFile, skyCultureDir); onstellationship.fab");
if (fic.isEmpty())
qWarning() << "ERROR loading constellation lines and art fro
m file: " << fic;
else
loadLinesAndArt(fic, conArtFile, skyCultureDir);
// load constellation names // load constellation names
loadNames(StelFileMgr::findFile("skycultures/" + skyCultureD fic = StelFileMgr::findFile("skycultures/" + skyCultureDir + "/const
ir + "/constellation_names.eng.fab")); ellation_names.eng.fab");
if (fic.isEmpty())
qWarning() << "ERROR loading constellation names from file:
" << fic;
else
loadNames(fic);
// Translate constellation names for the new sky culture // Translate constellation names for the new sky culture
updateI18n(); updateI18n();
}
catch (std::runtime_error& e)
{
qWarning() << "ERROR: while loading new constellation data f
or sky culture "
<< QDir::toNativeSeparators(skyCultureDir) << ", rea
son: " << e.what() << endl;
}
// TODO: do we need to have an else { clearBoundaries(); } ?
// load constellation boundaries // load constellation boundaries
try // First try load constellation boundaries from sky culture
{ fic = StelFileMgr::findFile("skycultures/" + skyCultureDir + "/const
loadBoundaries(StelFileMgr::findFile("skycultures/" + skyCul ellations_boundaries.dat");
tureDir + "/constellations_boundaries.dat")); bool existBoundaries = false;
} if (fic.isEmpty())
catch (std::runtime_error& e) {
{ qWarning() << "ERROR loading constellation boundaries file i
qWarning() << "ERROR loading constellation boundaries file: n sky culture: " << skyCultureDir;
" << e.what(); // OK, Second try load generic constellation boundaries
fic = StelFileMgr::findFile("data/constellations_boundaries.
dat");
if (fic.isEmpty())
qWarning() << "ERROR loading main constellation boun
daries file: " << fic;
else
existBoundaries = true;
} }
else
existBoundaries = true;
if (existBoundaries)
loadBoundaries(fic);
lastLoadedSkyCulture = skyCultureDir; lastLoadedSkyCulture = skyCultureDir;
} }
void ConstellationMgr::setStelStyle(const QString& section) void ConstellationMgr::setStelStyle(const QString& section)
{ {
QSettings* conf = StelApp::getInstance().getSettings(); QSettings* conf = StelApp::getInstance().getSettings();
// Load colors from config file // Load colors from config file
QString defaultColor = conf->value(section+"/default_color").toStrin g(); QString defaultColor = conf->value(section+"/default_color").toStrin g();
skipping to change at line 426 skipping to change at line 437
// Draw loading bar // Draw loading bar
// lb.SetMessage(q_("Loading Constellation Art: %1/%2").arg(cur rentLineNumber).arg(totalRecords)); // lb.SetMessage(q_("Loading Constellation Art: %1/%2").arg(cur rentLineNumber).arg(totalRecords));
// lb.Draw((float)(currentLineNumber)/totalRecords); // lb.Draw((float)(currentLineNumber)/totalRecords);
cons = NULL; cons = NULL;
cons = findFromAbbreviation(shortname); cons = findFromAbbreviation(shortname);
if (!cons) if (!cons)
{ {
qWarning() << "ERROR in constellation art file at li ne" << currentLineNumber << "for culture" << cultureName qWarning() << "ERROR in constellation art file at li ne" << currentLineNumber << "for culture" << cultureName
<< "constellation" << shortname << "unkno wn"; << "constellation" << shortname < < "unknown";
} }
else else
{ {
QString texturePath(texfile); QString texturePath = StelFileMgr::findFile("skycult
try ures/"+cultureName+"/"+texfile);
{ if (texturePath.isEmpty())
texturePath = StelFileMgr::findFile("skycult
ures/"+cultureName+"/"+texfile);
}
catch (std::runtime_error& e)
{ {
// if the texture isn't found in the skycult qWarning() << "ERROR: could not find texture
ures/[culture] directory, , " << QDir::toNativeSeparators(texfile);
// try the central textures diectory.
qWarning() << "WARNING, could not locate tex
ture file " << QDir::toNativeSeparators(texfile)
<< " in the skycultures/" << cultur
eName
<< " directory... looking in gener
al textures/ directory...";
try
{
texturePath = StelFileMgr::findFile(
QString("textures/")+texfile);
}
catch(std::exception& e2)
{
qWarning() << "ERROR: could not find
texture, " << QDir::toNativeSeparators(texfile) << ": " << e2.what();
}
} }
cons->artTexturePath = texturePath; cons->artTexture = StelApp::getInstance().getTexture Manager().createTextureThread(texturePath);
// This is one part that is less convenient than bef int texSizeX = 0, texSizeY = 0;
ore the GL refactor if (cons->artTexture==NULL || !cons->artTexture->get
// (due to the StelRenderer not being globally (Stel Dimensions(texSizeX, texSizeY))
Core) available.
// We need to determine texture size manually here.
// Try to get the size from the file without loading
data
QImageReader im(texturePath);
if (!im.canRead())
{ {
qWarning() << "Texture dimensions not availa ble"; qWarning() << "Texture dimension not availab le";
} }
const QSize size = im.canRead() ? im.size() : QSize(
64, 64);
const int texSizeX = size.width();
const int texSizeY = size.height();
StelCore* core = StelApp::getInstance().getCore(); StelCore* core = StelApp::getInstance().getCore();
Vec3d s1 = hipStarMgr->searchHP(hp1)->getJ2000Equato rialPos(core); Vec3d s1 = hipStarMgr->searchHP(hp1)->getJ2000Equato rialPos(core);
Vec3d s2 = hipStarMgr->searchHP(hp2)->getJ2000Equato rialPos(core); Vec3d s2 = hipStarMgr->searchHP(hp2)->getJ2000Equato rialPos(core);
Vec3d s3 = hipStarMgr->searchHP(hp3)->getJ2000Equato rialPos(core); Vec3d s3 = hipStarMgr->searchHP(hp3)->getJ2000Equato rialPos(core);
// To transform from texture coordinate to 2d coordi nate we need to find X with XA = B // To transform from texture coordinate to 2d coordi nate we need to find X with XA = B
// A formed of 4 points in texture coordinate, B for med with 4 points in 3d coordinate // A formed of 4 points in texture coordinate, B for med with 4 points in 3d coordinate
// We need 3 stars and the 4th point is deduced from the other to get an normal base // We need 3 stars and the 4th point is deduced from the other to get an normal base
// X = B inv(A) // X = B inv(A)
Vec3d s4 = s1 + ((s2 - s1) ^ (s3 - s1)); Vec3d s4 = s1 + ((s2 - s1) ^ (s3 - s1));
Mat4d B(s1[0], s1[1], s1[2], 1, Mat4d B(s1[0], s1[1], s1[2], 1, s2[0], s2[1], s2[2],
s2[0], s2[1], s2[2], 1, 1, s3[0], s3[1], s3[2], 1, s4[0], s4[1], s4[2], 1);
s3[0], s3[1], s3[2], 1, Mat4d A(x1, texSizeY - y1, 0.f, 1.f, x2, texSizeY -
s4[0], s4[1], s4[2], 1); y2, 0.f, 1.f, x3, texSizeY - y3, 0.f, 1.f, x1, texSizeY - y1, texSizeX, 1.f
Mat4d A(x1, texSizeY - y1, 0.f, 1.f, );
x2, texSizeY - y2, 0.f, 1.f,
x3, texSizeY - y3, 0.f, 1.f,
x1, texSizeY - y1, texSizeX, 1.f);
Mat4d X = B * A.inverse(); Mat4d X = B * A.inverse();
cons->texCoordTo3D = Mat4f(X[0] , X[1] , X[2] , X // Tesselate on the plan assuming a tangential proje
[3], ction for the image
X[4] , X[5] , X[6] , X static const int nbPoints=5;
[7], QVector<Vec2f> texCoords;
X[8] , X[9] , X[10] , X texCoords.reserve(nbPoints*nbPoints*6);
[11], for (int j=0;j<nbPoints;++j)
X[12] , X[13] , X[14] , X {
[15]); for (int i=0;i<nbPoints;++i)
{
texCoords << Vec2f(((float)i)/nbPoin
ts, ((float)j)/nbPoints);
texCoords << Vec2f(((float)i+1.f)/nb
Points, ((float)j)/nbPoints);
texCoords << Vec2f(((float)i)/nbPoin
ts, ((float)j+1.f)/nbPoints);
texCoords << Vec2f(((float)i+1.f)/nb
Points, ((float)j)/nbPoints);
texCoords << Vec2f(((float)i+1.f)/nb
Points, ((float)j+1.f)/nbPoints);
texCoords << Vec2f(((float)i)/nbPoin
ts, ((float)j+1.f)/nbPoints);
}
}
Vec3d tmp(X * Vec3d(0.5 * texSizeX, 0.5 * texSizeY, QVector<Vec3d> contour;
0.)); contour.reserve(texCoords.size());
foreach (const Vec2f& v, texCoords)
contour << X * Vec3d(v[0]*texSizeX, v[1]*tex
SizeY, 0.);
cons->artPolygon.vertex=contour;
cons->artPolygon.texCoords=texCoords;
cons->artPolygon.primitiveType=StelVertexArray::Tria
ngles;
Vec3d tmp(X * Vec3d(0.5*texSizeX, 0.5*texSizeY, 0.))
;
tmp.normalize(); tmp.normalize();
Vec3d tmp2(X * Vec3d(0., 0., 0.)); Vec3d tmp2(X * Vec3d(0., 0., 0.));
tmp2.normalize(); tmp2.normalize();
cons->boundingCap.n=tmp; cons->boundingCap.n=tmp;
cons->boundingCap.d=tmp*tmp2; cons->boundingCap.d=tmp*tmp2;
++readOk; ++readOk;
} }
} }
qDebug() << "Loaded" << readOk << "/" << totalRecords << "constellat ion art records successfully for culture" << cultureName; qDebug() << "Loaded" << readOk << "/" << totalRecords << "constellat ion art records successfully for culture" << cultureName;
fic.close(); fic.close();
} }
void ConstellationMgr::draw(StelCore* core, class StelRenderer* renderer) void ConstellationMgr::draw(StelCore* core)
{ {
const StelProjectorP projector = core->getProjection(StelCore::Frame const StelProjectorP prj = core->getProjection(StelCore::FrameJ2000)
J2000); ;
drawLines(renderer, projector, core); StelPainter sPainter(prj);
drawNames(renderer, projector, asterFont); sPainter.setFont(asterFont);
drawArt(renderer, projector); drawLines(sPainter, core);
drawBoundaries(renderer, projector); drawNames(sPainter);
drawArt(sPainter);
drawBoundaries(sPainter);
} }
// Draw constellations art textures // Draw constellations art textures
void ConstellationMgr::drawArt(StelRenderer* renderer, StelProjectorP proje ctor) const void ConstellationMgr::drawArt(StelPainter& sPainter) const
{ {
renderer->setBlendMode(BlendMode_Add); glBlendFunc(GL_ONE, GL_ONE);
sPainter.enableTexture2d(true);
glEnable(GL_BLEND);
glEnable(GL_CULL_FACE);
vector < Constellation * >::const_iterator iter; vector < Constellation * >::const_iterator iter;
SphericalRegionP region = projector->getViewportConvexPolygon(); SphericalRegionP region = sPainter.getProjector()->getViewportConvex Polygon();
for (iter = asterisms.begin(); iter != asterisms.end(); ++iter) for (iter = asterisms.begin(); iter != asterisms.end(); ++iter)
{ {
Constellation* cons = *iter; (*iter)->drawArtOptim(sPainter, *region);
if(NULL == cons->artTexture && !cons->artTexturePath.isEmpty
())
{
cons->artTexture = renderer->createTexture(cons->art
TexturePath);
}
if(NULL == cons->artVertices)
{
// Tesselate on the plane assuming a tangential proj
ection for the image
const int resolution = 5;
cons->generateArtVertices(renderer, resolution);
}
cons->drawArtOptim(renderer, projector, *region);
} }
glDisable(GL_CULL_FACE);
} }
// Draw constellations lines // Draw constellations lines
void ConstellationMgr::drawLines(StelRenderer* renderer, StelProjectorP pro jector, const StelCore* core) const void ConstellationMgr::drawLines(StelPainter& sPainter, const StelCore* cor e) const
{ {
renderer->setBlendMode(BlendMode_Alpha); sPainter.enableTexture2d(false);
const SphericalCap& viewportHalfspace = projector->getBoundingCap(); glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
const SphericalCap& viewportHalfspace = sPainter.getProjector()->get
BoundingCap();
vector < Constellation * >::const_iterator iter; vector < Constellation * >::const_iterator iter;
for (iter = asterisms.begin(); iter != asterisms.end(); ++iter) for (iter = asterisms.begin(); iter != asterisms.end(); ++iter)
{ {
(*iter)->drawOptim(renderer, projector, core, viewportHalfsp ace); (*iter)->drawOptim(sPainter, core, viewportHalfspace);
} }
} }
// Draw the names of all the constellations // Draw the names of all the constellations
void ConstellationMgr::drawNames(StelRenderer* renderer, StelProjectorP pro jector, QFont& font) const void ConstellationMgr::drawNames(StelPainter& sPainter) const
{ {
renderer->setBlendMode(BlendMode_Alpha); glEnable(GL_BLEND);
sPainter.enableTexture2d(true);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
vector < Constellation * >::const_iterator iter; vector < Constellation * >::const_iterator iter;
for (iter = asterisms.begin(); iter != asterisms.end(); iter++) for (iter = asterisms.begin(); iter != asterisms.end(); iter++)
{ {
// Check if in the field of view // Check if in the field of view
if (projector->projectCheck((*iter)->XYZname, (*iter)->XYnam if (sPainter.getProjector()->projectCheck((*iter)->XYZname,
e)) (*iter)->XYname))
{ (*iter)->drawName(sPainter);
(*iter)->drawName(renderer, font);\
}
} }
} }
Constellation *ConstellationMgr::isStarIn(const StelObject* s) const Constellation *ConstellationMgr::isStarIn(const StelObject* s) const
{ {
vector < Constellation * >::const_iterator iter; vector < Constellation * >::const_iterator iter;
for (iter = asterisms.begin(); iter != asterisms.end(); ++iter) for (iter = asterisms.begin(); iter != asterisms.end(); ++iter)
{ {
// Check if the star is in one of the constellation // Check if the star is in one of the constellation
if ((*iter)->isStarIn(s)) if ((*iter)->isStarIn(s))
skipping to change at line 677 skipping to change at line 675
qWarning() << "WARNING - constellation abbre viation" << shortName << "not found when loading constellation names"; qWarning() << "WARNING - constellation abbre viation" << shortName << "not found when loading constellation names";
} }
} }
} }
commonNameFile.close(); commonNameFile.close();
qDebug() << "Loaded" << readOk << "/" << totalRecords << "constellat ion names"; qDebug() << "Loaded" << readOk << "/" << totalRecords << "constellat ion names";
} }
void ConstellationMgr::updateI18n() void ConstellationMgr::updateI18n()
{ {
StelTranslator trans = StelApp::getInstance().getLocaleMgr().getSkyT ranslator(); const StelTranslator& trans = StelApp::getInstance().getLocaleMgr(). getSkyTranslator();
vector < Constellation * >::const_iterator iter; vector < Constellation * >::const_iterator iter;
for (iter = asterisms.begin(); iter != asterisms.end(); ++iter) for (iter = asterisms.begin(); iter != asterisms.end(); ++iter)
{ {
(*iter)->nameI18 = trans.qtranslate((*iter)->englishName); (*iter)->nameI18 = trans.qtranslate((*iter)->englishName);
} }
} }
// update faders // update faders
void ConstellationMgr::update(double deltaTime) void ConstellationMgr::update(double deltaTime)
{ {
skipping to change at line 1090 skipping to change at line 1088
i++; i++;
} }
dataFile.close(); dataFile.close();
qDebug() << "Loaded" << i << "constellation boundary segments"; qDebug() << "Loaded" << i << "constellation boundary segments";
delete points; delete points;
return true; return true;
} }
void ConstellationMgr::drawBoundaries(StelRenderer* renderer, StelProjector P projector) const void ConstellationMgr::drawBoundaries(StelPainter& sPainter) const
{ {
renderer->setBlendMode(BlendMode_None); sPainter.enableTexture2d(false);
glDisable(GL_BLEND);
vector < Constellation * >::const_iterator iter; vector < Constellation * >::const_iterator iter;
for (iter = asterisms.begin(); iter != asterisms.end(); ++iter) for (iter = asterisms.begin(); iter != asterisms.end(); ++iter)
{ {
(*iter)->drawBoundaryOptim(renderer, projector); (*iter)->drawBoundaryOptim(sPainter);
} }
} }
StelObjectP ConstellationMgr::searchByNameI18n(const QString& nameI18n) con st StelObjectP ConstellationMgr::searchByNameI18n(const QString& nameI18n) con st
{ {
QString objw = nameI18n.toUpper(); QString objw = nameI18n.toUpper();
vector <Constellation*>::const_iterator iter; vector <Constellation*>::const_iterator iter;
for (iter = asterisms.begin(); iter != asterisms.end(); ++iter) for (iter = asterisms.begin(); iter != asterisms.end(); ++iter)
{ {
 End of changes. 42 change blocks. 
155 lines changed or deleted 157 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/