Inviwo 0.9.12-pre
Inviwo documentation
Loading...
Searching...
No Matches
inviwo::animation::WorkspaceAnimations Class Reference

Responsible for animations saved in the workspace and ensuring that there always is at least one main Animation. More...

#include <workspaceanimations.h>

+ Inheritance diagram for inviwo::animation::WorkspaceAnimations:

Public Types

using OnChangedDispatcher = Dispatcher<void(size_t, Animation&)>
 
using const_iterator
 
using iterator
 

Public Member Functions

 WorkspaceAnimations (InviwoApplication *app, AnimationManager &manager, AnimationModule &module)
 
 WorkspaceAnimations (const WorkspaceAnimations &)=delete
 
 WorkspaceAnimations (WorkspaceAnimations &&)=delete
 
WorkspaceAnimationsoperator= (const WorkspaceAnimations &)=delete
 
WorkspaceAnimationsoperator= (WorkspaceAnimations &&)=delete
 
Animationget (size_t index)
 
std::vector< Animation * > get (std::string_view name)
 
Animationoperator[] (size_t i)
 
const Animationoperator[] (size_t i) const
 
const_iterator begin () const
 
const_iterator end () const
 
iterator begin ()
 
iterator end ()
 
Animationadd (std::string_view name)
 
Animationadd (Animation anim)
 
Animationinsert (size_t index, std::string_view name)
 
Animationinsert (const_iterator position, std::string_view name)
 
void erase (size_t index)
 
void erase (const_iterator position)
 
void clear ()
 
size_t size () const
 
void setMainAnimation (Animation &anim)
 Set specified Animation to be the MainAnimation. A copy of the Animation will be added in case the it has not been added before. The AnimationController in MainAnimation will notify its observers of the animation change.
 
MainAnimationgetMainAnimation ()
 
const MainAnimationgetMainAnimation () const
 
const_iterator find (const Animation *anim) const
 
iterator find (const Animation *anim)
 
- Public Member Functions inherited from inviwo::animation::AnimationControllerObserver
virtual void onStateChanged (AnimationController *, AnimationState, AnimationState)
 
virtual void onTimeChanged (AnimationController *, Seconds, Seconds)
 
- 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 ()
 
- Public Member Functions inherited from inviwo::animation::AnimationObserver
virtual void onFirstMoved ()
 
virtual void onLastMoved ()
 
- Public Member Functions inherited from inviwo::animation::TrackObserver
virtual void onFirstMoved (Track *)
 
virtual void onLastMoved (Track *)
 
- Public Member Functions inherited from inviwo::animation::KeyframeSequenceObserver
- Public Member Functions inherited from inviwo::animation::KeyframeObserver

Public Attributes

OnChangedDispatcher onChanged_
 

Additional Inherited Members

- Protected Member Functions inherited from inviwo::Observer
void addObservation (ObservableInterface *observable)
 
- Protected Attributes inherited from inviwo::Observer
std::unordered_set< ObservableInterface * > observables_
 

Detailed Description

Responsible for animations saved in the workspace and ensuring that there always is at least one main Animation.

One of its animations is set to be the MainAnimation. The Animation used by MainAnimation must be set through WorkspaceAnimations.

WorkspaceAnimations is responsible for clearing, saving, and loading animations when the workspace is cleared, saved, or loaded. It will also call notifyObserversProcessorNetworkChanged whenever its animations change to enable undo/redo.

Member Typedef Documentation

◆ const_iterator

Initial value:
util::IndirectIterator<typename std::vector<std::unique_ptr<Animation>>::const_iterator>

◆ iterator

Initial value:
util::IndirectIterator<typename std::vector<std::unique_ptr<Animation>>::iterator>

◆ OnChangedDispatcher

Called when an Animation is added or removed. In case of removal: The supplied Animation will be removed from WorkspaceAnimation before this function is called, but it will not be deleted until after this call.

Parameters
Indexof changed Animation (as it was before removal)
Referenceto the added/removed Animation.

Member Function Documentation

◆ add()

Animation & inviwo::animation::WorkspaceAnimations::add ( std::string_view name)

Add an empty Animation with specified name.

◆ clear()

void inviwo::animation::WorkspaceAnimations::clear ( )

Removes all animations leaving an empty Animation, which is set to be the MainAnimation. The size() will be 1 after clearing.

◆ erase()

void inviwo::animation::WorkspaceAnimations::erase ( size_t index)

Removes the animation and adjusts the main animation to the next available index if needed. An empty animation will be added if all animations are erased.

◆ get()

std::vector< Animation * > inviwo::animation::WorkspaceAnimations::get ( std::string_view name)
Returns
all animations matching name

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