22 #ifndef GUDHI_SKELETON_BLOCKERS_ITERATORS_EDGES_H_
23 #define GUDHI_SKELETON_BLOCKERS_ITERATORS_EDGES_H_
25 #include "boost/iterator/iterator_facade.hpp"
32 template<
typename SkeletonBlockerComplex>
33 class Complex_edge_around_vertex_iterator :
34 public boost::iterator_facade < Complex_edge_around_vertex_iterator<SkeletonBlockerComplex>
35 , typename SkeletonBlockerComplex::Edge_handle const
36 , boost::forward_traversal_tag
37 , typename SkeletonBlockerComplex::Edge_handle const
40 friend class boost::iterator_core_access;
42 typedef SkeletonBlockerComplex Complex;
43 typedef typename Complex::boost_adjacency_iterator boost_adjacency_iterator;
44 typedef typename Complex::Vertex_handle Vertex_handle;
45 typedef typename Complex::Edge_handle Edge_handle;
49 const Complex* complex;
52 boost_adjacency_iterator current_;
53 boost_adjacency_iterator end_;
57 Complex_edge_around_vertex_iterator():complex(NULL){
60 Complex_edge_around_vertex_iterator(
const Complex* complex_,Vertex_handle v_):
64 tie(current_,end_) = adjacent_vertices(v.vertex, complex->skeleton);
70 Complex_edge_around_vertex_iterator(
const Complex* complex_,Vertex_handle v_,
int end):
74 tie(current_,end_) = adjacent_vertices(v.vertex, complex->skeleton);
78 bool equal(
const Complex_edge_around_vertex_iterator& other)
const{
79 return (complex== other.complex) && (v == other.v) && (current_ == other.current_) && (end_ == other.end_);
87 Edge_handle dereference()
const{
88 return *(*complex)[std::make_pair(v,*current_)];
104 template<
typename SkeletonBlockerComplex>
106 public boost::iterator_facade < Complex_edge_iterator<SkeletonBlockerComplex>
107 , typename SkeletonBlockerComplex::Edge_handle const
108 , boost::forward_traversal_tag
109 , typename SkeletonBlockerComplex::Edge_handle const
113 friend class boost::iterator_core_access;
115 typedef SkeletonBlockerComplex Complex;
116 typedef typename Complex::boost_edge_iterator boost_edge_iterator;
117 typedef typename Complex::Edge_handle Edge_handle;
120 const Complex* complex;
121 std::pair<boost_edge_iterator,boost_edge_iterator> edge_iterator ;
128 edge_iterator(boost::edges(complex_->skeleton))
137 edge_iterator(boost::edges(complex_->skeleton))
139 edge_iterator.first = edge_iterator.second;
144 return (complex == other.complex) && (edge_iterator == other.edge_iterator);
148 if(edge_iterator.first != edge_iterator.second){
149 ++(edge_iterator.first);
153 Edge_handle dereference()
const{
154 return(*(edge_iterator.first));
Iterator on the edges of a simplicial complex.
Definition: Skeleton_blockers_edges_iterators.h:105
Complex_edge_iterator(const SkeletonBlockerComplex *complex_, int end)
Definition: Skeleton_blockers_edges_iterators.h:135