Go to the documentation of this file.00001 #ifndef OPENTISSUE_UTILITY_GL_GL_DRAW_CHAIN_H
00002 #define OPENTISSUE_UTILITY_GL_GL_DRAW_CHAIN_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 gl
00017 {
00018
00024 template<typename chain_type>
00025 inline void DrawChain(chain_type const & chain)
00026 {
00027 typedef typename chain_type::math_types math_types;
00028 typedef typename math_types::vector3_type vector3_type;
00029 typedef typename math_types::real_type real_type;
00030
00031 vector3_type origin = chain.get_root()->absolute().T();
00032 vector3_type destination = chain.get_end_effector()->absolute().T();
00033 vector3_type p_global = chain.p_global();
00034 vector3_type x_global = chain.x_global();
00035 vector3_type y_global = chain.y_global();
00036
00037 ColorPicker(1.0,0.6,0.0);
00038 DrawVector(origin,destination-origin,0.5);
00039
00040 ColorPicker(1.0,0.0,1.0);
00041 DrawVector(origin,p_global-origin,0.5);
00042
00043 ColorPicker(1.0,0.0,0.0);
00044 DrawVector(p_global,x_global,0.5);
00045
00046 ColorPicker(0.0,1.0,0.0);
00047 DrawVector(p_global,y_global,0.5);
00048 }
00049
00050 }
00051
00052 }
00053
00054
00055 #endif