00001 #ifndef OPENTISSUE_COLLISION_AABB_TREE_AABB_TREE_REFIT_H 00002 #define OPENTISSUE_COLLISION_AABB_TREE_AABB_TREE_REFIT_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/collision/aabb_tree/policies/aabb_tree_refitter_policy.h> 00013 #include <OpenTissue/collision/bvh/bvh_bottom_up_refitter.h> 00014 #include <OpenTissue/collision/bvh/bvh_get_leaf_nodes.h> 00015 00016 namespace OpenTissue 00017 { 00018 namespace aabb_tree 00019 { 00020 00026 template<typename aabb_tree_geometry> 00027 void refit( aabb_tree_geometry & aabb_tree) 00028 { 00029 typedef typename aabb_tree_geometry::bvh_type bvh_type; 00030 00031 typedef OpenTissue::bvh::BottomUpRefitter< OpenTissue::aabb_tree::RefitterPolicy<aabb_tree_geometry> > refitter_type; 00032 00033 // TODO exploit Caching, so leaves only have to be extracted once? 00034 typename bvh_type::bv_ptr_container leaves; 00035 OpenTissue::bvh::get_leaf_nodes(aabb_tree.m_bvh,leaves); 00036 refitter_type refitter; 00037 refitter.m_enlargement = 10e-5; 00038 refitter.run(leaves); 00039 } 00040 00041 } // namespace aabb_tree 00042 00043 } // namespace OpenTissue 00044 00045 // OPENTISSUE_COLLISION_AABB_TREE_AABB_TREE_REFIT_H 00046 #endif