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

#include <animationcontroller.h>

+ Inheritance diagram for inviwo::animation::AnimationController:

Classes

struct  RenderCanvasSize
 
struct  RenderState
 Data structure for the state needed during rendering. More...
 

Public Member Functions

 AnimationController (Animation &animation, InviwoApplication *app=InviwoApplication::getPtr())
 
void play ()
 Play animation.
 
void pause ()
 Pause animation.
 
void render ()
 Render the animation into an image sequence.
 
void stop ()
 
void setState (AnimationState newState)
 
void tick ()
 Advances the animation to the next time step in playing state.
 
void tickRender ()
 Advances the animation to the next time step in rendering state.
 
void eval (Seconds oldTime, Seconds newTime)
 Asks the animation to update the network to reflect the new time.
 
void setAnimation (Animation &animation)
 
void setPlaySpeed (double framesPerSecond)
 
AnimationgetAnimation ()
 Returns mutable controlled animation.
 
const AnimationgetAnimation () const
 Returns controlled animation.
 
const AnimationState & getState () const
 Returns the current state of the controller, whether it is playing, or pausing, and such.
 
const AnimationPlaySettingsgetPlaybackSettings () const
 Returns playback mode such as loop or swing and such.
 
AnimationPlaySettingsgetPlaybackSettings ()
 
void setPlaybackSettings (const AnimationPlaySettings &newSettings)
 
const AnimationPlaySettingsgetRenderingSettings () const
 
Seconds getCurrentTime () const
 
InviwoApplicationgetInviwoApplication ()
 
- Public Member Functions inherited from inviwo::Observable< AnimationControllerObserver >
 Observable (const Observable< AnimationControllerObserver > &other)
 
 Observable (Observable< AnimationControllerObserver > &&other)
 
Observable< AnimationControllerObserver > & operator= (const Observable< AnimationControllerObserver > &other)
 
Observable< AnimationControllerObserver > & operator= (Observable< AnimationControllerObserver > &&other)
 
void addObserver (AnimationControllerObserver *observer)
 
void removeObserver (AnimationControllerObserver *observer)
 
virtual void startBlockingNotifications () override final
 
virtual void stopBlockingNotifications () override final
 
- Public Member Functions inherited from inviwo::PropertyOwner
virtual ~PropertyOwner ()
 Removes all properties and notifies its observers of the removal.
 
virtual void addProperty (Property *property, bool owner=true)
 
virtual void addProperty (Property &property)
 
template<typename... Ts>
void addProperties (Ts &... properties)
 
virtual void insertProperty (size_t index, Property *property, bool owner=true)
 insert property property at position index If index is not valid, the property is appended. More...
 
virtual void insertProperty (size_t index, Property &property)
 insert property property at position index If index is not valid, the property is appended. More...
 
virtual PropertyremoveProperty (const std::string &identifier)
 
virtual PropertyremoveProperty (Property *property)
 
virtual PropertyremoveProperty (Property &property)
 
virtual PropertyremoveProperty (size_t index)
 remove property referred to by index More...
 
virtual std::vector< std::string > getPath () const
 
const std::vector< Property * > & getProperties () const
 
const std::vector< CompositeProperty * > & getCompositeProperties () const
 
std::vector< Property * > getPropertiesRecursive () const
 
PropertygetPropertyByIdentifier (const std::string &identifier, bool recursiveSearch=false) const
 
PropertygetPropertyByPath (const std::vector< std::string > &path) const
 
template<class T >
std::vector< T * > getPropertiesByType (bool recursiveSearch=false) const
 
size_t size () const
 
Propertyoperator[] (size_t)
 
const Propertyoperator[] (size_t) const
 
iterator begin ()
 
iterator end ()
 
const_iterator cbegin () const
 
const_iterator cend () const
 
virtual bool isValid () const
 
virtual void setValid ()
 
InvalidationLevel getInvalidationLevel () const
 
virtual void invalidate (InvalidationLevel invalidationLevel, Property *modifiedProperty=nullptr)
 
virtual ProcessorgetProcessor ()
 
virtual const ProcessorgetProcessor () const
 
virtual void serialize (Serializer &s) const override
 
virtual void deserialize (Deserializer &d) override
 
void setAllPropertiesCurrentStateAsDefault ()
 
void resetAllPoperties ()
 
virtual void invokeEvent (Event *event) override
 
