ArchaeoLines.cpp   ArchaeoLines.cpp 
skipping to change at line 92 skipping to change at line 92
, flagShowGeographicLocation1(false) , flagShowGeographicLocation1(false)
, geographicLocation1Longitude(39.8) // approx. Mecca , geographicLocation1Longitude(39.8) // approx. Mecca
, geographicLocation1Latitude(21.4) , geographicLocation1Latitude(21.4)
, flagShowGeographicLocation2(false) , flagShowGeographicLocation2(false)
, geographicLocation2Longitude(35.2) // approx. Jerusalem , geographicLocation2Longitude(35.2) // approx. Jerusalem
, geographicLocation2Latitude(31.8) , geographicLocation2Latitude(31.8)
, flagShowCustomAzimuth1(false) , flagShowCustomAzimuth1(false)
, flagShowCustomAzimuth2(false) , flagShowCustomAzimuth2(false)
//, customAzimuth1(0.0) //, customAzimuth1(0.0)
//, customAzimuth2(0.0) //, customAzimuth2(0.0)
, flagShowCustomDeclination1(false)
, flagShowCustomDeclination2(false)
, lastJDE(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);
skipping to change at line 130 skipping to change at line 132
zenithPassageLine = new ArchaeoLine(ArchaeoLine::ZenithPassage, 48. 0); zenithPassageLine = new ArchaeoLine(ArchaeoLine::ZenithPassage, 48. 0);
nadirPassageLine = new ArchaeoLine(ArchaeoLine::NadirPassage, 42.0 ); nadirPassageLine = new ArchaeoLine(ArchaeoLine::NadirPassage, 42.0 );
selectedObjectLine = new ArchaeoLine(ArchaeoLine::SelectedObject, 0. 0); selectedObjectLine = new ArchaeoLine(ArchaeoLine::SelectedObject, 0. 0);
currentSunLine = new ArchaeoLine(ArchaeoLine::CurrentSun, 0.0); currentSunLine = new ArchaeoLine(ArchaeoLine::CurrentSun, 0.0);
currentMoonLine = new ArchaeoLine(ArchaeoLine::CurrentMoon, 0.0); currentMoonLine = new ArchaeoLine(ArchaeoLine::CurrentMoon, 0.0);
currentPlanetLine = new ArchaeoLine(ArchaeoLine::CurrentPlanetNone, 0.0); currentPlanetLine = new ArchaeoLine(ArchaeoLine::CurrentPlanetNone, 0.0);
geographicLocation1Line = new ArchaeoLine(ArchaeoLine::GeographicLoc ation1, 0.0); geographicLocation1Line = new ArchaeoLine(ArchaeoLine::GeographicLoc ation1, 0.0);
geographicLocation2Line = new ArchaeoLine(ArchaeoLine::GeographicLoc ation2, 0.0); geographicLocation2Line = new ArchaeoLine(ArchaeoLine::GeographicLoc ation2, 0.0);
customAzimuth1Line = new ArchaeoLine(ArchaeoLine::CustomAzimuth1, 0. 0); customAzimuth1Line = new ArchaeoLine(ArchaeoLine::CustomAzimuth1, 0. 0);
customAzimuth2Line = new ArchaeoLine(ArchaeoLine::CustomAzimuth2, 0. 0); customAzimuth2Line = new ArchaeoLine(ArchaeoLine::CustomAzimuth2, 0. 0);
customDeclination1Line = new ArchaeoLine(ArchaeoLine::CustomDeclinat
ion1, 0.0);
customDeclination2Line = new ArchaeoLine(ArchaeoLine::CustomDeclinat
ion2, 0.0);
configDialog = new ArchaeoLinesDialog(); configDialog = new ArchaeoLinesDialog();
conf = StelApp::getInstance().getSettings(); conf = StelApp::getInstance().getSettings();
connect(core, SIGNAL(locationChanged(StelLocation)), this, SLOT(upda teObserverLocation(StelLocation))); connect(core, SIGNAL(locationChanged(StelLocation)), this, SLOT(upda teObserverLocation(StelLocation)));
} }
ArchaeoLines::~ArchaeoLines() ArchaeoLines::~ArchaeoLines()
{ {
skipping to change at line 163 skipping to change at line 167
delete zenithPassageLine; zenithPassageLine=NULL; delete zenithPassageLine; zenithPassageLine=NULL;
delete nadirPassageLine; nadirPassageLine=NULL; delete nadirPassageLine; nadirPassageLine=NULL;
delete selectedObjectLine; selectedObjectLine=NULL; delete selectedObjectLine; selectedObjectLine=NULL;
delete currentSunLine; currentSunLine=NULL; delete currentSunLine; currentSunLine=NULL;
delete currentMoonLine; currentMoonLine=NULL; delete currentMoonLine; currentMoonLine=NULL;
delete currentPlanetLine; currentPlanetLine=NULL; delete currentPlanetLine; currentPlanetLine=NULL;
delete geographicLocation1Line; geographicLocation1Line=NULL; delete geographicLocation1Line; geographicLocation1Line=NULL;
delete geographicLocation2Line; geographicLocation2Line=NULL; delete geographicLocation2Line; geographicLocation2Line=NULL;
delete customAzimuth1Line; customAzimuth1Line=NULL; delete customAzimuth1Line; customAzimuth1Line=NULL;
delete customAzimuth2Line; customAzimuth2Line=NULL; delete customAzimuth2Line; customAzimuth2Line=NULL;
delete customDeclination1Line; customDeclination1Line=NULL;
delete customDeclination2Line; customDeclination2Line=NULL;
delete configDialog; configDialog=NULL; delete configDialog; configDialog=NULL;
} }
bool ArchaeoLines::configureGui(bool show) bool ArchaeoLines::configureGui(bool show)
{ {
if (show) if (show)
configDialog->setVisible(true); configDialog->setVisible(true);
return true; return true;
} }
skipping to change at line 207 skipping to change at line 213
Q_ASSERT(zenithPassageLine); Q_ASSERT(zenithPassageLine);
Q_ASSERT(nadirPassageLine); Q_ASSERT(nadirPassageLine);
Q_ASSERT(selectedObjectLine); Q_ASSERT(selectedObjectLine);
Q_ASSERT(currentSunLine); Q_ASSERT(currentSunLine);
Q_ASSERT(currentMoonLine); Q_ASSERT(currentMoonLine);
Q_ASSERT(currentPlanetLine); Q_ASSERT(currentPlanetLine);
Q_ASSERT(geographicLocation1Line); Q_ASSERT(geographicLocation1Line);
Q_ASSERT(geographicLocation2Line); Q_ASSERT(geographicLocation2Line);
Q_ASSERT(customAzimuth1Line); Q_ASSERT(customAzimuth1Line);
Q_ASSERT(customAzimuth2Line); Q_ASSERT(customAzimuth2Line);
Q_ASSERT(customDeclination1Line);
Q_ASSERT(customDeclination2Line);
// if (!conf->childGroups().contains("ArchaeoLines")) // if (!conf->childGroups().contains("ArchaeoLines"))
// restoreDefaultSettings(); // restoreDefaultSettings();
loadSettings(); loadSettings();
StelApp& app = StelApp::getInstance(); StelApp& app = StelApp::getInstance();
// Create action for enable/disable & hook up signals // Create action for enable/disable & hook up signals
QString section=N_("ArchaeoLines"); QString section=N_("ArchaeoLines");
skipping to change at line 247 skipping to change at line 255
addAction("actionAL_showEquinoxLine", section, N_("Show Lin e for Equinox"), "flagShowEquinox" ); // No Shortcuts co nfigured. addAction("actionAL_showEquinoxLine", section, N_("Show Lin e for Equinox"), "flagShowEquinox" ); // No Shortcuts co nfigured.
addAction("actionAL_showSolsticeLines", section, N_("Show Lin e for Solstices"), "flagShowSolstices" ); // No Shortcuts co nfigured. addAction("actionAL_showSolsticeLines", section, N_("Show Lin e for Solstices"), "flagShowSolstices" ); // No Shortcuts co nfigured.
addAction("actionAL_showCrossquarterLines", section, N_("Show Lin e for Crossquarter"), "flagShowCrossquarters" ); // No Shortcuts co nfigured. addAction("actionAL_showCrossquarterLines", section, N_("Show Lin e for Crossquarter"), "flagShowCrossquarters" ); // No Shortcuts co nfigured.
addAction("actionAL_showMajorStandstillLines", section, N_("Show Lin e for Major Standstill"), "flagShowMajorStandstills"); // No Shortcuts co nfigured. addAction("actionAL_showMajorStandstillLines", section, N_("Show Lin e for Major Standstill"), "flagShowMajorStandstills"); // No Shortcuts co nfigured.
addAction("actionAL_showMinorStandstillLines", section, N_("Show Lin e for Minor Standstill"), "flagShowMinorStandstills"); // No Shortcuts co nfigured. addAction("actionAL_showMinorStandstillLines", section, N_("Show Lin e for Minor Standstill"), "flagShowMinorStandstills"); // No Shortcuts co nfigured.
addAction("actionAL_showZenithPassageLine", section, N_("Show Lin e for Zenith Passage"), "flagShowZenithPassage" ); // No Shortcuts co nfigured. addAction("actionAL_showZenithPassageLine", section, N_("Show Lin e for Zenith Passage"), "flagShowZenithPassage" ); // No Shortcuts co nfigured.
addAction("actionAL_showNadirPassageLine", section, N_("Show Lin e for Nadir Passage"), "flagShowNadirPassage" ); // No Shortcuts co nfigured. addAction("actionAL_showNadirPassageLine", section, N_("Show Lin e for Nadir Passage"), "flagShowNadirPassage" ); // No Shortcuts co nfigured.
addAction("actionAL_showSelectedObjectLine", section, N_("Show Lin e for Selected Object"), "flagShowSelectedObject" ); // No Shortcuts co nfigured. addAction("actionAL_showSelectedObjectLine", section, N_("Show Lin e for Selected Object"), "flagShowSelectedObject" ); // No Shortcuts co nfigured.
addAction("actionAL_showCurrentSunLine", section, N_("Show Lin e for Current Sun"), "flagShowCurrentSun" ); // No Shortcuts co nfigured. addAction("actionAL_showCurrentSunLine", section, N_("Show Lin e for Current Sun"), "flagShowCurrentSun" ); // No Shortcuts co nfigured.
addAction("actionAL_showCurrentMoonLine", section, N_("Show Lin e for Current Moon"), "flagShowCurrentMoon" ); // No Shortcuts co nfigured. addAction("actionAL_showCurrentMoonLine", section, N_("Show Lin e for Current Moon"), "flagShowCurrentMoon" ); // No Shortcuts co nfigured.
addAction("actionAL_showGeographicLocation1Line", section, N_("Sho addAction("actionAL_showGeographicLocation1Line",section, N_("Show L
w Line for Geographic Location 1"), "flagShowGeographicLocation1" ); // ine for Geographic Location 1"), "flagShowGeographicLocation1" ); // No
No Shortcuts configured. Shortcuts configured.
addAction("actionAL_showGeographicLocation2Line", section, N_("Sho addAction("actionAL_showGeographicLocation2Line",section, N_("Show L
w Line for Geographic Location 2"), "flagShowGeographicLocation2" ); // ine for Geographic Location 2"), "flagShowGeographicLocation2" ); // No
No Shortcuts configured. Shortcuts configured.
addAction("actionAL_showCustomAzimuth1Line", section, N_("Show Lin addAction("actionAL_showCustomAzimuth1Line", section, N_("Show L
e for Custom Azimuth 1"), "flagShowCustomAzimuth1" ); // No Shortcuts co ine for Custom Azimuth 1"), "flagShowCustomAzimuth1" ); // No Shortcuts
nfigured. configured.
addAction("actionAL_showCustomAzimuth2Line", section, N_("Show Lin addAction("actionAL_showCustomAzimuth2Line", section, N_("Show L
e for Custom Azimuth 2"), "flagShowCustomAzimuth2" ); // No Shortcuts co ine for Custom Azimuth 2"), "flagShowCustomAzimuth2" ); // No Shortcuts
nfigured. configured.
addAction("actionAL_showCustomDeclination1Line", section, N_("Show L
ine for Custom Declination 1"), "flagShowCustomDeclination1" ); // No Sh
ortcuts configured.
addAction("actionAL_showCustomDeclination2Line", section, N_("Show L
ine for Custom Declination 2"), "flagShowCustomDeclination2" ); // No Sh
ortcuts configured.
} }
void ArchaeoLines::update(double deltaTime) void ArchaeoLines::update(double deltaTime)
{ {
if (core->getCurrentPlanet()->getEnglishName()!="Earth") if (core->getCurrentPlanet()->getEnglishName()!="Earth")
return; 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.
skipping to change at line 389 skipping to change at line 399
zenithPassageLine->update(deltaTime); zenithPassageLine->update(deltaTime);
nadirPassageLine->update(deltaTime); nadirPassageLine->update(deltaTime);
selectedObjectLine->update(deltaTime); selectedObjectLine->update(deltaTime);
currentSunLine->update(deltaTime); currentSunLine->update(deltaTime);
currentMoonLine->update(deltaTime); currentMoonLine->update(deltaTime);
currentPlanetLine->update(deltaTime); currentPlanetLine->update(deltaTime);
geographicLocation1Line->update(deltaTime); geographicLocation1Line->update(deltaTime);
geographicLocation2Line->update(deltaTime); geographicLocation2Line->update(deltaTime);
customAzimuth1Line->update(deltaTime); customAzimuth1Line->update(deltaTime);
customAzimuth2Line->update(deltaTime); customAzimuth2Line->update(deltaTime);
customDeclination1Line->update(deltaTime);
customDeclination2Line->update(deltaTime);
//withDecimalDegree = StelApp::getInstance().getFlagShowDecimalDegre es();; //withDecimalDegree = StelApp::getInstance().getFlagShowDecimalDegre es();;
} }
//! 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") if (core->getCurrentPlanet()->getEnglishName()!="Earth")
return; return;
skipping to change at line 424 skipping to change at line 436
if (objMgr->getWasSelected()) if (objMgr->getWasSelected())
selectedObjectLine->draw(core, lineFader.getInterstate()); selectedObjectLine->draw(core, lineFader.getInterstate());
currentSunLine->draw(core, lineFader.getInterstate()); currentSunLine->draw(core, lineFader.getInterstate());
currentMoonLine->draw(core, lineFader.getInterstate()); currentMoonLine->draw(core, lineFader.getInterstate());
if (enumShowCurrentPlanet>ArchaeoLine::CurrentPlanetNone) if (enumShowCurrentPlanet>ArchaeoLine::CurrentPlanetNone)
currentPlanetLine->draw(core, lineFader.getInterstate()); currentPlanetLine->draw(core, lineFader.getInterstate());
geographicLocation1Line->draw(core, lineFader.getInterstate()); geographicLocation1Line->draw(core, lineFader.getInterstate());
geographicLocation2Line->draw(core, lineFader.getInterstate()); geographicLocation2Line->draw(core, lineFader.getInterstate());
customAzimuth1Line->draw(core, lineFader.getInterstate()); customAzimuth1Line->draw(core, lineFader.getInterstate());
customAzimuth2Line->draw(core, lineFader.getInterstate()); customAzimuth2Line->draw(core, lineFader.getInterstate());
customDeclination1Line->draw(core, lineFader.getInterstate());
customDeclination2Line->draw(core, lineFader.getInterstate());
} }
void ArchaeoLines::enableArchaeoLines(bool b) void ArchaeoLines::enableArchaeoLines(bool b)
{ {
if (b!=flagShowArchaeoLines) if (b!=flagShowArchaeoLines)
{ {
flagShowArchaeoLines = b; flagShowArchaeoLines = b;
lineFader = b; lineFader = b;
conf->setValue("ArchaeoLines/enable_at_startup", flagShowArc haeoLines); conf->setValue("ArchaeoLines/enable_at_startup", flagShowArc haeoLines);
emit archaeoLinesEnabledChanged(b); emit archaeoLinesEnabledChanged(b);
skipping to change at line 448 skipping to change at line 462
{ {
Q_ASSERT(conf); Q_ASSERT(conf);
// Remove the old values... // Remove the old values...
conf->remove("ArchaeoLines"); conf->remove("ArchaeoLines");
// ...load the default values... // ...load the default values...
loadSettings(); loadSettings();
} }
void ArchaeoLines::loadSettings() void ArchaeoLines::loadSettings()
{ {
equinoxColor = StelUtils::strToVec3f(conf->value("ArchaeoLin es/color_equinox", "1.00,1.00,0.5").toString()); equinoxColor = StelUtils::strToVec3f(conf->value("ArchaeoLin es/color_equinox", "1.00,1.00,0.50").toString());
equinoxLine->setColor(equinoxColor); equinoxLine->setColor(equinoxColor);
solsticesColor = StelUtils::strToVec3f(conf->value("ArchaeoLin es/color_solstices", "1.00,0.15,0.15").toString()); solsticesColor = StelUtils::strToVec3f(conf->value("ArchaeoLin es/color_solstices", "1.00,0.15,0.15").toString());
northernSolsticeLine->setColor(solsticesColor); northernSolsticeLine->setColor(solsticesColor);
southernSolsticeLine->setColor(solsticesColor); southernSolsticeLine->setColor(solsticesColor);
crossquartersColor = StelUtils::strToVec3f(conf->value("ArchaeoLin es/color_crossquarters", "1.00,0.75,0.25").toString()); crossquartersColor = StelUtils::strToVec3f(conf->value("ArchaeoLin es/color_crossquarters", "1.00,0.75,0.25").toString());
northernCrossquarterLine->setColor(crossquartersColor); northernCrossquarterLine->setColor(crossquartersColor);
southernCrossquarterLine->setColor(crossquartersColor); southernCrossquarterLine->setColor(crossquartersColor);
majorStandstillColor = StelUtils::strToVec3f(conf->value("ArchaeoLin es/color_major_standstill", "0.25,1.00,0.25").toString()); majorStandstillColor = StelUtils::strToVec3f(conf->value("ArchaeoLin es/color_major_standstill", "0.25,1.00,0.25").toString());
northernMajorStandstillLine0->setColor(majorStandstillColor); northernMajorStandstillLine0->setColor(majorStandstillColor);
northernMajorStandstillLine1->setColor(majorStandstillColor); northernMajorStandstillLine1->setColor(majorStandstillColor);
skipping to change at line 486 skipping to change at line 500
currentPlanetColor = StelUtils::strToVec3f(conf->value("ArchaeoLi nes/color_current_planet", "0.25,0.80,1.00").toString()); currentPlanetColor = StelUtils::strToVec3f(conf->value("ArchaeoLi nes/color_current_planet", "0.25,0.80,1.00").toString());
currentPlanetLine->setColor(currentPlanetColor); currentPlanetLine->setColor(currentPlanetColor);
geographicLocation1Color = StelUtils::strToVec3f(conf->value("Arch aeoLines/color_geographic_location_1", "0.25,1.00,0.25").toString()); geographicLocation1Color = StelUtils::strToVec3f(conf->value("Arch aeoLines/color_geographic_location_1", "0.25,1.00,0.25").toString());
geographicLocation1Line->setColor(geographicLocation1Color); geographicLocation1Line->setColor(geographicLocation1Color);
geographicLocation2Color = StelUtils::strToVec3f(conf->value("Arch aeoLines/color_geographic_location_2", "0.25,0.25,1.00").toString()); geographicLocation2Color = StelUtils::strToVec3f(conf->value("Arch aeoLines/color_geographic_location_2", "0.25,0.25,1.00").toString());
geographicLocation2Line->setColor(geographicLocation2Color); geographicLocation2Line->setColor(geographicLocation2Color);
customAzimuth1Color = StelUtils::strToVec3f(conf->value("ArchaeoLi nes/color_custom_azimuth_1", "0.25,1.00,0.25").toString()); customAzimuth1Color = StelUtils::strToVec3f(conf->value("ArchaeoLi nes/color_custom_azimuth_1", "0.25,1.00,0.25").toString());
customAzimuth1Line->setColor(customAzimuth1Color); customAzimuth1Line->setColor(customAzimuth1Color);
customAzimuth2Color = StelUtils::strToVec3f(conf->value("ArchaeoLi nes/color_custom_azimuth_2", "0.25,0.50,0.75").toString()); customAzimuth2Color = StelUtils::strToVec3f(conf->value("ArchaeoLi nes/color_custom_azimuth_2", "0.25,0.50,0.75").toString());
customAzimuth2Line->setColor(customAzimuth2Color); customAzimuth2Line->setColor(customAzimuth2Color);
customDeclination1Color = StelUtils::strToVec3f(conf->value("Archa
eoLines/color_custom_declination_1", "0.45,1.00,0.15").toString());
customDeclination1Line->setColor(customDeclination1Color);
customDeclination2Color = StelUtils::strToVec3f(conf->value("Archa
eoLines/color_custom_declination_2", "0.45,0.50,0.65").toString());
customDeclination2Line->setColor(customDeclination2Color);
setGeographicLocation1Longitude(conf->value("ArchaeoLines/geographic _location_1_longitude", 39.826175).toDouble()); setGeographicLocation1Longitude(conf->value("ArchaeoLines/geographic _location_1_longitude", 39.826175).toDouble());
setGeographicLocation1Latitude( conf->value("ArchaeoLines/geographic _location_1_latitude", 21.422476).toDouble()); setGeographicLocation1Latitude( conf->value("ArchaeoLines/geographic _location_1_latitude", 21.422476).toDouble());
setGeographicLocation2Longitude(conf->value("ArchaeoLines/geographic _location_2_longitude", 35.235774).toDouble()); setGeographicLocation2Longitude(conf->value("ArchaeoLines/geographic _location_2_longitude", 35.235774).toDouble());
setGeographicLocation2Latitude( conf->value("ArchaeoLines/geographic _location_2_latitude", 31.778087).toDouble()); setGeographicLocation2Latitude( conf->value("ArchaeoLines/geographic _location_2_latitude", 31.778087).toDouble());
StelLocation loc=core->getCurrentLocation(); StelLocation loc=core->getCurrentLocation();
geographicLocation1Line->setDefiningAngle(getAzimuthForLocation(loc. longitude, loc.latitude, geographicLocation1Longitude, geographicLocation1L atitude)); geographicLocation1Line->setDefiningAngle(getAzimuthForLocation(loc. longitude, loc.latitude, geographicLocation1Longitude, geographicLocation1L atitude));
geographicLocation2Line->setDefiningAngle(getAzimuthForLocation(loc. longitude, loc.latitude, geographicLocation2Longitude, geographicLocation2L atitude)); geographicLocation2Line->setDefiningAngle(getAzimuthForLocation(loc. longitude, loc.latitude, geographicLocation2Longitude, geographicLocation2L atitude));
geographicLocation1Line->setLabel(conf->value("ArchaeoLines/geograph ic_location_1_label", "Mecca (Qibla)").toString()); geographicLocation1Line->setLabel(conf->value("ArchaeoLines/geograph ic_location_1_label", "Mecca (Qibla)").toString());
geographicLocation2Line->setLabel(conf->value("ArchaeoLines/geograph ic_location_2_label", "Jerusalem").toString()); geographicLocation2Line->setLabel(conf->value("ArchaeoLines/geograph ic_location_2_label", "Jerusalem").toString());
customAzimuth1Line->setDefiningAngle(conf->value("ArchaeoLines/custo m_azimuth_1_angle", 0.0).toDouble()); customAzimuth1Line->setDefiningAngle(conf->value("ArchaeoLines/custo m_azimuth_1_angle", 0.0).toDouble());
customAzimuth2Line->setDefiningAngle(conf->value("ArchaeoLines/custo m_azimuth_2_angle", 0.0).toDouble()); customAzimuth2Line->setDefiningAngle(conf->value("ArchaeoLines/custo m_azimuth_2_angle", 0.0).toDouble());
customAzimuth1Line->setLabel(conf->value("ArchaeoLines/custom_azimut h_1_label", "custAzi1").toString()); customAzimuth1Line->setLabel(conf->value("ArchaeoLines/custom_azimut h_1_label", "custAzi1").toString());
customAzimuth2Line->setLabel(conf->value("ArchaeoLines/custom_azimut h_2_label", "custAzi2").toString()); customAzimuth2Line->setLabel(conf->value("ArchaeoLines/custom_azimut h_2_label", "custAzi2").toString());
customDeclination1Line->setDefiningAngle(conf->value("ArchaeoLines/c
ustom_declination_1_angle", 0.0).toDouble());
customDeclination2Line->setDefiningAngle(conf->value("ArchaeoLines/c
ustom_declination_2_angle", 0.0).toDouble());
customDeclination1Line->setLabel(conf->value("ArchaeoLines/custom_de
clination_1_label", "custDec1").toString());
customDeclination2Line->setLabel(conf->value("ArchaeoLines/custom_de
clination_2_label", "custDec2").toString());
// Now activate line display if needed. // Now activate line display if needed.
// 5 solar limits // 5 solar limits
showEquinox(conf->value("ArchaeoLines/show_equinox", true).toBool()) ; showEquinox(conf->value("ArchaeoLines/show_equinox", true).toBool()) ;
showSolstices(conf->value("ArchaeoLines/show_solstices", true).toBoo l()); showSolstices(conf->value("ArchaeoLines/show_solstices", true).toBoo l());
showCrossquarters(conf->value("ArchaeoLines/show_crossquarters", tru e).toBool()); showCrossquarters(conf->value("ArchaeoLines/show_crossquarters", tru e).toBool());
// 4 lunar limits // 4 lunar limits
showMajorStandstills(conf->value("ArchaeoLines/show_major_standstill s", true).toBool()); showMajorStandstills(conf->value("ArchaeoLines/show_major_standstill s", true).toBool());
showMinorStandstills(conf->value("ArchaeoLines/show_minor_standstill s", true).toBool()); showMinorStandstills(conf->value("ArchaeoLines/show_minor_standstill s", true).toBool());
// esp. Mesoamerica // esp. Mesoamerica
skipping to change at line 524 skipping to change at line 546
showSelectedObject(conf->value("ArchaeoLines/show_selected_object", false).toBool()); showSelectedObject(conf->value("ArchaeoLines/show_selected_object", false).toBool());
// indicators for current declinations (those move fast over days... ) // indicators for current declinations (those move fast over days... )
showCurrentSun(conf->value("ArchaeoLines/show_current_sun", true).to Bool()); showCurrentSun(conf->value("ArchaeoLines/show_current_sun", true).to Bool());
showCurrentMoon(conf->value("ArchaeoLines/show_current_moon", true). toBool()); showCurrentMoon(conf->value("ArchaeoLines/show_current_moon", true). toBool());
showCurrentPlanetNamed(conf->value("ArchaeoLines/show_current_planet ", "none").toString()); showCurrentPlanetNamed(conf->value("ArchaeoLines/show_current_planet ", "none").toString());
// azimuths to geographic targets, and custom azimuths. // azimuths to geographic targets, and custom azimuths.
showGeographicLocation1(conf->value("ArchaeoLines/show_geographic_lo cation_1", false).toBool()); showGeographicLocation1(conf->value("ArchaeoLines/show_geographic_lo cation_1", false).toBool());
showGeographicLocation2(conf->value("ArchaeoLines/show_geographic_lo cation_2", false).toBool()); showGeographicLocation2(conf->value("ArchaeoLines/show_geographic_lo cation_2", false).toBool());
showCustomAzimuth1(conf->value("ArchaeoLines/show_custom_azimuth_1", false).toBool()); showCustomAzimuth1(conf->value("ArchaeoLines/show_custom_azimuth_1", false).toBool());
showCustomAzimuth2(conf->value("ArchaeoLines/show_custom_azimuth_2", false).toBool()); showCustomAzimuth2(conf->value("ArchaeoLines/show_custom_azimuth_2", false).toBool());
showCustomDeclination1(conf->value("ArchaeoLines/show_custom_declina
tion_1", false).toBool());
showCustomDeclination2(conf->value("ArchaeoLines/show_custom_declina
tion_2", false).toBool());
enableArchaeoLines(conf->value("ArchaeoLines/enable_at_startup", fal se).toBool()); enableArchaeoLines(conf->value("ArchaeoLines/enable_at_startup", fal se).toBool());
} }
void ArchaeoLines::showEquinox(bool b) void ArchaeoLines::showEquinox(bool b)
{ {
if (b!=flagShowEquinox) if (b!=flagShowEquinox)
{ {
flagShowEquinox=b; flagShowEquinox=b;
conf->setValue("ArchaeoLines/show_equinox", isEquino xDisplayed()); conf->setValue("ArchaeoLines/show_equinox", isEquino xDisplayed());
skipping to change at line 714 skipping to change at line 738
void ArchaeoLines::showCustomAzimuth2(bool b) void ArchaeoLines::showCustomAzimuth2(bool b)
{ {
if (b!=flagShowCustomAzimuth2) if (b!=flagShowCustomAzimuth2)
{ {
flagShowCustomAzimuth2=b; flagShowCustomAzimuth2=b;
conf->setValue("ArchaeoLines/show_custom_azimuth_2", i sCustomAzimuth2Displayed()); conf->setValue("ArchaeoLines/show_custom_azimuth_2", i sCustomAzimuth2Displayed());
customAzimuth2Line->setDisplayed(b); customAzimuth2Line->setDisplayed(b);
emit showCustomAzimuth2Changed(b); emit showCustomAzimuth2Changed(b);
} }
} }
void ArchaeoLines::showCustomDeclination1(bool b)
{
if (b!=flagShowCustomDeclination1)
{
flagShowCustomDeclination1=b;
conf->setValue("ArchaeoLines/show_custom_declination_1",
isCustomDeclination1Displayed());
customDeclination1Line->setDisplayed(b);
emit showCustomDeclination1Changed(b);
}
}
void ArchaeoLines::showCustomDeclination2(bool b)
{
if (b!=flagShowCustomDeclination2)
{
flagShowCustomDeclination2=b;
conf->setValue("ArchaeoLines/show_custom_declination_2",
isCustomDeclination2Displayed());
customDeclination2Line->setDisplayed(b);
emit showCustomDeclination2Changed(b);
}
}
void ArchaeoLines::setGeographicLocation1Longitude(double lng) void ArchaeoLines::setGeographicLocation1Longitude(double lng)
{ {
conf->setValue("ArchaeoLines/geographic_location_1_longitude", lng); conf->setValue("ArchaeoLines/geographic_location_1_longitude", lng);
geographicLocation1Longitude=lng; geographicLocation1Longitude=lng;
StelLocation loc=core->getCurrentLocation(); StelLocation loc=core->getCurrentLocation();
geographicLocation1Line->setDefiningAngle(getAzimuthForLocation(loc. longitude, loc.latitude, geographicLocation1Longitude, geographicLocation1L atitude)); geographicLocation1Line->setDefiningAngle(getAzimuthForLocation(loc. longitude, loc.latitude, geographicLocation1Longitude, geographicLocation1L atitude));
emit geographicLocation1Changed(); emit geographicLocation1Changed();
} }
void ArchaeoLines::setGeographicLocation1Latitude(double lat) void ArchaeoLines::setGeographicLocation1Latitude(double lat)
skipping to change at line 768 skipping to change at line 812
void ArchaeoLines::updateObserverLocation(StelLocation loc) void ArchaeoLines::updateObserverLocation(StelLocation loc)
{ {
geographicLocation1Line->setDefiningAngle(getAzimuthForLocation(loc. longitude, loc.latitude, geographicLocation1Longitude, geographicLocation1L atitude)); geographicLocation1Line->setDefiningAngle(getAzimuthForLocation(loc. longitude, loc.latitude, geographicLocation1Longitude, geographicLocation1L atitude));
geographicLocation2Line->setDefiningAngle(getAzimuthForLocation(loc. longitude, loc.latitude, geographicLocation2Longitude, geographicLocation2L atitude)); geographicLocation2Line->setDefiningAngle(getAzimuthForLocation(loc. longitude, loc.latitude, geographicLocation2Longitude, geographicLocation2L atitude));
} }
void ArchaeoLines::setCustomAzimuth1(double az) void ArchaeoLines::setCustomAzimuth1(double az)
{ {
if (az!=customAzimuth1Line->getDefiningAngle()) if (az!=customAzimuth1Line->getDefiningAngle())
{ {
customAzimuth1Line->setDefiningAngle(az); customAzimuth1Line->setDefiningAngle(az);
conf->setValue("ArchaeoLines/custom_azimuth_1_angle", az); conf->setValue("ArchaeoLines/custom_azimuth_1_angle", az);
emit customAzimuth1Changed(az); emit customAzimuth1Changed(az);
} }
} }
void ArchaeoLines::setCustomAzimuth2(double az) void ArchaeoLines::setCustomAzimuth2(double az)
{ {
customAzimuth2Line->setDefiningAngle(az); if (az!=customAzimuth1Line->getDefiningAngle())
conf->setValue("ArchaeoLines/custom_azimuth_2_angle", az); {
emit customAzimuth2Changed(az); customAzimuth2Line->setDefiningAngle(az);
conf->setValue("ArchaeoLines/custom_azimuth_2_angle", az);
emit customAzimuth2Changed(az);
}
} }
void ArchaeoLines::setCustomAzimuth1Label(QString label) void ArchaeoLines::setCustomAzimuth1Label(QString label)
{ {
customAzimuth1Line->setLabel(label); customAzimuth1Line->setLabel(label);
conf->setValue("ArchaeoLines/custom_azimuth_1_label", label); conf->setValue("ArchaeoLines/custom_azimuth_1_label", label);
} }
void ArchaeoLines::setCustomAzimuth2Label(QString label) void ArchaeoLines::setCustomAzimuth2Label(QString label)
{ {
customAzimuth2Line->setLabel(label); customAzimuth2Line->setLabel(label);
conf->setValue("ArchaeoLines/custom_azimuth_2_label", label); conf->setValue("ArchaeoLines/custom_azimuth_2_label", label);
} }
void ArchaeoLines::setCustomDeclination1(double dec)
{
if (dec!=customDeclination1Line->getDefiningAngle())
{
customDeclination1Line->setDefiningAngle(dec);
conf->setValue("ArchaeoLines/custom_declination_1_angle", de
c);
emit customDeclination1Changed(dec);
}
}
void ArchaeoLines::setCustomDeclination2(double dec)
{
if (dec!=customDeclination1Line->getDefiningAngle())
{
customDeclination2Line->setDefiningAngle(dec);
conf->setValue("ArchaeoLines/custom_declination_2_angle", de
c);
emit customDeclination2Changed(dec);
}
}
void ArchaeoLines::setCustomDeclination1Label(QString label)
{
customDeclination1Line->setLabel(label);
conf->setValue("ArchaeoLines/custom_declination_1_label", label);
}
void ArchaeoLines::setCustomDeclination2Label(QString label)
{
customDeclination2Line->setLabel(label);
conf->setValue("ArchaeoLines/custom_declination_2_label", label);
}
// called by the dialog UI, converts QColor (0..255) to Stellarium's Vec3f float color. // called by the dialog UI, converts QColor (0..255) to Stellarium's Vec3f float color.
void ArchaeoLines::setLineColor(ArchaeoLine::Line whichLine, QColor color) void ArchaeoLines::setLineColor(ArchaeoLine::Line whichLine, QColor color)
{ {
switch (whichLine){ switch (whichLine){
case ArchaeoLine::Equinox: case ArchaeoLine::Equinox:
equinoxColor.set(color.redF(), color.greenF(), color .blueF()); equinoxColor.set(color.redF(), color.greenF(), color .blueF());
conf->setValue("ArchaeoLines/color_equinox", QString("%1,%2,%3").arg(equinoxColor.v[0]).arg(equinoxColor.v[1]).arg(equin oxColor.v[2])); conf->setValue("ArchaeoLines/color_equinox", QString("%1,%2,%3").arg(equinoxColor.v[0]).arg(equinoxColor.v[1]).arg(equin oxColor.v[2]));
equinoxLine->setColor(equinoxColor); equinoxLine->setColor(equinoxColor);
break; break;
skipping to change at line 881 skipping to change at line 956
break; break;
case ArchaeoLine::CustomAzimuth1: case ArchaeoLine::CustomAzimuth1:
customAzimuth1Color.set(color.redF(), color.greenF() , color.blueF()); customAzimuth1Color.set(color.redF(), color.greenF() , color.blueF());
conf->setValue("ArchaeoLines/color_custom_azimuth_1" , QString("%1,%2,%3").arg(customAzimuth1Color.v[0]).arg(customAzimuth1Co lor.v[1]).arg(customAzimuth1Color.v[2])); conf->setValue("ArchaeoLines/color_custom_azimuth_1" , QString("%1,%2,%3").arg(customAzimuth1Color.v[0]).arg(customAzimuth1Co lor.v[1]).arg(customAzimuth1Color.v[2]));
customAzimuth1Line->setColor(customAzimuth1Color); customAzimuth1Line->setColor(customAzimuth1Color);
break; break;
case ArchaeoLine::CustomAzimuth2: case ArchaeoLine::CustomAzimuth2:
customAzimuth2Color.set(color.redF(), color.greenF() , color.blueF()); customAzimuth2Color.set(color.redF(), color.greenF() , color.blueF());
conf->setValue("ArchaeoLines/color_custom_azimuth_2" , QString("%1,%2,%3").arg(customAzimuth2Color.v[0]).arg(customAzimuth2Co lor.v[1]).arg(customAzimuth2Color.v[2])); conf->setValue("ArchaeoLines/color_custom_azimuth_2" , QString("%1,%2,%3").arg(customAzimuth2Color.v[0]).arg(customAzimuth2Co lor.v[1]).arg(customAzimuth2Color.v[2]));
customAzimuth2Line->setColor(customAzimuth2Color); customAzimuth2Line->setColor(customAzimuth2Color);
break; default: break;
case ArchaeoLine::CustomDeclination1:
customDeclination1Color.set(color.redF(), color.gree
nF(), color.blueF());
conf->setValue("ArchaeoLines/color_custom_declinatio
n_1", QString("%1,%2,%3").arg(customDeclination1Color.v[0]).arg(customDe
clination1Color.v[1]).arg(customDeclination1Color.v[2]));
customDeclination1Line->setColor(customDeclination1C
olor);
break;
case ArchaeoLine::CustomDeclination2:
customDeclination2Color.set(color.redF(), color.gree
nF(), color.blueF());
conf->setValue("ArchaeoLines/color_custom_declinatio
n_2", QString("%1,%2,%3").arg(customDeclination2Color.v[0]).arg(customDe
clination2Color.v[1]).arg(customDeclination2Color.v[2]));
customDeclination2Line->setColor(customDeclination2C
olor);
break;
default:
Q_ASSERT(0); Q_ASSERT(0);
} }
} }
// called by the dialog UI, converts Stellarium's Vec3f float color to QCol or (0..255). // called by the dialog UI, converts Stellarium's Vec3f float color to QCol or (0..255).
QColor ArchaeoLines::getLineColor(ArchaeoLine::Line whichLine) QColor ArchaeoLines::getLineColor(ArchaeoLine::Line whichLine)
{ {
QColor color(0,0,0); QColor color(0,0,0);
Vec3f* vColor; Vec3f* vColor;
switch (whichLine){ switch (whichLine){
skipping to change at line 942 skipping to change at line 1028
break; break;
case ArchaeoLine::GeographicLocation2: case ArchaeoLine::GeographicLocation2:
vColor=&geographicLocation2Color; vColor=&geographicLocation2Color;
break; break;
case ArchaeoLine::CustomAzimuth1: case ArchaeoLine::CustomAzimuth1:
vColor=&customAzimuth1Color; vColor=&customAzimuth1Color;
break; break;
case ArchaeoLine::CustomAzimuth2: case ArchaeoLine::CustomAzimuth2:
vColor=&customAzimuth2Color; vColor=&customAzimuth2Color;
break; break;
case ArchaeoLine::CustomDeclination1:
vColor=&customDeclination1Color;
break;
case ArchaeoLine::CustomDeclination2:
vColor=&customDeclination2Color;
break;
default: default:
vColor=&selectedObjectColor; // this is only to sile nce compiler warning about uninitialized variable vColor. 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;
} }
double ArchaeoLines::getLineAngle(ArchaeoLine::Line whichLine) double ArchaeoLines::getLineAngle(ArchaeoLine::Line whichLine)
{ {
skipping to change at line 1005 skipping to change at line 1097
break; break;
case ArchaeoLine::GeographicLocation2: case ArchaeoLine::GeographicLocation2:
return geographicLocation2Line->getDefiningAngle(); return geographicLocation2Line->getDefiningAngle();
break; break;
case ArchaeoLine::CustomAzimuth1: case ArchaeoLine::CustomAzimuth1:
return customAzimuth1Line->getDefiningAngle(); return customAzimuth1Line->getDefiningAngle();
break; break;
case ArchaeoLine::CustomAzimuth2: case ArchaeoLine::CustomAzimuth2:
return customAzimuth2Line->getDefiningAngle(); return customAzimuth2Line->getDefiningAngle();
break; break;
case ArchaeoLine::CustomDeclination1:
return customDeclination1Line->getDefiningAngle();
break;
case ArchaeoLine::CustomDeclination2:
return customDeclination2Line->getDefiningAngle();
break;
default: default:
Q_ASSERT(0); Q_ASSERT(0);
} }
return -100.0; return -100.0;
} }
QString ArchaeoLines::getLineLabel(ArchaeoLine::Line whichLine) QString ArchaeoLines::getLineLabel(ArchaeoLine::Line whichLine)
{ {
switch (whichLine){ switch (whichLine){
case ArchaeoLine::Equinox: case ArchaeoLine::Equinox:
skipping to change at line 1064 skipping to change at line 1162
break; break;
case ArchaeoLine::GeographicLocation2: case ArchaeoLine::GeographicLocation2:
return geographicLocation2Line->getLabel(); return geographicLocation2Line->getLabel();
break; break;
case ArchaeoLine::CustomAzimuth1: case ArchaeoLine::CustomAzimuth1:
return customAzimuth1Line->getLabel(); return customAzimuth1Line->getLabel();
break; break;
case ArchaeoLine::CustomAzimuth2: case ArchaeoLine::CustomAzimuth2:
return customAzimuth2Line->getLabel(); return customAzimuth2Line->getLabel();
break; break;
case ArchaeoLine::CustomDeclination1:
return customDeclination1Line->getLabel();
break;
case ArchaeoLine::CustomDeclination2:
return customDeclination2Line->getLabel();
break;
default: default:
Q_ASSERT(0); Q_ASSERT(0);
return "ArchaeoLines::getLineLabel(): Error!"; return "ArchaeoLines::getLineLabel(): Error!";
} }
} }
double ArchaeoLines::getAzimuthForLocation(double longObs, double latObs, d ouble longTarget, double latTarget) const double ArchaeoLines::getAzimuthForLocation(double longObs, double latObs, d ouble longTarget, double latTarget) const
{ {
longObs *= (M_PI/180.0); longObs *= (M_PI/180.0);
latObs *= (M_PI/180.0); latObs *= (M_PI/180.0);
skipping to change at line 1133 skipping to change at line 1237
lineType(lineType), definingAngle(definingAngle), color(0.f, 0.f, 1. f), frameType(StelCore::FrameEquinoxEqu), flagLabel(true) lineType(lineType), definingAngle(definingAngle), color(0.f, 0.f, 1. f), frameType(StelCore::FrameEquinoxEqu), flagLabel(true)
{ {
if (lineType>=GeographicLocation1) if (lineType>=GeographicLocation1)
frameType=StelCore::FrameAltAz; frameType=StelCore::FrameAltAz;
// Font size is 14 // Font size is 14
font.setPixelSize(StelApp::getInstance().getBaseFontSize()+1); font.setPixelSize(StelApp::getInstance().getBaseFontSize()+1);
updateLabel(); updateLabel();
fader.setDuration(1000); fader.setDuration(1000);
// Initialize the message strings and make sure they are translated when the language changes. // Initialize the message strings and make sure they are translated when the language changes.
StelApp& app = StelApp::getInstance(); StelApp& app = StelApp::getInstance();
//updateLabel(); // WHY AGAIN??
connect(&app, SIGNAL(languageChanged()), this, SLOT(updateLabel())); connect(&app, SIGNAL(languageChanged()), this, SLOT(updateLabel()));
} }
void ArchaeoLine::updateLabel() void ArchaeoLine::updateLabel()
{ {
//qDebug() << "ArchaeoLine::updateLabel(): lineType is " << lineType ; //qDebug() << "ArchaeoLine::updateLabel(): lineType is " << lineType ;
// TODO: decide whether showing declinations in addition. // TODO: decide whether showing declinations in addition.
switch (lineType) switch (lineType)
{ {
case ArchaeoLine::Equinox: case ArchaeoLine::Equinox:
label = q_("Equinox"); label = q_("Equinox");
skipping to change at line 1196 skipping to change at line 1298
case ArchaeoLine::CurrentPlanetJupiter: case ArchaeoLine::CurrentPlanetJupiter:
label = q_("Jupiter"); label = q_("Jupiter");
break; break;
case ArchaeoLine::CurrentPlanetSaturn: case ArchaeoLine::CurrentPlanetSaturn:
label = q_("Saturn"); label = q_("Saturn");
break; break;
case ArchaeoLine::GeographicLocation1: // label was set in s etLabel(). DO NOT update. case ArchaeoLine::GeographicLocation1: // label was set in s etLabel(). DO NOT update.
case ArchaeoLine::GeographicLocation2: case ArchaeoLine::GeographicLocation2:
case ArchaeoLine::CustomAzimuth1: case ArchaeoLine::CustomAzimuth1:
case ArchaeoLine::CustomAzimuth2: case ArchaeoLine::CustomAzimuth2:
case ArchaeoLine::CustomDeclination1:
case ArchaeoLine::CustomDeclination2:
break; break;
default: default:
Q_ASSERT(0); Q_ASSERT(0);
} }
} }
void ArchaeoLine::draw(StelCore *core, float intensity) const void ArchaeoLine::draw(StelCore *core, float intensity) const
{ {
// borrowed largely from GridLinesMgr. // borrowed largely from GridLinesMgr.
if (intensity*fader.getInterstate() < 0.000001f) if (intensity*fader.getInterstate() < 0.000001f)
 End of changes. 22 change blocks. 
22 lines changed or deleted 152 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/