00001 #ifndef OPENTISSUE_COLLISION_AABB_TREE_AABB_TREE_INIT_H 00002 #define OPENTISSUE_COLLISION_AABB_TREE_AABB_TREE_INIT_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/bvh/bottom_up_constructor/bvh_graph.h> 00013 #include <OpenTissue/collision/bvh/bottom_up_constructor/bvh_bottom_up_constructor.h> 00014 #include <OpenTissue/collision/aabb_tree/policies/aabb_tree_bottom_up_constructor_policy.h> 00015 #include <OpenTissue/collision/aabb_tree/policies/aabb_tree_graph_converter.h> 00016 00017 namespace OpenTissue 00018 { 00019 namespace aabb_tree 00020 { 00021 00028 template< typename mesh_type, typename aabb_tree_geometry, typename vertex_data_binder> 00029 void init(mesh_type & mesh,aabb_tree_geometry & aabb_tree, vertex_data_binder & binder) 00030 { 00031 00032 typedef typename aabb_tree_geometry::bvh_type bvh_type; 00033 typedef OpenTissue::bvh::BVHGraph<bvh_type> graph_type; 00034 typedef OpenTissue::bvh::BottomUpConstructor<bvh_type, OpenTissue::aabb_tree::BottomUpConstructorPolicy<bvh_type> > constructor_type; 00035 typedef OpenTissue::aabb_tree::GraphConverter<graph_type> converter_type; 00036 00037 graph_type graph; 00038 converter_type converter; 00039 constructor_type constructor; 00040 00041 converter.run( mesh, graph, binder ); 00042 constructor.run( graph, aabb_tree.m_bvh ); 00043 } 00044 00045 00046 } // namespace aabb_tree 00047 } // namespace OpenTissue 00048 00049 // OPENTISSUE_COLLISION_AABB_TREE_AABB_TREE_INIT_H 00050 #endif