00001 #ifndef OPENTISSUE_CORE_CONTAINERS_MESH_TRIMESH_TRIMESH_FACE_H 00002 #define OPENTISSUE_CORE_CONTAINERS_MESH_TRIMESH_TRIMESH_FACE_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 trimesh 00015 { 00016 template<typename trimesh_type_ > 00017 class TriMeshFace : public trimesh_type_::face_traits 00018 { 00019 public: 00020 00021 typedef trimesh_type_ mesh_type; 00022 typedef typename mesh_type::face_handle face_handle; 00023 typedef typename mesh_type::vertex_handle vertex_handle; 00024 typedef typename mesh_type::vertex_iterator vertex_iterator; 00025 00026 private: 00027 00028 face_handle m_self; 00029 mesh_type * m_owner; 00030 vertex_handle m_vertex0; 00031 vertex_handle m_vertex1; 00032 vertex_handle m_vertex2; 00033 00034 public: 00035 TriMeshFace() 00036 : m_self() 00037 , m_owner(0) 00038 , m_vertex0() 00039 , m_vertex1() 00040 , m_vertex2() 00041 {}; 00042 00043 public: 00044 00045 face_handle get_handle() const { return m_self; }; 00046 mesh_type * get_owner() const { return m_owner; }; 00047 00048 vertex_handle get_vertex0_handle() const { return m_vertex0; }; 00049 vertex_iterator get_vertex0_iterator() const { return m_owner->get_vertex_iterator(m_vertex0); }; 00050 00051 vertex_handle get_vertex1_handle() const { return m_vertex1; }; 00052 vertex_iterator get_vertex1_iterator() const { return m_owner->get_vertex_iterator(m_vertex1); }; 00053 00054 vertex_handle get_vertex2_handle() const { return m_vertex2; }; 00055 vertex_iterator get_vertex2_iterator() const { return m_owner->get_vertex_iterator(m_vertex2); }; 00056 00057 private: 00058 00059 friend class trimesh_core_access; 00060 void set_handle(face_handle f) { m_self = f; }; 00061 void set_owner(mesh_type * owner) { m_owner = owner; }; 00062 void set_vertex0_handle(vertex_handle v) { m_vertex0 = v; }; 00063 void set_vertex1_handle(vertex_handle v) { m_vertex1 = v; }; 00064 void set_vertex2_handle(vertex_handle v) { m_vertex2 = v; }; 00065 00066 }; 00067 00068 } // namespace trimesh 00069 } // namespace OpenTissue 00070 00071 //OPENTISSUE_CORE_CONTAINERS_MESH_TRIMESH_TRIMESH_FACE_H 00072 #endif