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

@@ -473,27 +473,91 @@ The value is the diameter of the sphere to fit on the screen.</string>
</widget>
</item>
<item row="5" column="0">
<widget class="Gui::PrefCheckBox" name="checkBoxUseAutoRotation">
<widget class="Gui::PrefCheckBox" name="checkBoxNavigationAnimations">
<property name="enabled">
<bool>true</bool>
</property>
<property name="toolTip">
<string>Enable animated rotations</string>
<string>Enable navigation animations</string>
</property>
<property name="text">
<string>Enable animation</string>
<string>Enable navigation animations</string>
</property>
<property name="checked">
<bool>false</bool>
<bool>true</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>UseAutoRotation</cstring>
<cstring>UseNavigationAnimations</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLabel" name="navigationAnimationsLabel">
<property name="toolTip">
<string>Duration of navigation animations that have a fixed duration</string>
</property>
<property name="text">
<string>Animation duration</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="5" column="2">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="Gui::PrefSpinBox" name="spinBoxAnimationDuration">
<property name="maximumSize">
<size>
<width>60</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>The duration of navigation animations in milliseconds</string>
</property>
<property name="minimum">
<number>100</number>
</property>
<property name="maximum">
<number>10000</number>
</property>
<property name="singleStep">
<number>50</number>
</property>
<property name="value">
<number>250</number>
</property>
<property name="prefEntry" stdset="0">
<cstring>AnimationDuration</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="6" column="0">
<widget class="Gui::PrefCheckBox" name="checkBoxZoomAtCursor">
<property name="toolTip">
@@ -516,7 +580,7 @@ The value is the diameter of the sphere to fit on the screen.</string>
<item row="6" column="1">
<widget class="QLabel" name="label">
<property name="text">
<string> Zoom step</string>
<string>Zoom step</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>