diff --git a/BGL/include/CGAL/boost/graph/graph_traits_Linear_cell_complex.h b/BGL/include/CGAL/boost/graph/graph_traits_Linear_cell_complex.h index e6bf6211b8f..352d8b7ee4e 100644 --- a/BGL/include/CGAL/boost/graph/graph_traits_Linear_cell_complex.h +++ b/BGL/include/CGAL/boost/graph/graph_traits_Linear_cell_complex.h @@ -83,7 +83,7 @@ struct EdgeHandle : Dart_handle { return this->beta(2); } bool operator==(const EdgeHandle& h) - { return (*this)==h /* TODO || h->beta(2)==*this */ ; } + { return (*this)==h || h->get_f(2)==*this; } }; template @@ -167,7 +167,7 @@ public : typedef typename CMap::size_type edges_size_type; typedef typename CMap::size_type faces_size_type; - typedef CGAL::In_edge_iterator in_edge_iterator; + typedef CGAL::In_edge_iterator in_edge_iterator; typedef CGAL::Out_edge_iterator out_edge_iterator; // nulls @@ -424,8 +424,8 @@ halfedge(typename boost::graph_traits::edge_descriptor e, CGAL_LCC_TEMPLATE_ARGS typename boost::graph_traits::halfedge_descriptor halfedge(typename boost::graph_traits::vertex_descriptor v, - const CGAL_LCC_TYPE&) -{ return v->dart(); } + const CGAL_LCC_TYPE& cmap) +{ return const_cast(cmap).template beta<2>(v->dart()); } CGAL_LCC_TEMPLATE_ARGS std::pair< @@ -553,7 +553,6 @@ void set_halfedge(typename boost::graph_traits::vertex_descriptor CGAL_LCC_TYPE& cm) { //cm.template set_dart_of_attribute<0>(v, h); - cm.template set_dart_of_attribute<0>(v, cm.template beta<2>(h)); } diff --git a/Combinatorial_map/include/CGAL/Dart.h b/Combinatorial_map/include/CGAL/Dart.h index 04304ab8780..3d0cea84f4b 100644 --- a/Combinatorial_map/include/CGAL/Dart.h +++ b/Combinatorial_map/include/CGAL/Dart.h @@ -103,6 +103,12 @@ namespace CGAL { void * & for_compact_container() { return mf[0].for_compact_container(); } + Dart_handle get_f(unsigned int i) const + { + assert(i<=dimension); + return mf[i]; + } + protected: /** Default constructor: no real initialisation, * because this is done in the combinatorial map class.