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 Vb::template Rebind_TDS<Tds>::Other Vertex_base;
|
||||||
typedef typename Fb::template Rebind_TDS<Tds>::Other Face_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>;
|
||||||
friend class Triangulation_ds_edge_iterator_2<Tds,true>;
|
|
||||||
friend class Triangulation_ds_face_circulator_2<Tds>;
|
friend class Triangulation_ds_face_circulator_2<Tds>;
|
||||||
friend class Triangulation_ds_edge_circulator_2<Tds>;
|
friend class Triangulation_ds_edge_circulator_2<Tds>;
|
||||||
friend class Triangulation_ds_vertex_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 Face_range::iterator Face_iterator;
|
||||||
typedef typename Vertex_range::iterator Vertex_iterator;
|
typedef typename Vertex_range::iterator Vertex_iterator;
|
||||||
|
|
||||||
typedef Triangulation_ds_edge_iterator_2<Tds> Edge_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_face_circulator_2<Tds> Face_circulator;
|
||||||
typedef Triangulation_ds_vertex_circulator_2<Tds> Vertex_circulator;
|
typedef Triangulation_ds_vertex_circulator_2<Tds> Vertex_circulator;
|
||||||
|
|
@ -100,8 +97,7 @@ public:
|
||||||
|
|
||||||
typedef Vertex_iterator Vertex_handle;
|
typedef Vertex_iterator Vertex_handle;
|
||||||
typedef Face_iterator Face_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;
|
typedef std::list<Edge> List_edges;
|
||||||
|
|
||||||
|
|
@ -187,15 +183,7 @@ public:
|
||||||
Edge_iterator edges_end() const {
|
Edge_iterator edges_end() const {
|
||||||
return Edge_iterator(this,1);
|
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_circulator incident_faces(Vertex_handle v,
|
||||||
Face_handle f = Face_handle()) const{
|
Face_handle f = Face_handle()) const{
|
||||||
return Face_circulator(v,f);
|
return Face_circulator(v,f);
|
||||||
|
|
|
||||||
|
|
@ -31,8 +31,7 @@
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
// with Once set to false, the Edge is reported twice, seen from the two adjacentfaces
|
template <class Tds>
|
||||||
template <class Tds, bool Once = true>
|
|
||||||
class Triangulation_ds_edge_iterator_2
|
class Triangulation_ds_edge_iterator_2
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -47,7 +46,7 @@ public:
|
||||||
typedef std::ptrdiff_t difference_type;
|
typedef std::ptrdiff_t difference_type;
|
||||||
typedef std::bidirectional_iterator_tag iterator_category;
|
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:
|
private:
|
||||||
const Tds* _tds;
|
const Tds* _tds;
|
||||||
|
|
@ -71,15 +70,14 @@ public:
|
||||||
private:
|
private:
|
||||||
void increment();
|
void increment();
|
||||||
void decrement();
|
void decrement();
|
||||||
bool associated_edge(CGAL::Tag_true);
|
bool associated_edge();
|
||||||
bool associated_edge(CGAL::Tag_false);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Edge iterator implementation
|
// Edge iterator implementation
|
||||||
|
|
||||||
template<class Tds, bool Once>
|
template<class Tds>
|
||||||
Triangulation_ds_edge_iterator_2<Tds,Once> ::
|
Triangulation_ds_edge_iterator_2<Tds>::
|
||||||
Triangulation_ds_edge_iterator_2(const Tds * tds)
|
Triangulation_ds_edge_iterator_2(const Tds * tds)
|
||||||
: _tds(tds)
|
: _tds(tds)
|
||||||
{
|
{
|
||||||
|
|
@ -90,12 +88,12 @@ Triangulation_ds_edge_iterator_2(const Tds * tds)
|
||||||
}
|
}
|
||||||
pos = _tds->faces().begin();
|
pos = _tds->faces().begin();
|
||||||
if (_tds->dimension() == 1) edge.second = 2;
|
if (_tds->dimension() == 1) edge.second = 2;
|
||||||
while ( pos != _tds->faces().end()
|
while ( pos != _tds->faces().end() && !associated_edge())
|
||||||
&& !associated_edge(Boolean_tag<Once>()) ) increment();
|
increment();
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class Tds, bool Once>
|
template<class Tds>
|
||||||
Triangulation_ds_edge_iterator_2<Tds,Once> ::
|
Triangulation_ds_edge_iterator_2<Tds>::
|
||||||
Triangulation_ds_edge_iterator_2(const Tds * tds, int )
|
Triangulation_ds_edge_iterator_2(const Tds * tds, int )
|
||||||
: _tds(tds)
|
: _tds(tds)
|
||||||
{
|
{
|
||||||
|
|
@ -105,19 +103,19 @@ Triangulation_ds_edge_iterator_2(const Tds * tds, int )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Tds, bool Once>
|
template<class Tds>
|
||||||
inline
|
inline
|
||||||
bool
|
bool
|
||||||
Triangulation_ds_edge_iterator_2<Tds,Once> ::
|
Triangulation_ds_edge_iterator_2<Tds>::
|
||||||
operator==(const Edge_iterator& fi) const
|
operator==(const Edge_iterator& fi) const
|
||||||
{
|
{
|
||||||
return _tds == fi._tds && pos == fi.pos && edge.second == fi.edge.second;
|
return _tds == fi._tds && pos == fi.pos && edge.second == fi.edge.second;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class Tds, bool Once>
|
template<class Tds>
|
||||||
inline
|
inline
|
||||||
void
|
void
|
||||||
Triangulation_ds_edge_iterator_2<Tds,Once> ::
|
Triangulation_ds_edge_iterator_2<Tds>::
|
||||||
increment()
|
increment()
|
||||||
{
|
{
|
||||||
CGAL_triangulation_precondition(_tds->dimension() >= 1);
|
CGAL_triangulation_precondition(_tds->dimension() >= 1);
|
||||||
|
|
@ -127,10 +125,10 @@ increment()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class Tds, bool Once>
|
template<class Tds>
|
||||||
inline
|
inline
|
||||||
void
|
void
|
||||||
Triangulation_ds_edge_iterator_2<Tds,Once> ::
|
Triangulation_ds_edge_iterator_2<Tds>::
|
||||||
decrement()
|
decrement()
|
||||||
{
|
{
|
||||||
CGAL_triangulation_precondition(_tds->dimension() >= 1);
|
CGAL_triangulation_precondition(_tds->dimension() >= 1);
|
||||||
|
|
@ -140,57 +138,48 @@ decrement()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class Tds, bool Once>
|
template<class Tds>
|
||||||
inline
|
inline
|
||||||
bool
|
bool
|
||||||
Triangulation_ds_edge_iterator_2<Tds,Once> ::
|
Triangulation_ds_edge_iterator_2<Tds>::
|
||||||
associated_edge(Tag_true)
|
associated_edge()
|
||||||
{
|
{
|
||||||
if (_tds->dimension() == 1) {return true;}
|
if (_tds->dimension() == 1) {return true;}
|
||||||
return Face_handle(pos) < pos->neighbor(edge.second);
|
return Face_handle(pos) < pos->neighbor(edge.second);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class Tds, bool Once>
|
template<class Tds>
|
||||||
inline
|
inline
|
||||||
bool
|
Triangulation_ds_edge_iterator_2<Tds>&
|
||||||
Triangulation_ds_edge_iterator_2<Tds,Once> ::
|
Triangulation_ds_edge_iterator_2<Tds>::
|
||||||
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> ::
|
|
||||||
operator++()
|
operator++()
|
||||||
{
|
{
|
||||||
//CGAL_triangulation_precondition(pos != Iterator_base() &&
|
//CGAL_triangulation_precondition(pos != Iterator_base() &&
|
||||||
// pos != _tds->faces().end());
|
// pos != _tds->faces().end());
|
||||||
do increment();
|
do increment();
|
||||||
while( pos != _tds->faces().end() && !associated_edge(Boolean_tag<Once>()));
|
while( pos != _tds->faces().end() && !associated_edge());
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Tds, bool Once>
|
template<class Tds>
|
||||||
inline
|
inline
|
||||||
Triangulation_ds_edge_iterator_2<Tds,Once>&
|
Triangulation_ds_edge_iterator_2<Tds>&
|
||||||
Triangulation_ds_edge_iterator_2<Tds,Once> ::
|
Triangulation_ds_edge_iterator_2<Tds>::
|
||||||
operator--()
|
operator--()
|
||||||
{
|
{
|
||||||
// CGAL_triangulation_precondition(pos != Iterator_base()
|
// CGAL_triangulation_precondition(pos != Iterator_base()
|
||||||
// && *this != Edge_iterator(_tds));
|
// && *this != Edge_iterator(_tds));
|
||||||
do decrement();
|
do decrement();
|
||||||
while ( !associated_edge(Boolean_tag<Once>()) && *this != Edge_iterator(_tds) );
|
while ( !associated_edge() && *this != Edge_iterator(_tds) );
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Tds, bool Once>
|
template<class Tds>
|
||||||
inline
|
inline
|
||||||
Triangulation_ds_edge_iterator_2<Tds,Once>
|
Triangulation_ds_edge_iterator_2<Tds>
|
||||||
Triangulation_ds_edge_iterator_2<Tds,Once> ::
|
Triangulation_ds_edge_iterator_2<Tds>::
|
||||||
operator++(int)
|
operator++(int)
|
||||||
{
|
{
|
||||||
Edge_iterator tmp(*this);
|
Edge_iterator tmp(*this);
|
||||||
|
|
@ -198,10 +187,10 @@ operator++(int)
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class Tds, bool Once>
|
template<class Tds>
|
||||||
inline
|
inline
|
||||||
Triangulation_ds_edge_iterator_2<Tds,Once>
|
Triangulation_ds_edge_iterator_2<Tds>
|
||||||
Triangulation_ds_edge_iterator_2<Tds,Once> ::
|
Triangulation_ds_edge_iterator_2<Tds>::
|
||||||
operator--(int)
|
operator--(int)
|
||||||
{
|
{
|
||||||
Edge_iterator tmp(*this);
|
Edge_iterator tmp(*this);
|
||||||
|
|
@ -209,20 +198,20 @@ operator--(int)
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class Tds, bool Once>
|
template<class Tds>
|
||||||
inline
|
inline
|
||||||
typename Triangulation_ds_edge_iterator_2<Tds,Once>::Edge*
|
typename Triangulation_ds_edge_iterator_2<Tds>::Edge*
|
||||||
Triangulation_ds_edge_iterator_2<Tds,Once> ::
|
Triangulation_ds_edge_iterator_2<Tds>::
|
||||||
operator->() const
|
operator->() const
|
||||||
{
|
{
|
||||||
edge.first = pos;
|
edge.first = pos;
|
||||||
return &edge;
|
return &edge;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class Tds, bool Once>
|
template<class Tds>
|
||||||
inline
|
inline
|
||||||
typename Triangulation_ds_edge_iterator_2<Tds,Once>::Edge&
|
typename Triangulation_ds_edge_iterator_2<Tds>::Edge&
|
||||||
Triangulation_ds_edge_iterator_2<Tds,Once> ::
|
Triangulation_ds_edge_iterator_2<Tds>::
|
||||||
operator*() const
|
operator*() const
|
||||||
{
|
{
|
||||||
edge.first = pos;
|
edge.first = pos;
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,6 @@ public:
|
||||||
|
|
||||||
typedef typename Tds::Face_iterator All_faces_iterator;
|
typedef typename Tds::Face_iterator All_faces_iterator;
|
||||||
typedef typename Tds::Edge_iterator All_edges_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;
|
typedef typename Tds::Vertex_iterator All_vertices_iterator;
|
||||||
|
|
||||||
class Perturbation_order
|
class Perturbation_order
|
||||||
|
|
@ -450,8 +449,6 @@ public:
|
||||||
All_vertices_iterator all_vertices_end() const;
|
All_vertices_iterator all_vertices_end() const;
|
||||||
All_edges_iterator all_edges_begin() const;
|
All_edges_iterator all_edges_begin() const;
|
||||||
All_edges_iterator all_edges_end() 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
|
//for compatibility with previous versions
|
||||||
Face_iterator faces_begin() const {return finite_faces_begin();}
|
Face_iterator faces_begin() const {return finite_faces_begin();}
|
||||||
|
|
@ -3183,22 +3180,6 @@ all_edges_end() const
|
||||||
return _tds.edges_end();
|
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 >
|
template <class Gt, class Tds >
|
||||||
inline
|
inline
|
||||||
typename Triangulation_2<Gt, Tds>::Face_circulator
|
typename Triangulation_2<Gt, Tds>::Face_circulator
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue