GridLinesMgr.cpp   GridLinesMgr.cpp 
skipping to change at line 635 skipping to change at line 635
// // ecliptic line is not drawn around the observer, but around the su n: // // ecliptic line is not drawn around the observer, but around the su n:
// const Vec3d vv(1000000,0,0); // const Vec3d vv(1000000,0,0);
} }
GridLinesMgr::GridLinesMgr() GridLinesMgr::GridLinesMgr()
{ {
setObjectName("GridLinesMgr"); setObjectName("GridLinesMgr");
equGrid = new SkyGrid(StelCore::FrameEquinoxEqu); equGrid = new SkyGrid(StelCore::FrameEquinoxEqu);
equJ2000Grid = new SkyGrid(StelCore::FrameJ2000); equJ2000Grid = new SkyGrid(StelCore::FrameJ2000);
eclJ2000Grid = new SkyGrid(StelCore::FrameObservercentricEcliptic);
galacticGrid = new SkyGrid(StelCore::FrameGalactic); galacticGrid = new SkyGrid(StelCore::FrameGalactic);
aziGrid = new SkyGrid(StelCore::FrameAltAz); aziGrid = new SkyGrid(StelCore::FrameAltAz);
equatorLine = new SkyLine(SkyLine::EQUATOR); equatorLine = new SkyLine(SkyLine::EQUATOR);
eclipticLine = new SkyLine(SkyLine::ECLIPTIC); eclipticLine = new SkyLine(SkyLine::ECLIPTIC);
meridianLine = new SkyLine(SkyLine::MERIDIAN); meridianLine = new SkyLine(SkyLine::MERIDIAN);
horizonLine = new SkyLine(SkyLine::HORIZON); horizonLine = new SkyLine(SkyLine::HORIZON);
galacticPlaneLine = new SkyLine(SkyLine::GALACTICPLANE); galacticPlaneLine = new SkyLine(SkyLine::GALACTICPLANE);
} }
GridLinesMgr::~GridLinesMgr() GridLinesMgr::~GridLinesMgr()
{ {
delete equGrid; delete equGrid;
delete equJ2000Grid; delete equJ2000Grid;
delete eclJ2000Grid;
delete galacticGrid; delete galacticGrid;
delete aziGrid; delete aziGrid;
delete equatorLine; delete equatorLine;
delete eclipticLine; delete eclipticLine;
delete meridianLine; delete meridianLine;
delete horizonLine; delete horizonLine;
delete galacticPlaneLine; delete galacticPlaneLine;
} }
/************************************************************************* /*************************************************************************
skipping to change at line 675 skipping to change at line 677
} }
void GridLinesMgr::init() void GridLinesMgr::init()
{ {
QSettings* conf = StelApp::getInstance().getSettings(); QSettings* conf = StelApp::getInstance().getSettings();
Q_ASSERT(conf); Q_ASSERT(conf);
setFlagAzimuthalGrid(conf->value("viewing/flag_azimuthal_grid").toBo ol()); setFlagAzimuthalGrid(conf->value("viewing/flag_azimuthal_grid").toBo ol());
setFlagEquatorGrid(conf->value("viewing/flag_equatorial_grid").toBoo l()); setFlagEquatorGrid(conf->value("viewing/flag_equatorial_grid").toBoo l());
setFlagEquatorJ2000Grid(conf->value("viewing/flag_equatorial_J2000_g rid").toBool()); setFlagEquatorJ2000Grid(conf->value("viewing/flag_equatorial_J2000_g rid").toBool());
setFlagEclipticJ2000Grid(conf->value("viewing/flag_ecliptic_J2000_gr id").toBool());
setFlagGalacticGrid(conf->value("viewing/flag_galactic_grid").toBool ()); setFlagGalacticGrid(conf->value("viewing/flag_galactic_grid").toBool ());
setFlagEquatorLine(conf->value("viewing/flag_equator_line").toBool() ); setFlagEquatorLine(conf->value("viewing/flag_equator_line").toBool() );
setFlagEclipticLine(conf->value("viewing/flag_ecliptic_line").toBool ()); setFlagEclipticLine(conf->value("viewing/flag_ecliptic_line").toBool ());
setFlagMeridianLine(conf->value("viewing/flag_meridian_line").toBool ()); setFlagMeridianLine(conf->value("viewing/flag_meridian_line").toBool ());
setFlagHorizonLine(conf->value("viewing/flag_horizon_line").toBool() ); setFlagHorizonLine(conf->value("viewing/flag_horizon_line").toBool() );
setFlagGalacticPlaneLine(conf->value("viewing/flag_galactic_plane_li ne").toBool()); setFlagGalacticPlaneLine(conf->value("viewing/flag_galactic_plane_li ne").toBool());
StelApp& app = StelApp::getInstance(); StelApp& app = StelApp::getInstance();
connect(&app, SIGNAL(colorSchemeChanged(const QString&)), this, SLOT (setStelStyle(const QString&))); connect(&app, SIGNAL(colorSchemeChanged(const QString&)), this, SLOT (setStelStyle(const QString&)));
connect(&app, SIGNAL(languageChanged()), this, SLOT(updateLineLabels ())); connect(&app, SIGNAL(languageChanged()), this, SLOT(updateLineLabels ()));
} }
void GridLinesMgr::update(double deltaTime) void GridLinesMgr::update(double deltaTime)
{ {
// Update faders // Update faders
equGrid->update(deltaTime); equGrid->update(deltaTime);
equJ2000Grid->update(deltaTime); equJ2000Grid->update(deltaTime);
eclJ2000Grid->update(deltaTime);
galacticGrid->update(deltaTime); galacticGrid->update(deltaTime);
aziGrid->update(deltaTime); aziGrid->update(deltaTime);
equatorLine->update(deltaTime); equatorLine->update(deltaTime);
eclipticLine->update(deltaTime); eclipticLine->update(deltaTime);
meridianLine->update(deltaTime); meridianLine->update(deltaTime);
horizonLine->update(deltaTime); horizonLine->update(deltaTime);
galacticPlaneLine->update(deltaTime); galacticPlaneLine->update(deltaTime);
} }
void GridLinesMgr::draw(StelCore* core) void GridLinesMgr::draw(StelCore* core)
{ {
equGrid->draw(core); equGrid->draw(core);
galacticGrid->draw(core); galacticGrid->draw(core);
equJ2000Grid->draw(core); equJ2000Grid->draw(core);
eclJ2000Grid->draw(core);
aziGrid->draw(core); aziGrid->draw(core);
equatorLine->draw(core); equatorLine->draw(core);
eclipticLine->draw(core); eclipticLine->draw(core);
meridianLine->draw(core); meridianLine->draw(core);
horizonLine->draw(core); horizonLine->draw(core);
galacticPlaneLine->draw(core); galacticPlaneLine->draw(core);
} }
void GridLinesMgr::setStelStyle(const QString& section) void GridLinesMgr::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();
setColorEquatorGrid(StelUtils::strToVec3f(conf->value(section+"/equa torial_color", defaultColor).toString())); setColorEquatorGrid(StelUtils::strToVec3f(conf->value(section+"/equa torial_color", defaultColor).toString()));
setColorEquatorJ2000Grid(StelUtils::strToVec3f(conf->value(section+" /equatorial_J2000_color", defaultColor).toString())); setColorEquatorJ2000Grid(StelUtils::strToVec3f(conf->value(section+" /equatorial_J2000_color", defaultColor).toString()));
setColorEclipticJ2000Grid(StelUtils::strToVec3f(conf->value(section+ "/ecliptic_J2000_color", defaultColor).toString()));
setColorGalacticGrid(StelUtils::strToVec3f(conf->value(section+"/gal actic_color", defaultColor).toString())); setColorGalacticGrid(StelUtils::strToVec3f(conf->value(section+"/gal actic_color", defaultColor).toString()));
setColorAzimuthalGrid(StelUtils::strToVec3f(conf->value(section+"/az imuthal_color", defaultColor).toString())); setColorAzimuthalGrid(StelUtils::strToVec3f(conf->value(section+"/az imuthal_color", defaultColor).toString()));
setColorEquatorLine(StelUtils::strToVec3f(conf->value(section+"/equa tor_color", defaultColor).toString())); setColorEquatorLine(StelUtils::strToVec3f(conf->value(section+"/equa tor_color", defaultColor).toString()));
setColorEclipticLine(StelUtils::strToVec3f(conf->value(section+"/ecl iptic_color", defaultColor).toString())); setColorEclipticLine(StelUtils::strToVec3f(conf->value(section+"/ecl iptic_color", defaultColor).toString()));
setColorMeridianLine(StelUtils::strToVec3f(conf->value(section+"/mer idian_color", defaultColor).toString())); setColorMeridianLine(StelUtils::strToVec3f(conf->value(section+"/mer idian_color", defaultColor).toString()));
setColorHorizonLine(StelUtils::strToVec3f(conf->value(section+"/hori zon_color", defaultColor).toString())); setColorHorizonLine(StelUtils::strToVec3f(conf->value(section+"/hori zon_color", defaultColor).toString()));
setColorGalacticPlaneLine(StelUtils::strToVec3f(conf->value(section+ "/galactic_plane_color", defaultColor).toString())); setColorGalacticPlaneLine(StelUtils::strToVec3f(conf->value(section+ "/galactic_plane_color", defaultColor).toString()));
} }
void GridLinesMgr::updateLineLabels() void GridLinesMgr::updateLineLabels()
{ {
equatorLine->updateLabel(); equatorLine->updateLabel();
eclipticLine->updateLabel(); eclipticLine->updateLabel();
meridianLine->updateLabel(); meridianLine->updateLabel();
horizonLine->updateLabel(); horizonLine->updateLabel();
galacticPlaneLine->updateLabel();
} }
//! Set flag for displaying Azimuthal Grid //! Set flag for displaying Azimuthal Grid
void GridLinesMgr::setFlagAzimuthalGrid(const bool displayed) void GridLinesMgr::setFlagAzimuthalGrid(const bool displayed)
{ {
if(displayed != aziGrid->isDisplayed()) { if(displayed != aziGrid->isDisplayed()) {
aziGrid->setDisplayed(displayed); aziGrid->setDisplayed(displayed);
emit azimuthalGridDisplayedChanged(displayed); emit azimuthalGridDisplayedChanged(displayed);
} }
} }
skipping to change at line 814 skipping to change at line 821
return equJ2000Grid->getColor(); return equJ2000Grid->getColor();
} }
void GridLinesMgr::setColorEquatorJ2000Grid(const Vec3f& newColor) void GridLinesMgr::setColorEquatorJ2000Grid(const Vec3f& newColor)
{ {
if(newColor != equJ2000Grid->getColor()) { if(newColor != equJ2000Grid->getColor()) {
equJ2000Grid->setColor(newColor); equJ2000Grid->setColor(newColor);
emit equatorJ2000GridColorChanged(newColor); emit equatorJ2000GridColorChanged(newColor);
} }
} }
//! Set flag for displaying Equatorial J2000 Grid //! Set flag for displaying Ecliptic J2000 Grid
void GridLinesMgr::setFlagEclipticJ2000Grid(const bool displayed)
{
if(displayed != eclJ2000Grid->isDisplayed()) {
eclJ2000Grid->setDisplayed(displayed);
emit eclipticJ2000GridDisplayedChanged(displayed);
}
}
//! Get flag for displaying Ecliptic J2000 Grid
bool GridLinesMgr::getFlagEclipticJ2000Grid(void) const
{
return eclJ2000Grid->isDisplayed();
}
Vec3f GridLinesMgr::getColorEclipticJ2000Grid(void) const
{
return eclJ2000Grid->getColor();
}
void GridLinesMgr::setColorEclipticJ2000Grid(const Vec3f& newColor)
{
if(newColor != eclJ2000Grid->getColor()) {
eclJ2000Grid->setColor(newColor);
emit eclipticJ2000GridColorChanged(newColor);
}
}
//! Set flag for displaying Galactic Grid
void GridLinesMgr::setFlagGalacticGrid(const bool displayed) void GridLinesMgr::setFlagGalacticGrid(const bool displayed)
{ {
if(displayed != galacticGrid->isDisplayed()) { if(displayed != galacticGrid->isDisplayed()) {
galacticGrid->setDisplayed(displayed); galacticGrid->setDisplayed(displayed);
emit galacticGridDisplayedChanged(displayed); emit galacticGridDisplayedChanged(displayed);
} }
} }
//! Get flag for displaying Equatorial J2000 Grid //! Get flag for displaying Galactic Grid
bool GridLinesMgr::getFlagGalacticGrid(void) const bool GridLinesMgr::getFlagGalacticGrid(void) const
{ {
return galacticGrid->isDisplayed(); return galacticGrid->isDisplayed();
} }
Vec3f GridLinesMgr::getColorGalacticGrid(void) const Vec3f GridLinesMgr::getColorGalacticGrid(void) const
{ {
return galacticGrid->getColor(); return galacticGrid->getColor();
} }
void GridLinesMgr::setColorGalacticGrid(const Vec3f& newColor) void GridLinesMgr::setColorGalacticGrid(const Vec3f& newColor)
{ {
 End of changes. 9 change blocks. 
2 lines changed or deleted 34 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/