ArchaeoLines.cpp   ArchaeoLines.cpp 
skipping to change at line 82 skipping to change at line 82
, flagShowSolstices(false) , flagShowSolstices(false)
, flagShowCrossquarters(false) , flagShowCrossquarters(false)
, flagShowMajorStandstills(false) , flagShowMajorStandstills(false)
, flagShowMinorStandstills(false) , flagShowMinorStandstills(false)
, flagShowZenithPassage(false) , flagShowZenithPassage(false)
, flagShowNadirPassage(false) , flagShowNadirPassage(false)
, flagShowSelectedObject(false) , flagShowSelectedObject(false)
, flagShowCurrentSun(false) , flagShowCurrentSun(false)
, flagShowCurrentMoon(false) , flagShowCurrentMoon(false)
, enumShowCurrentPlanet(ArchaeoLine::CurrentPlanetNone) , enumShowCurrentPlanet(ArchaeoLine::CurrentPlanetNone)
, lastJD(0.0) , lastJDE(0.0)
, toolbarButton(NULL) , toolbarButton(NULL)
{ {
setObjectName("ArchaeoLines"); setObjectName("ArchaeoLines");
font.setPixelSize(16); font.setPixelSize(16);
core=StelApp::getInstance().getCore(); core=StelApp::getInstance().getCore();
Q_ASSERT(core); Q_ASSERT(core);
objMgr=GETSTELMODULE(StelObjectMgr); objMgr=GETSTELMODULE(StelObjectMgr);
Q_ASSERT(objMgr); Q_ASSERT(objMgr);
// optimize readabiity so that each upper line of the lunistice doub les is labeled. // optimize readabiity so that each upper line of the lunistice doub les is labeled.
skipping to change at line 157 skipping to change at line 157
{ {
if (show) if (show)
configDialog->setVisible(true); configDialog->setVisible(true);
return true; return true;
} }
//! Determine which "layer" the plugin's drawing will happen on. //! Determine which "layer" the plugin's drawing will happen on.
double ArchaeoLines::getCallOrder(StelModuleActionName actionName) const double ArchaeoLines::getCallOrder(StelModuleActionName actionName) const
{ {
if (actionName==StelModule::ActionDraw) if (actionName==StelModule::ActionDraw)
return StelApp::getInstance().getModuleMgr().getModule("NebulaMgr" )->getCallOrder(actionName)+10.; // same as lines from core (hint AW) return StelApp::getInstance().getModuleMgr().getModule("GridLinesM gr")->getCallOrder(actionName)+1.; // one after GridlineMgr: else its equat or covers our equinox line!
return 0; return 0;
} }
void ArchaeoLines::init() void ArchaeoLines::init()
{ {
Q_ASSERT(equinoxLine); Q_ASSERT(equinoxLine);
Q_ASSERT(northernSolsticeLine); Q_ASSERT(northernSolsticeLine);
Q_ASSERT(southernSolsticeLine); Q_ASSERT(southernSolsticeLine);
Q_ASSERT(northernCrossquarterLine); Q_ASSERT(northernCrossquarterLine);
Q_ASSERT(southernCrossquarterLine); Q_ASSERT(southernCrossquarterLine);
skipping to change at line 215 skipping to change at line 215
} }
} }
catch (std::runtime_error& e) catch (std::runtime_error& e)
{ {
qWarning() << "WARNING: unable to create toolbar button for ArchaeoLines plugin: " << e.what(); qWarning() << "WARNING: unable to create toolbar button for ArchaeoLines plugin: " << e.what();
} }
} }
void ArchaeoLines::update(double deltaTime) void ArchaeoLines::update(double deltaTime)
{ {
if (core->getCurrentPlanet()->getEnglishName()!="Earth")
return;
static SolarSystem *ssystem=GETSTELMODULE(SolarSystem); static SolarSystem *ssystem=GETSTELMODULE(SolarSystem);
static const double lunarI=5.145396; // inclination of lunar orbit static const double lunarI=5.145396; // inclination of lunar orbit
// compute min and max distance values for horizontal parallax. // compute min and max distance values for horizontal parallax.
// Meeus, AstrAlg 98, p342. // Meeus, AstrAlg 98, p342.
static const double meanDist=385000.56; // km earth-moon. static const double meanDist=385000.56; // km earth-moon.
static const double addedValues=20905.355+3699.111+2955.968+569.925+ 48.888+3.149+246.158+152.138+170.733+ static const double addedValues=20905.355+3699.111+2955.968+569.925+ 48.888+3.149+246.158+152.138+170.733+
204.586+129.620+108.743+104.755+10.321+79.661+34.782 +23.210+21.636+24.208+30.824+8.379+ 204.586+129.620+108.743+104.755+10.321+79.661+34.782 +23.210+21.636+24.208+30.824+8.379+
16.675+12.831+10.445+11.650+14.403+7.003+10.056+6.32 2+9.884; 16.675+12.831+10.445+11.650+14.403+7.003+10.056+6.32 2+9.884;
static const double minDist=meanDist-addedValues; static const double minDist=meanDist-addedValues;
static const double maxDist=meanDist+addedValues; static const double maxDist=meanDist+addedValues;
skipping to change at line 247 skipping to change at line 250
if (enumShowCurrentPlanet>ArchaeoLine::CurrentPlanetNone) if (enumShowCurrentPlanet>ArchaeoLine::CurrentPlanetNone)
{ {
const char *planetStrings[]={"", "Mercury", "Venus", "Mars", "Jupiter", "Saturn"}; const char *planetStrings[]={"", "Mercury", "Venus", "Mars", "Jupiter", "Saturn"};
QString currentPlanet(planetStrings[enumShowCurrentPlanet - ArchaeoLine::CurrentPlanetNone]); QString currentPlanet(planetStrings[enumShowCurrentPlanet - ArchaeoLine::CurrentPlanetNone]);
planet=ssystem->searchByEnglishName(currentPlanet); planet=ssystem->searchByEnglishName(currentPlanet);
Q_ASSERT(planet); Q_ASSERT(planet);
StelUtils::rectToSphe(&ra_equ,&dec_equ,planet->getEquinoxEqu atorialPos(core)); StelUtils::rectToSphe(&ra_equ,&dec_equ,planet->getEquinoxEqu atorialPos(core));
currentPlanetLine->setDeclination(dec_equ * 180.0/M_PI); currentPlanetLine->setDeclination(dec_equ * 180.0/M_PI);
} }
double newJD=core->getJDay(); double newJDE=core->getJDE();
if (fabs(newJD-lastJD) > 10.0) // enough to compute this every 10 da if (fabs(newJDE-lastJDE) > 10.0) // enough to compute this every 10
ys? days?
{ {
eps= ssystem->getEarth()->getRotObliquity(core->getJDay()) * 180.0/M_PI; eps= ssystem->getEarth()->getRotObliquity(newJDE) *180.0/M_P I;
static const double invSqrt2=1.0/std::sqrt(2.0); static const double invSqrt2=1.0/std::sqrt(2.0);
northernSolsticeLine->setDeclination( eps); northernSolsticeLine->setDeclination( eps);
southernSolsticeLine->setDeclination(-eps); southernSolsticeLine->setDeclination(-eps);
northernCrossquarterLine->setDeclination( eps*invSqrt2); northernCrossquarterLine->setDeclination( eps*invSqrt2);
southernCrossquarterLine->setDeclination(-eps*invSqrt2); southernCrossquarterLine->setDeclination(-eps*invSqrt2);
lastJD=newJD; lastJDE=newJDE;
} }
StelLocation loc=core->getCurrentLocation(); StelLocation loc=core->getCurrentLocation();
// compute parallax correction with Meeus 40.6. First, find H from h =0, then add corrections. // compute parallax correction with Meeus 40.6. First, find H from h =0, then add corrections.
static const double b_over_a=0.99664719; static const double b_over_a=0.99664719;
double latRad=loc.latitude*M_PI/180.0; double latRad=loc.latitude*M_PI/180.0;
double u=std::atan(b_over_a*std::tan(latRad)); double u=std::atan(b_over_a*std::tan(latRad));
double rhoSinPhiP=b_over_a*std::sin(u)+loc.altitude/6378140.0*std::s in(latRad); double rhoSinPhiP=b_over_a*std::sin(u)+loc.altitude/6378140.0*std::s in(latRad);
double rhoCosPhiP= std::cos(u)+loc.altitude/6378140.0*std::c os(latRad); double rhoCosPhiP= std::cos(u)+loc.altitude/6378140.0*std::c os(latRad);
skipping to change at line 349 skipping to change at line 352
currentSunLine->update(deltaTime); currentSunLine->update(deltaTime);
currentMoonLine->update(deltaTime); currentMoonLine->update(deltaTime);
currentPlanetLine->update(deltaTime); currentPlanetLine->update(deltaTime);
withDecimalDegree = StelApp::getInstance().getFlagShowDecimalDegrees ();; withDecimalDegree = StelApp::getInstance().getFlagShowDecimalDegrees ();;
} }
//! Draw any parts on the screen which are for our module //! Draw any parts on the screen which are for our module
void ArchaeoLines::draw(StelCore* core) void ArchaeoLines::draw(StelCore* core)
{ {
if (core->getCurrentPlanet()->getEnglishName()!="Earth")
return;
equinoxLine->draw(core, lineFader.getInterstate()); equinoxLine->draw(core, lineFader.getInterstate());
northernSolsticeLine->draw(core, lineFader.getInterstate()); northernSolsticeLine->draw(core, lineFader.getInterstate());
southernSolsticeLine->draw(core, lineFader.getInterstate()); southernSolsticeLine->draw(core, lineFader.getInterstate());
northernCrossquarterLine->draw(core, lineFader.getInterstate()); northernCrossquarterLine->draw(core, lineFader.getInterstate());
southernCrossquarterLine->draw(core, lineFader.getInterstate()); southernCrossquarterLine->draw(core, lineFader.getInterstate());
northernMajorStandstillLine0->draw(core, lineFader.getInterstate()); northernMajorStandstillLine0->draw(core, lineFader.getInterstate());
northernMajorStandstillLine1->draw(core, lineFader.getInterstate()); northernMajorStandstillLine1->draw(core, lineFader.getInterstate());
northernMinorStandstillLine2->draw(core, lineFader.getInterstate()); northernMinorStandstillLine2->draw(core, lineFader.getInterstate());
northernMinorStandstillLine3->draw(core, lineFader.getInterstate()); northernMinorStandstillLine3->draw(core, lineFader.getInterstate());
southernMinorStandstillLine4->draw(core, lineFader.getInterstate()); southernMinorStandstillLine4->draw(core, lineFader.getInterstate());
skipping to change at line 671 skipping to change at line 677
break; break;
case ArchaeoLine::CurrentPlanetNone: case ArchaeoLine::CurrentPlanetNone:
case ArchaeoLine::CurrentPlanetMercury: case ArchaeoLine::CurrentPlanetMercury:
case ArchaeoLine::CurrentPlanetVenus: case ArchaeoLine::CurrentPlanetVenus:
case ArchaeoLine::CurrentPlanetMars: case ArchaeoLine::CurrentPlanetMars:
case ArchaeoLine::CurrentPlanetJupiter: case ArchaeoLine::CurrentPlanetJupiter:
case ArchaeoLine::CurrentPlanetSaturn: case ArchaeoLine::CurrentPlanetSaturn:
vColor=&currentPlanetColor; vColor=&currentPlanetColor;
break; break;
default: default:
vColor=&selectedObjectColor; // this is only to sile nce compiler warning about uninitialized variable vColor.
Q_ASSERT(0); Q_ASSERT(0);
} }
color.setRgbF(vColor->v[0], vColor->v[1], vColor->v[2]); color.setRgbF(vColor->v[0], vColor->v[1], vColor->v[2]);
return color; return color;
} }
// callback stuff shamelessly taken from GridLinesMgr. Changes: Text MUST b e filled, can also be empty for no label! // callback stuff shamelessly taken from GridLinesMgr. Changes: Text MUST b e filled, can also be empty for no label!
struct ALViewportEdgeIntersectCallbackData struct ALViewportEdgeIntersectCallbackData
{ {
ALViewportEdgeIntersectCallbackData(StelPainter* p) ALViewportEdgeIntersectCallbackData(StelPainter* p)
 End of changes. 8 change blocks. 
7 lines changed or deleted 14 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/