StelMovementMgr.cpp   StelMovementMgr.cpp 
skipping to change at line 255 skipping to change at line 255
void StelMovementMgr::handleMouseWheel(QWheelEvent* event) void StelMovementMgr::handleMouseWheel(QWheelEvent* event)
{ {
if (flagEnableMouseNavigation==false) if (flagEnableMouseNavigation==false)
return; return;
int numDegrees = event->delta() / 8; int numDegrees = event->delta() / 8;
int numSteps = numDegrees / 15; int numSteps = numDegrees / 15;
zoomTo(getAimFov()-mouseZoomSpeed*numSteps*getAimFov()/60., 0.2); zoomTo(getAimFov()-mouseZoomSpeed*numSteps*getAimFov()/60., 0.2);
event->accept(); event->accept();
} }
void StelMovementMgr::addTimeDragPoint() void StelMovementMgr::addTimeDragPoint(int x, int y)
{ {
timeDragHistory.append(QPair<double, double>(StelApp::getInstance(). DragHistoryEntry e;
getTotalRunTime(), core->getNavigator()->getJDay())); e.runTime=StelApp::getInstance().getTotalRunTime();
e.jd=core->getNavigator()->getJDay();
e.x=x;
e.y=y;
timeDragHistory.append(e);
if (timeDragHistory.size()>3) if (timeDragHistory.size()>3)
timeDragHistory.removeFirst(); timeDragHistory.removeFirst();
} }
void StelMovementMgr::handleMouseClicks(QMouseEvent* event) void StelMovementMgr::handleMouseClicks(QMouseEvent* event)
{ {
switch (event->button()) switch (event->button())
{ {
case Qt::RightButton: case Qt::RightButton:
{ {
skipping to change at line 288 skipping to change at line 293
if (event->type()==QEvent::MouseButtonPress) if (event->type()==QEvent::MouseButtonPress)
{ {
isDragging = true; isDragging = true;
hasDragged = false; hasDragged = false;
previousX = event->x(); previousX = event->x();
previousY = event->y(); previousY = event->y();
beforeTimeDragTimeRate=core->getNavigator()- >getTimeRate(); beforeTimeDragTimeRate=core->getNavigator()- >getTimeRate();
if (dragTimeMode) if (dragTimeMode)
{ {
timeDragHistory.clear(); timeDragHistory.clear();
addTimeDragPoint(); addTimeDragPoint(event->pos().x(), e vent->pos().y());
} }
event->accept(); event->accept();
return; return;
} }
else else
{ {
isDragging = false; isDragging = false;
if (hasDragged) if (hasDragged)
{ {
event->accept(); event->accept();
if (dragTimeMode) if (dragTimeMode)
{ {
addTimeDragPoint();
if (timeDragHistory.size()>= 3) if (timeDragHistory.size()>= 3)
{ {
const double deltaT const double deltaT
= timeDragHistory.last().first-timeDragHistory.first().first; = timeDragHistory.last().runTime-timeDragHistory.first().runTime;
const double deltaJd Vec2f d(timeDragHist
= timeDragHistory.last().second-timeDragHistory.first().second; ory.last().x-timeDragHistory.first().x, timeDragHistory.last().y-timeDragHi
const double newTime story.first().y);
Rate = deltaJd/deltaT; if (d.length()/delta
if (deltaT>0.0000000 T<dragTriggerDistance)
1)
{ {
if (newTimeR core->getNav
ate>=0) igator()->setTimeRate(JD_SECOND);
core
->getNavigator()->setTimeRate(qMax(newTimeRate, JD_SECOND));
else
core
->getNavigator()->setTimeRate(qMin(newTimeRate, -JD_SECOND));
} }
else else
core->getNav {
igator()->setTimeRate(beforeTimeDragTimeRate); const double
deltaJd = timeDragHistory.last().jd-timeDragHistory.first().jd;
const double
newTimeRate = deltaJd/deltaT;
if (deltaT>0
.00000001)
{
if (
newTimeRate>=0)
core->getNavigator()->setTimeRate(qMax(newTimeRate, JD_SECOND));
else
core->getNavigator()->setTimeRate(qMin(newTimeRate, -JD_SECOND));
}
else
core
->getNavigator()->setTimeRate(beforeTimeDragTimeRate);
}
} }
else else
core->getNavigator() ->setTimeRate(beforeTimeDragTimeRate); core->getNavigator() ->setTimeRate(beforeTimeDragTimeRate);
} }
return; return;
} }
else else
{ {
// It's a normal click release // It's a normal click release
#ifdef Q_OS_MAC #ifdef Q_OS_MAC
skipping to change at line 679 skipping to change at line 691
satfov = objectMgr->getSelectedObject()[0]->getParentSatelli tesFov((core->getNavigator())); satfov = objectMgr->getSelectedObject()[0]->getParentSatelli tesFov((core->getNavigator()));
if (satfov>0.0 && currentFov<=satfov*0.9) if (satfov>0.0 && currentFov<=satfov*0.9)
{ {
zoomTo(satfov, moveDuration); zoomTo(satfov, moveDuration);
return; return;
} }
} }
zoomTo(initFov, moveDuration); zoomTo(initFov, moveDuration);
if (flagAutoZoomOutResetsDirection) if (flagAutoZoomOutResetsDirection)
{
moveToJ2000(core->getNavigator()->altAzToJ2000(getInitViewin gDirection()), moveDuration, -1); moveToJ2000(core->getNavigator()->altAzToJ2000(getInitViewin gDirection()), moveDuration, -1);
setFlagTracking(false); setFlagTracking(false);
setFlagLockEquPos(false); setFlagLockEquPos(false);
}
} }
void StelMovementMgr::setFlagTracking(bool b) void StelMovementMgr::setFlagTracking(bool b)
{ {
if (!b || !objectMgr->getWasSelected()) if (!b || !objectMgr->getWasSelected())
{ {
flagTracking=false; flagTracking=false;
} }
else else
{ {
skipping to change at line 806 skipping to change at line 820
core->getNavigator()->setTimeRate(0); core->getNavigator()->setTimeRate(0);
Vec3d v1, v2; Vec3d v1, v2;
const StelProjectorP prj = core->getProjection(StelCore::Fra meEquinoxEqu); const StelProjectorP prj = core->getProjection(StelCore::Fra meEquinoxEqu);
prj->unProject(x2,y2, v2); prj->unProject(x2,y2, v2);
prj->unProject(x1,y1, v1); prj->unProject(x1,y1, v1);
v1[2]=0; v1.normalize(); v1[2]=0; v1.normalize();
v2[2]=0; v2.normalize(); v2[2]=0; v2.normalize();
double angle = (v2^v1)[2]; double angle = (v2^v1)[2];
double deltaDay = angle/(2.*M_PI)*core->getNavigator()->getL ocalSideralDayLength(); double deltaDay = angle/(2.*M_PI)*core->getNavigator()->getL ocalSideralDayLength();
core->getNavigator()->setJDay(core->getNavigator()->getJDay( )+deltaDay); core->getNavigator()->setJDay(core->getNavigator()->getJDay( )+deltaDay);
addTimeDragPoint(); addTimeDragPoint(x2, y2);
} }
else else
{ {
Vec3d tempvec1, tempvec2; Vec3d tempvec1, tempvec2;
const StelProjectorP prj = core->getProjection(StelCore::Fra meJ2000); const StelProjectorP prj = core->getProjection(StelCore::Fra meJ2000);
prj->unProject(x2,y2, tempvec2); prj->unProject(x2,y2, tempvec2);
prj->unProject(x1,y1, tempvec1); prj->unProject(x1,y1, tempvec1);
double az1, alt1, az2, alt2; double az1, alt1, az2, alt2;
StelUtils::rectToSphe(&az1, &alt1, j2000ToMountFrame(tempvec 1)); StelUtils::rectToSphe(&az1, &alt1, j2000ToMountFrame(tempvec 1));
StelUtils::rectToSphe(&az2, &alt2, j2000ToMountFrame(tempvec 2)); StelUtils::rectToSphe(&az2, &alt2, j2000ToMountFrame(tempvec 2));
 End of changes. 10 change blocks. 
25 lines changed or deleted 42 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/