Go to the documentation of this file.00001 #ifndef OPENTISSUE_DYNAMICS_MBD_UTIL_MBD_COMPUTE_SCRIPTED_MOTIONS_H
00002 #define OPENTISSUE_DYNAMICS_MBD_UTIL_MBD_COMPUTE_SCRIPTED_MOTIONS_H
00003
00004
00005
00006
00007
00008
00009
00010 #include <OpenTissue/configuration.h>
00011
00012 namespace OpenTissue
00013 {
00014 namespace mbd
00015 {
00016
00028 template<typename indirect_body_iterator,typename real_type>
00029 void compute_scripted_motions(indirect_body_iterator begin, indirect_body_iterator end, real_type const & time)
00030 {
00031 for(indirect_body_iterator body = begin;body!=end;++body)
00032 {
00033 assert(body->is_active() || !"get_position_vector(): body was not active");
00034 if(body->is_scripted())
00035 body->compute_scripted_motion(time);
00036 }
00037 }
00038
00039 template<typename group_type,typename real_type>
00040 void compute_scripted_motions(group_type const & group, real_type const & time)
00041 {
00042 compute_scripted_motions(group.body_begin(),group.body_end(),time);
00043 }
00044
00045 }
00046 }
00047
00048 #endif