Go to the documentation of this file.00001 #ifndef OPENTISSUE_DYNAMICS_MBD_UTIL_MBD_IS_ALL_BODIES_SLEEPY_H
00002 #define OPENTISSUE_DYNAMICS_MBD_UTIL_MBD_IS_ALL_BODIES_SLEEPY_H
00003
00004
00005
00006
00007
00008
00009
00010 #include <OpenTissue/configuration.h>
00011
00012 namespace OpenTissue
00013 {
00014 namespace mbd
00015 {
00016
00017 template<typename indirect_body_iterator>
00018 bool is_all_bodies_sleepy(indirect_body_iterator begin, indirect_body_iterator end)
00019 {
00020 for(indirect_body_iterator body = begin;body!=end;++body)
00021 {
00022 assert(body->is_active() || !"is_all_bodies_sleepy(): body was not active");
00023 if(!body->is_sleepy())
00024 return false;
00025
00026 }
00027 return true;
00028 }
00029
00030 template<typename group_type>
00031 bool is_all_bodies_sleepy(group_type const & group)
00032 {
00033 return is_all_bodies_sleepy(group.body_begin(),group.body_end());
00034 }
00035
00036 }
00037 }
00038
00039 #endif