TelescopeMgr.cpp   TelescopeMgr.cpp 
skipping to change at line 113 skipping to change at line 113
glEnable(GL_TEXTURE_2D); glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND); glEnable(GL_BLEND);
telescopeTexture->bind(); telescopeTexture->bind();
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // Normal transpa rency mode glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // Normal transpa rency mode
foreach (Telescope* tel, telescope_map) foreach (Telescope* tel, telescope_map)
{ {
if (tel->isConnected() && tel->hasKnownPosition()) if (tel->isConnected() && tel->hasKnownPosition())
{ {
Vec3d XY; Vec3d XY;
if (prj->projectCheck(tel->getJ2000EquatorialPos(0), XY)) if (prj->projectCheck(tel->getJ2000EquatorialPos(nav ),XY))
{ {
if (telescopeFader.getInterstate() >= 0) if (telescopeFader.getInterstate() >= 0)
{ {
glColor4f(circleColor[0],circleColor [1],circleColor[2], telescopeFader.getInterstate()); glColor4f(circleColor[0],circleColor [1],circleColor[2], telescopeFader.getInterstate());
glDisable(GL_TEXTURE_2D); glDisable(GL_TEXTURE_2D);
foreach (double occul, tel->getOcula rs()) foreach (double occul, tel->getOcula rs())
{ {
sPainter.drawCircle(XY[0],XY [1],0.5*prj->getPixelPerRadAtCenter()*(M_PI/180)*(occul)); sPainter.drawCircle(XY[0],XY [1],0.5*prj->getPixelPerRadAtCenter()*(M_PI/180)*(occul));
} }
glEnable(GL_TEXTURE_2D); glEnable(GL_TEXTURE_2D);
skipping to change at line 173 skipping to change at line 173
QList<StelObjectP> TelescopeMgr::searchAround(const Vec3d& vv, double limit Fov, const StelCore* core) const QList<StelObjectP> TelescopeMgr::searchAround(const Vec3d& vv, double limit Fov, const StelCore* core) const
{ {
QList<StelObjectP> result; QList<StelObjectP> result;
if (!getFlagTelescopes()) if (!getFlagTelescopes())
return result; return result;
Vec3d v(vv); Vec3d v(vv);
v.normalize(); v.normalize();
double cosLimFov = cos(limitFov * M_PI/180.); double cosLimFov = cos(limitFov * M_PI/180.);
foreach (Telescope* tel, telescope_map) foreach (Telescope* tel, telescope_map)
{ {
if (tel->getJ2000EquatorialPos(0).dot(v) >= cosLimFov) if (tel->getJ2000EquatorialPos(core->getNavigator()).dot(v) >= cosLimFov)
{ {
result.push_back(tel); result.push_back(tel);
} }
} }
return result; return result;
} }
StelObjectP TelescopeMgr::searchByNameI18n(const QString &nameI18n) const StelObjectP TelescopeMgr::searchByNameI18n(const QString &nameI18n) const
{ {
foreach (Telescope* tel, telescope_map) foreach (Telescope* tel, telescope_map)
skipping to change at line 230 skipping to change at line 230
return result; return result;
} }
void TelescopeMgr::setFontSize(float fontSize) void TelescopeMgr::setFontSize(float fontSize)
{ {
telescope_font = &StelApp::getInstance().getFontManager().getStandar dFont(StelApp::getInstance().getLocaleMgr().getSkyLanguage(), fontSize); telescope_font = &StelApp::getInstance().getFontManager().getStandar dFont(StelApp::getInstance().getLocaleMgr().getSkyLanguage(), fontSize);
} }
void TelescopeMgr::moveTelescopeToSelected(void) void TelescopeMgr::moveTelescopeToSelected(void)
{ {
if (StelApp::getInstance().getStelObjectMgr().getSelectedObject().is StelObjectMgr* omgr = GETSTELMODULE(StelObjectMgr);
Empty()) if (omgr->getSelectedObject().isEmpty())
return; return;
if (sender() == NULL) if (sender() == NULL)
return; return;
StelObjectP selectObject = StelApp::getInstance().getStelObjectMgr() .getSelectedObject().at(0); StelObjectP selectObject = omgr->getSelectedObject().at(0);
if (!selectObject) // should never happen if (!selectObject) // should never happen
return; return;
Vec3d objectPos = selectObject->getJ2000EquatorialPos(StelApp::getIn stance().getCore()->getNavigator()); Vec3d objectPos = selectObject->getJ2000EquatorialPos(StelApp::getIn stance().getCore()->getNavigator());
int telNum = sender()->objectName().right(1).toInt(); int telNum = sender()->objectName().right(1).toInt();
telescopeGoto(telNum, objectPos); telescopeGoto(telNum, objectPos);
} }
void TelescopeMgr::init() void TelescopeMgr::init()
{ {
skipping to change at line 284 skipping to change at line 285
t->addOcular(fov); t->addOcular(fov);
} }
telescope_map[i] = t; telescope_map[i] = t;
} }
} }
} }
setFlagTelescopes(conf->value("astro/flag_telescopes",false).toBool( )); setFlagTelescopes(conf->value("astro/flag_telescopes",false).toBool( ));
setFlagTelescopeName(conf->value("astro/flag_telescope_name",false). toBool()); setFlagTelescopeName(conf->value("astro/flag_telescope_name",false). toBool());
StelApp::getInstance().getStelObjectMgr().registerStelObjectMgr(this ); GETSTELMODULE(StelObjectMgr)->registerStelObjectMgr(this);
// Load pointer texture // Load pointer texture
texPointer = StelApp::getInstance().getTextureManager().createTextur e("pointeur2.png"); texPointer = StelApp::getInstance().getTextureManager().createTextur e("pointeur2.png");
} }
void TelescopeMgr::drawPointer(const StelProjectorP& prj, const StelNavigat or * nav, const StelPainter& sPainter) void TelescopeMgr::drawPointer(const StelProjectorP& prj, const StelNavigat or * nav, const StelPainter& sPainter)
{ {
const QList<StelObjectP> newSelected = StelApp::getInstance().getSte lObjectMgr().getSelectedObject("Telescope"); const QList<StelObjectP> newSelected = GETSTELMODULE(StelObjectMgr)- >getSelectedObject("Telescope");
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(nav);
Vec3d screenpos; Vec3d screenpos;
// Compute 2D pos and return if outside screen // Compute 2D pos and return if outside screen
if (!prj->project(pos, screenpos)) return; if (!prj->project(pos, screenpos)) return;
glColor3fv(obj->getInfoColor()); glColor3fv(obj->getInfoColor());
texPointer->bind(); texPointer->bind();
 End of changes. 6 change blocks. 
7 lines changed or deleted 7 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/