00001 #ifndef OPENTISSUE_CORE_CONTAINERS_MESH_POLYMESH_POLYMESH_EDGE_H 00002 #define OPENTISSUE_CORE_CONTAINERS_MESH_POLYMESH_POLYMESH_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 namespace OpenTissue 00013 { 00014 namespace polymesh 00015 { 00016 00017 template<typename polymesh_type_ > 00018 class PolyMeshEdge : public polymesh_type_::edge_traits 00019 { 00020 public: 00021 00022 typedef polymesh_type_ mesh_type; 00023 typedef typename mesh_type::halfedge_handle halfedge_handle; 00024 typedef typename mesh_type::halfedge_iterator halfedge_iterator; 00025 typedef typename mesh_type::edge_handle edge_handle; 00026 typedef typename mesh_type::edge_iterator edge_iterator; 00027 00028 private: 00029 00030 edge_handle m_self; 00031 mesh_type * m_owner; 00032 halfedge_handle m_halfedge0; 00033 halfedge_handle m_halfedge1; 00034 00035 public: 00036 00037 PolyMeshEdge() 00038 : m_self() 00039 , m_owner(0) 00040 , m_halfedge0() 00041 , m_halfedge1() 00042 {} 00043 00044 public: 00045 00046 edge_handle get_handle() const { return m_self; } 00047 mesh_type * get_owner() const { return m_owner; } 00048 00049 halfedge_handle get_halfedge0_handle() const { return m_halfedge0; } 00050 halfedge_iterator get_halfedge0_iterator() const { return m_owner->get_halfedge_iterator(m_halfedge0); } 00051 00052 halfedge_handle get_halfedge1_handle() const { return m_halfedge1; }; 00053 halfedge_iterator get_halfedge1_iterator() const { return m_owner->get_halfedge_iterator(m_halfedge1); } 00054 00055 00056 private: 00057 00058 friend class polymesh_core_access; 00059 void set_handle(edge_handle e) { m_self = e; } 00060 void set_owner(mesh_type * owner) { m_owner = owner; } 00061 void set_halfedge0_handle(halfedge_handle h) { m_halfedge0 = h; } 00062 void set_halfedge1_handle(halfedge_handle h) { m_halfedge1 = h; } 00063 00064 }; 00065 00066 } // namespace polymesh 00067 } // namespace OpenTissue 00068 00069 //OPENTISSUE_CORE_CONTAINERS_MESH_POLYMESH_POLYMESH_EDGE_H 00070 #endif