00001 #ifndef OPENTISSUE_CORE_CONTAINERS_MESH_POLYMESH_CIRCULATORS_POLYMESH_FACE_FACE_CIRCULATOR_H 00002 #define OPENTISSUE_CORE_CONTAINERS_MESH_POLYMESH_CIRCULATORS_POLYMESH_FACE_FACE_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 PolyMeshFaceFaceCirculator 00037 { 00038 protected: 00039 00040 typename PolyMesh::face_halfedge_circulator m_circ; 00041 00042 public: 00043 00044 PolyMeshFaceFaceCirculator() 00045 : m_circ() 00046 {} 00047 00048 explicit PolyMeshFaceFaceCirculator( typename PolyMesh::face_type const & f) 00049 : m_circ(f) 00050 {} 00051 00052 template <class OtherValue> 00053 PolyMeshFaceFaceCirculator( 00054 PolyMeshFaceFaceCirculator<PolyMesh,OtherValue> const& other 00055 ) 00056 : m_circ( other.m_circ ) 00057 {} 00058 00059 public: 00060 00061 template <class OtherValue> 00062 bool operator==(PolyMeshFaceFaceCirculator<PolyMesh,OtherValue> const& other) const 00063 { 00064 return (m_circ == other.m_circ); 00065 } 00066 00067 template <class OtherValue> 00068 bool operator!=(PolyMeshFaceFaceCirculator<PolyMesh,OtherValue> const& other) const 00069 { 00070 return (m_circ != other.m_circ); 00071 } 00072 00073 PolyMeshFaceFaceCirculator & operator++() 00074 { 00075 ++m_circ; 00076 return *this; 00077 } 00078 00079 PolyMeshFaceFaceCirculator & operator--() 00080 { 00081 --m_circ; 00082 return *this; 00083 } 00084 00085 public: 00086 00087 Value & operator*() const 00088 { 00089 assert(!m_circ->get_face_handle().is_null() || !"face was null"); 00090 return *(m_circ->get_face_iterator()); 00091 } 00092 00093 Value * operator->() const 00094 { 00095 assert(!m_circ->get_face_handle().is_null() || !"face was null"); 00096 return &(*(m_circ->get_face_iterator())); 00097 } 00098 00099 }; 00100 00101 } // namespace polymesh 00102 } // namespace OpenTissue 00103 00104 //OPENTISSUE_CORE_CONTAINERS_MESH_POLYMESH_CIRCULATORS_POLYMESH_FACE_FACE_CIRCULATOR_H 00105 #endif