00001 #ifndef OPENTISSUE_COLLISION_BVH_BOTTOM_UP_CONSTRUCTOR_BVH_GRAPH_EDGE_H 00002 #define OPENTISSUE_COLLISION_BVH_BOTTOM_UP_CONSTRUCTOR_BVH_GRAPH_EDGE_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_node.h> 00013 00014 namespace OpenTissue 00015 { 00016 namespace bvh 00017 { 00018 00022 template <typename bvh_type> 00023 class BVHGraphEdge 00024 { 00025 public: 00026 00027 friend class BVHGraph<bvh_type>; 00028 00029 public: 00030 00031 //--- Conenience stuff for better readability 00032 typedef BVHGraph<bvh_type> graph_type; 00033 typedef typename graph_type::node_ptr_type node_ptr_type; 00034 typedef typename graph_type::edge_type edge_type; 00035 typedef typename graph_type::real_type real_type; 00036 00037 protected: 00038 00039 node_ptr_type m_A; 00040 node_ptr_type m_B; 00041 real_type m_priority; 00042 00043 00044 00045 00046 00047 00048 00049 public: 00050 00051 unsigned int m_tag; 00052 00053 public: 00054 00055 BVHGraphEdge() 00056 : m_A() 00057 , m_B() 00058 , m_priority(0) 00059 {} 00060 00061 public: 00062 00063 node_ptr_type const & A() const { return m_A; } 00064 node_ptr_type const & B() const { return m_B; } 00065 node_ptr_type & A() { return m_A; } 00066 node_ptr_type & B() { return m_B; } 00067 const real_type & priority() const { return m_priority; } 00068 real_type & priority() { return m_priority; } 00069 const bool operator>(const edge_type & edge) const { return (this->m_priority>edge.m_priority);} 00070 const bool operator<(const edge_type & edge) const { return (this->m_priority<edge.m_priority);} 00071 00072 }; 00073 00074 } // namespace bvh 00075 00076 } // namespace OpenTissue 00077 00078 // OPENTISSUE_COLLISION_BVH_BOTTOM_UP_CONSTRUCTOR_BVH_GRAPH_EDGE_H 00079 #endif