00001 #ifndef OPENTISSUE_CORE_CONTAINERS_MESH_POLYMESH_POLYMESH_VERTEX_H 00002 #define OPENTISSUE_CORE_CONTAINERS_MESH_POLYMESH_POLYMESH_VERTEX_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 PolyMeshVertex : public polymesh_type_::vertex_traits 00019 { 00020 public: 00021 00022 typedef polymesh_type_ mesh_type; 00023 typedef typename mesh_type::vertex_handle vertex_handle; 00024 typedef typename mesh_type::halfedge_handle halfedge_handle; 00025 typedef typename mesh_type::vertex_iterator vertex_iterator; 00026 typedef typename mesh_type::halfedge_iterator halfedge_iterator; 00027 00028 private: 00029 00030 vertex_handle m_self; 00031 mesh_type * m_owner; 00032 halfedge_handle m_outgoing_halfedge; 00033 00034 public: 00035 00036 PolyMeshVertex() 00037 : m_self() 00038 , m_owner(0) 00039 , m_outgoing_halfedge() 00040 {} 00041 00042 public: 00043 00044 vertex_handle get_handle() const { return m_self; } 00045 mesh_type * get_owner() const { return m_owner; } 00046 halfedge_handle get_outgoing_halfedge_handle() const { return m_outgoing_halfedge; } 00047 halfedge_iterator get_outgoing_halfedge_iterator() const { return m_owner->get_halfedge_iterator(m_outgoing_halfedge); } 00048 00049 private: 00050 00051 friend class polymesh_core_access; 00052 void set_handle(vertex_handle v) { m_self = v; } 00053 void set_owner(mesh_type * owner) { m_owner = owner; } 00054 void set_outgoing_halfedge_handle(halfedge_handle h) { m_outgoing_halfedge = h; } 00055 00056 }; 00057 00058 } // namespace polymesh 00059 } // namespace OpenTissue 00060 00061 //OPENTISSUE_CORE_CONTAINERS_MESH_POLYMESH_POLYMESH_VERTEX_H 00062 #endif