• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Classes
  • Files
  • Examples
  • File List
  • File Members

/home/hauberg/Dokumenter/Capture/humim-tracker-0.1/src/OpenTissue/OpenTissue/dynamics/mbd/util/mbd_draw_joint.h

Go to the documentation of this file.
00001 #ifndef OPENTISSUE_DYNAMICS_MBD_UTIL_MBD_DRAW_JOINT_H
00002 #define OPENTISSUE_DYNAMICS_MBD_UTIL_MBD_DRAW_JOINT_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 #include <OpenTissue/utility/gl/gl_util.h>
00013 
00014 namespace OpenTissue
00015 {
00016   namespace mbd
00017   {
00018 
00019     template<typename joint_type>
00020     void draw_joint(joint_type const & joint)
00021     {
00022       typedef typename joint_type::socket_type                socket_type;
00023       typedef typename joint_type::body_type                  body_type;
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 
00029       vector3_type r;
00030       quaternion_type Q;
00031 
00032       glPushMatrix();
00033       joint.get_socket_A()->get_body()->get_position(r);
00034       joint.get_socket_A()->get_body()->get_orientation(Q);
00035       gl::Transform(r,Q);
00036       gl::DrawFrame(joint.get_socket_A()->get_joint_frame());
00037       glPopMatrix();
00038 
00039       glPushMatrix();
00040       joint.get_socket_B()->get_body()->get_position(r);
00041       joint.get_socket_B()->get_body()->get_orientation(Q);
00042       gl::Transform(r,Q);
00043       gl::DrawFrame(joint.get_socket_B()->get_joint_frame());
00044       glPopMatrix();
00045     }
00046 
00047     class DrawJointFunctor
00048     {
00049     public:
00050       template<typename joint_type>
00051       void operator()(joint_type const & joint) const
00052       {
00053         draw_joint(joint);
00054       }
00055     };
00056 
00057   } //End of namespace mbd
00058 } //End of namespace OpenTissue
00059 // OPENTISSUE_DYNAMICS_MBD_UTIL_MBD_DRAW_JOINT_H
00060 #endif 

Generated on Thu Dec 1 2011 12:52:49 for HUMIM Tracker by  doxygen 1.7.1