00001 #ifndef SIMULATOR_TYPE_COMPILE_TEST 00002 #define SIMULATOR_TYPE_COMPILE_TEST 00003 // 00004 // OpenTissue, A toolbox for physical based simulation and animation. 00005 // Copyright (C) 2007 Department of Computer Science, University of Copenhagen 00006 // 00007 #include <OpenTissue/configuration.h> 00008 00009 #include <OpenTissue/dynamics/mbd/math/mbd_default_math_policy.h> 00010 #include <OpenTissue/dynamics/mbd/mbd.h> 00011 00012 template<typename types> 00013 class MyCollisionDetection 00014 : public OpenTissue::mbd::CollisionDetection< 00015 types 00016 , OpenTissue::mbd::SpatialHashing 00017 , OpenTissue::mbd::GeometryDispatcher 00018 , OpenTissue::mbd::SingleGroupAnalysis 00019 > 00020 {}; 00021 00022 00023 template<typename mbd_types> 00024 void simulator_interface_compile_test() 00025 { 00026 typedef typename mbd_types::math_policy::real_type real_type; 00027 typedef typename mbd_types::simulator_type simulator_type; 00028 typedef typename mbd_types::configuration_type configuration_type; 00029 00030 simulator_type simulator; 00031 configuration_type configuration; 00032 00033 real_type time_step = simulator.time(); 00034 simulator.run(time_step); 00035 simulator.init(configuration); 00036 00037 simulator.get_configuration(); 00038 simulator.get_stepper(); 00039 simulator.get_sleepy(); 00040 simulator.get_collision_detection(); 00041 } 00042 00043 00044 template<typename math_types, template <typename> class stepper_type,template <typename> class simulator_type> 00045 void simulator_type_compile_test() 00046 { 00047 typedef typename OpenTissue::mbd::Types< 00048 math_types 00049 , OpenTissue::mbd::NoSleepyPolicy 00050 , stepper_type 00051 , MyCollisionDetection 00052 , simulator_type 00053 > types1; 00054 00055 void (*ptr)() = 0; 00056 00057 ptr = &(simulator_interface_compile_test<types1> ); 00058 } 00059 00060 // SIMULATOR_TYPE_COMPILE_TEST 00061 #endif