- Public Member Functions inherited from inviwo::PropertyOwnerObservable
void notifyObserversWillAddProperty (Property *property, size_t index)
 
void notifyObserversDidAddProperty (Property *property, size_t index)
 
void notifyObserversWillRemoveProperty (Property *property, size_t index)
 
void notifyObserversDidRemoveProperty (Property *property, size_t index)
 
- Public Member Functions inherited from inviwo::Observable< PropertyOwnerObserver >
 Observable (const Observable< PropertyOwnerObserver > &other)
 
 Observable (Observable< PropertyOwnerObserver > &&other)
 
Observable< PropertyOwnerObserver > & operator= (const Observable< PropertyOwnerObserver > &other)
 
Observable< PropertyOwnerObserver > & operator= (Observable< PropertyOwnerObserver > &&other)
 
void addObserver (PropertyOwnerObserver *observer)
 
void removeObserver (PropertyOwnerObserver *observer)
 
virtual void startBlockingNotifications () override final
 
virtual void stopBlockingNotifications () override final
 

Public Attributes

CompositeProperty playOptions
 
OptionPropertyInt playWindowMode
 
DoubleMinMaxProperty playWindow
 
DoubleProperty framesPerSecond
 
TemplateOptionProperty< PlaybackMode > playMode
 
CompositeProperty renderOptions
 
OptionPropertyInt renderWindowMode
 
DoubleMinMaxProperty renderWindow
 
OptionPropertyInt renderSizeMode
 
IntVec2Property renderSize
 
OptionPropertyInt renderAspectRatio
 
DirectoryProperty renderLocation
 
StringProperty renderBaseName
 
OptionPropertyString renderImageExtension
 
IntProperty renderNumFrames
 
ButtonProperty renderAction
 
ButtonProperty renderActionStop
 
CompositeProperty controlOptions
 
ButtonProperty controlInsertPauseFrame
 

Protected Member Functions

void setTime (Seconds time)
 Low-level setting of currentTime_. Use eval() to set time in the public interface.
 
void afterRender ()
 Called to cleanup after rendering.
 
- Protected Member Functions inherited from inviwo::animation::AnimationControllerObservable
void notifyStateChanged (AnimationController *controller, AnimationState prevState, AnimationState newState)
 
void notifyPlaybackSettingsChanged (AnimationController *controller, AnimationPlaySettings prevMode, AnimationPlaySettings newMode)
 
void notifyTimeChanged (AnimationController *controller, Seconds oldTime, Seconds newTime)
 
void notifyAnimationChanged (AnimationController *controller, Animation *oldAnimation, Animation *newAnimation)
 
- Protected Member Functions inherited from inviwo::Observable< AnimationControllerObserver >
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::PropertyOwner
 PropertyOwner (const PropertyOwner &rhs)
 
PropertyOwneroperator= (const PropertyOwner &that)=delete
 
- Protected Member Functions inherited from inviwo::Observable< PropertyOwnerObserver >
void forEachObserver (C callback)
 

Protected Attributes

Animationanimation_
 The animation to control, non-owning reference.
 
InviwoApplicationapp_
 Host application.
 
AnimationState state_
 State of the animation, such as paused or playing or rendering.
 
AnimationPlaySettings settingsPlay_
 If in playback state, how fast we play the animation and whether we loop, or swing, etc.
 
AnimationPlaySettings settingsRendering_
 If in rendering state, how many frames we render.
 
Seconds currentTime_
 Current time of the animation. This is an important variable to keep consistent!
 
Seconds deltaTime_
 Time span between two frames.
 
Timer timer_
 Timer for calling the tick function is regular intervals.
 
RenderState renderState_
 State needed during rendering.
 
- Protected Attributes inherited from inviwo::PropertyOwner
std::vector< Property * > properties_
 
std::vector< EventProperty * > eventProperties_
 
std::vector< CompositeProperty * > compositeProperties_
 
std::vector< std::unique_ptr< Property > > ownedProperties_
 

Additional Inherited Members

- Public Types inherited from inviwo::PropertyOwner
using iterator = std::vector< Property * >::iterator
 
using const_iterator = std::vector< Property * >::const_iterator
 

Detailed Description

The AnimationController is responsible for steering the animation.

It keeps track of the animation time and state. When playing, it should adjust the step sizes to maintain a certain playback speed (frames per second).

Furthermore, it allows to render the animation into an image sequence.


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