AbstractGenericAnimator class new in Git master
#include <Magnum/Ui/AbstractAnimator.h>
Base for generic animators.
Base classes
- class AbstractAnimator new in Git master
- Base for animators.
Derived classes
- class GenericAnimator new in Git master
- Generic animator.
- class GenericDataAnimator new in Git master
- Generic animator with animations attached to layer data.
- class GenericNodeAnimator new in Git master
- Generic animator with animations attached to nodes.
Constructors, destructors, conversion operators
- AbstractGenericAnimator(AnimatorHandle handle) explicit
- Constructor.
- AbstractGenericAnimator(const AbstractGenericAnimator&) deleted
- Copying is not allowed.
- AbstractGenericAnimator(AbstractGenericAnimator&&) noexcept
- Move constructor.
Public functions
- auto operator=(const AbstractGenericAnimator&) -> AbstractGenericAnimator& deleted
- Copying is not allowed.
- auto operator=(AbstractGenericAnimator&&) -> AbstractGenericAnimator& noexcept
- Move assignment.
-
void advance(Nanoseconds time,
Containers::
MutableBitArrayView activeStorage, Containers:: MutableBitArrayView startedStorage, Containers:: MutableBitArrayView stoppedStorage, const Containers:: StridedArrayView1D<Float>& factorStorage, Containers:: MutableBitArrayView removeStorage) - Advance the animations.
Protected functions
- void setLayer(const AbstractLayer& layer)
- Set a layer associated with this animator.
Private functions
-
void doAdvance(Containers::
BitArrayView active, Containers:: BitArrayView started, Containers:: BitArrayView stopped, const Containers:: StridedArrayView1D<const Float>& factors) pure virtual - Advance the animations.
Function documentation
Magnum:: Ui:: AbstractGenericAnimator:: AbstractGenericAnimator(AnimatorHandle handle) explicit
Constructor.
| Parameters | |
|---|---|
| handle | Handle returned by AbstractUserInterface:: |
Magnum:: Ui:: AbstractGenericAnimator:: AbstractGenericAnimator(AbstractGenericAnimator&&) noexcept
Move constructor.
Performs a destructive move, i.e. the original object isn't usable afterwards anymore.
void Magnum:: Ui:: AbstractGenericAnimator:: advance(Nanoseconds time,
Containers:: MutableBitArrayView activeStorage,
Containers:: MutableBitArrayView startedStorage,
Containers:: MutableBitArrayView stoppedStorage,
const Containers:: StridedArrayView1D<Float>& factorStorage,
Containers:: MutableBitArrayView removeStorage)
Advance the animations.
Used internally from AbstractUserInterface::
Expects that size of activeStorage, startedStorage, stoppedStorage, factorStorage and removeStorage matches capacity(), their contents get filled by update() internally. Delegates to doAdvance(), see its documentation for more information.
void Magnum:: Ui:: AbstractGenericAnimator:: setLayer(const AbstractLayer& layer) protected
Set a layer associated with this animator.
Expects that the animator supports AnimatorFeature::layer into layer() const, making it possible to call create(Nanoseconds, Nanoseconds, DataHandle, UnsignedInt, AnimationFlags), create(Nanoseconds, Nanoseconds, LayerDataHandle, UnsignedInt, AnimationFlags), attach(AnimationHandle, DataHandle), attach(AnimationHandle, LayerDataHandle), attach(AnimatorDataHandle, DataHandle) and attach(AnimatorDataHandle, LayerDataHandle).
A concrete subclass exposing AnimatorFeature::
A corresponding API for an AbstractDataAnimator / AbstractStyleAnimator is AbstractLayer::
void Magnum:: Ui:: AbstractGenericAnimator:: doAdvance(Containers:: BitArrayView active,
Containers:: BitArrayView started,
Containers:: BitArrayView stopped,
const Containers:: StridedArrayView1D<const Float>& factors) pure virtual private
Advance the animations.
| Parameters | |
|---|---|
| active | Animation IDs that are active |
| started | Animation IDs that started playing since last time |
| stopped | Animation IDs that stopped playing since last time |
| factors | Interpolation factors indexed by animation ID |
Implementation for advance(), which is called from AbstractUserInterface::
The active, started, stopped and factors views are guaranteed to have the same size as capacity(). The factors array is guaranteed to contain values in the range for animations that have a corresponding bit set in active, calculated equivalently to factor(AnimationHandle) const, and may contain random or uninitialized values for others. This function is always called with at least one active bit set.