GridLinesMgr.cpp   GridLinesMgr.cpp 
skipping to change at line 27 skipping to change at line 27
* 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 "GridLinesMgr.hpp" #include "GridLinesMgr.hpp"
#include "StelApp.hpp" #include "StelApp.hpp"
#include "StelUtils.hpp" #include "StelUtils.hpp"
#include "StelTranslator.hpp" #include "StelTranslator.hpp"
#include "StelProjector.hpp" #include "StelProjector.hpp"
#include "StelFader.hpp" #include "StelFader.hpp"
#include "Planet.hpp" #include "Planet.hpp"
#include "SolarSystem.hpp"
#include "StelLocaleMgr.hpp" #include "StelLocaleMgr.hpp"
#include "StelModuleMgr.hpp" #include "StelModuleMgr.hpp"
#include "StelCore.hpp" #include "StelCore.hpp"
#include "StelPainter.hpp" #include "StelPainter.hpp"
#include "StelSkyDrawer.hpp" #include "StelSkyDrawer.hpp"
#include "StelTextureMgr.hpp" #include "StelTextureMgr.hpp"
#include "StelFileMgr.hpp" #include "StelFileMgr.hpp"
#include "precession.h" #include "precession.h"
#include <set> #include <set>
skipping to change at line 144 skipping to change at line 145
void setColor(const Vec3f& c) {color = c;} void setColor(const Vec3f& c) {color = c;}
const Vec3f& getColor() {return color;} const Vec3f& getColor() {return color;}
void update(double deltaTime) {fader.update((int)(deltaTime*1000));} void update(double deltaTime) {fader.update((int)(deltaTime*1000));}
void setFadeDuration(float duration) {fader.setDuration((int)(durati on*1000.f));} void setFadeDuration(float duration) {fader.setDuration((int)(durati on*1000.f));}
void setDisplayed(const bool displayed){fader = displayed;} void setDisplayed(const bool displayed){fader = displayed;}
bool isDisplayed(void) const {return fader;} bool isDisplayed(void) const {return fader;}
void setFontSize(double newSize); void setFontSize(double newSize);
//! Re-translates the label. //! Re-translates the label.
void updateLabel(); void updateLabel();
private: private:
QSharedPointer<Planet> earth, sun;
SKY_LINE_TYPE line_type; SKY_LINE_TYPE line_type;
Vec3f color; Vec3f color;
StelCore::FrameType frameType; StelCore::FrameType frameType;
LinearFader fader; LinearFader fader;
QFont font; QFont font;
QString label; QString label;
}; };
// rms added color as parameter // rms added color as parameter
SkyGrid::SkyGrid(StelCore::FrameType frame) : color(0.2,0.2,0.2), frameType (frame) SkyGrid::SkyGrid(StelCore::FrameType frame) : color(0.2,0.2,0.2), frameType (frame)
skipping to change at line 446 skipping to change at line 448
if (!SphericalCap::intersectionPoints(viewPortSphericalCap, meridianSphericalCap, p1, p2)) if (!SphericalCap::intersectionPoints(viewPortSphericalCap, meridianSphericalCap, p1, p2))
{ {
if (viewPortSphericalCap.d<meridianSphericalCap.d && viewPortSphericalCap.contains(meridianSphericalCap.n)) if (viewPortSphericalCap.d<meridianSphericalCap.d && viewPortSphericalCap.contains(meridianSphericalCap.n))
{ {
// The meridian is fully included in the vie wport, draw it in 3 sub-arcs to avoid length > 180. // The meridian is fully included in the vie wport, draw it in 3 sub-arcs to avoid length > 180.
const Mat4d& rotLon120 = Mat4d::rotation(mer idianSphericalCap.n, 120.*M_PI/180.); const Mat4d& rotLon120 = Mat4d::rotation(mer idianSphericalCap.n, 120.*M_PI/180.);
Vec3d rotFpt=fpt; Vec3d rotFpt=fpt;
rotFpt.transfo4d(rotLon120); rotFpt.transfo4d(rotLon120);
Vec3d rotFpt2=rotFpt; Vec3d rotFpt2=rotFpt;
rotFpt2.transfo4d(rotLon120); rotFpt2.transfo4d(rotLon120);
sPainter.drawGreatCircleArc(fpt, rotFpt, NUL sPainter.drawGreatCircleArc(fpt, rotFpt, Q_N
L, viewportEdgeIntersectCallback, &userData); ULLPTR, viewportEdgeIntersectCallback, &userData);
sPainter.drawGreatCircleArc(rotFpt, rotFpt2, sPainter.drawGreatCircleArc(rotFpt, rotFpt2,
NULL, viewportEdgeIntersectCallback, &userData); Q_NULLPTR, viewportEdgeIntersectCallback, &userData);
sPainter.drawGreatCircleArc(rotFpt2, fpt, NU sPainter.drawGreatCircleArc(rotFpt2, fpt, Q_
LL, viewportEdgeIntersectCallback, &userData); NULLPTR, viewportEdgeIntersectCallback, &userData);
fpt.transfo4d(rotLon); fpt.transfo4d(rotLon);
continue; continue;
} }
else else
break; break;
} }
Vec3d middlePoint = p1+p2; Vec3d middlePoint = p1+p2;
middlePoint.normalize(); middlePoint.normalize();
if (!viewPortSphericalCap.contains(middlePoint)) if (!viewPortSphericalCap.contains(middlePoint))
middlePoint*=-1.; middlePoint*=-1.;
// Draw the arc in 2 sub-arcs to avoid lengths > 180 deg // Draw the arc in 2 sub-arcs to avoid lengths > 180 deg
sPainter.drawGreatCircleArc(p1, middlePoint, NULL, viewportE sPainter.drawGreatCircleArc(p1, middlePoint, Q_NULLPTR, view
dgeIntersectCallback, &userData); portEdgeIntersectCallback, &userData);
sPainter.drawGreatCircleArc(p2, middlePoint, NULL, viewportE sPainter.drawGreatCircleArc(p2, middlePoint, Q_NULLPTR, view
dgeIntersectCallback, &userData); portEdgeIntersectCallback, &userData);
fpt.transfo4d(rotLon); fpt.transfo4d(rotLon);
} }
if (i!=maxNbIter) if (i!=maxNbIter)
{ {
rotLon = Mat4d::zrotation(-gridStepMeridianRad); rotLon = Mat4d::zrotation(-gridStepMeridianRad);
fpt = firstPoint; fpt = firstPoint;
fpt.transfo4d(rotLon); fpt.transfo4d(rotLon);
for (int j=0; j<maxNbIter-i; ++j) for (int j=0; j<maxNbIter-i; ++j)
skipping to change at line 488 skipping to change at line 490
meridianSphericalCap.n = fpt^Vec3d(0,0,1); meridianSphericalCap.n = fpt^Vec3d(0,0,1);
meridianSphericalCap.n.normalize(); meridianSphericalCap.n.normalize();
if (!SphericalCap::intersectionPoints(viewPortSpheri calCap, meridianSphericalCap, p1, p2)) if (!SphericalCap::intersectionPoints(viewPortSpheri calCap, meridianSphericalCap, p1, p2))
break; break;
Vec3d middlePoint = p1+p2; Vec3d middlePoint = p1+p2;
middlePoint.normalize(); middlePoint.normalize();
if (!viewPortSphericalCap.contains(middlePoint)) if (!viewPortSphericalCap.contains(middlePoint))
middlePoint*=-1; middlePoint*=-1;
sPainter.drawGreatCircleArc(p1, middlePoint, NULL, v sPainter.drawGreatCircleArc(p1, middlePoint, Q_NULLP
iewportEdgeIntersectCallback, &userData); TR, viewportEdgeIntersectCallback, &userData);
sPainter.drawGreatCircleArc(p2, middlePoint, NULL, v sPainter.drawGreatCircleArc(p2, middlePoint, Q_NULLP
iewportEdgeIntersectCallback, &userData); TR, viewportEdgeIntersectCallback, &userData);
fpt.transfo4d(rotLon); fpt.transfo4d(rotLon);
} }
} }
///////////////////////////////////////////////// /////////////////////////////////////////////////
// Draw all the parallels (small circles) // Draw all the parallels (small circles)
SphericalCap parallelSphericalCap(Vec3d(0,0,1), 0); SphericalCap parallelSphericalCap(Vec3d(0,0,1), 0);
rotLon = Mat4d::rotation(firstPoint^Vec3d(0,0,1), gridStepParallelRa d); rotLon = Mat4d::rotation(firstPoint^Vec3d(0,0,1), gridStepParallelRa d);
fpt = firstPoint; fpt = firstPoint;
skipping to change at line 616 skipping to change at line 618
} }
sPainter.setLineSmooth(false); sPainter.setLineSmooth(false);
} }
SkyLine::SkyLine(SKY_LINE_TYPE _line_type) : line_type(_line_type), color(0 .f, 0.f, 1.f) SkyLine::SkyLine(SKY_LINE_TYPE _line_type) : line_type(_line_type), color(0 .f, 0.f, 1.f)
{ {
// Font size is 14 // Font size is 14
font.setPixelSize(StelApp::getInstance().getBaseFontSize()+1); font.setPixelSize(StelApp::getInstance().getBaseFontSize()+1);
earth = GETSTELMODULE(SolarSystem)->getEarth();
sun = GETSTELMODULE(SolarSystem)->getSun();
updateLabel(); updateLabel();
} }
SkyLine::~SkyLine() SkyLine::~SkyLine()
{ {
} }
void SkyLine::setFontSize(double newFontSize) void SkyLine::setFontSize(double newFontSize)
{ {
font.setPixelSize(newFontSize); font.setPixelSize(newFontSize);
skipping to change at line 670 skipping to change at line 675
break; break;
case GALACTICEQUATOR: case GALACTICEQUATOR:
frameType = StelCore::FrameGalactic; frameType = StelCore::FrameGalactic;
label = q_("Galactic Equator"); label = q_("Galactic Equator");
break; break;
case SUPERGALACTICEQUATOR: case SUPERGALACTICEQUATOR:
frameType = StelCore::FrameSupergalactic; frameType = StelCore::FrameSupergalactic;
label = q_("Supergalactic Equator"); label = q_("Supergalactic Equator");
break; break;
case LONGITUDE: case LONGITUDE:
frameType = StelCore::FrameObservercentricEclipticJ2 000; frameType = StelCore::FrameObservercentricEclipticOf Date;
// TRANSLATORS: Full term is "opposition/conjunction longitude" // TRANSLATORS: Full term is "opposition/conjunction longitude"
label = q_("O./C. longitude"); label = q_("O./C. longitude");
break; break;
case PRIME_VERTICAL: case PRIME_VERTICAL:
frameType=StelCore::FrameAltAz; frameType=StelCore::FrameAltAz;
label = q_("Prime Vertical"); label = q_("Prime Vertical");
break; break;
case COLURE_1: case COLURE_1:
frameType=StelCore::FrameEquinoxEqu; frameType=StelCore::FrameEquinoxEqu;
label = q_("Equinoctial Colure"); label = q_("Equinoctial Colure");
skipping to change at line 807 skipping to change at line 812
meridianSphericalCap.n.set(0,1,0); meridianSphericalCap.n.set(0,1,0);
} }
if ((line_type==PRIME_VERTICAL) || (line_type==COLURE_2)) if ((line_type==PRIME_VERTICAL) || (line_type==COLURE_2))
{ {
meridianSphericalCap.n.set(1,0,0); meridianSphericalCap.n.set(1,0,0);
fpt.set(0,0,1); fpt.set(0,0,1);
} }
if (line_type==LONGITUDE) if (line_type==LONGITUDE)
{ {
Vec3d coord; Vec3d coord;
double lambda, beta; double eclJDE = earth->getRotObliquity(core->getJDE());
StelUtils::rectToSphe(&lambda, &beta, core->getCurrentPlanet double ra_equ, dec_equ, lambdaJDE, betaJDE;
()->getHeliocentricEclipticPos());
StelUtils::spheToRect(lambda + M_PI/2., 0., coord); StelUtils::rectToSphe(&ra_equ,&dec_equ, sun->getEquinoxEquat
orialPos(core));
StelUtils::equToEcl(ra_equ, dec_equ, eclJDE, &lambdaJDE, &be
taJDE);
if (lambdaJDE<0) lambdaJDE+=2.0*M_PI;
StelUtils::spheToRect(lambdaJDE + M_PI/2., 0., coord);
meridianSphericalCap.n.set(coord[0],coord[1],coord[2]); meridianSphericalCap.n.set(coord[0],coord[1],coord[2]);
fpt.set(0,0,1); fpt.set(0,0,1);
} }
Vec3d p1, p2; Vec3d p1, p2;
if (!SphericalCap::intersectionPoints(viewPortSphericalCap, meridian SphericalCap, p1, p2)) if (!SphericalCap::intersectionPoints(viewPortSphericalCap, meridian SphericalCap, p1, p2))
{ {
if ((viewPortSphericalCap.d<meridianSphericalCap.d && viewPo rtSphericalCap.contains(meridianSphericalCap.n)) if ((viewPortSphericalCap.d<meridianSphericalCap.d && viewPo rtSphericalCap.contains(meridianSphericalCap.n))
|| (viewPortSphericalCap.d<-meridianSphericalCap.d & & viewPortSphericalCap.contains(-meridianSphericalCap.n))) || (viewPortSphericalCap.d<-meridianSphericalCap.d & & viewPortSphericalCap.contains(-meridianSphericalCap.n)))
{ {
// The meridian is fully included in the viewport, d raw it in 3 sub-arcs to avoid length > 180. // The meridian is fully included in the viewport, d raw it in 3 sub-arcs to avoid length > 180.
const Mat4d& rotLon120 = Mat4d::rotation(meridianSph ericalCap.n, 120.*M_PI/180.); const Mat4d& rotLon120 = Mat4d::rotation(meridianSph ericalCap.n, 120.*M_PI/180.);
Vec3d rotFpt=fpt; Vec3d rotFpt=fpt;
rotFpt.transfo4d(rotLon120); rotFpt.transfo4d(rotLon120);
Vec3d rotFpt2=rotFpt; Vec3d rotFpt2=rotFpt;
rotFpt2.transfo4d(rotLon120); rotFpt2.transfo4d(rotLon120);
sPainter.drawGreatCircleArc(fpt, rotFpt, NULL, viewp sPainter.drawGreatCircleArc(fpt, rotFpt, Q_NULLPTR,
ortEdgeIntersectCallback, &userData); viewportEdgeIntersectCallback, &userData);
sPainter.drawGreatCircleArc(rotFpt, rotFpt2, NULL, v sPainter.drawGreatCircleArc(rotFpt, rotFpt2, Q_NULLP
iewportEdgeIntersectCallback, &userData); TR, viewportEdgeIntersectCallback, &userData);
sPainter.drawGreatCircleArc(rotFpt2, fpt, NULL, view sPainter.drawGreatCircleArc(rotFpt2, fpt, Q_NULLPTR,
portEdgeIntersectCallback, &userData); viewportEdgeIntersectCallback, &userData);
return; return;
} }
else else
return; return;
} }
Vec3d middlePoint = p1+p2; Vec3d middlePoint = p1+p2;
middlePoint.normalize(); middlePoint.normalize();
if (!viewPortSphericalCap.contains(middlePoint)) if (!viewPortSphericalCap.contains(middlePoint))
middlePoint*=-1.; middlePoint*=-1.;
// Draw the arc in 2 sub-arcs to avoid lengths > 180 deg // Draw the arc in 2 sub-arcs to avoid lengths > 180 deg
sPainter.drawGreatCircleArc(p1, middlePoint, NULL, viewportEdgeInter sPainter.drawGreatCircleArc(p1, middlePoint, Q_NULLPTR, viewportEdge
sectCallback, &userData); IntersectCallback, &userData);
sPainter.drawGreatCircleArc(p2, middlePoint, NULL, viewportEdgeInter sPainter.drawGreatCircleArc(p2, middlePoint, Q_NULLPTR, viewportEdge
sectCallback, &userData); IntersectCallback, &userData);
sPainter.setLineSmooth(false); sPainter.setLineSmooth(false);
sPainter.setBlending(false); sPainter.setBlending(false);
// // Johannes: use a big radius as a dirty workaround for the bug that the // // Johannes: use a big radius as a dirty workaround for the bug that the
// // 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);
} }
skipping to change at line 1043 skipping to change at line 1053
sPainter.drawSprite2dMode(Vec3d(0,-1,0), 5.f); sPainter.drawSprite2dMode(Vec3d(0,-1,0), 5.f);
sPainter.drawText(Vec3d(0,-1,0), southernLabel, 0, s hift, shift, false); sPainter.drawText(Vec3d(0,-1,0), southernLabel, 0, s hift, shift, false);
break; break;
} }
default: default:
Q_ASSERT(0); Q_ASSERT(0);
} }
} }
GridLinesMgr::GridLinesMgr() GridLinesMgr::GridLinesMgr()
: gridlinesDisplayed(true)
{ {
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::FrameObservercentricEclipticJ20 00); eclJ2000Grid = new SkyGrid(StelCore::FrameObservercentricEclipticJ20 00);
eclGrid = new SkyGrid(StelCore::FrameObservercentricEclipticOfDate); eclGrid = new SkyGrid(StelCore::FrameObservercentricEclipticOfDate);
galacticGrid = new SkyGrid(StelCore::FrameGalactic); galacticGrid = new SkyGrid(StelCore::FrameGalactic);
supergalacticGrid = new SkyGrid(StelCore::FrameSupergalactic); supergalacticGrid = new SkyGrid(StelCore::FrameSupergalactic);
aziGrid = new SkyGrid(StelCore::FrameAltAz); aziGrid = new SkyGrid(StelCore::FrameAltAz);
equatorLine = new SkyLine(SkyLine::EQUATOR_OF_DATE); equatorLine = new SkyLine(SkyLine::EQUATOR_OF_DATE);
equatorJ2000Line = new SkyLine(SkyLine::EQUATOR_J2000); equatorJ2000Line = new SkyLine(SkyLine::EQUATOR_J2000);
eclipticJ2000Line = new SkyLine(SkyLine::ECLIPTIC_J2000); // previou s eclipticLine eclipticJ2000Line = new SkyLine(SkyLine::ECLIPTIC_J2000); // previou s eclipticLine
skipping to change at line 1079 skipping to change at line 1091
celestialPoles = new SkyPoint(SkyPoint::CELESTIALPOLES_OF_DATE); celestialPoles = new SkyPoint(SkyPoint::CELESTIALPOLES_OF_DATE);
zenithNadir = new SkyPoint(SkyPoint::ZENITH_NADIR); zenithNadir = new SkyPoint(SkyPoint::ZENITH_NADIR);
eclipticJ2000Poles = new SkyPoint(SkyPoint::ECLIPTICPOLES_J2000); eclipticJ2000Poles = new SkyPoint(SkyPoint::ECLIPTICPOLES_J2000);
eclipticPoles = new SkyPoint(SkyPoint::ECLIPTICPOLES_OF_DATE); eclipticPoles = new SkyPoint(SkyPoint::ECLIPTICPOLES_OF_DATE);
galacticPoles = new SkyPoint(SkyPoint::GALACTICPOLES); galacticPoles = new SkyPoint(SkyPoint::GALACTICPOLES);
supergalacticPoles = new SkyPoint(SkyPoint::SUPERGALACTICPOLES); supergalacticPoles = new SkyPoint(SkyPoint::SUPERGALACTICPOLES);
equinoxJ2000Points = new SkyPoint(SkyPoint::EQUINOXES_J2000); equinoxJ2000Points = new SkyPoint(SkyPoint::EQUINOXES_J2000);
equinoxPoints = new SkyPoint(SkyPoint::EQUINOXES_OF_DATE); equinoxPoints = new SkyPoint(SkyPoint::EQUINOXES_OF_DATE);
solsticeJ2000Points = new SkyPoint(SkyPoint::SOLSTICES_J2000); solsticeJ2000Points = new SkyPoint(SkyPoint::SOLSTICES_J2000);
solsticePoints = new SkyPoint(SkyPoint::SOLSTICES_OF_DATE); solsticePoints = new SkyPoint(SkyPoint::SOLSTICES_OF_DATE);
earth = GETSTELMODULE(SolarSystem)->getEarth();
connect(GETSTELMODULE(SolarSystem), SIGNAL(solarSystemDataReloaded()
), this, SLOT(connectEarthFromSolarSystem()));
} }
GridLinesMgr::~GridLinesMgr() GridLinesMgr::~GridLinesMgr()
{ {
delete equGrid; delete equGrid;
delete equJ2000Grid; delete equJ2000Grid;
delete eclJ2000Grid; delete eclJ2000Grid;
delete eclGrid; delete eclGrid;
delete galacticGrid; delete galacticGrid;
delete supergalacticGrid; delete supergalacticGrid;
skipping to change at line 1141 skipping to change at line 1156
QSettings* conf = StelApp::getInstance().getSettings(); QSettings* conf = StelApp::getInstance().getSettings();
Q_ASSERT(conf); Q_ASSERT(conf);
// Upgrade config keys // Upgrade config keys
if (conf->contains("color/longitude_color")) if (conf->contains("color/longitude_color"))
{ {
conf->setValue("color/oc_longitude_color", conf->value("colo r/longitude_color", "0.2,0.4,0.4").toString()); conf->setValue("color/oc_longitude_color", conf->value("colo r/longitude_color", "0.2,0.4,0.4").toString());
conf->remove("color/longitude_color"); conf->remove("color/longitude_color");
} }
setFlagGridlines(conf->value("viewing/flag_gridlines", true).toBool( ));
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()); setFlagEclipticJ2000Grid(conf->value("viewing/flag_ecliptic_J2000_gr id").toBool());
setFlagEclipticGrid(conf->value("viewing/flag_ecliptic_grid").toBool ()); setFlagEclipticGrid(conf->value("viewing/flag_ecliptic_grid").toBool ());
setFlagGalacticGrid(conf->value("viewing/flag_galactic_grid").toBool ()); setFlagGalacticGrid(conf->value("viewing/flag_galactic_grid").toBool ());
setFlagSupergalacticGrid(conf->value("viewing/flag_supergalactic_gri d").toBool()); setFlagSupergalacticGrid(conf->value("viewing/flag_supergalactic_gri d").toBool());
setFlagEquatorLine(conf->value("viewing/flag_equator_line").toBool() ); setFlagEquatorLine(conf->value("viewing/flag_equator_line").toBool() );
setFlagEquatorJ2000Line(conf->value("viewing/flag_equator_J2000_line ").toBool()); setFlagEquatorJ2000Line(conf->value("viewing/flag_equator_J2000_line ").toBool());
setFlagEclipticLine(conf->value("viewing/flag_ecliptic_line").toBool ()); setFlagEclipticLine(conf->value("viewing/flag_ecliptic_line").toBool ());
skipping to change at line 1211 skipping to change at line 1227
setColorSupergalacticPoles(StelUtils::strToVec3f(conf->value("color/ supergalactic_poles_color", defaultColor).toString())); setColorSupergalacticPoles(StelUtils::strToVec3f(conf->value("color/ supergalactic_poles_color", defaultColor).toString()));
setColorEquinoxJ2000Points(StelUtils::strToVec3f(conf->value("color/ equinox_J2000_points_color", defaultColor).toString())); setColorEquinoxJ2000Points(StelUtils::strToVec3f(conf->value("color/ equinox_J2000_points_color", defaultColor).toString()));
setColorEquinoxPoints(StelUtils::strToVec3f(conf->value("color/equin ox_points_color", defaultColor).toString())); setColorEquinoxPoints(StelUtils::strToVec3f(conf->value("color/equin ox_points_color", defaultColor).toString()));
setColorSolsticeJ2000Points(StelUtils::strToVec3f(conf->value("color /solstice_J2000_points_color", defaultColor).toString())); setColorSolsticeJ2000Points(StelUtils::strToVec3f(conf->value("color /solstice_J2000_points_color", defaultColor).toString()));
setColorSolsticePoints(StelUtils::strToVec3f(conf->value("color/sols tice_points_color", defaultColor).toString())); setColorSolsticePoints(StelUtils::strToVec3f(conf->value("color/sols tice_points_color", defaultColor).toString()));
StelApp& app = StelApp::getInstance(); StelApp& app = StelApp::getInstance();
connect(&app, SIGNAL(languageChanged()), this, SLOT(updateLineLabels ())); connect(&app, SIGNAL(languageChanged()), this, SLOT(updateLineLabels ()));
QString displayGroup = N_("Display Options"); QString displayGroup = N_("Display Options");
addAction("actionShow_Gridlines", displayGroup, N_("Grids and lines" ), "gridlinesDisplayed");
addAction("actionShow_Equatorial_Grid", displayGroup, N_("Equatorial grid"), "equatorGridDisplayed", "E"); addAction("actionShow_Equatorial_Grid", displayGroup, N_("Equatorial grid"), "equatorGridDisplayed", "E");
addAction("actionShow_Azimuthal_Grid", displayGroup, N_("Azimuthal g rid"), "azimuthalGridDisplayed", "Z"); addAction("actionShow_Azimuthal_Grid", displayGroup, N_("Azimuthal g rid"), "azimuthalGridDisplayed", "Z");
addAction("actionShow_Ecliptic_Line", displayGroup, N_("Ecliptic lin e"), "eclipticLineDisplayed", ","); addAction("actionShow_Ecliptic_Line", displayGroup, N_("Ecliptic lin e"), "eclipticLineDisplayed", ",");
addAction("actionShow_Ecliptic_J2000_Line", displayGroup, N_("Eclipt ic J2000 line"), "eclipticJ2000LineDisplayed"); addAction("actionShow_Ecliptic_J2000_Line", displayGroup, N_("Eclipt ic J2000 line"), "eclipticJ2000LineDisplayed");
addAction("actionShow_Equator_Line", displayGroup, N_("Equator line" ), "equatorLineDisplayed", "."); addAction("actionShow_Equator_Line", displayGroup, N_("Equator line" ), "equatorLineDisplayed", ".");
addAction("actionShow_Equator_J2000_Line", displayGroup, N_("Equator J2000 line"), "equatorJ2000LineDisplayed"); // or with Hotkey?? addAction("actionShow_Equator_J2000_Line", displayGroup, N_("Equator J2000 line"), "equatorJ2000LineDisplayed"); // or with Hotkey??
addAction("actionShow_Meridian_Line", displayGroup, N_("Meridian lin e"), "meridianLineDisplayed", ";"); addAction("actionShow_Meridian_Line", displayGroup, N_("Meridian lin e"), "meridianLineDisplayed", ";");
addAction("actionShow_Horizon_Line", displayGroup, N_("Horizon line" ), "horizonLineDisplayed", "H"); addAction("actionShow_Horizon_Line", displayGroup, N_("Horizon line" ), "horizonLineDisplayed", "H");
addAction("actionShow_Equatorial_J2000_Grid", displayGroup, N_("Equa torial J2000 grid"), "equatorJ2000GridDisplayed"); addAction("actionShow_Equatorial_J2000_Grid", displayGroup, N_("Equa torial J2000 grid"), "equatorJ2000GridDisplayed");
addAction("actionShow_Ecliptic_J2000_Grid", displayGroup, N_("Eclipt ic J2000 grid"), "eclipticJ2000GridDisplayed"); addAction("actionShow_Ecliptic_J2000_Grid", displayGroup, N_("Eclipt ic J2000 grid"), "eclipticJ2000GridDisplayed");
skipping to change at line 1244 skipping to change at line 1261
addAction("actionShow_Ecliptic_J2000_Poles", displayGroup, N_("Eclip tic J2000 poles"), "eclipticJ2000PolesDisplayed"); addAction("actionShow_Ecliptic_J2000_Poles", displayGroup, N_("Eclip tic J2000 poles"), "eclipticJ2000PolesDisplayed");
addAction("actionShow_Ecliptic_Poles", displayGroup, N_("Ecliptic po les"), "eclipticPolesDisplayed"); addAction("actionShow_Ecliptic_Poles", displayGroup, N_("Ecliptic po les"), "eclipticPolesDisplayed");
addAction("actionShow_Galactic_Poles", displayGroup, N_("Galactic po les"), "galacticPolesDisplayed"); addAction("actionShow_Galactic_Poles", displayGroup, N_("Galactic po les"), "galacticPolesDisplayed");
addAction("actionShow_Supergalactic_Poles", displayGroup, N_("Superg alactic poles"), "supergalacticPolesDisplayed"); addAction("actionShow_Supergalactic_Poles", displayGroup, N_("Superg alactic poles"), "supergalacticPolesDisplayed");
addAction("actionShow_Equinox_J2000_Points", displayGroup, N_("Equin ox J2000 points"), "equinoxJ2000PointsDisplayed"); addAction("actionShow_Equinox_J2000_Points", displayGroup, N_("Equin ox J2000 points"), "equinoxJ2000PointsDisplayed");
addAction("actionShow_Equinox_Points", displayGroup, N_("Equinox poi nts"), "equinoxPointsDisplayed"); addAction("actionShow_Equinox_Points", displayGroup, N_("Equinox poi nts"), "equinoxPointsDisplayed");
addAction("actionShow_Solstice_J2000_Points", displayGroup, N_("Sols tice J2000 points"), "solsticeJ2000PointsDisplayed"); addAction("actionShow_Solstice_J2000_Points", displayGroup, N_("Sols tice J2000 points"), "solsticeJ2000PointsDisplayed");
addAction("actionShow_Solstice_Points", displayGroup, N_("Solstice p oints"), "solsticePointsDisplayed"); addAction("actionShow_Solstice_Points", displayGroup, N_("Solstice p oints"), "solsticePointsDisplayed");
} }
void GridLinesMgr::connectEarthFromSolarSystem()
{
earth = GETSTELMODULE(SolarSystem)->getEarth();
}
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); eclJ2000Grid->update(deltaTime);
eclGrid->update(deltaTime); eclGrid->update(deltaTime);
galacticGrid->update(deltaTime); galacticGrid->update(deltaTime);
supergalacticGrid->update(deltaTime); supergalacticGrid->update(deltaTime);
aziGrid->update(deltaTime); aziGrid->update(deltaTime);
skipping to change at line 1285 skipping to change at line 1307
galacticPoles->update(deltaTime); galacticPoles->update(deltaTime);
supergalacticPoles->update(deltaTime); supergalacticPoles->update(deltaTime);
equinoxJ2000Points->update(deltaTime); equinoxJ2000Points->update(deltaTime);
equinoxPoints->update(deltaTime); equinoxPoints->update(deltaTime);
solsticeJ2000Points->update(deltaTime); solsticeJ2000Points->update(deltaTime);
solsticePoints->update(deltaTime); solsticePoints->update(deltaTime);
} }
void GridLinesMgr::draw(StelCore* core) void GridLinesMgr::draw(StelCore* core)
{ {
if (!gridlinesDisplayed)
return;
galacticGrid->draw(core); galacticGrid->draw(core);
supergalacticGrid->draw(core); supergalacticGrid->draw(core);
eclJ2000Grid->draw(core); eclJ2000Grid->draw(core);
// While ecliptic of J2000 may be helpful to get a feeling of the Z= 0 plane of VSOP87, // While ecliptic of J2000 may be helpful to get a feeling of the Z= 0 plane of VSOP87,
// ecliptic of date is related to Earth and does not make much sense for the other planets. // ecliptic of date is related to Earth and does not make much sense for the other planets.
// Of course, orbital plane of respective planet would be better, bu t is not implemented. // Of course, orbital plane of respective planet would be better, bu t is not implemented.
if (core->getCurrentPlanet()->getEnglishName()=="Earth") if (core->getCurrentPlanet()==earth)
{
eclGrid->draw(core); eclGrid->draw(core);
eclipticLine->draw(core);
precessionCircleN->draw(core);
precessionCircleS->draw(core);
colureLine_1->draw(core);
colureLine_2->draw(core);
eclipticPoles->draw(core);
equinoxPoints->draw(core);
solsticePoints->draw(core);
longitudeLine->draw(core);
}
equJ2000Grid->draw(core); equJ2000Grid->draw(core);
equGrid->draw(core); equGrid->draw(core);
aziGrid->draw(core); aziGrid->draw(core);
// Lines after grids, to be able to e.g. draw equators in different color! // Lines after grids, to be able to e.g. draw equators in different color!
galacticEquatorLine->draw(core); galacticEquatorLine->draw(core);
supergalacticEquatorLine->draw(core); supergalacticEquatorLine->draw(core);
eclipticJ2000Line->draw(core); eclipticJ2000Line->draw(core);
if (core->getCurrentPlanet()->getEnglishName()=="Earth")
{
eclipticLine->draw(core);
precessionCircleN->draw(core);
precessionCircleS->draw(core);
colureLine_1->draw(core);
colureLine_2->draw(core);
}
longitudeLine->draw(core);
equatorJ2000Line->draw(core); equatorJ2000Line->draw(core);
equatorLine->draw(core); equatorLine->draw(core);
meridianLine->draw(core); meridianLine->draw(core);
horizonLine->draw(core); horizonLine->draw(core);
primeVerticalLine->draw(core); primeVerticalLine->draw(core);
circumpolarCircleN->draw(core); circumpolarCircleN->draw(core);
circumpolarCircleS->draw(core); circumpolarCircleS->draw(core);
celestialJ2000Poles->draw(core); celestialJ2000Poles->draw(core);
celestialPoles->draw(core); celestialPoles->draw(core);
zenithNadir->draw(core); zenithNadir->draw(core);
eclipticJ2000Poles->draw(core); eclipticJ2000Poles->draw(core);
eclipticPoles->draw(core);
galacticPoles->draw(core); galacticPoles->draw(core);
supergalacticPoles->draw(core); supergalacticPoles->draw(core);
equinoxJ2000Points->draw(core); equinoxJ2000Points->draw(core);
equinoxPoints->draw(core);
solsticeJ2000Points->draw(core); solsticeJ2000Points->draw(core);
solsticePoints->draw(core);
} }
void GridLinesMgr::updateLineLabels() void GridLinesMgr::updateLineLabels()
{ {
equatorJ2000Line->updateLabel(); equatorJ2000Line->updateLabel();
equatorLine->updateLabel(); equatorLine->updateLabel();
eclipticLine->updateLabel(); eclipticLine->updateLabel();
eclipticJ2000Line->updateLabel(); eclipticJ2000Line->updateLabel();
precessionCircleN->updateLabel(); precessionCircleN->updateLabel();
precessionCircleS->updateLabel(); precessionCircleS->updateLabel();
skipping to change at line 1360 skipping to change at line 1385
eclipticJ2000Poles->updateLabel(); eclipticJ2000Poles->updateLabel();
eclipticPoles->updateLabel(); eclipticPoles->updateLabel();
galacticPoles->updateLabel(); galacticPoles->updateLabel();
supergalacticPoles->updateLabel(); supergalacticPoles->updateLabel();
equinoxJ2000Points->updateLabel(); equinoxJ2000Points->updateLabel();
equinoxPoints->updateLabel(); equinoxPoints->updateLabel();
solsticeJ2000Points->updateLabel(); solsticeJ2000Points->updateLabel();
solsticePoints->updateLabel(); solsticePoints->updateLabel();
} }
//! Setter ("master switch") for displaying any grid/line.
void GridLinesMgr::setFlagGridlines(const bool displayed)
{
if(displayed != gridlinesDisplayed) {
gridlinesDisplayed=displayed;
emit gridlinesDisplayedChanged(displayed);
}
}
//! Accessor ("master switch") for displaying any grid/line.
bool GridLinesMgr::getFlagGridlines(void) const
{
return gridlinesDisplayed;
}
//! 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);
} }
} }
//! Get flag for displaying Azimuthal Grid //! Get flag for displaying Azimuthal Grid
bool GridLinesMgr::getFlagAzimuthalGrid(void) const bool GridLinesMgr::getFlagAzimuthalGrid(void) const
 End of changes. 24 change blocks. 
42 lines changed or deleted 83 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/