11 #ifndef SKELETON_BLOCKER_ITERATORS_SKELETON_BLOCKERS_EDGES_ITERATORS_H_
12 #define SKELETON_BLOCKER_ITERATORS_SKELETON_BLOCKERS_EDGES_ITERATORS_H_
14 #include <boost/iterator/iterator_facade.hpp>
15 #include <boost/graph/adjacency_list.hpp>
21 namespace skeleton_blocker {
23 template<
typename SkeletonBlockerComplex>
24 class Edge_around_vertex_iterator :
public boost::iterator_facade <Edge_around_vertex_iterator<SkeletonBlockerComplex>
25 , typename SkeletonBlockerComplex::Edge_handle const, boost::forward_traversal_tag
26 , typename SkeletonBlockerComplex::Edge_handle const> {
27 friend class boost::iterator_core_access;
29 typedef SkeletonBlockerComplex
Complex;
30 typedef typename Complex::boost_adjacency_iterator boost_adjacency_iterator;
32 typedef typename Complex::Edge_handle Edge_handle;
38 boost_adjacency_iterator current_;
39 boost_adjacency_iterator end_;
42 Edge_around_vertex_iterator() : complex(NULL) { }
47 tie(current_, end_) = adjacent_vertices(v.vertex, complex->skeleton);
56 tie(current_, end_) = adjacent_vertices(v.vertex, complex->skeleton);
60 bool equal(
const Edge_around_vertex_iterator& other)
const {
61 return (complex == other.complex) && (v == other.v) && (current_ == other.current_) && (end_ == other.end_);
69 Edge_handle dereference()
const {
70 return *(*complex)[std::make_pair(v,
static_cast<Vertex_handle> (*current_))];
84 template<
typename SkeletonBlockerComplex>
85 class Edge_iterator :
public boost::iterator_facade <Edge_iterator<SkeletonBlockerComplex>
86 , typename SkeletonBlockerComplex::Edge_handle const
87 , boost::forward_traversal_tag
88 , typename SkeletonBlockerComplex::Edge_handle const> {
89 friend class boost::iterator_core_access;
92 typedef SkeletonBlockerComplex Complex;
93 typedef typename Complex::boost_edge_iterator boost_edge_iterator;
94 typedef typename Complex::Edge_handle Edge_handle;
96 const Complex* complex;
97 std::pair<boost_edge_iterator, boost_edge_iterator> edge_iterator;
103 edge_iterator(boost::edges(complex_->skeleton)) { }
110 edge_iterator(boost::edges(complex_->skeleton)) {
111 edge_iterator.first = edge_iterator.second;
115 return (complex == other.complex) && (edge_iterator == other.edge_iterator);
119 if (edge_iterator.first != edge_iterator.second) {
120 ++(edge_iterator.first);
124 Edge_handle dereference()
const {
125 return (*(edge_iterator.first));
131 namespace skbl = skeleton_blocker;
Iterator on the edges of a simplicial complex.
Definition: Skeleton_blockers_edges_iterators.h:88
Edge_iterator(const SkeletonBlockerComplex *complex_, int end)
Definition: Skeleton_blockers_edges_iterators.h:108
Class that represents a geometric complex that can be simplified. The class allows access to points o...
Definition: Skeleton_blocker_geometric_complex.h:29
Gudhi namespace.
Definition: SimplicialComplexForAlpha.h:14
Definition: SkeletonBlockerDS.h:56
Handle type for the vertices of a cell complex.
Definition: VertexHandle.h:15