00001 #ifndef OPENTISSUE_KINEMATICS_ANIMATION_ANIMATION_INTERFACE_H 00002 #define OPENTISSUE_KINEMATICS_ANIMATION_ANIMATION_INTERFACE_H 00003 // 00004 // OpenTissue Template Library 00005 // - A generic toolbox for physics-based modeling and simulation. 00006 // Copyright (C) 2008 Department of Computer Science, University of Copenhagen. 00007 // 00008 // OTTL is licensed under zlib: http://opensource.org/licenses/zlib-license.php 00009 // 00010 #include <OpenTissue/configuration.h> 00011 00012 #include <cassert> 00013 00014 namespace OpenTissue 00015 { 00016 namespace animation 00017 { 00018 00019 00023 template<typename skeleton_type_> 00024 class Interface 00025 { 00026 public: 00027 00028 typedef skeleton_type_ skeleton_type; 00029 typedef typename skeleton_type::math_types math_types; 00030 typedef typename math_types::coordsys_type coordsys_type; 00031 typedef typename math_types::real_type real_type; 00032 00033 protected: 00034 00035 real_type m_weight; 00036 00037 public: 00038 00039 Interface() 00040 : m_weight(1.0) 00041 {} 00042 00043 virtual ~Interface(){} 00044 00045 public: 00046 00047 virtual void clear() 00048 { 00049 m_weight = 1.0; 00050 } 00051 00052 00053 public: 00054 00055 real_type const & get_weight() const { return m_weight; }; 00056 00057 void set_weight(real_type const & value) { assert(value>=0); m_weight= value; }; 00058 00059 public: 00060 00067 virtual void blend_pose(skeleton_type & skeleton, real_type const & local_time)=0; 00068 00069 00075 virtual real_type compute_duration(void)=0; 00076 00077 }; 00078 00079 } // namespace animation 00080 } // namespace OpenTissue 00081 00082 //OPENTISSUE_KINEMATICS_ANIMATION_ANIMATION_INTERFACE_H 00083 #endif