ArchaeoLines.cpp   ArchaeoLines.cpp 
skipping to change at line 94 skipping to change at line 94
, 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) , flagShowCustomDeclination1(false)
, flagShowCustomDeclination2(false) , flagShowCustomDeclination2(false)
, lastJDE(0.0) , lastJDE(0.0)
, toolbarButton(NULL) , toolbarButton(Q_NULLPTR)
{ {
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 readability so that each upper line of the lunistice dou bles is labeled. // optimize readability so that each upper line of the lunistice dou bles is labeled.
equinoxLine = new ArchaeoLine(ArchaeoLine::Equinox, 0.0); equinoxLine = new ArchaeoLine(ArchaeoLine::Equinox, 0.0);
skipping to change at line 138 skipping to change at line 138
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); customDeclination1Line = new ArchaeoLine(ArchaeoLine::CustomDeclinat ion1, 0.0);
customDeclination2Line = new ArchaeoLine(ArchaeoLine::CustomDeclinat ion2, 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()
{ {
delete equinoxLine; equinoxLine=NULL; delete equinoxLine; equinoxLine=Q_NULLPTR;
delete northernSolsticeLine; northernSolsticeLine=NULL; delete northernSolsticeLine; northernSolsticeLine=Q_NULLPTR;
delete southernSolsticeLine; southernSolsticeLine=NULL; delete southernSolsticeLine; southernSolsticeLine=Q_NULLPTR;
delete northernCrossquarterLine; northernCrossquarterLine=NULL; delete northernCrossquarterLine; northernCrossquarterLine=Q_NULLPTR;
delete southernCrossquarterLine; southernCrossquarterLine=NULL; delete southernCrossquarterLine; southernCrossquarterLine=Q_NULLPTR;
delete northernMajorStandstillLine0; northernMajorStandstillLine0=NU delete northernMajorStandstillLine0; northernMajorStandstillLine0=Q_
LL; NULLPTR;
delete northernMajorStandstillLine1; northernMajorStandstillLine1=NU delete northernMajorStandstillLine1; northernMajorStandstillLine1=Q_
LL; NULLPTR;
delete northernMinorStandstillLine2; northernMinorStandstillLine2=NU delete northernMinorStandstillLine2; northernMinorStandstillLine2=Q_
LL; NULLPTR;
delete northernMinorStandstillLine3; northernMinorStandstillLine3=NU delete northernMinorStandstillLine3; northernMinorStandstillLine3=Q_
LL; NULLPTR;
delete southernMinorStandstillLine4; southernMinorStandstillLine4=NU delete southernMinorStandstillLine4; southernMinorStandstillLine4=Q_
LL; NULLPTR;
delete southernMinorStandstillLine5; southernMinorStandstillLine5=NU delete southernMinorStandstillLine5; southernMinorStandstillLine5=Q_
LL; NULLPTR;
delete southernMajorStandstillLine6; southernMajorStandstillLine6=NU delete southernMajorStandstillLine6; southernMajorStandstillLine6=Q_
LL; NULLPTR;
delete southernMajorStandstillLine7; southernMajorStandstillLine7=NU delete southernMajorStandstillLine7; southernMajorStandstillLine7=Q_
LL; NULLPTR;
delete zenithPassageLine; zenithPassageLine=NULL; delete zenithPassageLine; zenithPassageLine=Q_NULLPTR;
delete nadirPassageLine; nadirPassageLine=NULL; delete nadirPassageLine; nadirPassageLine=Q_NULLPTR;
delete selectedObjectLine; selectedObjectLine=NULL; delete selectedObjectLine; selectedObjectLine=Q_NULLPTR;
delete currentSunLine; currentSunLine=NULL; delete currentSunLine; currentSunLine=Q_NULLPTR;
delete currentMoonLine; currentMoonLine=NULL; delete currentMoonLine; currentMoonLine=Q_NULLPTR;
delete currentPlanetLine; currentPlanetLine=NULL; delete currentPlanetLine; currentPlanetLine=Q_NULLPTR;
delete geographicLocation1Line; geographicLocation1Line=NULL; delete geographicLocation1Line; geographicLocation1Line=Q_NULLPTR;
delete geographicLocation2Line; geographicLocation2Line=NULL; delete geographicLocation2Line; geographicLocation2Line=Q_NULLPTR;
delete customAzimuth1Line; customAzimuth1Line=NULL; delete customAzimuth1Line; customAzimuth1Line=Q_NULLPTR;
delete customAzimuth2Line; customAzimuth2Line=NULL; delete customAzimuth2Line; customAzimuth2Line=Q_NULLPTR;
delete customDeclination1Line; customDeclination1Line=NULL; delete customDeclination1Line; customDeclination1Line=Q_NULLPTR;
delete customDeclination2Line; customDeclination2Line=NULL; delete customDeclination2Line; customDeclination2Line=Q_NULLPTR;
delete configDialog; configDialog=NULL; delete configDialog; configDialog=Q_NULLPTR;
} }
bool ArchaeoLines::configureGui(bool show) bool ArchaeoLines::configureGui(bool show)
{ {
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.
skipping to change at line 231 skipping to change at line 230
// Create action for enable/disable & hook up signals // Create action for enable/disable & hook up signals
QString section=N_("ArchaeoLines"); QString section=N_("ArchaeoLines");
addAction("actionShow_ArchaeoLines", section, N_("ArchaeoLin es"), "enabled", "Ctrl+U"); addAction("actionShow_ArchaeoLines", section, N_("ArchaeoLin es"), "enabled", "Ctrl+U");
addAction("actionShow_ArchaeoLines_dialog", section, N_("Show setti ngs dialog"), configDialog, "visible", "Ctrl+Shift+U"); addAction("actionShow_ArchaeoLines_dialog", section, N_("Show setti ngs dialog"), configDialog, "visible", "Ctrl+Shift+U");
// Add a toolbar button // Add a toolbar button
try try
{ {
StelGui* gui = dynamic_cast<StelGui*>(app.getGui()); StelGui* gui = dynamic_cast<StelGui*>(app.getGui());
if (gui!=NULL) if (gui!=Q_NULLPTR)
{ {
toolbarButton = new StelButton(NULL, toolbarButton = new StelButton(Q_NULLPTR,
QPixmap(":/archaeoLin es/bt_archaeolines_on.png"), QPixmap(":/archaeoLin es/bt_archaeolines_on.png"),
QPixmap(":/archaeoLin es/bt_archaeolines_off.png"), QPixmap(":/archaeoLin es/bt_archaeolines_off.png"),
QPixmap(":/graphicGui /glow32x32.png"), QPixmap(":/graphicGui /glow32x32.png"),
"actionShow_ArchaeoLi nes"); "actionShow_ArchaeoLi nes");
gui->getButtonBar()->addButton(toolbarButton, "065-p luginsGroup"); gui->getButtonBar()->addButton(toolbarButton, "065-p luginsGroup");
} }
} }
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();
skipping to change at line 255 skipping to change at line 254
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_("Show L addAction("actionAL_showGeographicLocation1Line",section, N_("Show V
ine for Geographic Location 1"), "flagShowGeographicLocation1" ); // No ertical for Geographic Location 1"), "flagShowGeographicLocation1" ); //
Shortcuts configured. No Shortcuts configured.
addAction("actionAL_showGeographicLocation2Line",section, N_("Show L addAction("actionAL_showGeographicLocation2Line",section, N_("Show V
ine for Geographic Location 2"), "flagShowGeographicLocation2" ); // No ertical for Geographic Location 2"), "flagShowGeographicLocation2" ); //
Shortcuts configured. No Shortcuts configured.
addAction("actionAL_showCustomAzimuth1Line", section, N_("Show L addAction("actionAL_showCustomAzimuth1Line", section, N_("Show V
ine for Custom Azimuth 1"), "flagShowCustomAzimuth1" ); // No Shortcuts ertical for Custom Azimuth 1"), "flagShowCustomAzimuth1" ); // No Shortc
configured. uts configured.
addAction("actionAL_showCustomAzimuth2Line", section, N_("Show L addAction("actionAL_showCustomAzimuth2Line", section, N_("Show V
ine for Custom Azimuth 2"), "flagShowCustomAzimuth2" ); // No Shortcuts ertical for Custom Azimuth 2"), "flagShowCustomAzimuth2" ); // No Shortc
configured. uts configured.
addAction("actionAL_showCustomDeclination1Line", section, N_("Show L ine for Custom Declination 1"), "flagShowCustomDeclination1" ); // No Sh ortcuts 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. 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);
skipping to change at line 785 skipping to change at line 784
conf->setValue("ArchaeoLines/geographic_location_1_latitude", lat); conf->setValue("ArchaeoLines/geographic_location_1_latitude", lat);
geographicLocation1Latitude=lat; geographicLocation1Latitude=lat;
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::setGeographicLocation1Label(QString label) void ArchaeoLines::setGeographicLocation1Label(QString label)
{ {
geographicLocation1Line->setLabel(label); geographicLocation1Line->setLabel(label);
conf->setValue("ArchaeoLines/geographic_location_1_label", label); conf->setValue("ArchaeoLines/geographic_location_1_label", label);
emit geographicLocation1LabelChanged(label);
} }
void ArchaeoLines::setGeographicLocation2Longitude(double lng) void ArchaeoLines::setGeographicLocation2Longitude(double lng)
{ {
conf->setValue("ArchaeoLines/geographic_location_2_longitude", lng); conf->setValue("ArchaeoLines/geographic_location_2_longitude", lng);
geographicLocation2Longitude=lng; geographicLocation2Longitude=lng;
StelLocation loc=core->getCurrentLocation(); StelLocation loc=core->getCurrentLocation();
geographicLocation2Line->setDefiningAngle(getAzimuthForLocation(loc. longitude, loc.latitude, geographicLocation2Longitude, geographicLocation2L atitude)); geographicLocation2Line->setDefiningAngle(getAzimuthForLocation(loc. longitude, loc.latitude, geographicLocation2Longitude, geographicLocation2L atitude));
emit geographicLocation2Changed(); emit geographicLocation2Changed();
} }
void ArchaeoLines::setGeographicLocation2Latitude(double lat) void ArchaeoLines::setGeographicLocation2Latitude(double lat)
skipping to change at line 806 skipping to change at line 806
conf->setValue("ArchaeoLines/geographic_location_2_latitude", lat); conf->setValue("ArchaeoLines/geographic_location_2_latitude", lat);
geographicLocation2Latitude=lat; geographicLocation2Latitude=lat;
StelLocation loc=core->getCurrentLocation(); StelLocation loc=core->getCurrentLocation();
geographicLocation2Line->setDefiningAngle(getAzimuthForLocation(loc. longitude, loc.latitude, geographicLocation2Longitude, geographicLocation2L atitude)); geographicLocation2Line->setDefiningAngle(getAzimuthForLocation(loc. longitude, loc.latitude, geographicLocation2Longitude, geographicLocation2L atitude));
emit geographicLocation2Changed(); emit geographicLocation2Changed();
} }
void ArchaeoLines::setGeographicLocation2Label(QString label) void ArchaeoLines::setGeographicLocation2Label(QString label)
{ {
geographicLocation2Line->setLabel(label); geographicLocation2Line->setLabel(label);
conf->setValue("ArchaeoLines/geographic_location_2_label", label); conf->setValue("ArchaeoLines/geographic_location_2_label", label);
emit geographicLocation2LabelChanged(label);
} }
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)
{ {
skipping to change at line 836 skipping to change at line 837
{ {
customAzimuth2Line->setDefiningAngle(az); customAzimuth2Line->setDefiningAngle(az);
conf->setValue("ArchaeoLines/custom_azimuth_2_angle", az); conf->setValue("ArchaeoLines/custom_azimuth_2_angle", az);
emit customAzimuth2Changed(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);
emit customAzimuth1LabelChanged(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);
emit customAzimuth2LabelChanged(label);
} }
void ArchaeoLines::setCustomDeclination1(double dec) void ArchaeoLines::setCustomDeclination1(double dec)
{ {
if (dec!=customDeclination1Line->getDefiningAngle()) if (dec!=customDeclination1Line->getDefiningAngle())
{ {
customDeclination1Line->setDefiningAngle(dec); customDeclination1Line->setDefiningAngle(dec);
conf->setValue("ArchaeoLines/custom_declination_1_angle", de c); conf->setValue("ArchaeoLines/custom_declination_1_angle", de c);
emit customDeclination1Changed(dec); emit customDeclination1Changed(dec);
} }
} }
skipping to change at line 864 skipping to change at line 867
{ {
customDeclination2Line->setDefiningAngle(dec); customDeclination2Line->setDefiningAngle(dec);
conf->setValue("ArchaeoLines/custom_declination_2_angle", de c); conf->setValue("ArchaeoLines/custom_declination_2_angle", de c);
emit customDeclination2Changed(dec); emit customDeclination2Changed(dec);
} }
} }
void ArchaeoLines::setCustomDeclination1Label(QString label) void ArchaeoLines::setCustomDeclination1Label(QString label)
{ {
customDeclination1Line->setLabel(label); customDeclination1Line->setLabel(label);
conf->setValue("ArchaeoLines/custom_declination_1_label", label); conf->setValue("ArchaeoLines/custom_declination_1_label", label);
emit customDeclination1LabelChanged(label);
} }
void ArchaeoLines::setCustomDeclination2Label(QString label) void ArchaeoLines::setCustomDeclination2Label(QString label)
{ {
customDeclination2Line->setLabel(label); customDeclination2Line->setLabel(label);
conf->setValue("ArchaeoLines/custom_declination_2_label", label); conf->setValue("ArchaeoLines/custom_declination_2_label", label);
emit customDeclination2LabelChanged(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);
skipping to change at line 979 skipping to change at line 984
customDeclination2Color.set(color.redF(), color.gree nF(), color.blueF()); 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])); 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); customDeclination2Line->setColor(customDeclination2C olor);
break; break;
default: 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) const
{ {
QColor color(0,0,0); QColor color(0,0,0);
Vec3f* vColor; const Vec3f* vColor;
switch (whichLine){ switch (whichLine){
case ArchaeoLine::Equinox: case ArchaeoLine::Equinox:
vColor=&equinoxColor; vColor=&equinoxColor;
break; break;
case ArchaeoLine::Solstices: case ArchaeoLine::Solstices:
vColor=&solsticesColor; vColor=&solsticesColor;
break; break;
case ArchaeoLine::Crossquarters: case ArchaeoLine::Crossquarters:
vColor=&crossquartersColor; vColor=&crossquartersColor;
break; break;
skipping to change at line 1048 skipping to change at line 1053
vColor=&customDeclination2Color; vColor=&customDeclination2Color;
break; 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) const
{ {
switch (whichLine){ switch (whichLine){
case ArchaeoLine::Equinox: case ArchaeoLine::Equinox:
return equinoxLine->getDefiningAngle(); return equinoxLine->getDefiningAngle();
break; break;
case ArchaeoLine::Solstices: case ArchaeoLine::Solstices:
return northernSolsticeLine->getDefiningAngle(); return northernSolsticeLine->getDefiningAngle();
break; break;
case ArchaeoLine::Crossquarters: case ArchaeoLine::Crossquarters:
return northernCrossquarterLine->getDefiningAngle(); return northernCrossquarterLine->getDefiningAngle();
skipping to change at line 1115 skipping to change at line 1120
break; break;
case ArchaeoLine::CustomDeclination2: case ArchaeoLine::CustomDeclination2:
return customDeclination2Line->getDefiningAngle(); return customDeclination2Line->getDefiningAngle();
break; 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) const
{ {
switch (whichLine){ switch (whichLine){
case ArchaeoLine::Equinox: case ArchaeoLine::Equinox:
return equinoxLine->getLabel(); return equinoxLine->getLabel();
break; break;
case ArchaeoLine::Solstices: case ArchaeoLine::Solstices:
return northernSolsticeLine->getLabel(); return northernSolsticeLine->getLabel();
break; break;
case ArchaeoLine::Crossquarters: case ArchaeoLine::Crossquarters:
return northernCrossquarterLine->getLabel(); return northernCrossquarterLine->getLabel();
skipping to change at line 1180 skipping to change at line 1185
break; break;
case ArchaeoLine::CustomDeclination2: case ArchaeoLine::CustomDeclination2:
return customDeclination2Line->getLabel(); return customDeclination2Line->getLabel();
break; 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)
{ {
longObs *= (M_PI/180.0); longObs *= (M_PI/180.0);
latObs *= (M_PI/180.0); latObs *= (M_PI/180.0);
longTarget *= (M_PI/180.0); longTarget *= (M_PI/180.0);
latTarget *= (M_PI/180.0); latTarget *= (M_PI/180.0);
return (180.0/M_PI) * atan2(sin(longTarget-longObs), cos(latObs)*tan (latTarget)-sin(latObs)*cos(longTarget-longObs)); return (180.0/M_PI) * atan2(sin(longTarget-longObs), cos(latObs)*tan (latTarget)-sin(latObs)*cos(longTarget-longObs));
} }
// 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!
skipping to change at line 1354 skipping to change at line 1359
// //if ((viewPortSphericalCap.d<meridianSphericalCap.d && viewPortSphericalCap.contains(meridianSphericalCap.n)) // //if ((viewPortSphericalCap.d<meridianSphericalCap.d && viewPortSphericalCap.contains(meridianSphericalCap.n))
// // || (viewPortSphericalCap.d<-meridianSpherica lCap.d && viewPortSphericalCap.contains(-meridianSphericalCap.n))) // // || (viewPortSphericalCap.d<-meridianSpherica lCap.d && viewPortSphericalCap.contains(-meridianSphericalCap.n)))
// { // N.B. we had 3x120degrees here. Look into GridLi neMgr to restore if neessary. // { // N.B. we had 3x120degrees here. Look into GridLi neMgr to restore if neessary.
// // 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& rotLonP90 = Mat4d::rotation(mer idianSphericalCap.n, 90.*M_PI/180.); const Mat4d& rotLonP90 = Mat4d::rotation(mer idianSphericalCap.n, 90.*M_PI/180.);
const Mat4d& rotLonM90 = Mat4d::rotation(mer idianSphericalCap.n, -90.*M_PI/180.); const Mat4d& rotLonM90 = Mat4d::rotation(mer idianSphericalCap.n, -90.*M_PI/180.);
Vec3d rotFpt=fpt; Vec3d rotFpt=fpt;
rotFpt.transfo4d(rotLonP90); rotFpt.transfo4d(rotLonP90);
Vec3d rotFpt2=fpt; Vec3d rotFpt2=fpt;
rotFpt2.transfo4d(rotLonM90); rotFpt2.transfo4d(rotLonM90);
sPainter.drawGreatCircleArc(fpt, rotFpt, NUL sPainter.drawGreatCircleArc(fpt, rotFpt, Q_N
L, alViewportEdgeIntersectCallback, &userData); ULLPTR, alViewportEdgeIntersectCallback, &userData);
sPainter.drawGreatCircleArc(rotFpt2, fpt, NU sPainter.drawGreatCircleArc(rotFpt2, fpt, Q_
LL, alViewportEdgeIntersectCallback, &userData); NULLPTR, alViewportEdgeIntersectCallback, &userData);
//sPainter.drawGreatCircleArc(rotFpt2, fpt, //sPainter.drawGreatCircleArc(rotFpt2, fpt,
NULL, alViewportEdgeIntersectCallback, &userData); Q_NULLPTR, alViewportEdgeIntersectCallback, &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, alViewpor // sPainter.drawGreatCircleArc(p1, middlePoint, Q_NULLPTR, alVi
tEdgeIntersectCallback, &userData); ewportEdgeIntersectCallback, &userData);
// sPainter.drawGreatCircleArc(p2, middlePoint, NULL, alViewpor // sPainter.drawGreatCircleArc(p2, middlePoint, Q_NULLPTR, alVi
tEdgeIntersectCallback, &userData); ewportEdgeIntersectCallback, &userData);
// // OpenGL ES 2.0 doesn't have GL_LINE_SMOOTH // // OpenGL ES 2.0 doesn't have GL_LINE_SMOOTH
// #ifdef GL_LINE_SMOOTH // #ifdef GL_LINE_SMOOTH
// if (QOpenGLContext::currentContext()->format().renderableTyp e()==QSurfaceFormat::OpenGL) // if (QOpenGLContext::currentContext()->format().renderableTyp e()==QSurfaceFormat::OpenGL)
// glDisable(GL_LINE_SMOOTH); // glDisable(GL_LINE_SMOOTH);
// #endif // #endif
// glDisable(GL_BLEND); // glDisable(GL_BLEND);
// return; // return;
skipping to change at line 1434 skipping to change at line 1439
middlePoint*=-1.; middlePoint*=-1.;
middlePoint+=rotCenter; middlePoint+=rotCenter;
} }
sPainter.drawSmallCircleArc(p1, middlePoint, rotCenter,alViewportEdg eIntersectCallback, &userData); sPainter.drawSmallCircleArc(p1, middlePoint, rotCenter,alViewportEdg eIntersectCallback, &userData);
sPainter.drawSmallCircleArc(p2, middlePoint, rotCenter, alViewportEd geIntersectCallback, &userData); sPainter.drawSmallCircleArc(p2, middlePoint, rotCenter, alViewportEd geIntersectCallback, &userData);
sPainter.setLineSmooth(false); sPainter.setLineSmooth(false);
sPainter.setBlending(false); sPainter.setBlending(false);
} }
void ArchaeoLine::setColor(const Vec3f& c)
{
if (c!=color)
{
color = c;
emit colorChanged(c);
}
}
void ArchaeoLine::setDefiningAngle(double angle)
{
if (angle != definingAngle)
{
definingAngle=angle;
emit definingAngleChanged(angle);
}
}
void ArchaeoLine::setLabelVisible(bool b)
{
if (b!=flagLabel)
{
flagLabel=b;
emit flagLabelChanged(b);
}
}
 End of changes. 21 change blocks. 
65 lines changed or deleted 70 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/