mirror of https://github.com/CGAL/cgal
Partial revert of 42a1c49066
Halfedges in TDS2 and T2 were being used to get halfedges in the T2 graph traits We now do it differently and without polluting the packages T2 and TDS2
This commit is contained in:
parent
e919ceff80
commit
aa4e1913d1
|
|
@ -61,8 +61,7 @@ class Triangulation_data_structure_2
|
|||
typedef typename Vb::template Rebind_TDS<Tds>::Other Vertex_base;
|
||||
typedef typename Fb::template Rebind_TDS<Tds>::Other Face_base;
|
||||
|
||||
friend class Triangulation_ds_edge_iterator_2<Tds,false>;
|
||||
friend class Triangulation_ds_edge_iterator_2<Tds,true>;
|
||||
friend class Triangulation_ds_edge_iterator_2<Tds>;
|
||||
friend class Triangulation_ds_face_circulator_2<Tds>;
|
||||
friend class Triangulation_ds_edge_circulator_2<Tds>;
|
||||
friend class Triangulation_ds_vertex_circulator_2<Tds>;
|
||||
|
|
@ -90,9 +89,7 @@ public:
|
|||
|
||||
typedef typename Face_range::iterator Face_iterator;
|
||||
typedef typename Vertex_range::iterator Vertex_iterator;
|
||||
|
||||
typedef Triangulation_ds_edge_iterator_2<Tds> Edge_iterator;
|
||||
typedef Triangulation_ds_edge_iterator_2<Tds,false> Halfedge_iterator;
|
||||
|
||||
typedef Triangulation_ds_face_circulator_2<Tds> Face_circulator;
|
||||
typedef Triangulation_ds_vertex_circulator_2<Tds> Vertex_circulator;
|
||||
|
|
@ -100,8 +97,7 @@ public:
|
|||
|
||||
typedef Vertex_iterator Vertex_handle;
|
||||
typedef Face_iterator Face_handle;
|
||||
|
||||
typedef std::pair<Face_handle,int> Edge;
|
||||
typedef std::pair<Face_handle, int> Edge;
|
||||
|
||||
typedef std::list<Edge> List_edges;
|
||||
|
||||
|
|
@ -188,14 +184,6 @@ public:
|
|||
return Edge_iterator(this,1);
|
||||
}
|
||||
|
||||
Halfedge_iterator halfedges_begin() const {
|
||||
return Halfedge_iterator(this);
|
||||
}
|
||||
|
||||
Halfedge_iterator halfedges_end() const {
|
||||
return Halfedge_iterator(this,1);
|
||||
}
|
||||
|
||||
Face_circulator incident_faces(Vertex_handle v,
|
||||
Face_handle f = Face_handle()) const{
|
||||
return Face_circulator(v,f);
|
||||
|
|
|
|||
|
|
@ -31,8 +31,7 @@
|
|||
|
||||
namespace CGAL {
|
||||
|
||||
// with Once set to false, the Edge is reported twice, seen from the two adjacentfaces
|
||||
template <class Tds, bool Once = true>
|
||||
template <class Tds>
|
||||
class Triangulation_ds_edge_iterator_2
|
||||
{
|
||||
public:
|
||||
|
|
@ -47,7 +46,7 @@ public:
|
|||
typedef std::ptrdiff_t difference_type;
|
||||
typedef std::bidirectional_iterator_tag iterator_category;
|
||||
|
||||
typedef Triangulation_ds_edge_iterator_2<Tds,Once> Edge_iterator;
|
||||
typedef Triangulation_ds_edge_iterator_2<Tds> Edge_iterator;
|
||||
|
||||
private:
|
||||
const Tds* _tds;
|
||||
|
|
@ -71,15 +70,14 @@ public:
|
|||
private:
|
||||
void increment();
|
||||
void decrement();
|
||||
bool associated_edge(CGAL::Tag_true);
|
||||
bool associated_edge(CGAL::Tag_false);
|
||||
bool associated_edge();
|
||||
};
|
||||
|
||||
|
||||
// Edge iterator implementation
|
||||
|
||||
template<class Tds, bool Once>
|
||||
Triangulation_ds_edge_iterator_2<Tds,Once> ::
|
||||
template<class Tds>
|
||||
Triangulation_ds_edge_iterator_2<Tds>::
|
||||
Triangulation_ds_edge_iterator_2(const Tds * tds)
|
||||
: _tds(tds)
|
||||
{
|
||||
|
|
@ -90,12 +88,12 @@ Triangulation_ds_edge_iterator_2(const Tds * tds)
|
|||
}
|
||||
pos = _tds->faces().begin();
|
||||
if (_tds->dimension() == 1) edge.second = 2;
|
||||
while ( pos != _tds->faces().end()
|
||||
&& !associated_edge(Boolean_tag<Once>()) ) increment();
|
||||
while ( pos != _tds->faces().end() && !associated_edge())
|
||||
increment();
|
||||
}
|
||||
|
||||
template<class Tds, bool Once>
|
||||
Triangulation_ds_edge_iterator_2<Tds,Once> ::
|
||||
template<class Tds>
|
||||
Triangulation_ds_edge_iterator_2<Tds>::
|
||||
Triangulation_ds_edge_iterator_2(const Tds * tds, int )
|
||||
: _tds(tds)
|
||||
{
|
||||
|
|
@ -105,19 +103,19 @@ Triangulation_ds_edge_iterator_2(const Tds * tds, int )
|
|||
}
|
||||
|
||||
|
||||
template<class Tds, bool Once>
|
||||
template<class Tds>
|
||||
inline
|
||||
bool
|
||||
Triangulation_ds_edge_iterator_2<Tds,Once> ::
|
||||
Triangulation_ds_edge_iterator_2<Tds>::
|
||||
operator==(const Edge_iterator& fi) const
|
||||
{
|
||||
return _tds == fi._tds && pos == fi.pos && edge.second == fi.edge.second;
|
||||
}
|
||||
|
||||
template<class Tds, bool Once>
|
||||
template<class Tds>
|
||||
inline
|
||||
void
|
||||
Triangulation_ds_edge_iterator_2<Tds,Once> ::
|
||||
Triangulation_ds_edge_iterator_2<Tds>::
|
||||
increment()
|
||||
{
|
||||
CGAL_triangulation_precondition(_tds->dimension() >= 1);
|
||||
|
|
@ -127,10 +125,10 @@ increment()
|
|||
return;
|
||||
}
|
||||
|
||||
template<class Tds, bool Once>
|
||||
template<class Tds>
|
||||
inline
|
||||
void
|
||||
Triangulation_ds_edge_iterator_2<Tds,Once> ::
|
||||
Triangulation_ds_edge_iterator_2<Tds>::
|
||||
decrement()
|
||||
{
|
||||
CGAL_triangulation_precondition(_tds->dimension() >= 1);
|
||||
|
|
@ -140,57 +138,48 @@ decrement()
|
|||
return;
|
||||
}
|
||||
|
||||
template<class Tds, bool Once>
|
||||
template<class Tds>
|
||||
inline
|
||||
bool
|
||||
Triangulation_ds_edge_iterator_2<Tds,Once> ::
|
||||
associated_edge(Tag_true)
|
||||
Triangulation_ds_edge_iterator_2<Tds>::
|
||||
associated_edge()
|
||||
{
|
||||
if (_tds->dimension() == 1) {return true;}
|
||||
return Face_handle(pos) < pos->neighbor(edge.second);
|
||||
}
|
||||
|
||||
template<class Tds, bool Once>
|
||||
template<class Tds>
|
||||
inline
|
||||
bool
|
||||
Triangulation_ds_edge_iterator_2<Tds,Once> ::
|
||||
associated_edge(Tag_false)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
template<class Tds, bool Once>
|
||||
inline
|
||||
Triangulation_ds_edge_iterator_2<Tds,Once>&
|
||||
Triangulation_ds_edge_iterator_2<Tds,Once> ::
|
||||
Triangulation_ds_edge_iterator_2<Tds>&
|
||||
Triangulation_ds_edge_iterator_2<Tds>::
|
||||
operator++()
|
||||
{
|
||||
//CGAL_triangulation_precondition(pos != Iterator_base() &&
|
||||
// pos != _tds->faces().end());
|
||||
do increment();
|
||||
while( pos != _tds->faces().end() && !associated_edge(Boolean_tag<Once>()));
|
||||
while( pos != _tds->faces().end() && !associated_edge());
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
template<class Tds, bool Once>
|
||||
template<class Tds>
|
||||
inline
|
||||
Triangulation_ds_edge_iterator_2<Tds,Once>&
|
||||
Triangulation_ds_edge_iterator_2<Tds,Once> ::
|
||||
Triangulation_ds_edge_iterator_2<Tds>&
|
||||
Triangulation_ds_edge_iterator_2<Tds>::
|
||||
operator--()
|
||||
{
|
||||
// CGAL_triangulation_precondition(pos != Iterator_base()
|
||||
// && *this != Edge_iterator(_tds));
|
||||
do decrement();
|
||||
while ( !associated_edge(Boolean_tag<Once>()) && *this != Edge_iterator(_tds) );
|
||||
while ( !associated_edge() && *this != Edge_iterator(_tds) );
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
template<class Tds, bool Once>
|
||||
template<class Tds>
|
||||
inline
|
||||
Triangulation_ds_edge_iterator_2<Tds,Once>
|
||||
Triangulation_ds_edge_iterator_2<Tds,Once> ::
|
||||
Triangulation_ds_edge_iterator_2<Tds>
|
||||
Triangulation_ds_edge_iterator_2<Tds>::
|
||||
operator++(int)
|
||||
{
|
||||
Edge_iterator tmp(*this);
|
||||
|
|
@ -198,10 +187,10 @@ operator++(int)
|
|||
return tmp;
|
||||
}
|
||||
|
||||
template<class Tds, bool Once>
|
||||
template<class Tds>
|
||||
inline
|
||||
Triangulation_ds_edge_iterator_2<Tds,Once>
|
||||
Triangulation_ds_edge_iterator_2<Tds,Once> ::
|
||||
Triangulation_ds_edge_iterator_2<Tds>
|
||||
Triangulation_ds_edge_iterator_2<Tds>::
|
||||
operator--(int)
|
||||
{
|
||||
Edge_iterator tmp(*this);
|
||||
|
|
@ -209,20 +198,20 @@ operator--(int)
|
|||
return tmp;
|
||||
}
|
||||
|
||||
template<class Tds, bool Once>
|
||||
template<class Tds>
|
||||
inline
|
||||
typename Triangulation_ds_edge_iterator_2<Tds,Once>::Edge*
|
||||
Triangulation_ds_edge_iterator_2<Tds,Once> ::
|
||||
typename Triangulation_ds_edge_iterator_2<Tds>::Edge*
|
||||
Triangulation_ds_edge_iterator_2<Tds>::
|
||||
operator->() const
|
||||
{
|
||||
edge.first = pos;
|
||||
return &edge;
|
||||
}
|
||||
|
||||
template<class Tds, bool Once>
|
||||
template<class Tds>
|
||||
inline
|
||||
typename Triangulation_ds_edge_iterator_2<Tds,Once>::Edge&
|
||||
Triangulation_ds_edge_iterator_2<Tds,Once> ::
|
||||
typename Triangulation_ds_edge_iterator_2<Tds>::Edge&
|
||||
Triangulation_ds_edge_iterator_2<Tds>::
|
||||
operator*() const
|
||||
{
|
||||
edge.first = pos;
|
||||
|
|
|
|||
|
|
@ -125,7 +125,6 @@ public:
|
|||
|
||||
typedef typename Tds::Face_iterator All_faces_iterator;
|
||||
typedef typename Tds::Edge_iterator All_edges_iterator;
|
||||
typedef typename Tds::Halfedge_iterator All_halfedges_iterator;
|
||||
typedef typename Tds::Vertex_iterator All_vertices_iterator;
|
||||
|
||||
class Perturbation_order
|
||||
|
|
@ -450,8 +449,6 @@ public:
|
|||
All_vertices_iterator all_vertices_end() const;
|
||||
All_edges_iterator all_edges_begin() const;
|
||||
All_edges_iterator all_edges_end() const;
|
||||
All_halfedges_iterator all_halfedges_begin() const;
|
||||
All_halfedges_iterator all_halfedges_end() const;
|
||||
|
||||
//for compatibility with previous versions
|
||||
Face_iterator faces_begin() const {return finite_faces_begin();}
|
||||
|
|
@ -3183,22 +3180,6 @@ all_edges_end() const
|
|||
return _tds.edges_end();
|
||||
}
|
||||
|
||||
template <class Gt, class Tds >
|
||||
typename Triangulation_2<Gt, Tds>::All_halfedges_iterator
|
||||
Triangulation_2<Gt, Tds>::
|
||||
all_halfedges_begin() const
|
||||
{
|
||||
return _tds.halfedges_begin();
|
||||
}
|
||||
|
||||
template <class Gt, class Tds >
|
||||
typename Triangulation_2<Gt, Tds>::All_halfedges_iterator
|
||||
Triangulation_2<Gt, Tds>::
|
||||
all_halfedges_end() const
|
||||
{
|
||||
return _tds.halfedges_end();
|
||||
}
|
||||
|
||||
template <class Gt, class Tds >
|
||||
inline
|
||||
typename Triangulation_2<Gt, Tds>::Face_circulator
|
||||
|
|
|
|||
Loading…
Reference in New Issue