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

@@ -74,7 +74,7 @@ void View3DSettings::applySettings()
OnChange(*hGrp,"CornerCoordSystem");
OnChange(*hGrp,"CornerCoordSystemSize");
OnChange(*hGrp,"ShowAxisCross");
OnChange(*hGrp,"UseAutoRotation");
OnChange(*hGrp,"UseNavigationAnimations");
OnChange(*hGrp,"Gradient");
OnChange(*hGrp,"RadialGradient");
OnChange(*hGrp,"BackgroundColor");
@@ -287,9 +287,9 @@ void View3DSettings::OnChange(ParameterGrp::SubjectType &rCaller,ParameterGrp::M
_viewer->setAxisCross(rGrp.GetBool("ShowAxisCross", false));
}
}
else if (strcmp(Reason,"UseAutoRotation") == 0) {
else if (strcmp(Reason,"UseNavigationAnimations") == 0) {
for (auto _viewer : _viewers) {
_viewer->setAnimationEnabled(rGrp.GetBool("UseAutoRotation", false));
_viewer->setAnimationEnabled(rGrp.GetBool("UseNavigationAnimations", true));
}
}
else if (strcmp(Reason,"Gradient") == 0 || strcmp(Reason,"RadialGradient") == 0) {