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