Go to the documentation of this file.00001 #ifndef OPENTISSUE_UTILITY_GL_GL_DRAW_HYBRID_H
00002 #define OPENTISSUE_UTILITY_GL_GL_DRAW_HYBRID_H
00003
00004
00005
00006
00007
00008
00009
00010 #include <OpenTissue/configuration.h>
00011
00012 #include <OpenTissue/utility/gl/gl.h>
00013 #include <OpenTissue/utility/gl/gl_draw_aabb.h>
00014 #include <OpenTissue/utility/gl/gl_draw_obb.h>
00015 #include <OpenTissue/utility/gl/gl_draw_sphere.h>
00016 #include <OpenTissue/utility/gl/gl_draw_prism.h>
00017 #include <OpenTissue/utility/gl/gl_draw_cylinder.h>
00018
00019 namespace OpenTissue
00020 {
00021
00022 namespace gl
00023 {
00024
00032 template<typename hybrid_type>
00033 inline void DrawHybrid(hybrid_type const & hybrid, bool wireframe = false)
00034 {
00035 switch(hybrid.selected_type())
00036 {
00037 case hybrid_type::selection_aabb:
00038 DrawAABB( hybrid.m_aabb, wireframe);
00039 break;
00040 case hybrid_type::selection_obb:
00041 DrawOBB( hybrid.m_obb, wireframe );
00042 break;
00043 case hybrid_type::selection_sphere:
00044 DrawSphere( hybrid.m_sphere, wireframe );
00045 break;
00046 case hybrid_type::selection_cylinder:
00047 DrawCylinder( hybrid.m_cylinder, wireframe );
00048 break;
00049 case hybrid_type::selection_prism:
00050 DrawPrism(hybrid.m_prism, wireframe );
00051 break;
00052 case hybrid_type::selection_tetrahedron:
00053 assert(!"DrawHybrid(): case not handled");
00054 break;
00055 case hybrid_type::selection_undefined:
00056 break;
00057 }
00058 };
00059
00060 }
00061
00062 }
00063
00064
00065 #endif