OSDN Git Service

fix cmake/Macros.cmake
[moflib/moflib.git] / moflib-1.0 / moflib / moflib / mof / stream / ParametricAnimation.hpp
1  #pragma once
2  
3  #include <mof/Animation.hpp>
4  
5  namespace mof{
6  
7  
8  
9  template<typename T>
10  class ParametricAnimation : public mof::Animation<T>{
11         const boost::shared_ptr<T>& m_parameter;
12  public:
13  
14         ParametricAnimation(const boost::shared_ptr<T>& parameter) 
15                 : m_parameter(parameter){
16         }
17  
18         virtual T getValue(mof::FrameNumber ) const{
19                 return *m_parameter;
20         }
21  
22  };
23  
24  template<class T>
25  typename mof::Animation<T>::Handler makeParametricHandler(const boost::shared_ptr<T>& parameter){
26         return mof::Animation<T>::Handler(new mof::ParametricAnimation<T>(parameter));
27  }
28  
29  } //namespace mof
30