Go to the documentation of this file.00001 #ifndef OPENTISSUE_DYNAMICS_MBD_MBD_TYPES_H
00002 #define OPENTISSUE_DYNAMICS_MBD_MBD_TYPES_H
00003
00004
00005
00006
00007 #include <OpenTissue/configuration.h>
00008
00009
00010 #include <OpenTissue/collision/collision_geometry_interface.h>
00011
00012
00013 #include <OpenTissue/utility/utility_identifier.h>
00014
00015 #include <OpenTissue/dynamics/mbd/mbd_body_group.h>
00016 #include <OpenTissue/dynamics/mbd/mbd_material.h>
00017 #include <OpenTissue/dynamics/mbd/mbd_material_library.h>
00018 #include <OpenTissue/dynamics/mbd/mbd_contact_point.h>
00019 #include <OpenTissue/dynamics/mbd/mbd_body.h>
00020 #include <OpenTissue/dynamics/mbd/mbd_edge.h>
00021 #include <OpenTissue/dynamics/mbd/mbd_configuration.h>
00022 #include <OpenTissue/dynamics/mbd/mbd_joint_socket.h>
00023
00024 #include <OpenTissue/dynamics/mbd/mbd_collision_info.h>
00025
00026 #include <OpenTissue/dynamics/mbd/interfaces/mbd_constraint_interface.h>
00027 #include <OpenTissue/dynamics/mbd/interfaces/mbd_sub_constraint_interface.h>
00028 #include <OpenTissue/dynamics/mbd/interfaces/mbd_force_interface.h>
00029 #include <OpenTissue/dynamics/mbd/interfaces/mbd_joint_interface.h>
00030 #include <OpenTissue/dynamics/mbd/interfaces/mbd_scripted_motion_interface.h>
00031
00032 #include <boost/iterator/indirect_iterator.hpp>
00033
00034 #include <list>
00035 #include <vector>
00036
00037 namespace OpenTissue
00038 {
00039 namespace mbd
00040 {
00047 template<
00048 typename math_policy_
00049 , template< typename > class sleepy_policy_
00050 , template< typename > class stepper_policy_
00051 , template< typename > class collision_detection_policy_
00052 , template< typename > class simulator_type_
00053 >
00054 class Types
00055 {
00056 public:
00057
00058 typedef Types<math_policy_,sleepy_policy_,stepper_policy_,collision_detection_policy_,simulator_type_> types;
00059
00060 typedef math_policy_ math_policy;
00061 typedef sleepy_policy_<types> sleepy_policy;
00062 typedef stepper_policy_<types> stepper_policy;
00063 typedef collision_detection_policy_<types> collision_detection_policy;
00064 typedef simulator_type_<types> simulator_type;
00065
00066 protected:
00067
00068 class NodeTraitsClass
00069 : public sleepy_policy::node_traits
00070 , public stepper_policy::node_traits
00071 , public collision_detection_policy::node_traits
00072 , public simulator_type::node_traits
00073 {
00074 };
00075
00076 class EdgeTraitsClass
00077 : public sleepy_policy::edge_traits
00078 , public stepper_policy::edge_traits
00079 , public collision_detection_policy::edge_traits
00080 , public simulator_type::edge_traits
00081 {};
00082
00083 class ConstraintTraitsClass
00084 : public sleepy_policy::constraint_traits
00085 , public stepper_policy::constraint_traits
00086 , public collision_detection_policy::constraint_traits
00087 , public simulator_type::constraint_traits
00088 {};
00089
00090 public:
00091
00092 typedef EdgeTraitsClass edge_traits;
00093 typedef NodeTraitsClass node_traits;
00094 typedef ConstraintTraitsClass constraint_traits;
00095
00096 typedef OpenTissue::utility::Identifier identifier_type;
00097 typedef Body<types> body_type;
00098 typedef Edge<types> edge_type;
00099 typedef Configuration<types> configuration_type;
00100 typedef ScriptedMotionInterface<types> scripted_motion_type;
00101 typedef ForceInterface<types> force_type;
00102 typedef BodyGroup<types> group_type;
00103 typedef Material<types> material_type;
00104 typedef MaterialLibrary<types> material_library_type;
00105
00106 typedef OpenTissue::collision::GeometryInterface<math_policy> geometry_type;
00107 typedef CollisionInfo<types> collision_info_type;
00108
00109 typedef ConstraintInterface<types> constraint_type;
00110 typedef SubConstraintInterface<types> sub_constraint_type;
00111 typedef ContactPoint<types> contact_type;
00112 typedef JointInterface<types> joint_type;
00113 typedef JointSocket<types> socket_type;
00114
00115 typedef typename std::vector<group_type> group_container;
00116
00117 typedef typename std::list<group_type*> group_ptr_container;
00118 typedef boost::indirect_iterator<typename group_ptr_container::iterator,group_type> indirect_group_iterator;
00119 typedef boost::indirect_iterator<typename group_ptr_container::const_iterator,group_type> const_indirect_group_iterator;
00120
00121 typedef typename std::list<contact_type*> contact_ptr_container;
00122 typedef boost::indirect_iterator<typename contact_ptr_container::iterator,contact_type> indirect_contact_iterator;
00123 typedef boost::indirect_iterator<typename contact_ptr_container::const_iterator,contact_type> const_indirect_contact_iterator;
00124
00125 typedef typename std::vector<contact_type> contact_container;
00126 typedef typename contact_container::iterator contact_iterator;
00127 typedef typename contact_container::const_iterator const_contact_iterator;
00128
00129 typedef typename std::list<edge_type *> edge_ptr_container;
00130 typedef boost::indirect_iterator<typename edge_ptr_container::iterator,edge_type> indirect_edge_iterator;
00131 typedef boost::indirect_iterator<typename edge_ptr_container::const_iterator,edge_type> const_edge_iterator;
00132
00133 typedef typename std::list<joint_type *> joint_ptr_container;
00134 typedef boost::indirect_iterator<typename joint_ptr_container::iterator,joint_type> indirect_joint_iterator;
00135 typedef boost::indirect_iterator<typename joint_ptr_container::const_iterator,joint_type> const_indirect_joint_iterator;
00136
00137 typedef typename std::list<force_type *> force_ptr_container;
00138 typedef boost::indirect_iterator<typename force_ptr_container::iterator,force_type> indirect_force_iterator;
00139 typedef boost::indirect_iterator<typename force_ptr_container::const_iterator,force_type> const_indirect_force_iterator;
00140
00141 typedef typename std::list<body_type*> body_ptr_container;
00142 typedef boost::indirect_iterator<typename body_ptr_container::iterator,body_type> indirect_body_iterator;
00143 typedef boost::indirect_iterator<typename body_ptr_container::const_iterator,body_type> const_indirect_body_iterator;
00144
00145 typedef typename std::list<constraint_type* > constraint_ptr_container;
00146 typedef boost::indirect_iterator<typename constraint_ptr_container::iterator,constraint_type> indirect_constraint_iterator;
00147 typedef boost::indirect_iterator<typename constraint_ptr_container::const_iterator,constraint_type> const_indirect_constraint_iterator;
00148 };
00149
00150 }
00151
00152 }
00153
00154
00155 #endif