StarMgr.cpp   StarMgr.cpp 
skipping to change at line 35 skipping to change at line 35
#include <QSettings> #include <QSettings>
#include <QString> #include <QString>
#include <QRegExp> #include <QRegExp>
#include <QDebug> #include <QDebug>
#include <QFileInfo> #include <QFileInfo>
#include "StelProjector.hpp" #include "StelProjector.hpp"
#include "StarMgr.hpp" #include "StarMgr.hpp"
#include "StelObject.hpp" #include "StelObject.hpp"
#include "StelTexture.hpp" #include "StelTexture.hpp"
#include "StelNavigator.hpp"
#include "StelUtils.hpp" #include "StelUtils.hpp"
#include "StelToneReproducer.hpp" #include "StelToneReproducer.hpp"
#include "StelTranslator.hpp" #include "StelTranslator.hpp"
#include "StelGeodesicGrid.hpp" #include "StelGeodesicGrid.hpp"
#include "StelTranslator.hpp" #include "StelTranslator.hpp"
#include "StelApp.hpp" #include "StelApp.hpp"
#include "StelTextureMgr.hpp" #include "StelTextureMgr.hpp"
#include "StelObjectMgr.hpp" #include "StelObjectMgr.hpp"
#include "StelLocaleMgr.hpp" #include "StelLocaleMgr.hpp"
#include "StelSkyCultureMgr.hpp" #include "StelSkyCultureMgr.hpp"
#include "StelFileMgr.hpp" #include "StelFileMgr.hpp"
#include "StelModuleMgr.hpp" #include "StelModuleMgr.hpp"
#include "StelCore.hpp" #include "StelCore.hpp"
#include "StelIniParser.hpp" #include "StelIniParser.hpp"
#include "StelPainter.hpp" #include "StelPainter.hpp"
#include "StelJsonParser.hpp" #include "StelJsonParser.hpp"
#include "ZoneArray.hpp" #include "ZoneArray.hpp"
#include "StelSkyDrawer.hpp"
#include "RefractionExtinction.hpp"
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
using namespace BigStarCatalogExtension; using namespace BigStarCatalogExtension;
static QStringList spectral_array; static QStringList spectral_array;
static QStringList component_array; static QStringList component_array;
// This number must be incremented each time the content or file format of the stars catalogs change // This number must be incremented each time the content or file format of the stars catalogs change
skipping to change at line 236 skipping to change at line 238
setLabelsAmount(conf->value("stars/labels_amount",3.f).toFloat()); setLabelsAmount(conf->value("stars/labels_amount",3.f).toFloat());
objectMgr->registerStelObjectMgr(this); objectMgr->registerStelObjectMgr(this);
texPointer = StelApp::getInstance().getTextureManager().createTextur e("textures/pointeur2.png"); // Load pointer texture texPointer = StelApp::getInstance().getTextureManager().createTextur e("textures/pointeur2.png"); // Load pointer texture
StelApp::getInstance().getCore()->getGeodesicGrid(maxGeodesicGridLev el)->visitTriangles(maxGeodesicGridLevel,initTriangleFunc,this); StelApp::getInstance().getCore()->getGeodesicGrid(maxGeodesicGridLev el)->visitTriangles(maxGeodesicGridLevel,initTriangleFunc,this);
for (ZoneArrayMap::const_iterator it(zoneArrays.begin()); it!=zoneAr rays.end();it++) for (ZoneArrayMap::const_iterator it(zoneArrays.begin()); it!=zoneAr rays.end();it++)
{ {
it.value()->scaleAxis(); it.value()->scaleAxis();
} }
StelApp *app = &StelApp::getInstance();
connect(app, SIGNAL(languageChanged()), this, SLOT(updateI18n()));
connect(app, SIGNAL(skyCultureChanged(const QString&)), this, SLOT(u
pdateSkyCulture(const QString&)));
connect(app, SIGNAL(colorSchemeChanged(const QString&)), this, SLOT(
setStelStyle(const QString&)));
} }
void StarMgr::drawPointer(StelPainter& sPainter, const StelNavigator * nav) void StarMgr::drawPointer(StelPainter& sPainter, const StelCore* core)
{ {
const QList<StelObjectP> newSelected = objectMgr->getSelectedObject( "Star"); const QList<StelObjectP> newSelected = objectMgr->getSelectedObject( "Star");
if (!newSelected.empty()) if (!newSelected.empty())
{ {
const StelObjectP obj = newSelected[0]; const StelObjectP obj = newSelected[0];
Vec3d pos=obj->getJ2000EquatorialPos(nav); 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;
const Vec3f& c(obj->getInfoColor()); const 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.enableTexture2d(true);
glEnable(GL_BLEND); glEnable(GL_BLEND);
skipping to change at line 614 skipping to change at line 621
if (StelApp::getInstance().getCore()->getSkyDrawer()->comput eRCMag(mag_min,rcmag)==false) if (StelApp::getInstance().getCore()->getSkyDrawer()->comput eRCMag(mag_min,rcmag)==false)
break; break;
rval = it.key(); rval = it.key();
} }
return rval; return rval;
} }
// Draw all the stars // Draw all the stars
void StarMgr::draw(StelCore* core) void StarMgr::draw(StelCore* core)
{ {
StelNavigator* nav = core->getNavigator();
const StelProjectorP prj = core->getProjection(StelCore::FrameJ2000) ; const StelProjectorP prj = core->getProjection(StelCore::FrameJ2000) ;
StelSkyDrawer* skyDrawer = core->getSkyDrawer(); StelSkyDrawer* skyDrawer = core->getSkyDrawer();
// If stars are turned off don't waste time below // If stars are turned off don't waste time below
// projecting all stars just to draw disembodied labels // projecting all stars just to draw disembodied labels
if (!starsFader.getInterstate()) if (!starsFader.getInterstate())
return; return;
int maxSearchLevel = getMaxSearchLevel(); int maxSearchLevel = getMaxSearchLevel();
const GeodesicSearchResult* geodesic_search_result = core->getGeodes icGrid(maxSearchLevel)->search(prj->getViewportConvexPolygon()->getBounding SphericalCaps(),maxSearchLevel); const GeodesicSearchResult* geodesic_search_result = core->getGeodes icGrid(maxSearchLevel)->search(prj->getViewportConvexPolygon()->getBounding SphericalCaps(),maxSearchLevel);
skipping to change at line 678 skipping to change at line 684
for (GeodesicSearchInsideIterator it1(*geodesic_search_resul t,it.key());(zone = it1.next()) >= 0;) for (GeodesicSearchInsideIterator it1(*geodesic_search_resul t,it.key());(zone = it1.next()) >= 0;)
it.value()->draw(&sPainter, zone, true, rcmag_table, core, maxMagStarName, names_brightness); it.value()->draw(&sPainter, zone, true, rcmag_table, core, maxMagStarName, names_brightness);
for (GeodesicSearchBorderIterator it1(*geodesic_search_resul t,it.key());(zone = it1.next()) >= 0;) for (GeodesicSearchBorderIterator it1(*geodesic_search_resul t,it.key());(zone = it1.next()) >= 0;)
it.value()->draw(&sPainter, zone, false, rcmag_table , core, maxMagStarName,names_brightness); it.value()->draw(&sPainter, zone, false, rcmag_table , core, maxMagStarName,names_brightness);
} }
exit_loop: exit_loop:
// Finish drawing many stars // Finish drawing many stars
skyDrawer->postDrawPointSource(&sPainter); skyDrawer->postDrawPointSource(&sPainter);
if (objectMgr->getFlagSelectedObjectPointer()) if (objectMgr->getFlagSelectedObjectPointer())
drawPointer(sPainter, nav); drawPointer(sPainter, core);
} }
// Return a stl vector containing the stars located // Return a stl vector containing the stars located
// inside the limFov circle around position v // inside the limFov circle around position v
QList<StelObjectP > StarMgr::searchAround(const Vec3d& vv, double limFov, c onst StelCore* core) const QList<StelObjectP > StarMgr::searchAround(const Vec3d& vv, double limFov, c onst StelCore* core) const
{ {
QList<StelObjectP > result; QList<StelObjectP > result;
if (!getFlagStars()) if (!getFlagStars())
return result; return result;
skipping to change at line 741 skipping to change at line 747
const GeodesicSearchResult* geodesic_search_result = core->getGeodes icGrid(lastMaxSearchLevel)->search(c.getBoundingSphericalCaps(),lastMaxSear chLevel); const GeodesicSearchResult* geodesic_search_result = core->getGeodes icGrid(lastMaxSearchLevel)->search(c.getBoundingSphericalCaps(),lastMaxSear chLevel);
// Iterate over the stars inside the triangles // Iterate over the stars inside the triangles
f = cos(limFov * M_PI/180.); f = cos(limFov * M_PI/180.);
for (ZoneArrayMap::const_iterator it(zoneArrays.constBegin());it!=zo neArrays.constEnd();it++) for (ZoneArrayMap::const_iterator it(zoneArrays.constBegin());it!=zo neArrays.constEnd();it++)
{ {
//qDebug() << "search inside(" << it->first << "):"; //qDebug() << "search inside(" << it->first << "):";
int zone; int zone;
for (GeodesicSearchInsideIterator it1(*geodesic_search_resul t,it.key());(zone = it1.next()) >= 0;) for (GeodesicSearchInsideIterator it1(*geodesic_search_resul t,it.key());(zone = it1.next()) >= 0;)
{ {
it.value()->searchAround(core->getNavigator(), zone, v,f,result); it.value()->searchAround(core, zone,v,f,result);
//qDebug() << " " << zone; //qDebug() << " " << zone;
} }
//qDebug() << endl << "search border(" << it->first << "):"; //qDebug() << endl << "search border(" << it->first << "):";
for (GeodesicSearchBorderIterator it1(*geodesic_search_resul t,it.key()); (zone = it1.next()) >= 0;) for (GeodesicSearchBorderIterator it1(*geodesic_search_resul t,it.key()); (zone = it1.next()) >= 0;)
{ {
it.value()->searchAround(core->getNavigator(), zone, v,f,result); it.value()->searchAround(core, zone,v,f,result);
//qDebug() << " " << zone; //qDebug() << " " << zone;
} }
} }
return result; return result;
} }
//! Update i18 names from english names according to passed translator. //! Update i18 names from english names according to passed translator.
//! The translation is done using gettext with translated strings defined i n translations.h //! The translation is done using gettext with translated strings defined i n translations.h
void StarMgr::updateI18n() void StarMgr::updateI18n()
{ {
 End of changes. 9 change blocks. 
7 lines changed or deleted 15 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/