Go to the documentation of this file.00001 #ifndef OPENTISSUE_DYNAMICS_MBD_UTIL_MBD_DRAW_PENETRATIONS_H
00002 #define OPENTISSUE_DYNAMICS_MBD_UTIL_MBD_DRAW_PENETRATIONS_H
00003
00004
00005
00006
00007
00008
00009
00010 #include <OpenTissue/configuration.h>
00011
00012 #include <OpenTissue/utility/gl/gl_util.h>
00013
00014 namespace OpenTissue
00015 {
00016 namespace mbd
00017 {
00018 template<typename configuration_type>
00019 void draw_penetrations(configuration_type & configuration)
00020 {
00021 typedef typename configuration_type::body_type body_type;
00022 typedef typename configuration_type::edge_type edge_type;
00023 typedef typename edge_type::contact_iterator contact_iterator;
00024 typedef typename body_type::real_type real_type;
00025 typedef typename body_type::vector3_type vector3_type;
00026 typedef typename body_type::matrix3x3_type matrix3x3_type;
00027 typedef typename body_type::quaternion_type quaternion_type;
00028 typedef typename body_type::value_traits value_traits;
00029 typedef typename configuration_type::edge_iterator edge_iterator;
00030
00031 for(edge_iterator edge = configuration.edge_begin();edge!=configuration.edge_end();++edge)
00032 {
00033 if(edge->is_up_to_date())
00034 {
00035 for(contact_iterator contact = edge->contact_begin();contact!=edge->contact_end();++contact)
00036 {
00037 if(contact->m_distance<0)
00038 gl::ColorPicker(value_traits::one(),value_traits::zero(),value_traits::zero());
00039 else
00040 gl::ColorPicker(value_traits::zero(),value_traits::zero(),value_traits::one());
00041 gl::DrawVector(contact->m_p,contact->m_n*contact->m_distance,0.3,true);
00042 }
00043 }
00044 }
00045 }
00046
00047
00048 }
00049 }
00050
00051 #endif