Gui: Refactor navigation animations

- Animations are played through an Animator
- Standard animations have a fixed duration and inherit from QVariantAnimation
- The animation duration can be changed in the preferences
- Fix animations when using the two arrows above the NaviCube
- Start an animation or start and wait for an animation
- Replaces standard camera animations (e.g. by selecting standard views or NaviCube) with FixedTimeAnimation
- Replace View3DInventorViewer's CameraAnimation with FixedTimeAnimation
- Replace OpenInventor navigation style infinite spin animation with SpinningAnimation
- Stops an active animation when a new animation is started
- Stops an active animation when the user starts dragging, panning or zooming
- Refactor reorientCamera so it can be used in animations
- Enable animations by default
This commit is contained in:
Rexbas
2023-04-30 19:26:27 +02:00
parent 6da62b83fa
commit dc216cde2a
15 changed files with 677 additions and 355 deletions

View File

@@ -91,7 +91,7 @@ void DemoMode::reset()
view->getViewer()->stopAnimating();
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath
("User parameter:BaseApp/Preferences/View");
hGrp->Notify("UseAutoRotation");
hGrp->Notify("UseNavigationAnimations");
}
void DemoMode::accept()
@@ -272,8 +272,9 @@ void DemoMode::startAnimation(Gui::View3DInventor* view)
{
if (!view->getViewer()->isAnimationEnabled())
view->getViewer()->setAnimationEnabled(true);
view->getViewer()->startAnimating(getDirection(view),
getSpeed(ui->speedSlider->value()));
view->getViewer()->startSpinningAnimation(getDirection(view),
getSpeed(ui->speedSlider->value()));
}
void DemoMode::onTimerCheckToggled(bool on)