Gui: Apply Law of Demeter to starting and stopping animations

This commit is contained in:
Rexbas
2023-10-24 22:05:20 +02:00
committed by wwmayer
parent 9eee332bb3
commit 61c1b2bfc2
3 changed files with 19 additions and 12 deletions

View File

@@ -3110,12 +3110,7 @@ void View3DInventorViewer::startAnimation(const SbRotation& orientation,
auto animation = std::make_shared<FixedTimeAnimation>(
navigation, orientation, rotationCenter, translation, duration);
if (wait) {
navigation->getAnimator()->startAndWait(animation);
}
else {
navigation->getAnimator()->start(animation);
}
navigation->startAnimating(animation, wait);
}
/**
@@ -3127,12 +3122,12 @@ void View3DInventorViewer::startAnimation(const SbRotation& orientation,
void View3DInventorViewer::startSpinningAnimation(const SbVec3f& axis, float velocity)
{
auto animation = std::make_shared<SpinningAnimation>(navigation, axis, velocity);
navigation->getAnimator()->start(animation);
navigation->startAnimating(animation);
}
void View3DInventorViewer::stopAnimating()
{
navigation->getAnimator()->stop();
navigation->stopAnimating();
}
void View3DInventorViewer::setPopupMenuEnabled(const SbBool on)