00001 #ifndef OPENTISSUE_KINEMATICS_INVERSE_INVERSE_ADD_CHAIN_H 00002 #define OPENTISSUE_KINEMATICS_INVERSE_INVERSE_ADD_CHAIN_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 namespace OpenTissue 00013 { 00014 namespace kinematics 00015 { 00016 namespace inverse 00017 { 00018 00033 template<typename solver_type> 00034 inline typename solver_type::chain_iterator add_chain( 00035 solver_type & solver 00036 , typename solver_type::skeleton_type::bone_type const & root_ 00037 , typename solver_type::skeleton_type::bone_type const & end_effector 00038 ) 00039 { 00040 typedef typename solver_type::chain_type chain_type; 00041 typedef typename solver_type::skeleton_type::bone_type bone_type; 00042 00043 bone_type * end = const_cast<bone_type*>(&end_effector); 00044 bone_type * root = const_cast<bone_type*>(&root_ ); 00045 00046 chain_type chain; 00047 chain.init( root, end ); 00048 00049 typename solver_type::chain_iterator iter = solver.add_chain( chain ); 00050 00051 return iter; 00052 } 00053 00054 } // namespace inverse 00055 } // namespace kinematics 00056 } // namespace OpenTissue 00057 00058 //OPENTISSUE_KINEMATICS_INVERSE_INVERSE_ADD_CHAIN_H 00059 #endif