PointerCoordinates.cpp   PointerCoordinates.cpp 
skipping to change at line 127 skipping to change at line 127
font.setPixelSize(getFontSize()); font.setPixelSize(getFontSize());
sPainter.setFont(font); sPainter.setFont(font);
QPoint p = StelMainView::getInstance().getMousePos(); // get screen coordinates of mouse cursor QPoint p = StelMainView::getInstance().getMousePos(); // get screen coordinates of mouse cursor
Vec3d mousePosition; Vec3d mousePosition;
float wh = prj->getViewportWidth()/2.; // get half of width of the s creen float wh = prj->getViewportWidth()/2.; // get half of width of the s creen
float hh = prj->getViewportHeight()/2.; // get half of height of the screen float hh = prj->getViewportHeight()/2.; // get half of height of the screen
float mx = p.x()-wh; // point 0 in center of the screen, axis X dire cted to right float mx = p.x()-wh; // point 0 in center of the screen, axis X dire cted to right
float my = p.y()-hh; // point 0 in center of the screen, axis Y dire cted to bottom float my = p.y()-hh; // point 0 in center of the screen, axis Y dire cted to bottom
// calculate position of mouse cursor via position of center of the screen (and invert axis Y) // calculate position of mouse cursor via position of center of the screen (and invert axis Y)
prj->unProject(prj->getViewportPosX()+wh+mx, prj->getViewportPosY()+ // If coordinates are invalid, don't draw them.
hh+1-my, mousePosition); bool coordsValid=false;
coordsValid = prj->unProject(prj->getViewportPosX()+wh+mx, prj->getV
iewportPosY()+hh+1-my, mousePosition);
{ // Nick Fedoseev patch { // Nick Fedoseev patch
Vec3d win; Vec3d win;
prj->project(mousePosition,win); prj->project(mousePosition,win);
float dx = prj->getViewportPosX()+wh+mx - win.v[0]; float dx = prj->getViewportPosX()+wh+mx - win.v[0];
float dy = prj->getViewportPosY()+hh+1-my - win.v[1]; float dy = prj->getViewportPosY()+hh+1-my - win.v[1];
prj->unProject(prj->getViewportPosX()+wh+mx+dx, prj->getViewportP coordsValid = prj->unProject(prj->getViewportPosX()+wh+mx+dx
osY()+hh+1-my+dy, mousePosition); , prj->getViewportPosY()+hh+1-my+dy, mousePosition);
} }
if (!coordsValid)
return;
bool withDecimalDegree = StelApp::getInstance().getFlagShowDecimalDe grees(); bool withDecimalDegree = StelApp::getInstance().getFlagShowDecimalDe grees();
bool useOldAzimuth = StelApp::getInstance().getFlagOldAzimuthUsage() ;
QString coordsSystem, cxt, cyt; QString coordsSystem, cxt, cyt;
double cx, cy; double cx, cy;
switch (getCurrentCoordinateSystem()) switch (getCurrentCoordinateSystem())
{ {
case RaDecJ2000: case RaDecJ2000:
{ {
StelUtils::rectToSphe(&cx,&cy,mousePosition); // Cal culate RA/DE (J2000.0) and show it... StelUtils::rectToSphe(&cx,&cy,mousePosition); // Cal culate RA/DE (J2000.0) and show it...
coordsSystem = qc_("RA/Dec (J2000.0)", "abbreviated in the plugin"); coordsSystem = qc_("RA/Dec (J2000.0)", "abbreviated in the plugin");
if (withDecimalDegree) if (withDecimalDegree)
skipping to change at line 176 skipping to change at line 182
else else
{ {
cxt = StelUtils::radToHmsStr(cx, true); cxt = StelUtils::radToHmsStr(cx, true);
cyt = StelUtils::radToDmsStr(cy, true); cyt = StelUtils::radToDmsStr(cy, true);
} }
break; break;
} }
case AltAzi: case AltAzi:
{ {
StelUtils::rectToSphe(&cy,&cx,core->j2000ToAltAz(mou sePosition, StelCore::RefractionAuto)); StelUtils::rectToSphe(&cy,&cx,core->j2000ToAltAz(mou sePosition, StelCore::RefractionAuto));
cy = 3.*M_PI - cy; // N is zero, E is 90 degrees float direction = 3.; // N is zero, E is 90 degrees
if (useOldAzimuth)
direction = 2.;
cy = direction*M_PI - cy;
if (cy > M_PI*2) if (cy > M_PI*2)
cy -= M_PI*2; cy -= M_PI*2;
coordsSystem = qc_("Az/Alt", "abbreviated in the plu gin"); coordsSystem = qc_("Az/Alt", "abbreviated in the plu gin");
if (withDecimalDegree) if (withDecimalDegree)
{ {
cxt = StelUtils::radToDecDegStr(cy); cxt = StelUtils::radToDecDegStr(cy);
cyt = StelUtils::radToDecDegStr(cx); cyt = StelUtils::radToDecDegStr(cx);
} }
else else
skipping to change at line 213 skipping to change at line 222
{ {
cxt = StelUtils::radToDmsStr(cx, true); cxt = StelUtils::radToDmsStr(cx, true);
cyt = StelUtils::radToDmsStr(cy, true); cyt = StelUtils::radToDmsStr(cy, true);
} }
break; break;
} }
case Ecliptic: case Ecliptic:
{ {
double lambda, beta; double lambda, beta;
StelUtils::rectToSphe(&cx,&cy,core->j2000ToEquinoxEq u(mousePosition)); StelUtils::rectToSphe(&cx,&cy,core->j2000ToEquinoxEq u(mousePosition));
StelUtils::equToEcl(cx, cy, core->getCurrentPlanet() ->getRotObliquity(core->getJDay()), &lambda, &beta); // Calculate ecliptic position and show it... StelUtils::equToEcl(cx, cy, core->getCurrentPlanet() ->getRotObliquity(core->getJDE()), &lambda, &beta); // Calculate ecliptic p osition and show it...
if (lambda<0) lambda+=2.0*M_PI; if (lambda<0) lambda+=2.0*M_PI;
coordsSystem = qc_("Ecl. Long/Lat", "abbreviated in the plugin"); coordsSystem = qc_("Ecl. Long/Lat", "abbreviated in the plugin");
if (withDecimalDegree) if (withDecimalDegree)
{ {
cxt = StelUtils::radToDecDegStr(lambda); cxt = StelUtils::radToDecDegStr(lambda);
cyt = StelUtils::radToDecDegStr(beta); cyt = StelUtils::radToDecDegStr(beta);
} }
else else
{ {
cxt = StelUtils::radToDmsStr(lambda, true); cxt = StelUtils::radToDmsStr(lambda, true);
skipping to change at line 250 skipping to change at line 259
else else
{ {
cxt = StelUtils::radToDmsStr(lambda, true); cxt = StelUtils::radToDmsStr(lambda, true);
cyt = StelUtils::radToDmsStr(beta, true); cyt = StelUtils::radToDmsStr(beta, true);
} }
break; break;
} }
case HourAngle: case HourAngle:
{ {
Vec3d v = core->j2000ToAltAz(mousePosition, StelCore ::RefractionAuto); Vec3d v = core->j2000ToAltAz(mousePosition, StelCore ::RefractionAuto);
StelUtils::rectToSphe(&cx,&cy,Mat4d::zrotation(-core ->getLocalSiderealTime()+((core->getDeltaT(core->getJDay())/240.)*M_PI/180. ))*core->altAzToEquinoxEqu(v, StelCore::RefractionOff)); StelUtils::rectToSphe(&cx,&cy,Mat4d::zrotation(-core ->getLocalSiderealTime())*core->altAzToEquinoxEqu(v, StelCore::RefractionOf f));
cx = 2.*M_PI-cx; cx = 2.*M_PI-cx;
coordsSystem = qc_("HA/Dec", "abbreviated in the plu gin"); coordsSystem = qc_("HA/Dec", "abbreviated in the plu gin");
if (withDecimalDegree) if (withDecimalDegree)
{ {
double ha_sidereal = cx*12/M_PI; double ha_sidereal = cx*12/M_PI;
if (ha_sidereal>24.) if (ha_sidereal>24.)
ha_sidereal -= 24.; ha_sidereal -= 24.;
cxt = QString("%1h").arg(ha_sidereal, 0, 'f' , 5); cxt = QString("%1h").arg(ha_sidereal, 0, 'f' , 5);
cyt = StelUtils::radToDecDegStr(cy); cyt = StelUtils::radToDecDegStr(cy);
 End of changes. 6 change blocks. 
12 lines changed or deleted 21 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/