Inviwo  0.9.10.1
Inviwo documentation
inviwo::animation::Animation Class Reference

#include <animation.h>

+ Inheritance diagram for inviwo::animation::Animation:

Public Types

using iterator = util::IndirectIterator< typename std::vector< std::unique_ptr< Track > >::iterator >
 
using const_iterator = util::IndirectIterator< typename std::vector< std::unique_ptr< Track > >::const_iterator >
 

Public Member Functions

 Animation (const Animation &)=delete
 
Animationoperator= (const Animation &that)=delete
 
AnimationTimeState operator() (Seconds from, Seconds to, AnimationState state) const
 
bool empty () const
 
size_t size () const
 
Trackoperator[] (size_t i)
 
const Trackoperator[] (size_t i) const
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
void add (std::unique_ptr< Track > track)
 
std::unique_ptr< Trackremove (size_t i)
 
std::unique_ptr< Trackremove (const std::string &id)
 
std::unique_ptr< Keyframeremove (Keyframe *key)
 
std::unique_ptr< KeyframeSequenceremove (KeyframeSequence *seq)
 
void clear ()
 
std::vector< Seconds > getAllTimes () const
 
Seconds getFirstTime () const
 
Seconds getLastTime () const
 
virtual void serialize (Serializer &s) const override
 
virtual void deserialize (Deserializer &d) override
 
- Public Member Functions inherited from inviwo::Observable< AnimationObserver >
 Observable (const Observable< AnimationObserver > &other)
 
 Observable (Observable< AnimationObserver > &&other)
 
Observable< AnimationObserver > & operator= (const Observable< AnimationObserver > &other)
 
Observable< AnimationObserver > & operator= (Observable< AnimationObserver > &&other)
 
void addObserver (AnimationObserver *observer)
 
void removeObserver (AnimationObserver *observer)
 
virtual void startBlockingNotifications () override final
 
virtual void stopBlockingNotifications () override final
 
- Public Member Functions inherited from inviwo::animation::TrackObserver
virtual void onKeyframeSequenceAdded (Track *, KeyframeSequence *)
 
virtual void onKeyframeSequenceRemoved (Track *, KeyframeSequence *)
 
virtual void onEnabledChanged (Track *)
 
virtual void onIdentifierChanged (Track *)
 
virtual void onNameChanged (Track *)
 
- Public Member Functions inherited from inviwo::Observer
 Observer (const Observer &other)
 
 Observer (Observer &&other)
 
Observeroperator= (Observer &&other)
 
Observeroperator= (const Observer &other)
 
virtual ~Observer ()
 
void removeObservation (ObservableInterface *observable)
 
void removeObservations ()
 

Additional Inherited Members

- Protected Types inherited from inviwo::Observer
using ObservableSet = std::unordered_set< ObservableInterface * >
 
- Protected Member Functions inherited from inviwo::animation::AnimationObservable
void notifyTrackAdded (Track *track)
 
void notifyTrackRemoved (Track *track)
 
void notifyFirstMoved ()
 
void notifyLastMoved ()
 
- Protected Member Functions inherited from inviwo::Observable< AnimationObserver >
void forEachObserver (C callback)
 
- Protected Member Functions inherited from inviwo::ObservableInterface
void addObservationHelper (Observer *observer)
 
void removeObservationHelper (Observer *observer)
 
- Protected Member Functions inherited from inviwo::Observer
void addObservation (ObservableInterface *observable)
 
- Protected Attributes inherited from inviwo::Observer
ObservableSet observables_
 

Detailed Description

Animation data structure, owns a list of tracks. Each Track usually represents a value to be animated.

Member Function Documentation

◆ clear()

void inviwo::animation::Animation::clear ( )

Remove all tracks. Calls TrackObserver::notifyTrackRemoved for each removed track.

◆ getAllTimes()

std::vector< Seconds > inviwo::animation::Animation::getAllTimes ( ) const

Return a sorted list, in ascending order, of all Keyframe times existing in the animation.

◆ getFirstTime()

Seconds inviwo::animation::Animation::getFirstTime ( ) const

Return time of first Keyframe in all tracks, or 0 if no track exist.

◆ getLastTime()

Seconds inviwo::animation::Animation::getLastTime ( ) const

Return time of last Keyframe in all tracks, or 0 if no track exist.

◆ remove() [1/4]

std::unique_ptr< Track > inviwo::animation::Animation::remove ( size_t  i)

Remove tracks at index i, indicating the order in which the track was added, not the order in which they are sorted by Track priority. No range check is done. Calls TrackObserver::notifyTrackRemoved after removing track.

◆ remove() [2/4]

std::unique_ptr< Track > inviwo::animation::Animation::remove ( const std::string &  id)

Remove tracks based on Track::getIdentifier Does nothing if no match was found. Calls TrackObserver::notifyTrackRemoved after removing track.

◆ remove() [3/4]

std::unique_ptr< Keyframe > inviwo::animation::Animation::remove ( Keyframe key)

Remove Keyframe if matching any of the Keyframes in the tracks. Calls TrackObserver::notifyKeyframeRemoved after removing Keyframe. Removes the KeyFrameSequence owning the Keyframe if it does not contain any Keyframe after removal, thereby calling KeyFrameSequenceObserver::notifyKeyframeSequenceRemoved Does nothing if no match was found.

Note
Keyframe will be deleted if removed so do not use pointer after calling this function.

◆ remove() [4/4]

std::unique_ptr< KeyframeSequence > inviwo::animation::Animation::remove ( KeyframeSequence seq)

Remove KeyframeSequence if matching any of the Sequences in the tracks. Calls KeyFrameSequenceObserver::notifyKeyframeSequenceRemoved for the sequence removed and TrackObserver::notifyKeyframeRemoved for every removed keyframe. Does nothing if no match was found.

Note
KeyframeSequences and its Keyframes will be deleted if removed so do not use pointer after calling this function.

The documentation for this class was generated from the following files: