+ increment/decrement interactive counter for animations

git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5105 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
This commit is contained in:
wmayer 2011-11-09 10:54:54 +00:00
parent 5afb26cf18
commit a87e19073e

View File

@ -321,6 +321,7 @@ void NavigationStyle::setCameraPosition(const SbVec3f& pos)
if (PRIVATE(this)->animsensor->isScheduled()) {
PRIVATE(this)->animsensor->unschedule();
this->interactiveCountDec();
}
if (isAnimationEnabled()) {
@ -342,6 +343,7 @@ void NavigationStyle::setCameraPosition(const SbVec3f& pos)
PRIVATE(this)->animationdelta = std::max<int>(100/steps, 5);
PRIVATE(this)->animsensor->setBaseTime(SbTime::getTimeOfDay());
PRIVATE(this)->animsensor->schedule();
this->interactiveCountInc();
}
else {
// set to the given position
@ -387,6 +389,7 @@ void NavigationStyle::setCameraOrientation(const SbRotation& rot)
if (PRIVATE(this)->animsensor->isScheduled()) {
PRIVATE(this)->animsensor->unschedule();
this->interactiveCountDec();
}
if (isAnimationEnabled()) {
@ -407,6 +410,7 @@ void NavigationStyle::setCameraOrientation(const SbRotation& rot)
PRIVATE(this)->animationdelta = std::max<int>(100/steps, 5);
PRIVATE(this)->animsensor->setBaseTime(SbTime::getTimeOfDay());
PRIVATE(this)->animsensor->schedule();
this->interactiveCountInc();
}
else {
// due to possible round-off errors make sure that the
@ -444,6 +448,7 @@ void NavigationStyleP::viewAnimationCB(void * data, SoSensor * sensor)
// now we have reached the end of the movement
PRIVATE(that)->animationsteps=0;
PRIVATE(that)->animsensor->unschedule();
that->interactiveCountDec();
// set to the actual given rotation
cam->orientation.setValue(PRIVATE(that)->endRotation);
cam->orientation.getValue().multVec(SbVec3f(0, 0, -1), direction);