00001 #ifndef OPENTISSUE_COLLISION_BVH_BVH_ANNOTATED_BV_NODE_H 00002 #define OPENTISSUE_COLLISION_BVH_BVH_ANNOTATED_BV_NODE_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/bvh_bv_node.h> 00013 00014 namespace OpenTissue 00015 { 00016 namespace bvh 00017 { 00018 00023 template <typename B, typename T> 00024 class AnnotatedBV 00025 : public BV<B, T> 00026 { 00027 public: 00028 00029 typedef B bvh_type; 00030 typedef typename bvh_type::geometry_type geometry_type; 00031 typedef typename bvh_type::geometry_container geometry_container; 00032 typedef typename bvh_type::geometry_iterator geometry_iterator; 00033 typedef typename bvh_type::geometry_const_iterator geometry_const_iterator; 00034 00035 protected: 00036 00037 geometry_container m_geometry; 00038 00039 public: 00040 00041 AnnotatedBV() 00042 : BV<B,T>() 00043 , m_geometry() 00044 { 00045 this->m_has_geometry=true; 00046 } 00047 00048 public: 00049 00050 geometry_iterator geometry_begin() { return m_geometry.begin(); } 00051 geometry_iterator geometry_end() { return m_geometry.end(); } 00052 geometry_const_iterator geometry_begin() const { return m_geometry.begin(); } 00053 geometry_const_iterator geometry_end() const { return m_geometry.end(); } 00054 00055 void insert( geometry_type const & G ) { m_geometry.push_back( G ); } 00056 00057 void insert( geometry_container const & G ) { std::copy( G.begin(), G.end(), std::back_inserter( m_geometry ) ); } 00058 }; 00059 00060 } // namespace bvh 00061 00062 } // namespace OpenTissue 00063 00064 //OPENTISSUE_COLLISION_BVH_BVH_ANNOTATED_BV_NODE_H 00065 #endif