00001 #ifndef OPENTISSUE_CORE_CONTAINERS_MESH_POLYMESH_CIRCULATORS_POLYMESH_FACE_VERTEX_CIRCULATOR_H 00002 #define OPENTISSUE_CORE_CONTAINERS_MESH_POLYMESH_CIRCULATORS_POLYMESH_FACE_VERTEX_CIRCULATOR_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/core/containers/mesh/polymesh/circulators/polymesh_face_halfedge_circulator.h> 00013 00014 namespace OpenTissue 00015 { 00016 namespace polymesh 00017 { 00032 template< 00033 typename PolyMesh, 00034 class Value 00035 > 00036 class PolyMeshFaceVertexCirculator 00037 { 00038 protected: 00039 00040 typename PolyMesh::face_halfedge_circulator m_circ; 00041 00042 public: 00043 00044 PolyMeshFaceVertexCirculator() 00045 : m_circ() 00046 {} 00047 00048 explicit PolyMeshFaceVertexCirculator( typename PolyMesh::face_type const & f) 00049 : m_circ(f) 00050 {} 00051 00052 template <class OtherValue> 00053 PolyMeshFaceVertexCirculator( 00054 PolyMeshFaceVertexCirculator<PolyMesh,OtherValue> const& other 00055 ) 00056 : m_circ( other.m_circ ) 00057 {} 00058 00059 public: 00060 00061 template <class OtherValue> 00062 bool operator==(PolyMeshFaceVertexCirculator<PolyMesh,OtherValue> const& other) const 00063 { 00064 return (m_circ == other.m_circ); 00065 } 00066 00067 template <class OtherValue> 00068 bool operator!=(PolyMeshFaceVertexCirculator<PolyMesh,OtherValue> const& other) const 00069 { 00070 return (m_circ != other.m_circ); 00071 } 00072 00073 PolyMeshFaceVertexCirculator & operator++() 00074 { 00075 ++m_circ; 00076 return *this; 00077 } 00078 00079 PolyMeshFaceVertexCirculator & operator--() 00080 { 00081 --m_circ; 00082 return *this; 00083 } 00084 00085 public: 00086 00087 Value & operator*() const { return *(m_circ->get_origin_iterator()); } 00088 00089 Value * operator->() const { return &(*(m_circ->get_origin_iterator())); } 00090 00091 }; 00092 00093 } // namespace polymesh 00094 } // namespace OpenTissue 00095 00096 //OPENTISSUE_CORE_CONTAINERS_MESH_POLYMESH_CIRCULATORS_POLYMESH_FACE_VERTEX_CIRCULATOR_H 00097 #endif