Gui: Add a separate checkbox for enabling spinning animations (#11534)

* Gui: Create group box for animation preferences

* Gui: Add spinning animation checkbox

* Gui: Implement isAnimating() for NavigationAnimator

* Gui: No need to enable animations in DemoMode

The spin animation is played regardless of the user preference and does not need to be enabled before starting the spin animation

* Gui: Change comment
This commit is contained in:
Bas Ruigrok
2023-12-04 17:50:29 +01:00
committed by GitHub
parent b70eb6a173
commit ea8b5b4b39
11 changed files with 226 additions and 151 deletions

View File

@@ -2397,7 +2397,7 @@ void View3DInventorViewer::renderScene()
glDepthRange(0.1,1.0);
#endif
// Immediately reschedule to get continuous spin animation.
// Immediately reschedule to get continuous animation.
if (this->isAnimating()) {
this->getSoRenderManager()->scheduleRedraw();
}
@@ -3233,39 +3233,58 @@ void View3DInventorViewer::viewSelection()
}
}
/*!
Decide if it should be possible to start a spin animation of the
model in the viewer by releasing the mouse button while dragging.
If the \a enable flag is \c false and we're currently animating, the
spin will be stopped.
*/
void
View3DInventorViewer::setAnimationEnabled(bool enable)
/**
* @brief Decide if it should be possible to start any animation
*
* If the enable flag is false and we're currently animating, the animation will be stopped
*/
void View3DInventorViewer::setAnimationEnabled(bool enable)
{
navigation->setAnimationEnabled(enable);
}
/*!
Query whether or not it is possible to start a spinning animation by
releasing the left mouse button while dragging the mouse.
*/
/**
* @brief Decide if it should be possible to start a spin animation of the model in the viewer by releasing the mouse button while dragging
*
* If the enable flag is false and we're currently animating, the spin animation will be stopped
*/
void View3DInventorViewer::setSpinningAnimationEnabled(bool enable)
{
navigation->setSpinningAnimationEnabled(enable);
}
bool
View3DInventorViewer::isAnimationEnabled() const
/**
* @return Whether or not it is possible to start any animation
*/
bool View3DInventorViewer::isAnimationEnabled() const
{
return navigation->isAnimationEnabled();
}
/*!
Query if the model in the viewer is currently in spinning mode after
a user drag.
*/
/**
* @return Whether or not it is possible to start a spinning animation e.g. after dragging
*/
bool View3DInventorViewer::isSpinningAnimationEnabled() const
{
return navigation->isSpinningAnimationEnabled();
}
/**
* @return Whether or not any animation is currently active
*/
bool View3DInventorViewer::isAnimating() const
{
return navigation->isAnimating();
}
/**
* @return Whether or not a spinning animation is currently active e.g. after a user drag
*/
bool View3DInventorViewer::isSpinning() const
{
return navigation->isSpinning();
}
/**
* @brief Change the camera pose with an animation
*