Go to the documentation of this file.00001 #ifndef OPENTISSUE_COLLISION_SDF_SDF_DEBUG_DRAW_BVH_H
00002 #define OPENTISSUE_COLLISION_SDF_SDF_DEBUG_DRAW_BVH_H
00003
00004
00005
00006
00007
00008
00009
00010 #include <OpenTissue/configuration.h>
00011
00012 #include <OpenTissue/utility/gl/gl_util.h>
00013 #include <OpenTissue/collision/bvh/bvh_get_nodes_at_depth.h>
00014 #include <OpenTissue/collision/bvh/bvh_get_nodes_at_height.h>
00015
00016 namespace OpenTissue
00017 {
00018 namespace sdf
00019 {
00020
00021
00031 template<typename sdf_geometry_type>
00032 void debug_draw_bvh(sdf_geometry_type const & geometry, int depth)
00033 {
00034 typedef typename sdf_geometry_type::bvh_type bvh_type;
00035 typedef typename bvh_type::bv_ptr_container bv_ptr_container;
00036 typedef typename bvh_type::bv_iterator bv_iterator;
00037
00038 bv_ptr_container nodes;
00039
00040 bvh::get_nodes_at_height(geometry.m_bvh,1,nodes);
00041
00042 {
00043 bv_iterator node = nodes.begin();
00044 bv_iterator end = nodes.end();
00045 for (;node!= end;++node )
00046 gl::DrawSphere( node->volume(), false );
00047 }
00048 bvh::get_nodes_at_depth(geometry.m_bvh,depth,nodes);
00049
00050 {
00051 bv_iterator node = nodes.begin();
00052 bv_iterator end = nodes.end();
00053 for (;node!= end;++node )
00054 gl::DrawSphere( node->volume(), true );
00055 }
00056 }
00057
00058 }
00059
00060 }
00061
00062
00063 #endif